Jump to content

Shipping Zone ID in template needed


Recommended Posts

Hi together,

i want to present some extra informations in the order confirmation page, in my case in ROOT/modules/bankwire/payment.php.

this informations are depending on shipping zone of the client.

my question:
how can i finde out which zone has actual client?
something like:

if ($zone_id== 1) {echo "informations for zone 1"}
else if ($zone_id== 2) {echo "informations for zone 2"}

which is the right variable for zone id?

thanks

Link to comment
Share on other sites

bankwire line 187

what you have to do is define the variable first before assigning them to the smarty template.
example below. Then update payment_execution.tpl with something like
{if $id_zone == '1'} {l s=“informations for zone 1”} {/if}

hope that helps ;-)


public function execPayment($cart)
{
global $cookie, $smarty;

$address = new Address(intval($cart->id_address_delivery));
$id_zone = Address::getZoneById($address->id);

$currencies = Currency::getCurrencies();
$authorized_currencies = array_flip(explode(',', $this->currencies));
$currencies_used = array();
foreach ($currencies as $key => $currency)
if (isset($authorized_currencies[$currency['id_currency']]))
$currencies_used[] = $currencies[$key];
$smarty->assign(array(
'id_zone' => $id_zone,
'currency_default' => new Currency(Configuration::get('PS_CURRENCY_DEFAULT')),
'currencies' => $currencies_used,
'total' => number_format($cart->getOrderTotal(true, 3), 2, '.', ''),
'isoCode' => Language::getIsoById(intval($cookie->id_lang)),
'bankwireDetails' => nl2br2($this->details),
'bankwireAddress' => nl2br2($this->address),
'bankwireOwner' => $this->owner,
'this_path' => $this->_path,
'this_path_ssl' => (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/'.$this->name.'/'
));

return $this->display(__FILE__, 'payment_execution.tpl');
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...