Forums › Product XML Feeds for WooCommerce › Custom prices
- Support forum for the WooCommerce Product XML Feeds Manager.
- This topic has 3 replies, 2 voices, and was last updated 3 weeks, 2 days ago by
Pascal Schmid.
-
AuthorPosts
-
January 8, 2025 at 10:07 pm #157077
Pascal Schmid
ParticipantDear support
We caught an eye on this plugin but we need to be sure if theres a functionality to create Google Shopping feeds with different prices based on the countries tax. So let me explain
So in our backend prices are based off Germany (19% VAT)
F.e.
€ 99.95 incl. VAT
Visitors from France have different price (based on IP) because they have 20% VAT. So 99.95 / 1.19 (to get excl. VAT price) * 1.20 (France VAT) = €100.79 incl. VAT. It’s basically just a simple formula (but different formula for each country because of different tax rates). Is there a possibility to add like formulas to create different price feeds?
Thanks in advance
-
This topic was modified 4 months, 2 weeks ago by
Pascal Schmid.
-
This topic was modified 4 months, 2 weeks ago by
Pascal Schmid.
April 8, 2025 at 8:35 pm #162987Hi Pascal,
Thanks for reaching out, and my sincere apologies for the delayed response—your message was mistakenly overlooked.
I’ve reviewed your request and I’m currently consulting with our developer to see if there’s a way to accomplish what you’re looking for. I’ll get back to you as soon as possible with an update.
Thank you again for your patience and understanding.
Best regards,
WPFactory Support TeamApril 28, 2025 at 4:36 am #164601Hi Pascal,
Good morning, I hope you are doing well.
Sorry for the delay in getting back to you — your issue was with our development team, and I have just heard back from them. Here is the suggested code for achieving your request.The developer has tested it using the
custom_function
option. Based on your description, the following code worked as expected, and you can adjust it if needed:function france_price_with_vat() { $product_id = get_the_ID(); if ( ! $product_id ) return; $product = wc_get_product( $product_id ); if ( ! $product ) return; // Get WooCommerce setting (if prices include tax) $prices_include_tax = get_option( 'woocommerce_prices_include_tax' ) === 'yes'; // VAT rates $germany_vat = 1.19; $france_vat = 1.20; // Product price $price = floatval( $product->get_price() ); if ( $prices_include_tax ) { // Remove Germany VAT, then apply France VAT $price_excl = $price / $germany_vat; $france_price = $price_excl * $france_vat; } else { // Add France VAT directly if price is excluding tax $france_price = $price * $france_vat; } return number_format( $france_price, 2 ); }
And here’s the XML structure you can use:
<vat_price>
<germany>[alg_product_price]</germany>
<france>[alg_product_id custom_function="france_price_with_vat"]</france>
</vat_price>
Please try it out and let me know if it works for you!
Best regards,
WPFactory support teamMay 6, 2025 at 11:59 am #165034Pascal Schmid
ParticipantHi Taha!
Many thanks, sounds promising! We’ll buy the plugin and try it out and will come back to you with a feedback 🙂
Best regards
Pascal
-
This topic was modified 4 months, 2 weeks ago by
-
AuthorPosts
- You must be logged in to reply to this topic.