Answer the question
In order to leave comments, you need to log in
Add item to cart opencart?
Hello, friends!
There is a form filled out by the client. The question is how to add data from it to the opencart basket ? Interested in the path to the controller / handler file, as well as the API of the addition itself.
For example:
file - ...
class - ...
methods - ... (with min. explanation)
Answer the question
In order to leave comments, you need to log in
If you want to add from the front, then make a post request to this address
index.php?route=checkout/cart/add
Accordingly, the controller:
catalog/checkout/cart.php method add ()
There, in addition to adding to the cart, different checks pass
For the addition itself the following line responds to the cart:
$this->cart->add($this->request->post['product_id'], $quantity, $option, $recurring_id);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question