Я новичок в опенкарте, реализовал добавление двух подарочных товаров в корзину вместе с добавлением первого платного
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');
}
}
Помогите реализовать удаление этих двух товаров вместе с последним платным из корзины. вот моя попытка (не работает)
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');
}
}