// Allow / Disallow multishipping

This commit is contained in:
mDeflotte
2011-12-01 16:34:20 +00:00
parent 660a595bf1
commit ab5edcd2d1
5 changed files with 51 additions and 26 deletions
@@ -165,6 +165,13 @@ class AdminPreferencesControllerCore extends AdminController
'list' => $order_process_type, 'list' => $order_process_type,
'identifier' => 'value' 'identifier' => 'value'
), ),
'PS_ALLOW_MULTISHIPPING' => array(
'title' => $this->l('Allow multi-shipping'),
'desc' => $this->l('Allow the customer to ship is order to multiple addressed or in to deliver the products "in stock" first. This option will transform the customer cart in one or more orders.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
),
'PS_REGISTRATION_PROCESS_TYPE' => array( 'PS_REGISTRATION_PROCESS_TYPE' => array(
'title' => $this->l('Registration process type'), 'title' => $this->l('Registration process type'),
'desc' => $this->l('The "Only account creation" step register process allows the customer to register faster, and create his address later.'), 'desc' => $this->l('The "Only account creation" step register process allows the customer to register faster, and create his address later.'),
+9
View File
@@ -117,6 +117,9 @@ class CartControllerCore extends FrontController
protected function processChangeProductAddressDelivery() protected function processChangeProductAddressDelivery()
{ {
if (!Configuration::get('PS_ALLOW_MULTISHIPPING'))
return;
$old_id_address_delivery = (int)Tools::getValue('old_id_address_delivery'); $old_id_address_delivery = (int)Tools::getValue('old_id_address_delivery');
$new_id_address_delivery = (int)Tools::getValue('new_id_address_delivery'); $new_id_address_delivery = (int)Tools::getValue('new_id_address_delivery');
@@ -129,6 +132,9 @@ class CartControllerCore extends FrontController
protected function processAllowSeperatedPackage() protected function processAllowSeperatedPackage()
{ {
if (!Configuration::get('PS_ALLOW_MULTISHIPPING'))
return;
if (Tools::getValue('value') === false) if (Tools::getValue('value') === false)
die('{"error":true, "error_message": "No value setted"}'); die('{"error":true, "error_message": "No value setted"}');
@@ -139,6 +145,9 @@ class CartControllerCore extends FrontController
protected function processDuplicateProduct() protected function processDuplicateProduct()
{ {
if (!Configuration::get('PS_ALLOW_MULTISHIPPING'))
return;
if ( if (
!$this->context->cart->duplicateProduct( !$this->context->cart->duplicateProduct(
$this->id_product, $this->id_product,
+5
View File
@@ -109,6 +109,7 @@ function changeAddressDelivery(obj)
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART); updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
if (jsonData.carriers != null) if (jsonData.carriers != null)
if (typeof(getCarrierListAndUpdate) != 'undefined')
getCarrierListAndUpdate(); getCarrierListAndUpdate();
// @todo reverse the remove order // @todo reverse the remove order
@@ -299,6 +300,7 @@ function deleteProductFromSummary(id)
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
updateCustomizedDatas(jsonData.customizedDatas); updateCustomizedDatas(jsonData.customizedDatas);
if (jsonData.carriers != null) if (jsonData.carriers != null)
if (typeof(getCarrierListAndUpdate) != 'undefined')
getCarrierListAndUpdate(); getCarrierListAndUpdate();
} }
}, },
@@ -349,6 +351,7 @@ function upQuantity(id, qty)
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART); updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
if (jsonData.carriers != null) if (jsonData.carriers != null)
if (typeof(getCarrierListAndUpdate) != 'undefined')
getCarrierListAndUpdate(); getCarrierListAndUpdate();
} }
}, },
@@ -408,6 +411,7 @@ function downQuantity(id, qty)
updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART); updateHookShoppingCart(jsonData.HOOK_SHOPPING_CART);
updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA); updateHookShoppingCartExtra(jsonData.HOOK_SHOPPING_CART_EXTRA);
if (jsonData.carriers != null) if (jsonData.carriers != null)
if (typeof(getCarrierListAndUpdate) != 'undefined')
getCarrierListAndUpdate(); getCarrierListAndUpdate();
} }
}, },
@@ -635,6 +639,7 @@ $(document).ready(function() {
+'&token='+static_token, +'&token='+static_token,
success: function(jsonData) success: function(jsonData)
{ {
if (typeof(getCarrierListAndUpdate) != 'undefined')
getCarrierListAndUpdate(); getCarrierListAndUpdate();
} }
}); });
+3 -1
View File
@@ -164,7 +164,7 @@
{include file="$tpl_dir./order-steps.tpl"} {include file="$tpl_dir./order-steps.tpl"}
{include file="$tpl_dir./errors.tpl"} {include file="$tpl_dir./errors.tpl"}
{if !$multi_shipping} {if !$multi_shipping && {Configuration::get('PS_ALLOW_MULTISHIPPING')}}
<div class="button_multishipping_mode" id="multishipping_mode_box"> <div class="button_multishipping_mode" id="multishipping_mode_box">
<div class="title">{l s='Multi-shipping'}</div> <div class="title">{l s='Multi-shipping'}</div>
<div class="description"> <div class="description">
@@ -176,6 +176,7 @@
{/if} {/if}
<form action="{$link->getPageLink($back_order_page, true)}" method="post"> <form action="{$link->getPageLink($back_order_page, true)}" method="post">
{else} {else}
{if {Configuration::get('PS_ALLOW_MULTISHIPPING')}}
<div class="address-form-multishipping"> <div class="address-form-multishipping">
<div class="button_multishipping_mode" id="multishipping_mode_box"> <div class="button_multishipping_mode" id="multishipping_mode_box">
<div class="title">{l s='Multi-shipping'}</div> <div class="title">{l s='Multi-shipping'}</div>
@@ -196,6 +197,7 @@
{/if} {/if}
</script> </script>
</div> </div>
{/if}
<div id="opc_account" class="opc-main-block"> <div id="opc_account" class="opc-main-block">
<div id="opc_account-overlay" class="opc-overlay" style="display: none;"></div> <div id="opc_account-overlay" class="opc-overlay" style="display: none;"></div>
{/if} {/if}
+2
View File
@@ -404,8 +404,10 @@
<p class="cart_navigation"> <p class="cart_navigation">
{if !$opc} {if !$opc}
<a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&amp;back={$back}')}{else}{$link->getPageLink('order', true, NULL, 'step=1')}{/if}" class="exclusive" title="{l s='Next'}">{l s='Next'} &raquo;</a> <a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&amp;back={$back}')}{else}{$link->getPageLink('order', true, NULL, 'step=1')}{/if}" class="exclusive" title="{l s='Next'}">{l s='Next'} &raquo;</a>
{if {Configuration::get('PS_ALLOW_MULTISHIPPING')}}
<a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&amp;back={$back}')}{else}{$link->getPageLink('order', true, NULL, 'step=1')}{/if}&amp;multi-shipping=1" class="multishipping-button exclusive" title="{l s='Multi-shipping'}">{l s='Multi-shipping'} &raquo;</a> <a href="{if $back}{$link->getPageLink('order', true, NULL, 'step=1&amp;back={$back}')}{else}{$link->getPageLink('order', true, NULL, 'step=1')}{/if}&amp;multi-shipping=1" class="multishipping-button exclusive" title="{l s='Multi-shipping'}">{l s='Multi-shipping'} &raquo;</a>
{/if} {/if}
{/if}
<a href="{if (isset($smarty.server.HTTP_REFERER) && strstr($smarty.server.HTTP_REFERER, 'order.php')) || !isset($smarty.server.HTTP_REFERER)}{$link->getPageLink('index')}', {else}{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}{/if}" class="button_large" title="{l s='Continue shopping'}">&laquo; {l s='Continue shopping'}</a> <a href="{if (isset($smarty.server.HTTP_REFERER) && strstr($smarty.server.HTTP_REFERER, 'order.php')) || !isset($smarty.server.HTTP_REFERER)}{$link->getPageLink('index')}', {else}{$smarty.server.HTTP_REFERER|escape:'htmlall':'UTF-8'|secureReferrer}{/if}" class="button_large" title="{l s='Continue shopping'}">&laquo; {l s='Continue shopping'}</a>
</p> </p>
<p class="clear"><br /><br /></p> <p class="clear"><br /><br /></p>