Answer the question
In order to leave comments, you need to log in
Why doesn't CCatalogProduct::GetOptimalPrice work in the agent?
I created a function in init.php Function to create a price, there I use CCatalogProduct::GetOptimalPrice to get the price at a discount. If you simply run the func_name(); then everything is fine and the price is returned with a discount, if I add it to the agent, then GetOptimalPrice does not work and gives the price without a discount
Solution: You must specify the site_id
Answer the question
In order to leave comments, you need to log in
GetOptimalPrice operates on the current user's $USER->GetUserGroupArray() groups from the session.
Accordingly, there is a problem with this somewhere, maybe you have discounts assigned to a specific group that is not processed in the session?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question