Tuesday, August 27, 2013

Magento: How to find parent Category and an NB note on Tax

This is a actually a note for myself, but if you understand this code, feel free to modify it as appropriate.


$product1 = Mage::getModel(‘catalog/product’)->load($_productObject->getId()); $categories_id = $product1->getCategoryIds(); $categoryModel = Mage::getModel(‘catalog/category’); $child = $categoryModel->load($categories_id[1]); $parent = $categoryModel->load($child->getParentId()); $parent->getName()

Just a quick note: When using checkout rules, if you use discount to cancel out the Shipping and Handling price, the Shipping and Handling will probably still be calculated to the tax. To solve this, rather use your condition with Free Shipping specified to the relevant option, I just used it as a blank because I want the shipping to be free once the cart is over a certain amount.

No comments:

Post a Comment