我在銀行電匯訂單步驟中獲取交付國家時遇到了一些問題。 我嘗試modules/bankwire/bankwire.php
function __construct()
與Context::getContext();
GET國名這樣的:Context :: getContext()如何在Prestashop銀行電匯模塊中使用
$context = Context::getContext();
$this->context->smarty->assign('country_name', $context->country->name[1]);
並沒有什麼。但在Cart.php它工作正常:
$context = Context::getContext();
if ($context->country->name[1] == 'Germany') {}
我也嘗試在同一modules/bankwire/bankwire.php
得到國名這樣的:
$context = Context::getContext();
$delivery = new Address($context->cart->id_address_delivery);
$this->context->smarty->assign('country_name', $delivery->country);
並獲得什麼太。但在ParentOrderController.php
它的工作原理:
$address = new Address($this->context->cart->id_address_delivery);
$this->context->smarty->assign('country_name', $address->country);
請你能告訴我怎樣才能在bankwire得到國家的名字,我怎麼可以使用右鍵::的getContext()?
謝謝