Simplecart 总重量
此页面描述了我的购物车,它使用 simpleCart JavaScript 库,并且该函数会更改我的购物车的运费。如何实现与我的购物车一起使用的功能?
<div class="simpleCart_items"></div>
<a href="#" class="simpleCart_empty">Svuota Carrello</a>
<strong>Sub Total: <span class="simpleCart_total"></span></strong> <br />
<strong>TAX:<span class="simpleCart_taxCost"</span> </strong> <br />
<strong>Productions numbers:<span class="simpleCart_quantity"></span></strong> <br />
<strong>Total Weight:???????</span></strong> <br />
<strong>Shipping:????</strong> <br />
我当前的功能是:
me.shipping = function()
{
var q = 0;
q += item.weight*item.quantity;
if(q <= 3000){
return 19.00;
}
if((q <= 10000)) {
return 23.00;
}
if((q <= 20000)){
return 24.00;
}
if((q <= 30000)){
return 26.00;
}
if((q <= 50000)){
return 32.00;
}
if((q <= 75000)){
return 35.00;
}
if((q <= 100000)){
return 39.00;
}
}
This page describes my shopping cart which is using the simpleCart JavaScript library, and the function alters the shipping cost of my cart. How can I implement my function to be used with my cart?
<div class="simpleCart_items"></div>
<a href="#" class="simpleCart_empty">Svuota Carrello</a>
<strong>Sub Total: <span class="simpleCart_total"></span></strong> <br />
<strong>TAX:<span class="simpleCart_taxCost"</span> </strong> <br />
<strong>Productions numbers:<span class="simpleCart_quantity"></span></strong> <br />
<strong>Total Weight:???????</span></strong> <br />
<strong>Shipping:????</strong> <br />
My current function is:
me.shipping = function()
{
var q = 0;
q += item.weight*item.quantity;
if(q <= 3000){
return 19.00;
}
if((q <= 10000)) {
return 23.00;
}
if((q <= 20000)){
return 24.00;
}
if((q <= 30000)){
return 26.00;
}
if((q <= 50000)){
return 32.00;
}
if((q <= 75000)){
return 35.00;
}
if((q <= 100000)){
return 39.00;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 simpleCart 文档,您可以通过多种方式自定义运费。我特别看到的一个几乎正是我所认为的(帖子很难阅读)您想要的:
这显示了如何编辑运费的计算方式。此示例可以根据其网站文档获得许多其他示例:http://simplecartjs.com/documentation.html
Per simpleCart Documentation, there are many ways they allow you to customize shipping costs. One in particular I saw was almost exactly what I think (post was difficult to read) you want:
This shows how you can edit how shipping is calculated. This example any many others are available per their site documentation at: http://simplecartjs.com/documentation.html