Skip to content

Commit dc4ee59

Browse files
committed
Merge branch 'WP-188' into 'main'
fix: type of vat sum and ignore set vat to product if tax is null See merge request ecommerce_modules/cms/wordpress/wordpress!77
2 parents ba9ee4d + 35457a4 commit dc4ee59

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Actions/OrderCreateAction.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,11 @@ private function buildItemData(
364364
$shouldConvert,
365365
);
366366

367-
if($taxCost > 0){
368-
$payment['vat_sum'] = (int)(($shouldPay / 100) * $taxCost);
369-
$payment['vat_rate'] = Tax::getTax($product->get_tax_class());
367+
$tax = Tax::getTax($product->get_tax_class());
368+
369+
if($taxCost > 0 && $tax !== null){
370+
$payment['vat_sum'] = (float)(($shouldPay / 100) * $taxCost);
371+
$payment['vat_rate'] = $tax;
370372
}else{
371373
$payment['vat_sum'] = 0;
372374
$payment['vat_rate'] = 0;

0 commit comments

Comments
 (0)