Shipping Groups Template Changes

This article describes what changes need to be made to implement automatic order splitting by shipping groups.

Introduction

This article describes what needs to be changed in your templates to implement automatic order splitting by shipping groups.

Basket Template

When a basket contains products from multiple shipping groups, to display a notice that products will be shipped in multiple consignments, you should use the if_basket_has_multiple_shipping_groups smarty conditional block in your templates/example.com/basket/index.tpl.html template:

{if_basket_has_multiple_shipping_groups}
	<div class="infobox">
		<h2>Information</h2>
		<p>{site_text page="Basket" part="Warning: Multiple shipping groups"}</p>
	</div>
{/if_basket_has_multiple_shipping_groups}

When a basket has products from multiple shipping groups, to display a notice for every product which is not in the default shipping group, to indicate that it will be shipped in a separate consignment, in your templates/example.com/basket/basket.tpl.html template you should add:

{if isset($basket_item.product.shipping_groups.0) && $basket_item.product.shipping_groups.0.id != 0}
	{if_basket_has_multiple_shipping_groups}
		<div class="infobox">{site_text page="Basket" part="Warning: Item shipped separately"}</div>
	{/if_basket_has_multiple_shipping_groups}
{/if}

Basket Template - Shipping Restrictions

Shipping country restrictions operate in 2 modes: inclusive and exclusive. By default, Shipping country restrictions will be displayed in exclusive mode, meaning that there is no need to change the template.

However, the template can be changed to display either banned or allowed shipping countries, depending on the shipping restrictions mode set for the product. For that, in your templates/example.com/basket/basket.tpl.html template you should use this code for displaying shipping country restrictions: 

{if ($basket_item.product.shipping_restrictions_mode == 'include' && $basket_item.product.allowed_shipping_countries) || $basket_item.product.banned_shipping_countries}
    <div class="basketbannedcountrys">
        {if $basket_item.product.shipping_restrictions_mode == 'include'}
        <p>This product can be shipped to the following locations only:</p>
        <ul>
            {foreach from=$basket_item.product.allowed_shipping_countries item="country"}
            <li>{$country}</li>
            {/foreach}
        </ul>
        {else}
        <p>This product cannot be shipped to the following locations:</p>
        <ul>
            {foreach from=$basket_item.product.banned_shipping_countries item="country"}
            <li>{$country}</li>
            {/foreach}
        </ul>
        {/if}
    </div>
{/if}

🚧

On the order confirmation page shipping restrictions are also displayed, so you should amend your templates/example.com/basket/order-complete-basket.tpl.html template the same way like templates/example.com/basket/basket.tpl.html template to display shipping restrictions consistently.

Checkout template

When a user is purchasing products from multiple shipping groups, to display a notice that products will be shipped in multiple consignments, you should use the if_basket_has_multiple_shipping_groups smarty conditional block in your templates/example.com/checkout/index.tpl.html template:

{if_basket_has_multiple_shipping_groups}
	<div class="infobox">
		<h2>Information</h2>
		<p>{site_text page="Basket" part="Warning: Multiple shipping groups"}</p>
	</div>
{/if_basket_has_multiple_shipping_groups}

templates/example.com/basket/index.tpl.html and templates/example.com/basket/basket.tpl.html