@@ -66,6 +66,7 @@ function assignPrice ({ product, target, price = 0, tax = 0, deprecatedPriceFiel
6666}
6767
6868export function updateProductPrices ( { product, rate, sourcePriceInclTax = false , deprecatedPriceFieldsSupport = false , finalPriceInclTax = true } ) {
69+ console . log ( finalPriceInclTax )
6970 const rate_factor = parseFloat ( rate . rate ) / 100
7071 const hasOriginalPrices = (
7172 product . hasOwnProperty ( 'original_price' ) &&
@@ -170,15 +171,15 @@ export function calculateProductTax ({ product, taxClasses, taxCountry = 'PL', t
170171 if ( taxClass ) {
171172 for ( let rate of taxClass . rates ) { // TODO: add check for zip code ranges (!)
172173 if ( rate . tax_country_id === taxCountry && ( rate . region_name === taxRegion || rate . tax_region_id === 0 || ! rate . region_name ) ) {
173- updateProductPrices ( { product, rate, sourcePriceInclTax, deprecatedPriceFieldsSupport } )
174+ updateProductPrices ( { product, rate, sourcePriceInclTax, deprecatedPriceFieldsSupport, finalPriceInclTax } )
174175 rateFound = true
175176 break
176177 }
177178 }
178179 }
179180 }
180181 if ( ! rateFound ) {
181- updateProductPrices ( { product, rate : { rate : 0 } , sourcePriceInclTax, deprecatedPriceFieldsSupport } )
182+ updateProductPrices ( { product, rate : { rate : 0 } , sourcePriceInclTax, deprecatedPriceFieldsSupport, finalPriceInclTax } )
182183
183184 product . price_incl_tax = product . price
184185 product . price_tax = 0
0 commit comments