A
A
Alexander2016-10-28 23:02:19
1C-Bitrix
Alexander, 2016-10-28 23:02:19

Question about adding a product to the cart from the catalog using the standard Bitrix ajax?

I ran into a problem, in the custom template of the catalog component, on the detailed page of the catalog (template catalog.element of the complex catalog component), the product is not added. As I understand it, adding a product to the cart from the catalog where regular ajax works is tied to the DOM tree. The question is, if you do ajax-adding based on the regular Bitrix JS, do you need to repeat all the html elements that are in the regular template in the layout? Is it possible to somehow exclude some of the DOM elements from the required ones and specify only product ids, quantities and prices?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-10-29
@inviziblll

In a regular js script, debug at least through console.log. There you can find out which fields are missing, there are even some error codes.
Fields need id, price, images, quantity.
In general, it’s better to do it yourself through ajax, pass only the id and the amount to the script

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question