Completed
Branch feature-dynamic-fields (3b03cc)
by Ashutosh
09:05
created
app/Http/Controllers/Front/CartController.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -178,13 +178,13 @@  discard block
 block discarded – undo
178 178
                 if (count($tax_class_id) > 0) {//If the product is allowed for tax (Check in tax_product relation table)
179 179
                     if ($tax_enable == 1) {//If GST is Enabled
180 180
 
181
-                         $details = $this->getDetailsWhenUserStateIsIndian(
182
-                             $user_state,
183
-                             $origin_state,
184
-                          $productid,
185
-                             $geoip_state,
186
-                             $geoip_country
187
-                         );
181
+                            $details = $this->getDetailsWhenUserStateIsIndian(
182
+                                $user_state,
183
+                                $origin_state,
184
+                            $productid,
185
+                                $geoip_state,
186
+                                $geoip_country
187
+                            );
188 188
 
189 189
                         $c_gst = $details['cgst'];
190 190
                         $s_gst = $details['sgst'];
@@ -203,21 +203,21 @@  discard block
 block discarded – undo
203 203
                             if ($taxes[0]) {
204 204
                                 $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst,
205 205
 
206
-                               's_gst'         => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
206
+                                's_gst'         => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
207 207
                                 'state'        => $state_code, 'origin_state'=>$origin_state,
208
-                                 'tax_enable'  => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
208
+                                    'tax_enable'  => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
209 209
 
210 210
                                 $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
211 211
                                             'name'   => 'no compound', 'type'   => 'tax',
212 212
                                             'target' => 'item', 'value'  => $value,
213
-                                          ]);
213
+                                            ]);
214 214
                             } else {
215 215
                                 $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
216 216
                                 $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
217
-                                           'name'   => 'null', 'type'   => 'tax',
218
-                                           'target' => 'item', 'value'  => '0%',
219
-                                           'rate'   => 0, 'tax_enable' =>0,
220
-                                         ]);
217
+                                            'name'   => 'null', 'type'   => 'tax',
218
+                                            'target' => 'item', 'value'  => '0%',
219
+                                            'rate'   => 0, 'tax_enable' =>0,
220
+                                            ]);
221 221
                             }
222 222
                         }
223 223
                     } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
             $subregion = \App\Model\Common\State::where('state_subdivision_code', $code)->first();
406 406
             if ($subregion) {
407 407
                 $result = ['id' => $subregion->state_subdivision_code,
408
-                 'name'         => $subregion->state_subdivision_name, ];
408
+                    'name'         => $subregion->state_subdivision_name, ];
409 409
             }
410 410
 
411 411
             return $result;
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,7 +96,8 @@  discard block
 block discarded – undo
96 96
     {
97 97
         try {
98 98
             $plan = '';
99
-            if ($request->has('subscription')) {//put he Plan id sent into session variable
99
+            if ($request->has('subscription')) {
100
+//put he Plan id sent into session variable
100 101
                 $plan = $request->get('subscription');
101 102
                 Session::put('plan', $plan);
102 103
             }
@@ -127,7 +128,8 @@  discard block
 block discarded – undo
127 128
             foreach ($cartCollection as $item) {
128 129
                 $attributes[] = $item->attributes;
129 130
                 $cart_currency = $attributes[0]['currency']['currency'];
130
-                if (\Auth::user()) {//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart
131
+                if (\Auth::user()) {
132
+//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart
131 133
                     $currency = \Auth::user()->currency;
132 134
                     if ($cart_currency != $currency) {
133 135
                         $id = $item->id;
@@ -175,8 +177,10 @@  discard block
 block discarded – undo
175 177
                 $origin_state = $this->setting->first()->state; //Get the State of origin
176 178
                 $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray();
177 179
 
178
-                if (count($tax_class_id) > 0) {//If the product is allowed for tax (Check in tax_product relation table)
179
-                    if ($tax_enable == 1) {//If GST is Enabled
180
+                if (count($tax_class_id) > 0) {
181
+//If the product is allowed for tax (Check in tax_product relation table)
182
+                    if ($tax_enable == 1) {
183
+//If GST is Enabled
180 184
 
181 185
                          $details = $this->getDetailsWhenUserStateIsIndian(
182 186
                              $user_state,
@@ -220,7 +224,8 @@  discard block
 block discarded – undo
220 224
                                          ]);
221 225
                             }
222 226
                         }
223
-                    } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available
227
+                    } elseif ($tax_enable == 0) {
228
+//If Tax enable is 0 and other tax is available
224 229
 
225 230
                         $details = $this->whenOtherTaxAvailableAndTaxNotEnable($tax_class_id, $productid, $geoip_state, $geoip_country);
226 231
 
@@ -472,7 +477,8 @@  discard block
 block discarded – undo
472 477
         try {
473 478
             $currency = Setting::find(1)->default_currency;
474 479
             $currency_symbol = Setting::find(1)->default_symbol;
475
-            if (!\Auth::user()) {//When user is not logged in
480
+            if (!\Auth::user()) {
481
+//When user is not logged in
476 482
                 $cont = new \App\Http\Controllers\Front\PageController();
477 483
                 $location = $cont->getLocation();
478 484
                 $country = self::findCountryByGeoip($location['iso_code']);
@@ -487,7 +493,8 @@  discard block
 block discarded – undo
487 493
                 $currency = \Auth::user()->currency;
488 494
                 $currency_symbol = \Auth::user()->currency_symbol;
489 495
             }
490
-            if ($userid != '') {//For Admin Panel Clients
496
+            if ($userid != '') {
497
+//For Admin Panel Clients
491 498
                 $currencyAndSymbol = self::getCurrency($userid);
492 499
                 $currency = $currencyAndSymbol['currency'];
493 500
                 $currency_symbol = $currencyAndSymbol['symbol'];
Please login to merge, or discard this patch.