From fae14aca88c8a49a85b9888c8c9503e4d11cc50c Mon Sep 17 00:00:00 2001
From: mDeflotte
Date: Tue, 17 Jan 2012 08:35:27 +0000
Subject: [PATCH] [-] BO : #PSFV-491 - Fixed problem with multishipping and
summary cart
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12458 b9a71923-0436-4b27-9f14-aed3839534dd
---
themes/default/js/order-address.js | 4 +++-
themes/default/js/order-opc.js | 19 +++++++++++++++----
themes/default/order-address.tpl | 2 +-
3 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/themes/default/js/order-address.js b/themes/default/js/order-address.js
index 504178f20..747ef137f 100644
--- a/themes/default/js/order-address.js
+++ b/themes/default/js/order-address.js
@@ -53,7 +53,9 @@ function updateAddressesDisplay(first_view)
if ($('input[type=checkbox]#addressesAreEquals:checked').length == 1)
{
- $('#address_invoice_form:visible').hide('fast');
+ if ($('#multishipping_mode_checkbox:checked').length == 0) {
+ $('#address_invoice_form:visible').hide('fast');
+ }
$('ul#address_invoice').html($('ul#address_delivery').html());
$('ul#address_invoice li.address_title').html(txtInvoiceTitle);
}
diff --git a/themes/default/js/order-opc.js b/themes/default/js/order-opc.js
index 402c124f0..da3be0ff0 100644
--- a/themes/default/js/order-opc.js
+++ b/themes/default/js/order-opc.js
@@ -670,9 +670,11 @@ function multishippingMode(it)
{
if ($(it).attr('checked'))
{
- $('#address_delivery').hide();
+ $('#address_delivery, .address_delivery').hide();
$('#address_invoice').removeClass('alternate_item').addClass('item');
$('#multishipping_mode_box').addClass('on');
+ $('.addressesAreEquals').hide();
+ $('#address_invoice_form').show();
$('#link_multishipping_form').click(function() {return false;});
@@ -728,9 +730,15 @@ function multishippingMode(it)
}
else
{
- $('#address_delivery').show();
+ $('#address_delivery, .address_delivery').show();
$('#address_invoice').removeClass('item').addClass('alternate_item');
$('#multishipping_mode_box').removeClass('on');
+ $('.addressesAreEquals').show();
+ if ($('.addressesAreEquals').find('input:checked')) {
+ $('#address_invoice_form').hide();
+ } else {
+ $('#address_invoice_form').show();
+ }
// Disable multi address shipping
$.ajax({
@@ -758,6 +766,9 @@ $(document).ready(function() {
// If the multishipping mode is off assure us the checkbox "I want to specify a delivery address for each products I order." is unchecked.
$('#multishipping_mode_checkbox').attr('checked', false);
// If the multishipping mode is on, check the box "I want to specify a delivery address for each products I order.".
- if (typeof(multishipping_mode) != 'undefined' && multishipping_mode)
- $('#multishipping_mode_checkbox').click()
+ if (typeof(multishipping_mode) != 'undefined' && multishipping_mode) {
+ $('#multishipping_mode_checkbox').click();
+ $('.addressesAreEquals').hide();
+ $('.addressesAreEquals').find('input').attr('checked', false);
+ }
});
diff --git a/themes/default/order-address.tpl b/themes/default/order-address.tpl
index ea50d7f5e..5177ae83d 100644
--- a/themes/default/order-address.tpl
+++ b/themes/default/order-address.tpl
@@ -212,7 +212,7 @@
- isVirtualCart()}style="display:none;"{/if}>
+
isVirtualCart()}style="display:none;"{/if}>
id_address_invoice == $cart->id_address_delivery || $addresses|@count == 1}checked="checked"{/if} />