// Improving adding address with order-opc
This commit is contained in:
+1
-1
@@ -2470,7 +2470,7 @@ class CartCore extends ObjectModel
|
|||||||
'total_price' => $this->getOrderTotal(),
|
'total_price' => $this->getOrderTotal(),
|
||||||
'total_tax' => $total_tax,
|
'total_tax' => $total_tax,
|
||||||
'total_price_without_tax' => $this->getOrderTotal(false),
|
'total_price_without_tax' => $this->getOrderTotal(false),
|
||||||
'is_multi_address_delivery' => $this->isMultiAddressDelivery(),
|
'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
|
||||||
'free_ship' => 0,
|
'free_ship' => 0,
|
||||||
'carrier' => new Carrier($this->id_carrier, $id_lang),
|
'carrier' => new Carrier($this->id_carrier, $id_lang),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -41,7 +41,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
|||||||
if ($this->nbProducts)
|
if ($this->nbProducts)
|
||||||
$this->context->smarty->assign('virtual_cart', false);
|
$this->context->smarty->assign('virtual_cart', false);
|
||||||
|
|
||||||
$this->context->smarty->assign('is_multi_address_delivery', $this->context->cart->isMultiAddressDelivery());
|
$this->context->smarty->assign('is_multi_address_delivery', $this->context->cart->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1));
|
||||||
|
$this->context->smarty->assign('open_multishipping_fancybox', (int)Tools::getValue('multi-shipping') == 1);
|
||||||
|
|
||||||
$this->isLogged = (bool)($this->context->customer->id && Customer::customerIdExistsStatic((int)$this->context->cookie->id_customer));
|
$this->isLogged = (bool)($this->context->customer->id && Customer::customerIdExistsStatic((int)$this->context->cookie->id_customer));
|
||||||
|
|
||||||
|
|||||||
@@ -825,7 +825,6 @@ table#cart_summary .cart_total_price .total_price_container {
|
|||||||
|
|
||||||
.multishipping_close_container {
|
.multishipping_close_container {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: -30px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* step 2 - authentification ******************************************************************* */
|
/* step 2 - authentification ******************************************************************* */
|
||||||
|
|||||||
@@ -678,6 +678,7 @@ function multishippingMode(it)
|
|||||||
$('#address_invoice_form').show();
|
$('#address_invoice_form').show();
|
||||||
|
|
||||||
$('#link_multishipping_form').click(function() {return false;});
|
$('#link_multishipping_form').click(function() {return false;});
|
||||||
|
$('.address_add a').attr('href', addressMultishippingUrl);
|
||||||
|
|
||||||
$('#link_multishipping_form').fancybox({
|
$('#link_multishipping_form').fancybox({
|
||||||
'transitionIn': 'elastic',
|
'transitionIn': 'elastic',
|
||||||
@@ -740,6 +741,7 @@ function multishippingMode(it)
|
|||||||
} else {
|
} else {
|
||||||
$('#address_invoice_form').show();
|
$('#address_invoice_form').show();
|
||||||
}
|
}
|
||||||
|
$('.address_add a').attr('href', addressUrl);
|
||||||
|
|
||||||
// Disable multi address shipping
|
// Disable multi address shipping
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@@ -772,4 +774,7 @@ $(document).ready(function() {
|
|||||||
$('.addressesAreEquals').hide();
|
$('.addressesAreEquals').hide();
|
||||||
$('.addressesAreEquals').find('input').attr('checked', false);
|
$('.addressesAreEquals').find('input').attr('checked', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (open_multishipping_fancybox)
|
||||||
|
$('#link_multishipping_form').click();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -75,6 +75,9 @@
|
|||||||
var txtProduct = "{l s='product'}";
|
var txtProduct = "{l s='product'}";
|
||||||
var txtProducts = "{l s='products'}";
|
var txtProducts = "{l s='products'}";
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
var addressMultishippingUrl = "{$link->getPageLink('address', true, NULL, "back={$back_order_page}?step=1{'&multi-shipping=1'|urlencode}{if $back}&mod={$back|urlencode}{/if}")}";
|
||||||
|
var addressUrl = "{$link->getPageLink('address', true, NULL, "back={$back_order_page}?step=1{if $back}&mod={$back}{/if}")}";
|
||||||
|
|
||||||
var formatedAddressFieldsValuesList = new Array();
|
var formatedAddressFieldsValuesList = new Array();
|
||||||
|
|
||||||
@@ -195,6 +198,7 @@
|
|||||||
{else}
|
{else}
|
||||||
var multishipping_mode = false;
|
var multishipping_mode = false;
|
||||||
{/if}
|
{/if}
|
||||||
|
var open_multishipping_fancybox = {$open_multishipping_fancybox|intval};
|
||||||
</script>
|
</script>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user