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.