Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Academic Free License (AFL 3.0)
- * that is bundled with this package in the file LICENSE_AFL.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/afl-3.0.php
- * If you did not receive a copy of the license and are unable to
- * obtain it through the world-wide-web, please send an email
- * to license@magentocommerce.com so we can send you a copy immediately.
- *
- * DISCLAIMER
- *
- * Do not edit or add to this file if you wish to upgrade Magento to newer
- * versions in the future. If you wish to customize Magento for your
- * needs please refer to http://www.magentocommerce.com for more information.
- *
- * @category design
- * @package base_default
- * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
- */
- ?>
- <?php
- $_product = $this->getProduct();
- $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
- ?>
- <?php if ($_product->isSaleable() && count($_attributes)):?>
- <dl>
- <?php foreach($_attributes as $_attribute): ?>
- <dt><label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label></dt>
- <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>
- <?php if ($_attribute->getLabel() == "Other size") { ?>
- <div class="input-box">
- <input name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" type="hidden" value="" />
- <?php-
- $attribute = $_product->getResource()->getAttribute('size'); //load the configurable attribute here which is the color
- $frontend = $attribute->getFrontend();
- $selectOptions = $frontend->getSelectOptions(); //get the frontend labels and values of this attribute
- foreach($selectOptions as $color_prop)
- ?>
- <img onClick="document.getElementById('attribute<?php echo $_attribute->getAttributeId() ?>').value = this.id;" id="<?php echo $color_prop['value'] ?>" src="<?php echo Mage::helper('attributeoptionimage')->getAttributeOptionImage($color_prop['value']) ?>" width="30" height="30">
- </div>
- <?php } else { ?>
- <div class="input-box">
- <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
- <option><?php echo $this->__('Choose an Option...') ?></option>
- </select>
- </div>
- <?php } ?>
- </dd>
- <?php endforeach; ?>
- </dl>
- <script type="text/javascript">
- var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>);
- </script>
- <?php endif;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement