I have a module to check whether a carrier can deliver in a postcode(I have custom tables and functions for this).But I am stuck in select "Shipping" step.
I want to disable a carrier on "Shipping" step,based on availability on postcode..
in mymodule.php
//mymodule.php
public function hookDisplayBeforeCarrier($params) {
$delivery_option_list = $params['delivery_option_list'];
$carriers = $params['carriers'];
//updated $delivery_option_list and $carriers here.Removed unavailable carriers in that delivery address.
// overwrite the list of shipping options
$this->context->smarty->assign('carriers', $carrires);
$this->context->smarty->assign('delivery_option_list', $delivery_option_list);
}
But its not reflecting in the front end..Still its showing all the carriers..
I checked order-carrier.tpl.
order-carrier.tpl line no 51
<div class="delivery_options_address">
{if isset($delivery_option_list)}
{$delivery_option_list|@print_r}
{foreach $delivery_option_list as $id_address => $option_list}
<p class="carrier_title">
{if isset($address_collection[$id_address])}
{l s='Choose a shipping option for this address:'} {$address_collection[$id_address]->alias}
{else}
{l s='Choose a shipping option'}
{/if}
</p>
Please help me to remove a carrier on hookDisplayBeforeCarrier hook..