Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--app\design\frontend\theme\default\template\colorswicher\page\html\jshead.phtml-->
- <?php
- $_product = Mage::registry('current_product');
- ?>
- <script type="text/javascript">
- //<![CDATA[
- var assocIMG = // Added - Removed { here, causes issues with other scripts when not working with a configurable product.
- <?php
- $dados = array();
- if ($_product->getTypeId() == "configurable") {
- echo "{";
- $associated_products = $_product->loadByAttribute('sku', $_product->getSku())->getTypeInstance()->getUsedProducts();
- foreach ($associated_products as $assoc)
- $dados[] = $assoc->getId().":'".($assoc->image == "no_selection" || $assoc->image == "" ? $this->helper('catalog/image')->init($_product, 'image', $_product->image)->resize(338) : $this->helper('catalog/image')->init($assoc, 'image', $assoc->image)->resize(338))."'";
- } else {
- $dados[] = "''";
- }
- echo implode(',', $dados );
- if ($_product->getTypeId() == "configurable") {
- echo "}";
- }
- ?> ;
- var assocBIGIMG = // Added - Removed { here, causes issues with other scripts when not working with a configurable product.
- <?php
- $dados = array();
- if ($_product->getTypeId() == "configurable") {
- echo "{";
- $associated_products = $_product->loadByAttribute('sku', $_product->getSku())->getTypeInstance()->getUsedProducts();
- foreach ($associated_products as $assoc)
- $dados[] = $assoc->getId().":'".($assoc->image == "no_selection" || $assoc->image == "" ? $this->helper('catalog/image')->init($_product, 'image', $_product->image)->resize(1000) : $this->helper('catalog/image')->init($assoc, 'image', $assoc->image)->resize(1000))."'";
- } else {
- $dados[] = "''";
- }
- echo implode(',', $dados );
- if ($_product->getTypeId() == "configurable") {
- echo "}";
- }
- ?> ;
- //]]
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement