// Multishipping : on opc, on putting multi-shipping to off, the cart is set to one address delivery

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10458 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2011-11-22 17:18:30 +00:00
parent 4dc0ebb2de
commit 5532f12d80
5 changed files with 60 additions and 7 deletions
+29 -3
View File
@@ -29,7 +29,7 @@ function updateCarrierList(json)
var carriers = json.carriers;
/* contains all carrier available for this address */
if (carriers.length == 0)
if (!carriers || carriers.length == 0)
{
checkedCarrier = 0;
$('input[name=id_carrier]:checked').attr('checked', false);
@@ -750,15 +750,16 @@ function multishippingMode(it)
'type': 'ajax',
'onClosed': function()
{
// Relaod the cart
// Reload the cart
$.ajax({
url: orderOpcUrl,
data: 'ajax=true&method=cartReload',
dataType : 'html',
cache: false,
success: function(data) {
$('#cart_summary').replaceWith($(data).find('#cart_summary'));
}
})
});
updateCarrierSelectionAndGift();
},
'onStart': function()
@@ -781,5 +782,30 @@ function multishippingMode(it)
$('#address_invoice').removeClass('item').addClass('alternate_item');
$(it).removeClass('on');
$('#link_multishipping_form').hide();
// Disable multi address shipping
$.ajax({
url: orderOpcUrl,
async: false,
cache: false,
data: 'ajax=true&method=noMultiAddressDelivery',
});
// Reload the cart
$.ajax({
url: orderOpcUrl,
async: false,
cache: false,
data: 'ajax=true&method=cartReload',
dataType : 'html',
success: function(data) {
$('#cart_summary').replaceWith($(data).find('#cart_summary'));
}
});
}
}
$(document).ready(function() {
if (multishipping_mode)
$('#multishipping_mode').click();
});
+7
View File
@@ -178,6 +178,13 @@
<a href="{$link->getPageLink('order-opc', true, NULL, 'ajax=1&multi-shipping=1&method=multishipping')}" id="link_multishipping_form" title="{l s='Choose the delivery addresses'}" class="button exclusive" style="display:none">
{l s='Choose the delivery addresses'}
</a>
<script type="text/javascript">
{if $is_multi_address_delivery}
var multishipping_mode = true;
{else}
var multishipping_mode = false;
{/if}
</script>
</div>
<div id="opc_account" class="opc-main-block">
<div id="opc_account-overlay" class="opc-overlay" style="display: none;"></div>