Author Archives: erik

Error Source model “customer_entity/address_attribute_source_country” not found for attribute “country_id”

If you happen to encounter this error in magento 1.6 there is a chance that was caused by an upgrade from a previous version of magento.  Check eav_atribute table and change rows containing customer_entity/address_attribute_source_country customer_entity/address_attribute_source_region to customer/entity_address_attribute_source_country customer/entity_address_attribute_source_region Also if … Continue reading

Posted in Errors | 4 Comments

How to get the newest products of magento current category

If you ever need listing the newest products of magento current category (or even of a category given by it’s Id, see the code comments) <?php $totalPerPage = ($this->show_total) ? $this->show_total : 9; $visibility = array( Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG );   … Continue reading

Posted in Categories, Products | Tagged , , | 2 Comments

Get magento page current url

echo Mage::help(’core/url’)->getCurrentUrl();

Posted in Uncategorized | Tagged , | Leave a comment

Magento new products

New products is one of the useful feature required for a magento site. Below is a short example how to have this. You can call this in a cms page. $totalPerPage = ($this->show_total) ? $this->show_total : 9; $visibility = array( … Continue reading

Posted in Products | Tagged , | Leave a comment

Magento query filter by category and attribute

We know how to show up the products of a category in a cms page. But what if we wanna filter them by an attribute? Here is an example where $category_id is a given category ID, $currentPage the number of … Continue reading

Posted in Categories, Queries | Tagged , , , , | 3 Comments

Add featured category products to cms home page

If you have a category with products( like the featured products) you can  include them in a cms page calling the template block  the following way: {{block type=”catalog/product_list” template=”catalog/product/list.phtml” category_id=”5″ column_count=”4″ }} You have to change category_id 5 for your … Continue reading

Posted in Categories, Cms | Tagged , , | Leave a comment

Magento get category subcategories

One thing we will meet for sure in magento is the category. One of the task we will need to do is the listing of child categories, the subcategories. In the following example will be listed the subcategories of a … Continue reading

Posted in Categories | Tagged , , , | Leave a comment

eBay Agrees to Acquire Magento

Some interesting news regarding Magento received two weeks ago by Magento newsletter. The past several years have been an amazing journey for Magento, as we’ve grown from a new open source platform into an eCommerce leader. Along the way, we’ve … Continue reading

Posted in News | Tagged , | Leave a comment

Magento disable block cache

As  an example if you want to disable caching for the footer block you have to make a copy of app/code/coreMage/Page/Block/Html in app/code/local/Mage/Page/Block/Html. If you have copied the file open it from local and in the _construct function comment out … Continue reading

Posted in Cache | Tagged , , | 5 Comments