Code For Getting Data’s Of All Selected Simple Products In Configurable Product in Magento 1 - Magesan

Code For Getting Data’s Of All Selected Simple Products In Configurable Product in Magento 1

Code For Getting Data’s Of All Selected Simple Products In Configurable Product in Magento 1

<?php if($_product->getTypeId() == "configurable") : ?>
  <div class="product-options-image">
    <?php $configChilds = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$_product); ?>
    <?php foreach($configChilds as $childProducts) : ?>
      <?php $image = $this->helper('catalog/image')->init($childProducts, 'small_image')->keepFrame(false)->resize(500,500); ?>
      <?php $imagelabel = $this->escapeHtml($childProducts->getImageLabel()); ?>
      <li class="config-image-box">
        <a href="javascript:void(0);" class="image-config"><img src="<?php echo $image; ?>" alt="<?php echo $imagelabel; ?>" title="<?php echo $imagelabel; ?>" width="100" height="100" /></a>
      </li>
      <script type="text/javascript">
        jQuery(document).ready(function() {
          jQuery(".product-options-image li a img").click(function() {
            jQuery(".product-media .product-image .product-image-gallery img").attr("src", jQuery(this).attr("src"));
            //jQuery(".product-options-image li a img").addClass('active');
          });
        });
      </script>
    <?php endforeach; ?>
  </div>
<?php endif; ?>

Leave a Reply

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

*
*
You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>