2

New to OpenCart and running a customized version of 1.5.5.1. I am having some issues with 'Remove' from cart:

  1. I can see from dumping the $_SESSION that I have

    [cart] => Array([88:base64_encoded(serialized($option)=] => 1)`
    

    and

    [key] => 88:base64_encoded(serialized($option)=, 
    

but the

 $this->cart->remove($this->request->get['remove']) 

is only removing the [cart] and not [key].

I begin with the following by adding an item to the cart:

[cart] => Array ( [88:YTo1OntpOjMyMDtzOjM6IjMwOCI7aTozMjE7czozOiIzMDYiO2k6MzIyO3M6MzoiMzA1IjtpOjMyMztzOjM6IjMxMCI7aTozMjQ7czozOiIzMDkiO30=] => 1 ) [key] => 88:YTo1OntpOjMyMDtzOjM6IjMwOCI7aTozMjE7czozOiIzMDYiO2k6MzIyO3M6MzoiMzA1IjtpOjMyMztzOjM6IjMxMCI7aTozMjQ7czozOiIzMDkiO30=

And on removing it, I am left with:

[cart] => Array ( ) [key] => 88:YTo1OntpOjMyMDtzOjM6IjMwOCI7aTozMjE7czozOiIzMDYiO2k6MzIyO3M6MzoiMzA1IjtpOjMyMztzOjM6IjMxMCI7aTozMjQ7czozOiIzMDkiO30= 
  1. I would like to refresh the route=product/category&path=## on the removal from the mini-cart in the header, but am stumped as to where to look for that.

Thanks for any direction.

4

1 回答 1

1
  1. 在聊天中讨论了这个之后,您似乎正在处理使用称为“键”的非标准索引的修改代码。这可能是一个错误,并且没有简单的方法来确定它的目的是什么。事实上,该cart->remove()方法似乎按预期工作。

  2. 如果您想要刷新,只需附加location.reload();onclick迷你购物车模板中的事件。

于 2015-10-22T16:16:14.750 回答