我的客戶正在使用Opencart v2.1.0.2。問題是,當我從購物車中移除單個物品時,所有其他物品也會被移除。是的,它使用自定義模板和這裏的,對於刪除函數調用行:從opencart購物車中刪除一個項目會刪除所有內容
<td class="text-center"><button type="button" onclick="cart.remove('<?php echo $product['cart_id']; ?>');" title="<?php echo $button_remove; ?>" class="btn btn-danger btn-xs"><i class="fa fa-times"></i></button></td>
我還需要找出的js單擊此按鈕時,文件被調用。如果它會幫助,這個我覺得這是從購物車中刪除項目時Opencart的運行的cart.php庫中的函數:
public function remove($cart_id) {
$this->db->query("DELETE FROM " . DB_PREFIX . "cart WHERE cart_id = '" . (int)$cart_id . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND session_id = '" . $this->db->escape($this->session->getId()) . "'");
}