繁体   English   中英

magento 1.7自定义选项未更新价格

[英]magento 1.7 custom options not updating price

嗨,我有一个带有自定义选项的简单产品,此垂直产品的输入类型设置为下拉菜单。

在产品视图页面上,更改下拉选择选项后,产品价格不会改变,而是显示0.00英镑。 它在js控制台中引发错误

Uncaught ReferenceError: spConfig is not defined 

再一次,这不是可配置的产品。 如果我必须添加到购物车并继续检出,则将从自定义选项中添加值。

我了解这是一个JavaScript问题,并且我也知道它在js / varien / product.js下

但我看不到要在哪里进行更改或要进行哪些更改。

非常感谢

您的两个问题没有直接关系。 我们在这里遇到了同样的问题-我假设您正在使用'OrganicInternet'模块( http://www.magentocommerce.com/magento-connect/simple-configurable-products.html )。 可以通过在运行功能之前检查对象的存在来解决未捕获的参考错误。 (spConfig对象仅存在于可配置的产品页面上。)

在/skin/frontent/base/default/js/scp_product_extension.js中,包装最后一个函数,如下所示:

if (typeof spConfig != "undefined") {

    //SCP: Forces price labels to be updated on load
    //so that first select shows ranges from the start
    document.observe("dom:loaded", function() {
        //Really only needs to be the first element that has configureElement set on it,
        //rather than all.
        $('product_addtocart_form').getElements().each(function(el) {
            if(el.type == 'select-one') {
                if(el.options && (el.options.length > 1)) {
                    el.options[0].selected = true;
                    spConfig.reloadOptionLabels(el);
                }
            }
        });
    });
};

与0.00定价相关的实际问题是由于以下事实:该模块将产品页面上的产品选项HTML和JS替换为从下拉列表中获取期权价格时不会返回有效响应的元素。 到目前为止,我们似乎已经通过防止模块以这种方式覆盖来解决了这一问题。 我不确定这是否已解决,我们仍在测试中。

在/app/design/frontent/base/default/layout/simpleconfigurableproducts.xml中,注释掉-或删除scpwrapper和scpoptions模板:

  <!--<reference name="product.info.options.wrapper">
        <action method="setTemplate"><template>catalog/product/view/options/scpwrapper.phtml</template></action>
    </reference>

    <reference name="product.info.options">
        <action method="setTemplate"><template>catalog/product/view/scpoptions.phtml</template></action>
    </reference>-->

如果我们发现更多信息/问题,将努力更新此帖子。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM