 Support forum for the Product Price by Formula for WooCommerce.
 This topic has 1 reply, 1 voice, and was last updated 4 years, 4 months ago by Tom Anbinder.
 AuthorPosts

May 11, 2019 at 12:32 pm #99107Olaf WalkowiakGuest
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 howMay 13, 2019 at 8:24 pm #99108Hi 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/productpricebyformulaforwoocommerce/reviews/.
 AuthorPosts
 You must be logged in to reply to this topic.