Display product count in top menu

Share
Posted on January 16th, 2015 | Posted by admin

Magento categories marked as ‘Include in menu’ are added by  page_block_html_topmenu_gethtml_before event observer function addCatalogToTopmenuItems located in app/code/core/Mage/Catalog/Model/Observer.php. Lets overwrite it:

1
2
cp app/code/core/Mage/Catalog/Model/Observer.php \
app/code/local/Mage/Catalog/Model/Observer.php

edit the function _addCategoriesToMenu:

Magento How to: Custom Error Page Design

Share
Posted on January 9th, 2015 | Posted by admin

A question was asked in the comments of a previous post about creating a custom design for the error “report” page of Magento. Another reader, from PILLWAX Industrial Solutions Consulting gave us this solution.

Edit: This post was originally written for.. well, actually I have no idea what version of Magento was around back then.. maybe 1.4? But since then the/report directory has changed to the /errors directory, so keep that in mind!

Create the layout First we need to create a layout file. This is called design.xml, is placed in the /report directory and has the following content.

REORDER MAGENTO JAVASCRIPT USING LAYOUT XML

Share
Posted on January 6th, 2015 | Posted by admin

This post explains how to reorder Magento javascript using layout XML. If you want to force the load order of Javascript included with the addJsmethod, the easiest way is to supply a name using the <params>. You can use the <params> element, with name attribute in it . Magento will load the Javascript files in alphabetical order based on the name supplied.

  • code
  • source
  1. <action method="addJs"><!-- this will be shown second -->
  2. <script>prototype/javascript1.js</script>
  3. <params><!--[CDATA[name="js002_second"]]--></params>

No More Square (White Background) Magento Product Images

Share
Posted on January 5th, 2015 | Posted by admin

Do you have a site with product images of varying proportions. It can be annoying when Magento gives you that white border to make your product image square. Here’s how customize what color that background is: just add backgroundcolor('000', '000', '000') before the resize() method

<code>
&lt;img src="&lt;?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail',<br/> $_image->getFile())->backgroundcolor('000', '000', '000')->resize(100); ?>" ... />
</code>

Better yet, get rid of the background using keepFrame(false):

&lt;img src="&lt;?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail',<br/> $_image->getFile())->keepFrame(false)->resize(100); ?>" width="100"  ... />

Resizing after keepFrame(false) will resize the largest dimension. Don’t forget to delete your image height and width attributes (if need be)!

how to really easy create a configurable product

Share
Posted on December 18th, 2014 | Posted by admin

First, create some attributes you want to use, i have taken three attributes, motor, servo, deko. They should be global and drop-down. Create the “answers” for your attribues, b.e.

  • motor : None, Brushless, Brushless with prop
  • servo : None, 2xcheap, 2xexpensive
  • deko : None, colored tape

Put these attribues into a new attribute-set depending on default-set, remove any attribues you dont want and add the three new ones.

Create a configurable product depending on your new attribute-set. Choose only the three new attributes. Then give the information for the main-product, name, description, pricing and so on. Save the product.

Page 3 of 95«12345»102030...Last »