The postage Smarty block retrieves the postage amount of the current cart if it exists.
Thelia uses the following rules to select the country :
the country of the delivery address of the customer related to the cart if it exists
the country saved in cookie if customer have changed the default country
the default country for the shop if it exists
The loop selects the cheapest delivery for this country.
Outputs
Inside the postage block this variables are defined :
$country_id: the country id or null
$delivery_id: the delivery id or null
$postage: the postage amount or 0.0
$is_customizable: indicate if the postage can be customized. False When customer is signed and have a valid delivery address
An implementation for the default front office template
And the associated javascript to trigger the form submission. It allows the customer to change the default country. His choice is saved in a cookie by the Front\Controller\FrontCrontroller::changeCountry method.