0
嗨,我試圖從結算頁面中的可用運營商列表中取消設置運營商(步驟2)。我試圖從鉤子取消它:hookDisplayBeforeCarrier,但運營商仍然存在。不是緩存問題。PrestaShop:從結帳頁面中取消運營商
非常感謝!
public function hookDisplayBeforeCarrier($params)
{
$delivery_option_list = $params['delivery_option_list'];
foreach ($delivery_option_list as $id_address => $carrier_list_raw) {
foreach ($carrier_list_raw as $key => $carrier_list) {
foreach ($carrier_list['carrier_list'] as $id_carrier => $carrier) {
if ($id_carrier != 21) {
continue;
}
unset($delivery_option_list[$id_address][$key]);
}
}
}
$this->context->smarty->assign('delivery_option_list', $delivery_option_list);
}
謝謝,但我想自動禁用一個載體,我是在DB自動開發一個模塊.... –
你的模塊? – ethercreation