Jump to content

Multiple shipping not working correctly


Recommended Posts

Prestashop 1.5.6.2

 

With multi-shipping turned on, the customer chooses for each product from a drop-down list of registered addresses or, the top choice to create a new address, or the bottom one to 'Ship to multiple addresses' (ie split this product order).

 

The last option does not work correctly. It appears if only one product is ordered and if selected by the customer it changes the order. I would like to remove it from the options (or prevent it from appearing unless two or more identical products are ordered) but cannot work out how. My best option is to not have it appear.

 

From translations, the phrase 'ship to multiple addresses' is found in two .tpl files:

 

order-address-multishipping-products

order-address-product-line

 

The second file looks like it controls the last option in the box (I cannot see how the first file is involved with this phrase and editing translations changes the text in the second file). The code is here - the relevant bit is right at the end (I think!):

 

....................

 

        <form method="post" action="{$link->getPageLink('cart', true, NULL, "token={$token_cart}")|escape:'html'}">
            <input type="hidden" name="id_product" value="{$product.id_product}" />
            <input type="hidden" name="id_product_attribute" value="{$product.id_product_attribute}" />
            <select name="address_delivery" id="select_address_delivery_{$product.id_product}_{$product.id_product_attribute}_{$product.id_address_delivery|intval}" class="cart_address_delivery">
                {if $product.id_address_delivery == 0 && $delivery->id == 0}
                <option></option>
                {/if}
                <option value="-1">{l s='Create a new address'}</option>
                {foreach $address_list as $address}
                    <option value="{$address.id_address}"
                        {if ($product.id_address_delivery > 0 && $product.id_address_delivery == $address.id_address) || ($product.id_address_delivery == 0  && $address.id_address == $delivery->id)}
                            selected="selected"
                        {/if}
                    >
                        {$address.alias}
                    </option>
                {/foreach}
                <option value="-2">{l s='Ship to multiple addresses'}</option>
            </select>
        </form>

 

...........................

 

I've tried commenting out different bits around the last few lines or changing the number -2 to -1 and -3 - either nothing happens at all or else more than one entry appears in the drop-down box! I don't know how to change this to remove that lost option from the box - someone, please help!

Edited by CJH (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...