Magento: Product Edit Warning: Invalid argument supplied for foreach()

Scenario: While editing product programatically from frontend. I was trying to change the status of the product with the following code. I was trying to disable the product. Status value 2 = Disabled. // Trying to disable the product // $product->getId() = PRODUCT ID Mage::getModel('catalog/product')->load($product->getId())->setStatus(2)->save(); Problem: Product could not be edited programatically from frontend. The … Read more

Smarty: Selection list using foreach and section loop

In this article, I will be explaining about foreach and section loop used in Smarty. I will be using these loops for creating a selection list. We can create selection list from a custom Smarty function html_options. <select name="user"> {html_options values=$id output=$names selected="4"} </select> Instead of html_options, we can also use loops to create the … Read more