Home / Magento / Create swtch color on product list page in Magento

Create swtch color on product list page in Magento

Copy and past the code . where you want to display color  below the name or above the name.

follow the following steps:

images updated in configurable simple product  acording to color .

Change Visibility *: catalog search

 List.phtml

<? if($_product->getTypeId() == "configurable"):
    $conf = Mage::getModel('catalog/product_type_configurable')->setProduct($_product);
    $simple_collection = $conf->getUsedProductCollection()->addAttributeToSelect('*')->addFilterByRequiredOptions();
    foreach($simple_collection as $simple_product){
      // echo $simple_product->getSku() . " - " . $simple_product->getName() . " - " . Mage::helper('core')->currency($simple_product->getPrice()) . "
";
    ?>
         
     
 <? } endif;?>

<? $product = Mage::getModel(‘catalog/product’)->load($_product->getId()); foreach ($product->getMediaGalleryImages() as $image) { $image->getUrl();?> <? } ?>

About Sushil_kumar

Check Also

magento-log-setting

Optimize log table of magento database

Optimize log table of magento database Optimize Magento Database table is one of a very …

Leave a Reply

Your email address will not be published. Required fields are marked *

0

December 9, 2016

Clear all