Answer the question
In order to leave comments, you need to log in
How can I find out the price of an item when adding it to the cart?
The bottom line is that when you add a product to the cart (opencart 3), you need to find out the price of this product.
In JS, in the add() function, after adding, only the response json['total'] is received - where the final information about the goods in the basket and the cost is indicated. And I need to know the price of the product at the time of adding.
For example, there is an item Apple. It costs 15 rubles.
I press the add button and in response (for example, to the console) I want to display 15 (the cost of the product), unfortunately I can’t figure out how to do it. and its cost when added to the cart (in the products array, I can easily get the id, but I can’t get the price)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question