我做在的Prestashop模塊,我需要重寫類CartCore的方法更新。我已經在文件夾覆蓋內創建了一個類(我已經在modules/name_of_module/override中嘗試過)Cart擴展了CartCore(該文件是Cart.php),並且我有下一個代碼。覆蓋的Prestashop 1.6.1.4
public function update($null_values = false, $hook = true)
{
if (isset(self::$_nbProducts[$this->id])) {
unset(self::$_nbProducts[$this->id]);
}
if (isset(self::$_totalWeight[$this->id])) {
unset(self::$_totalWeight[$this->id]);
}
$this->_products = null;
$return = parent::update($null_values);
if($hook) Hook::exec('actionCartSave');
return $return;
}
我已刪除的文件緩存/ class_index.php,我已經激活了後臺性能的覆蓋,但它不工作。只有當我更改原始購物車類時纔有效,但我不想這樣做。
謝謝!
這是一個文件中哪個具體的位置?你能粘貼整個文件嗎? – joseantgv