@@ -322,7 +322,8 @@ discard block |
||
| 322 | 322 | { |
| 323 | 323 | $code = ''; |
| 324 | 324 | $codevalue = ''; |
| 325 | - if (\Session::has('code')) {//If coupon code is applied get it here from Session |
|
| 325 | + if (\Session::has('code')) { |
|
| 326 | +//If coupon code is applied get it here from Session |
|
| 326 | 327 | $code = \Session::get('code'); |
| 327 | 328 | $codevalue = \Session::get('codevalue'); |
| 328 | 329 | } |
@@ -512,7 +513,8 @@ discard block |
||
| 512 | 513 | if ($this->tax_option->findOrFail(1)->inclusive == 0) { |
| 513 | 514 | if ($this->tax_option->findOrFail(1)->tax_enable == 1) { |
| 514 | 515 | $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid); |
| 515 | - } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0 |
|
| 516 | + } elseif ($this->tax_option->tax_enable == 0) { |
|
| 517 | +//if tax_enable is 0 |
|
| 516 | 518 | |
| 517 | 519 | $taxClassId = Tax::where('country', '')->where('state', 'Any State') |
| 518 | 520 | ->pluck('tax_classes_id')->first(); //In case of India when |
@@ -521,13 +523,15 @@ discard block |
||
| 521 | 523 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 522 | 524 | $taxs = $rate['taxes']; |
| 523 | 525 | $rate = $rate['rate']; |
| 524 | - } elseif ($geoip_country != 'IN') {//In case of other country |
|
| 526 | + } elseif ($geoip_country != 'IN') { |
|
| 527 | +//In case of other country |
|
| 525 | 528 | // when tax is available and tax is not enabled(Applicable |
| 526 | 529 | //when Global Tax class for any country and state is not there) |
| 527 | 530 | |
| 528 | 531 | $taxClassId = Tax::where('state', $geoip_state) |
| 529 | 532 | ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
| 530 | - if ($taxClassId) { //if state equals the user State |
|
| 533 | + if ($taxClassId) { |
|
| 534 | +//if state equals the user State |
|
| 531 | 535 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 532 | 536 | $taxs = $rate['taxes']; |
| 533 | 537 | $rate = $rate['rate']; |
@@ -569,11 +573,13 @@ discard block |
||
| 569 | 573 | $i_gst = 0; |
| 570 | 574 | $ut_gst = 0; |
| 571 | 575 | $state_code = ''; |
| 572 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 576 | + if ($user_state != '') { |
|
| 577 | +//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 573 | 578 | $tax = $this->getTaxWhenState($user_state, $productid, $origin_state); |
| 574 | 579 | $taxes = $tax['taxes']; |
| 575 | 580 | $value = $tax['value']; |
| 576 | - } else {//If user from other Country |
|
| 581 | + } else { |
|
| 582 | +//If user from other Country |
|
| 577 | 583 | $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid); |
| 578 | 584 | $taxes = $tax['taxes']; |
| 579 | 585 | $value = $tax['value']; |