嗨,我有一个带有自定义选项的简单产品,此永久产品的输入类型设置为下拉列表。
在产品视图页面,当下拉选择选项改变时,该产品的价格没有变化,而是显示为it 0.00。它在js控制台中抛出一个错误。
Uncaught ReferenceError: spConfig is not defined 再说一次,这不是可配置的产品。如果我必须添加到购物车并继续检出,这些值将从自定义选项中添加。
我知道这是一个javascript问题,我也知道它在js/varien/product.js下。
但我不知道该在哪里做改变,或者做什么改变。
非常感谢
发布于 2014-09-19 19:45:35
你的两个问题没有直接关系。我们在这里遇到了同样的问题--我假设您使用的是'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>-->如果我们发现更多的信息/问题,我们将努力更新这篇文章。
https://stackoverflow.com/questions/22460719
复制相似问题