0

We want to charge tax if shipping or billing address is in California.

So to summarize, tax should be charged if:

  1. Shipping address is California
  2. Billing address is California

Do NOT charge tax if shipping and billing address both are outside of California.

Currently in the admin under tax setting I can choose either billing or shipping [drop down].

Please help me to modify the logic

vanurag
  • 297
  • 2
  • 19

1 Answers1

0

Okay ! So finally I found answer to my own question and below what I did. This can be helpful

I Classes Cart.php under the function getSummaryDetails()

after this code

`$base_total_tax_inc = $this->getOrderTotal(true);
$base_total_tax_exc = $this->getOrderTotal(false);`

I have added $my_product_total = $this->getProductOrderTotal(true);

Where the function getProductOrderTotal() which I have written in order to get the total product price in the cart. After this, I have added

`

    if($invoice->id_state==5 AND $delivery->id_state!=5){
                $total_tax = ($my_product_total*8)/100;
                $base_total_tax_inc=$base_total_tax_inc+$total_tax;
             }
               else{ $total_tax = $base_total_tax_inc - $base_total_tax_exc;}

`

5 is the id for California.

Notice AND $delivery->id_state!=5 in my IF condition. This I do because the delivery address is already set in the system(From Back admin) to TRUE.

vanurag
  • 297
  • 2
  • 19