Completed
Push — development ( 9ea476...895d6a )
by Bhanu
27:18 queued 17:28
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
                         $c_gst = $details['cgst'];
189 189
                         $s_gst = $details['sgst'];
190 190
                         $i_gst = $details['igst'];
@@ -202,21 +202,21 @@  discard block
 block discarded – undo
202 202
                             if ($taxes[0]) {
203 203
                                 $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst,
204 204
 
205
-                               's_gst'         => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
205
+                                's_gst'         => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
206 206
                                 'state'        => $state_code, 'origin_state'=>$origin_state,
207
-                                 'tax_enable'  => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
207
+                                    'tax_enable'  => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
208 208
 
209 209
                                 $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
210 210
                                             'name'   => 'no compound', 'type'   => 'tax',
211 211
                                             'target' => 'item', 'value'  => $value,
212
-                                          ]);
212
+                                            ]);
213 213
                             } else {
214 214
                                 $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
215 215
                                 $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
216
-                                           'name'   => 'null', 'type'   => 'tax',
217
-                                           'target' => 'item', 'value'  => '0%',
218
-                                           'rate'   => 0, 'tax_enable' =>0,
219
-                                         ]);
216
+                                            'name'   => 'null', 'type'   => 'tax',
217
+                                            'target' => 'item', 'value'  => '0%',
218
+                                            'rate'   => 0, 'tax_enable' =>0,
219
+                                            ]);
220 220
                             }
221 221
                         }
222 222
                     } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             $subregion = \App\Model\Common\State::where('state_subdivision_code', $code)->first();
353 353
             if ($subregion) {
354 354
                 $result = ['id' => $subregion->state_subdivision_code,
355
-                 'name'         => $subregion->state_subdivision_name, ];
355
+                    'name'         => $subregion->state_subdivision_name, ];
356 356
             }
357 357
 
358 358
             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
             }
@@ -128,7 +129,8 @@  discard block
 block discarded – undo
128 129
                 $attributes[] = $item->attributes;
129 130
                 $cart_currency = $attributes[0]['currency']['currency'];
130 131
                 \Session::put('currency', $cart_currency);
131
-                if (\Auth::user()) {//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart
132
+                if (\Auth::user()) {
133
+//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart
132 134
                     $currency = \Auth::user()->currency;
133 135
                     if ($cart_currency != $currency) {
134 136
                         $id = $item->id;
@@ -175,8 +177,10 @@  discard block
 block discarded – undo
175 177
                 $user_state = TaxByState::where('state_code', $geoip_state)->first();
176 178
                 $origin_state = $this->setting->first()->state; //Get the State of origin
177 179
                 $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray();
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,
@@ -219,7 +223,8 @@  discard block
 block discarded – undo
219 223
                                          ]);
220 224
                             }
221 225
                         }
222
-                    } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available
226
+                    } elseif ($tax_enable == 0) {
227
+//If Tax enable is 0 and other tax is available
223 228
 
224 229
                         $details = $this->whenOtherTaxAvailableAndTaxNotEnable($tax_class_id, $productid, $geoip_state, $geoip_country);
225 230
 
@@ -395,7 +400,8 @@  discard block
 block discarded – undo
395 400
         try {
396 401
             $currency = Setting::find(1)->default_currency;
397 402
             $currency_symbol = Setting::find(1)->default_symbol;
398
-            if (!\Auth::user()) {//When user is not logged in
403
+            if (!\Auth::user()) {
404
+//When user is not logged in
399 405
                 $cont = new \App\Http\Controllers\Front\PageController();
400 406
                 $location = $cont->getLocation();
401 407
                 $country = self::findCountryByGeoip($location['iso_code']);
@@ -410,7 +416,8 @@  discard block
 block discarded – undo
410 416
                 $currency = \Auth::user()->currency;
411 417
                 $currency_symbol = \Auth::user()->currency_symbol;
412 418
             }
413
-            if ($userid != '') {//For Admin Panel Clients
419
+            if ($userid != '') {
420
+//For Admin Panel Clients
414 421
                 $currencyAndSymbol = self::getCurrency($userid);
415 422
                 $currency = $currencyAndSymbol['currency'];
416 423
                 $currency_symbol = $currencyAndSymbol['symbol'];
Please login to merge, or discard this patch.