Reply To: Question

#99108
Tom Anbinder
Moderator
Plugin Support

Hi Olaf,

Yes, that is possible. Basically, there are at least two possible solutions:

1. You can use not_slug attribute, i.e.:

x[if_product_category slug="bags"]*1.10[/if_product_category][if_product_category slug="men"]*1.50[/if_product_category][if_product_category not_slug="bags,men"]*1.33[/if_product_category]

2. You could recalculate coefficients, i.e.:

x*1.33[if_product_category slug="bags"]*0.827068[/if_product_category][if_product_category slug="men"]*1.127820[/if_product_category]

That is – first we are always multiplying by 1.33 and then in case of “bags” we are additionally multiplying by 0.827068 (as 1.10 / 1.33 = 0.827068) and so on… Hope you get the idea.

You could also write it in another form:

x*1.33[if_product_category slug="bags"]*1.10/1.33[/if_product_category][if_product_category slug="men"]*1.50/1.33[/if_product_category]

Please note that I didn’t test it, but I believe that both solutions should work fine, so please let me know if something is not working as expected.

P.S. Please let me know if you have any questions. And if you like the plugin, please consider leaving us a rating at https://wordpress.org/support/plugin/product-price-by-formula-for-woocommerce/reviews/.