Commit 49881120 by dhn Committed by halweg

物流展示规则修改

parent 0e7cd005
...@@ -56,21 +56,7 @@ define([ ...@@ -56,21 +56,7 @@ define([
serviceUrl, payload, false serviceUrl, payload, false
).done(function (result) { ).done(function (result) {
var new_sh = []; var new_sh = [];
if(result.length > 1) new_sh.push(result[0]);
{
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]);
}
rateRegistry.set(address.getCacheKey(), result); rateRegistry.set(address.getCacheKey(), result);
shippingService.setShippingRates(new_sh); shippingService.setShippingRates(new_sh);
}).fail(function (response) { }).fail(function (response) {
......
...@@ -71,26 +71,12 @@ define([ ...@@ -71,26 +71,12 @@ define([
paymentServiceDefault.setPaymentMethods(methodConverter(response.payment_methods)); paymentServiceDefault.setPaymentMethods(methodConverter(response.payment_methods));
var sh = response.shipping_methods; var sh = response.shipping_methods;
var new_sh = []; var new_sh = [];
if(sh.length > 1)
{
for(var i=0;i<sh.length;i++) selectShippingMethodAction(sh[0]);
{ checkoutData.setSelectedShippingRate(sh[0]['carrier_code'] + '_' + sh[0]['method_code']);
if(sh[i].amount == 0) quote.shippingMethod(sh[0]);
{ new_sh.push(sh[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]);
}
shippingService.setShippingRates(new_sh); shippingService.setShippingRates(new_sh);
updateItemService.hasUpdateResult(false); updateItemService.hasUpdateResult(false);
response.totals.coupon_code ? paymentService.isAppliedCoupon(true) : paymentService.isAppliedCoupon(false); response.totals.coupon_code ? paymentService.isAppliedCoupon(true) : paymentService.isAppliedCoupon(false);
......
...@@ -40,21 +40,7 @@ define([ ...@@ -40,21 +40,7 @@ define([
serviceUrl, payload, false serviceUrl, payload, false
).done(function (result) { ).done(function (result) {
var new_sh = []; var new_sh = [];
if(result.length > 1) new_sh.push(result[0]);
{
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]);
}
rateRegistry.set(address.getCacheKey(), result); rateRegistry.set(address.getCacheKey(), result);
shippingService.setShippingRates(new_sh); shippingService.setShippingRates(new_sh);
}).fail(function (response) { }).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