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
I would recommend checking the path of the cookie that Magento sets. Most likely, it is set to /shop, so the cookie will not be accessible to your file above it. You can modify the path that Magento uses to set its cookie in the control panel under System -> Configuration -> Web (under the … 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
I recently upgraded a clients magento from V1.4 to V1.7.2.0 and i followed this steps:- Following are the main points to upgrade the website from Magento v1.4.0.0 to v1.7.2.0:- Collect the live database backup in a zipped format, without the following tables:- “log_customer” “log_quote” “log_summary” “log_url” “log_url_info” “log_visitor” “log_visitor_info” “log_visitor_online” Unzip the zipped backup database, … Read more
You can use such methods within your setup script: Use Varien_Db_Ddl_Table class to create new tables, where you can configure all the fields, keys, relations in combination with $this->getConnection()->createTable($tableObject) Example: /* @var $this Mage_Core_Model_Resource_Setup */ $table = new Varien_Db_Ddl_Table(); $table->setName($this->getTable(‘module/table’)); $table->addColumn(‘id’, Varien_Db_Ddl_Table::TYPE_INT, 10, array(‘unsigned’ => true, ‘primary’ => true)); $table->addColumn(‘name’, Varien_Db_Ddl_Table::TYPE_VARCHAR, 255); $table->addIndex(‘name’, ‘name’); $table->setOption(‘type’, … Read more
I’ve only been tangentially involved in optimizing Magento for performance, but here’s a few reasons why the system is so slow Parts of Magento use an EAV database system implemented on top of MySQL. This means querying for a single “thing” often means querying multiple rows There’s a lot of things behind the scenes (application … Read more