# Question

Viewing 2 posts - 1 through 2 (of 2 total)
• Author
Posts
• #99107
Olaf Walkowiak
Guest

Hi There, i do have a problem. We import 10000 products with buying prices. And now we want your tool to calculate and show the selling prices on the Woo Product page. We use different calculation percentages for each Product Category like this:

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

Everything is working fine BUT we want to prevent that if a product will be imported with a complete new category (a category to wicht we don´t have a formular for), the the buying price is showing up on the product page. So my question is, if there is any formular for this situation. For example: For products with the category “bag” use 1.2, for category “men” use 1.25 … and for other product categories use 1.33
Is that possible?
all product how

#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/.

Viewing 2 posts - 1 through 2 (of 2 total)
• The forum ‘Product Price by Formula for WooCommerce’ is closed to new topics and replies.