Commit 8151b306 by dhn

物流展示规则修改

parent cc9e5401
......@@ -56,21 +56,7 @@ define([
serviceUrl, payload, false
).done(function (result) {
var new_sh = [];
if(result.length > 1)
{
for(var i=0;i<result.length;i++)
{
if(result[i].amount == 0)
{
new_sh.push(result[i]);
}
}
}
else if(result.length === 1)
{
new_sh.push(result[0]);
}
new_sh.push(result[0]);
rateRegistry.set(address.getCacheKey(), result);
shippingService.setShippingRates(new_sh);
}).fail(function (response) {
......
......@@ -71,26 +71,12 @@ define([
paymentServiceDefault.setPaymentMethods(methodConverter(response.payment_methods));
var sh = response.shipping_methods;
var new_sh = [];
if(sh.length > 1)
{
for(var i=0;i<sh.length;i++)
{
if(sh[i].amount == 0)
{
selectShippingMethodAction(sh[i]);
checkoutData.setSelectedShippingRate(sh[i]['carrier_code'] + '_' + sh[i]['method_code']);
quote.shippingMethod(sh[i]);
new_sh.push(sh[i]);
}
}
}
else if(sh.length === 1)
{
selectShippingMethodAction(sh[0]);
quote.shippingMethod(sh[0]);
new_sh.push(sh[0]);
}
selectShippingMethodAction(sh[0]);
checkoutData.setSelectedShippingRate(sh[0]['carrier_code'] + '_' + sh[0]['method_code']);
quote.shippingMethod(sh[0]);
new_sh.push(sh[0]);
shippingService.setShippingRates(new_sh);
updateItemService.hasUpdateResult(false);
response.totals.coupon_code ? paymentService.isAppliedCoupon(true) : paymentService.isAppliedCoupon(false);
......
......@@ -40,21 +40,7 @@ define([
serviceUrl, payload, false
).done(function (result) {
var new_sh = [];
if(result.length > 1)
{
for(var i=0;i<result.length;i++)
{
if(result[i].amount == 0)
{
new_sh.push(result[i]);
}
}
}
else if(result.length === 1)
{
new_sh.push(result[0]);
}
new_sh.push(result[0]);
rateRegistry.set(address.getCacheKey(), result);
shippingService.setShippingRates(new_sh);
}).fail(function (response) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment