Answer the question
In order to leave comments, you need to log in
How if the trade offer does not have a price to take it from the product card?
Hello. There are products with trade offers. There are many of these proposals. Almost all products have the same price for all offers, which is indicated in the product card. Now, if the price in the TP is not specified, the site displays "Out of stock" and the purchase is not available.
How to make it so that in this case, the price is taken from the product card and it would be possible to buy it?
Answer the question
In order to leave comments, you need to log in
1) Make a custom addition to the cart, in which you will get the price of the product using the API, and then add it to the cart with the CUSTOM_PRICE flag and the price you need
2) Implement your own \Bitrix\Catalog\Product\CatalogProvider . In this option, you can leave adding to the cart as standard, and in the OnSaleBasketItemBeforeSaved handler, substitute yourCatalogProvider in the PRODUCT_PROVIDER_CLASS field.
3) You can still fill in the prices in all TPs and you won’t have to invent anything.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question