1

I just upgraded from 1.9.1 and our configurable.phtml was working fine before that. Now it's showing the pricing as "$0.00". I've replaced our configurable.phtml with the "Default" and it worked, but is giving us the ugly "Drop Down" menus. I'd like to get all our color swatch images and sizing to display again. Here's our original configurable.phtml code that worked before the upgrade.

<?php
$_product = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
$_jsonConfig = $this->getJsonConfig();
$_renderers = $this->getChild('attr_renderers')->getSortedChildren();
?>
<?php if ($_product->isSaleable() && count($_attributes)): ?>
    <dl>
        <?php foreach ($_attributes as $_attribute): ?>
            <?php
            $_rendered = false;
            foreach ($_renderers as $_rendererName):
                $_renderer = $this->getChild('attr_renderers')->getChild($_rendererName);
                if (method_exists($_renderer, 'shouldRender') && $_renderer->shouldRender($_product, $_attribute, $_jsonConfig)):
                    $_renderer->setProduct($_product);
                    $_renderer->setAttributeObj($_attribute);
                    echo $_renderer->toHtml();
                    $_rendered = true;
                    break;
                endif;
            endforeach;

            if (!$_rendered):
                ?>
                <dt>
                <label class="required"><em>*</em><?php echo $_attribute->getLabel() ?></label>
                </dt>
                <dd<?php if ($_attribute->decoratedIsLast)
            { ?> class="last"<?php } ?>>
                    <div class="input-box">
                        <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>_<?php echo $_product->getId() ?>" class="required-entry super-attribute-select_<?php echo $_product->getId() ?> no-display">
                            <option><?php echo $this->__('Choose an Option...') ?></option>
                        </select>
                    </div>
                </dd>
            <?php endif; ?>
    <?php endforeach; ?>
    </dl>
    <script type="text/javascript">
        var spConfig_<?php echo $_product->getId(); ?> = new Jennyyoo_Product.Config(<?php echo $_jsonConfig ?>);
    </script>
    <?php echo $this->getChildHtml('after') ?>
<?php endif; ?>

So after some research, I've found that I am getting a ReferenceError: spConfig is not defined error. I'm assuming there's an issue with my js file?

1 Answer 1

0

I have updated my magento version to 1.9.2.2 recently, After updated to new version, if i select the price of product, that cost is showing normally fine till here. The main problem is, if i select the any Custom option like color, size That product's price is showing ZERO.
Solution:
First of all, we need to open file at


app/design/[your package]/[yourtheme]/template/catalog/product/view/options.phtml

Search for this script

price += parseFloat(config[optionId][element.getValue()]);

Replace with

price += parseFloat(config[optionId][element.getValue()].price);

Now it is cleared.

1
  • This is not in my code for options.phtml Commented Feb 20, 2016 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.