问题是他们会选择MYR并选择非马来西亚国家并付款。
所以我在catalog / controller / checkout / checkout.php上应用了以下内容
$this->currency->set('MYR');
if ($_SESSION['shipping_zone_id'] == '3528'){
$this->currency->set('USD');
}
问题是货币进入会话,需要刷新页面,所以我应用了以下内容:
$this->currency->set('MYR');
if ($_SESSION['shipping_zone_id'] == '3528'){
$this->currency->set('USD');
$sec = "10";
header("Refresh: $sec; url=index.php?route=checkout/checkout");
}
以上是刷新页面,但它继续刷新页面。我希望它只刷新一次。 PLZ建议
答案 0 :(得分:0)
添加以下代码行
$this->currency->set('MYR');
if ($_SESSION['shipping_zone_id'] == '3528'){
$this->currency->set('USD');
if(!empty($_GET['refresh']) && $_GET['refresh'] == 0 ){} //add this
else{
$sec = "10";
header("Refresh: $sec; url=index.php?refresh=0&route=checkout/checkout");
} //and close it here
}