@@ -268,7 +268,8 @@ discard block |
||
| 268 | 268 | try { |
| 269 | 269 | $code = ''; |
| 270 | 270 | $codevalue = ''; |
| 271 | - if (\Session::has('code')) {//If coupon code is applied get it here from Session |
|
| 271 | + if (\Session::has('code')) { |
|
| 272 | +//If coupon code is applied get it here from Session |
|
| 272 | 273 | $code = \Session::get('code'); |
| 273 | 274 | $codevalue = \Session::get('codevalue'); |
| 274 | 275 | } |
@@ -497,7 +498,8 @@ discard block |
||
| 497 | 498 | if ($this->tax_option->findOrFail(1)->inclusive == 0) { |
| 498 | 499 | if ($this->tax_option->findOrFail(1)->tax_enable == 1) { |
| 499 | 500 | $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid); |
| 500 | - } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0 |
|
| 501 | + } elseif ($this->tax_option->tax_enable == 0) { |
|
| 502 | +//if tax_enable is 0 |
|
| 501 | 503 | |
| 502 | 504 | $taxClassId = Tax::where('country', '')->where('state', 'Any State') |
| 503 | 505 | ->pluck('tax_classes_id')->first(); //In case of India when |
@@ -506,13 +508,15 @@ discard block |
||
| 506 | 508 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 507 | 509 | $taxs = $rate['taxes']; |
| 508 | 510 | $rate = $rate['rate']; |
| 509 | - } elseif ($geoip_country != 'IN') {//In case of other country |
|
| 511 | + } elseif ($geoip_country != 'IN') { |
|
| 512 | +//In case of other country |
|
| 510 | 513 | // when tax is available and tax is not enabled(Applicable |
| 511 | 514 | //when Global Tax class for any country and state is not there) |
| 512 | 515 | |
| 513 | 516 | $taxClassId = Tax::where('state', $geoip_state) |
| 514 | 517 | ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first(); |
| 515 | - if ($taxClassId) { //if state equals the user State |
|
| 518 | + if ($taxClassId) { |
|
| 519 | +//if state equals the user State |
|
| 516 | 520 | $rate = $this->getTotalRate($taxClassId, $productid, $taxs); |
| 517 | 521 | $taxs = $rate['taxes']; |
| 518 | 522 | $rate = $rate['rate']; |
@@ -554,11 +558,13 @@ discard block |
||
| 554 | 558 | $i_gst = 0; |
| 555 | 559 | $ut_gst = 0; |
| 556 | 560 | $state_code = ''; |
| 557 | - if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 561 | + if ($user_state != '') { |
|
| 562 | +//Get the CGST,SGST,IGST,STATE_CODE of the user |
|
| 558 | 563 | $tax = $this->getTaxWhenState($user_state, $productid, $origin_state); |
| 559 | 564 | $taxes = $tax['taxes']; |
| 560 | 565 | $value = $tax['value']; |
| 561 | - } else {//If user from other Country |
|
| 566 | + } else { |
|
| 567 | +//If user from other Country |
|
| 562 | 568 | $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid); |
| 563 | 569 | $taxes = $tax['taxes']; |
| 564 | 570 | $value = $tax['value']; |