S
S
Sergey2015-12-27 13:30:49
PHP
Sergey, 2015-12-27 13:30:49

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

2 answer(s)
A
Andrey Kornev, 2015-12-30
@webkornevand

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?

S
Sergey, 2015-12-30
@gangstarcj

Solution: You must specify the site_id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question