How to get a product’s image in Magento?
echo $_product->getImageUrl(); This method of the Product class should do the trick for you.
echo $_product->getImageUrl(); This method of the Product class should do the trick for you.
For understanding more about magento block types following are some built-in block types which are widely used in layout. core/template: This block renders a template defined by its template attribute. The majority of blocks defined in the layout are of type or subtype of core/template. page/html: This is a subtype of core/template and defines the root block. All other blocks … Read more
To display layered navigation on cms page you have to set root category to Is Anchor=Yes.
If you want to add some custom fields for Magento newsletter subscriber (for example subscriber_name), you should do the following: Add new column for newsletter_subscriber table Add text input to newsletter template Create observer for newsletter_subscriber_save_before event In the observer you can get your custom field’s value from request and assign it to subscriber’s object: … Read more
Try this: Create: app/code/local/MagePal/EnableDuplicateProductStatus/etc/config.xml <?xml version=”1.0″?> <config> <modules> <MagePal_EnableDuplicateProductStatus> <version>1.0.1</version> </MagePal_EnableDuplicateProductStatus> </modules> <global> <models> <enableduplicateproductstatus> <class>MagePal_EnableDuplicateProductStatus_Model</class> </enableduplicateproductstatus> </models> <events> <catalog_model_product_duplicate> <observers> <enableduplicateproductstatus> <type>singleton</type> <class>enableduplicateproductstatus/observer</class> <method>productDuplicate</method> </enableduplicateproductstatus> </observers> </catalog_model_product_duplicate> </events> </global> </config> Create: app/code/local/MagePal/EnableDuplicateProductStatus/Model/Observer.php class MagePal_EnableDuplicateProductStatus_Model_Observer { /** * Prepare product for duplicate action. * * @param Varien_Event_Observer $observer * @return object */ public function productDuplicate(Varien_Event_Observer … Read more
In the end I found the solution. I changed System > VAT > Tax Calculation Method Based On from Unit price to Row Total and it works, more details here The issue which I found is in core/store model. I had to rewrite roundPrice method and change rounding precision there. public function roundPrice($price) { return … Read more
The checklist for whether items are in stock follows. Some will seem stupid until the first time you spend an hour trying to figure this problem out: The products must be Visible in Catalog. The products must be Enabled. Product must have a stock Quantity. The product must be set to In Stock. If the … Read more
The way to do it is add an observer which looks for this event ‘sales_quote_add_item’: <events> <sales_quote_add_item> <observers> <priceupdate_observer> <type>singleton</type> <class>mymodule/observer</class> <method>updatePrice</method> </priceupdate_observer> </observers> </sales_quote_add_item> </events> The observer should have a method which does something like this: public function updatePrice($observer) { $event = $observer->getEvent(); $quote_item = $event->getQuoteItem(); $new_price = <insert logic> $quote_item->setOriginalCustomPrice($new_price); $quote_item->save(); }