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 admin

Check Also

Mladen Lotar will be joining us on #MM18HR stage with “Production grade PWA”

We are very proud to present one of our ex-coworkers – Mladen Lotar who will …

Leave a Reply

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