From 848a29dfa7c2a11a4ef01dc7cd3f10199b363ec6 Mon Sep 17 00:00:00 2001 From: Malin Date: Fri, 23 Jan 2026 17:53:24 +0100 Subject: [PATCH] Show tax-inclusive local prices in comparison Google Merchant Center prices are always tax-inclusive, so now the local WooCommerce price is also displayed with tax included using wc_get_price_including_tax() for a fair comparison. Co-Authored-By: Claude Opus 4.5 --- admin/class-informatiq-sp-admin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/class-informatiq-sp-admin.php b/admin/class-informatiq-sp-admin.php index 112e2a66..b414787d 100644 --- a/admin/class-informatiq-sp-admin.php +++ b/admin/class-informatiq-sp-admin.php @@ -883,11 +883,18 @@ class Informatiq_SP_Admin { } // Get local price (sale price priority, then regular). + // Always calculate tax-inclusive price for comparison with Google (which is always tax-inclusive). $sale_price = $product->get_sale_price(); $regular_price = $product->get_regular_price(); - $local_price = ! empty( $sale_price ) ? $sale_price : $regular_price; + $base_price = ! empty( $sale_price ) ? $sale_price : $regular_price; $price_type = ! empty( $sale_price ) ? 'sale' : 'regular'; + // Get price including tax for fair comparison with Google. + $local_price = null; + if ( $base_price ) { + $local_price = wc_get_price_including_tax( $product, array( 'price' => $base_price ) ); + } + // Try to find matching Google product. $google_product = null; $match_type = '';