magento

Magento: template based on attribute set

夙愿已清 提交于 2020-01-13 04:31:06
问题 I want to create different product views based on the attribute set the product belongs to: does Magento provide a way to do this? - UPDATE - Following dan.codes suggestion I've added $update->addHandle('PRODUCT_ATTRIBUTE_SET_ID_'.$product->getAttributeSetId()); to Mage_Catalog_ProductController (I duplicated ProductController.php and put it in local/Mage/Catalog/controllers/). Then I added this to catalog.xml <PRODUCT_ATTRIBUTE_SET_ID_9> // PRODUCT ID of Book Attribute Set <label>Catalog

Magento 1.12 and Solr 3.6 No proper results and no spell suggestions

最后都变了- 提交于 2020-01-13 03:29:08
问题 Any idea or suggestion. I am kind of confuse , I have setup solr and magento couple of times but now with magento 1.12 its behaving strange no proper results and no spell check. We had our magento 1.11 working fine with solr 1.4 ,its still working fine I try to use 1.4 and solr 3.6 no fix. Any idea or suggestion. I am kind of confuse 回答1: We have found multiple problems with solr with Magento EE 1.12. If you run the fulltext indexer from the shell via a cronjob the following event (yes it is

Magento changes layout dynamically via system variable

假装没事ソ 提交于 2020-01-13 02:23:51
问题 Is there a way we could changes the layout of a Magento page (let's say a product category page) dynamically by using system variable which have been set on our own module? I want to be able to set my category page's default layout via my own module admin config panel. So that I don't have to deal with those confusing XML layout file each time I want to change my default layout for a certain magento page. I know, on a phtml file, we could simply call our own module's system variable by

How to disable a remove statement from local.xml in Magento

主宰稳场 提交于 2020-01-13 01:46:53
问题 Is it possible to disable a <remove name="left"> statement defined in a default layout .xml file, from the local.xml file? For example, in the checkout.xml in the <checkout_cart_index> section, the statement <remove name="left"/> is defined there, but can you disable that line from the local.xml file, so you still see the left menu on the checkout page? 回答1: By default Magento doesn't provide an <unremove /> tag for local.xml. However, the Layout system contains the right events, such that

Magento - Move a category programmatically

我怕爱的太早我们不能终老 提交于 2020-01-12 23:15:31
问题 How do I move a category to another category with all child categories? I have tried the following solution: $nodeId = 2269; $parentId = 2268; $tree = Mage::getResourceModel('catalog/category_tree')->load(); $node = $tree->getNodeById($nodeId); $parentNode = $tree->getNodeById($parentId); $parentChildren = explode(',', $parentNode->getChildren()); $afterId = array_pop($parentChildren); $prevNode = $tree->getNodeById($afterId); if (!$prevNode || !$prevNode->getId()) { $prevNode = null; } $tree

Ajax In Magento

微笑、不失礼 提交于 2020-01-12 11:37:30
问题 I've been reading about ajax in magento and their is alot of talk about modules and controllers, so after managing to setup a custom module, controller and frontend router i'm now having problems, at the moment i just want my ajax call to return an category page and its products depending on what id/param is posted to the controller. I dont know alot about PHP so i looked around and came cross this The Controller public function indexAction() { $id = $this->getRequest()->getParam('id'); if(

Ajax In Magento

空扰寡人 提交于 2020-01-12 11:36:55
问题 I've been reading about ajax in magento and their is alot of talk about modules and controllers, so after managing to setup a custom module, controller and frontend router i'm now having problems, at the moment i just want my ajax call to return an category page and its products depending on what id/param is posted to the controller. I dont know alot about PHP so i looked around and came cross this The Controller public function indexAction() { $id = $this->getRequest()->getParam('id'); if(

How to add custom uploaded images to cart in magento 1.4.1.1?

元气小坏坏 提交于 2020-01-12 10:34:28
问题 How to add custom fields as well as custom images to cart in magento 1.4.1.1 ? Any one have any idea about this??? 回答1: If you need add you custom product attribute to shopping cart, just add the following lines of code into your module configuration: <config> <global> <sales> <quote> <item> <product_attributes> <[your_custom_attribute_code] /> </product_attributes> </item> </quote> </sales> </global> </config> Just replace [your_custom_attribute_code] with the code of your attribute. You may

How To Customize a Magento Theme and Retain Its Source

不羁岁月 提交于 2020-01-12 08:41:33
问题 Running Magento 1.7.0.2 (latest) I downloaded a free theme and installed it - no problem. I wish to start making subtle edits to it but I do not want to touch the source. I want to make the edits in a directory where they will render and override the base custom theme yet not get trashed if I were to upgrade the free theme should a newer version get released. My theme is installed at: .../app/design/frontend/default/the_free_theme/ ../skin/frontend/default/the_free_theme/ What directory

Copy and Paste Category in Magento

一笑奈何 提交于 2020-01-12 08:21:33
问题 I want to copy my first category to a second category in Magento. What should I do? Thanks, Wesley. 回答1: By code: <?php $category = Mage::getModel('catalog/category') ->load(123); // The ID of the category you want to copy. $copy = clone $category; $copy->setId(null) // Remove the ID. ->save(); 回答2: If you want to do it in a programmatic way you can use the Magento API. Use: catalog_category.info - to read a category catalog_category.create - to create a new one by copying data from existing.