Skip to content

Commit

Permalink
Tax field can be text or dropdown. Fixes #34
Browse files Browse the repository at this point in the history
  • Loading branch information
imagehat committed Jul 7, 2021
1 parent 21aa901 commit 3690997
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/services/SalesTaxService.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ private function getTotalTax($order, $transaction)

$taxCode = $defaultTaxCode;

if(isset($lineItem->purchasable->product->avataxTaxCode)) {
$taxCode = $lineItem->purchasable->product->avataxTaxCode ?: $defaultTaxCode;
if($this->getFieldValue('avataxTaxCode', $lineItem->purchasable->product)) {
$taxCode = $this->getFieldValue('avataxTaxCode', $lineItem->purchasable->product);
}

$itemCode = $lineItem->id;
Expand Down Expand Up @@ -639,9 +639,9 @@ private function getTotalTax($order, $transaction)
$discountCode = $defaultTaxCode;

// check to see if there is an Avatax Tax Code override specified
if(!empty($adjustmentLineItem->purchasable->product->avataxTaxCode))
if($this->getFieldValue('avataxTaxCode', $lineItem->purchasable->product))
{
$discountCode = $adjustmentLineItem->purchasable->product->avataxTaxCode;
$discountCode = $this->getFieldValue('avataxTaxCode', $lineItem->purchasable->product);
}
}

Expand Down

0 comments on commit 3690997

Please sign in to comment.