Jump to content

autumn_sunset

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. I am beginner in opencart, realized adding two gift items to the cart, along with adding the first paid if (!$json) { $this->cart->add($this->request->post['product_id'], $quantity, $option, $recurring_id); $cart_contents = $this->cart->countProducts(); if ($cart_contents == 1) { $this->cart->add('656', '1'); $this->cart->add('657', '1'); } } Help to implement the removal of these two products along with the last paid from the cart. Here is my attempt (doesn't work) if (isset($this->request->post['key'])) { $this->cart->remove($this->request->post['key']); $cart_contents = $this->cart->countProducts(); if (isset($this->request->post['product_id'])) { if ($cart_contents == 3) { $this->cart->remove($this->request->post['product_id']); $this->cart->remove('656'); $this->cart->remove('657'); } }
×