Price expression editor error

Hi,

I’m on version 11.
I’m trying to use price expression editor, however getting error codes (25 and 24). Changed the price_parser.class.php file and added #supplier_min_price#*2 into the price editor. Purpose is to rather add markup instead of adding selling price for each product.

Hi,
No problem on my side using your price expression. Error code 24 means “variable ‘%s’ exists but has no value”, error code 25 arises when the call to find_min_price_product_fournisseur fails, so I am just wondering whether you defined supplier prices for the product giving you that error.
Regards,
Marc

Hi Marc,

Below my buying price, everything is filled, still getting 24 error.

What would the expression be if I want to update all my cost prices with 20% (retail)?

Hi,
This is strange indeed. On the same page where you took this snapshot, what do you have as the best (or minimum) buy price ?
As for the expression to use to update your cost prices by 20%, a small change is to be applied to what you entered :
price=1.2*#supplier_min_price#
(or the way around, it should not matter)
Of note, you could as well define a global varialble, say retailrate with the value of 1.2, in the ‘dynamic prices’ module configuration and then use the following expresssion :
price=#global_retailrate#*#supplier_min_price#
That way, if you decide to modify this rate, you don’t have to go every product, but simply change this global value.
Regards,
Marc

Hi Marc,

Tried the global variable (price=#global_retailrate#*#supplier_min_price#) gives me below error, any suggestions?

image

Regards,
Andre

Well, I don’t know what you did exactly.
In order to define a global variable, you go in the configuration option of the dynamic price module and enter something like the attached screenshot.

Then, under the ‘selling price’ of your article, you ‘Update default price’, allowing you to define a price expression.

In the price expression editor, you enter the formula :

Was that the procedure you followed ?
Regards,
Marc

Hi Marc,

Followed your process, it is working now thank you.

Regards,
André

Hello Marc,
This works just as I wanted, thank you for yor help