Magento技术添加到购物车不工作ie8



Magento产品详细信息页面有添加到愿望列表和添加到购物车按钮,这些按钮在ie8中没有任何作用,但在其他浏览器上可以正常工作。一个按钮中的代码部分是

<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" onclick="productAddToCartForm.submit(this)"><span><span><?php echo $buttonTitle ?></span></span></button>

它应该连接的脚本函数是:

<script type="text/javascript">
    <?php if($this->getMessagesBlock()->getGroupedHtml()): ?>
        document.observe("dom:loaded", function(){
            var submitButton = $$('.btn-cart')[0];
            productAddToCartForm.submit(submitButton);
         });
    <?php endif; ?>
</script>

如有任何帮助,不胜感激。

当我运行调试时,它给了我这个错误:SCRIPT5007:无法设置未定义或空引用的属性'href'

它指向

附近的代码
    <?php if (Mage::getStoreConfig('Moii_Pinterest_Config/configuration/Moii_Pinterest_Price') == 1) { ?>
            var pinit_desc = desc + ' - ' + window['pinit_price_'+params.colour];
        <?php } ?>
        var pinit_href = $$('.product-share')[0].firstElementChild.href;
?><

由于这个问题的解决方案firstElementChild不能在Internet Explorer 7中工作…我有什么选择?你应该替换:

var pinit_href = $$('.product-share')[0].firstElementChild.href;

var pShare = $$('.product-share')[0];
var pinit_href = (pShare.firstElementChild || pShare.children[0] || {}).href;

最新更新