Completed
Pull Request — development (#571)
by Ashutosh
10:22
created
app/Http/Requests/User/ProfileRequest.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                     'zip'                    => 'required|numeric',
38 38
                     'user_name'              => 'required|unique:users,user_name,'.$userid,
39 39
                     'bussiness'              => 'required',
40
-                     'profile_pic'           => 'sometimes|mimes:jpeg,jpg,png,gif|max:100000',
40
+                        'profile_pic'           => 'sometimes|mimes:jpeg,jpg,png,gif|max:100000',
41 41
 
42 42
         ];
43 43
         }
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
             $userid = \Auth::user()->id;
47 47
 
48 48
             return [
49
-                     'first_name'            => 'required|min:3|max:30',
49
+                        'first_name'            => 'required|min:3|max:30',
50 50
                     'last_name'              => 'required|max:30',
51
-                     'mobile'                => 'required|regex:/[0-9]/|min:5|max:20',
52
-                     'email'                 => 'required',
51
+                        'mobile'                => 'required|regex:/[0-9]/|min:5|max:20',
52
+                        'email'                 => 'required',
53 53
                     'mobile_code'            => 'required|numeric',
54 54
                     'mobile'                 => 'required|numeric',
55 55
                     'zip'                    => 'required|numeric',
Please login to merge, or discard this patch.
app/Http/Controllers/Common/MailChimpController.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         try {
82 82
             $merge_fields = $this->field($email);
83 83
             $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No
84
-              $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
84
+                $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
85 85
             $result = $this->mailchimp->post("lists/$this->list_id/members", [
86 86
                 'status'        => $this->mailchimp_set->subscribe_status,
87 87
                 'email_address' => $email,
@@ -106,14 +106,14 @@  discard block
 block discarded – undo
106 106
         try {
107 107
             $merge_fields = $this->field($email);
108 108
             $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No
109
-              $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
110
-              $productGroupId = $this->groupRelation->where('agora_product_id', $productid)
111
-              ->pluck('mailchimp_group_cat_id')->first();
109
+                $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
110
+                $productGroupId = $this->groupRelation->where('agora_product_id', $productid)
111
+                ->pluck('mailchimp_group_cat_id')->first();
112 112
             $hash = md5($email);
113 113
             $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
114
-                 'interests'         => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true],
115
-                 //refer to https://us7.api.mailchimp.com/playground
116
-              ]);
114
+                    'interests'         => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true],
115
+                    //refer to https://us7.api.mailchimp.com/playground
116
+                ]);
117 117
         } catch (Exception $ex) {
118 118
             $exe = json_decode($ex->getMessage(), true);
119 119
         }
@@ -125,16 +125,16 @@  discard block
 block discarded – undo
125 125
         try {
126 126
             $merge_fields = $this->field($email);
127 127
             $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No
128
-              $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
129
-               $productGroupId = $this->groupRelation->where('agora_product_id', $productid)
130
-              ->pluck('mailchimp_group_cat_id')->first();
128
+                $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes
129
+                $productGroupId = $this->groupRelation->where('agora_product_id', $productid)
130
+                ->pluck('mailchimp_group_cat_id')->first();
131 131
 
132 132
             $hash = md5($email);
133 133
             $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [
134
-                 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true],
134
+                    'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true],
135 135
 
136
-                 //refer to https://us7.api.mailchimp.com/playground
137
-              ]);
136
+                    //refer to https://us7.api.mailchimp.com/playground
137
+                ]);
138 138
         } catch (Exception $ex) {
139 139
             $exe = json_decode($ex->getMessage(), true);
140 140
         }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             $user = $user->where('email', $email)->first();
176 176
             if ($user) {
177 177
                 $fields = ['first_name', 'last_name', 'company', 'mobile',
178
-                 'address', 'town', 'state', 'zip', 'active', 'role', 'source', ];
178
+                    'address', 'town', 'state', 'zip', 'active', 'role', 'source', ];
179 179
                 $relation = $this->relation;
180 180
                 $merge_fields = [];
181 181
                 foreach ($fields as $field) {
@@ -326,11 +326,11 @@  discard block
 block discarded – undo
326 326
             // this->addIsPaidInterestFieldsToAgora();
327 327
 
328 328
             $group_fields = $this->groups->where('list_id', $this->list_id)
329
-          ->select('category_name', 'category_option_id', 'category_id')->get()->toArray();
329
+            ->select('category_name', 'category_option_id', 'category_id')->get()->toArray();
330 330
             // dd($group_fields[0]);
331 331
             $relations = MailchimpGroupAgoraRelation::where('id', '!=', 0)
332
-          ->select('agora_product_id', 'mailchimp_group_cat_id')
333
-          ->orderBy('id', 'asc')->get()->toArray();
332
+            ->select('agora_product_id', 'mailchimp_group_cat_id')
333
+            ->orderBy('id', 'asc')->get()->toArray();
334 334
             $productList = [];
335 335
             $categoryList = [];
336 336
             if (count($relations) != 0) {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                     // code...
341 341
                 }
342 342
                 // dd(count($categoryList));
343
-         // dd($productList);
343
+            // dd($productList);
344 344
             }
345 345
 
346 346
             // $relations = MailchimpGroupAgoraRelation::where('id', '!=', 0)->orderBy('id', 'asc')->get()->toArray();
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                 echo '<option value='.$field['category_option_id'].'>'.$field['category_option_name'].'</option>';
376 376
 
377 377
                 // array_push($responseData, (['selectedCat'=>$selectedCategory, 'catId'=>$field['category_option_id'],'catName'=>$field['category_option_name']]
378
-                  //  ));
378
+                    //  ));
379 379
             }
380 380
             // return $responseData;
381 381
         }
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
             MailchimpGroupAgoraRelation::where('id', '!=', 0)->delete();
426 426
             foreach ($request->row as $key => $value) {
427 427
                 MailchimpGroupAgoraRelation::create(['agora_product_id'=> $value[0],
428
-             'mailchimp_group_cat_id'                                  => $value[1], ]);
428
+                'mailchimp_group_cat_id'                                  => $value[1], ]);
429 429
             }
430 430
 
431 431
             return redirect()->back()->with('success', \Lang::get('message.updated-successfully'));
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CartController.php 1 patch
Braces   +28 added lines, -14 removed lines patch added patch discarded remove patch
@@ -179,8 +179,10 @@  discard block
 block discarded – undo
179 179
                 $origin_state = $this->setting->first()->state; //Get the State of origin
180 180
                 $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray();
181 181
 
182
-                if ($tax_class_id) {//If the product is allowed for tax (Check in tax_product relation table)
183
-                   if ($tax_enable == 1) {//If GST is Enabled
182
+                if ($tax_class_id) {
183
+//If the product is allowed for tax (Check in tax_product relation table)
184
+                   if ($tax_enable == 1) {
185
+//If GST is Enabled
184 186
 
185 187
                        $state_code = '';
186 188
                        $c_gst = '';
@@ -191,45 +193,52 @@  discard block
 block discarded – undo
191 193
                        $rate = '';
192 194
                        $status = 1;
193 195
 
194
-                       if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
196
+                       if ($user_state != '') {
197
+//Get the CGST,SGST,IGST,STATE_CODE of the user
195 198
                            $c_gst = $user_state->c_gst;
196 199
                            $s_gst = $user_state->s_gst;
197 200
                            $i_gst = $user_state->i_gst;
198 201
                            $ut_gst = $user_state->ut_gst;
199 202
                            $state_code = $user_state->state_code;
200 203
 
201
-                           if ($state_code == $origin_state) {//If user and origin state are same
204
+                           if ($state_code == $origin_state) {
205
+//If user and origin state are same
202 206
                                $rateForSameState = $this->getTaxWhenIndianSameState($user_state,
203 207
                                 $origin_state, $productid, $c_gst, $s_gst, $state_code, $status);
204 208
 
205 209
                                $taxes = $rateForSameState['taxes'];
206 210
                                $status = $rateForSameState['status'];
207 211
                                $value = $rateForSameState['value'];
208
-                           } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
212
+                           } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {
213
+//If user is from other state
209 214
                                $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state,
210 215
                                 $origin_state, $productid, $i_gst, $state_code, $status);
211 216
                                $taxes = $rateForOtherState['taxes'];
212 217
                                $status = $rateForOtherState['status'];
213 218
                                $value = $rateForOtherState['value'];
214
-                           } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
219
+                           } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {
220
+//if user from Union Territory
215 221
                                $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state,
216 222
                                 $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status);
217 223
                                $taxes = $rateForUnionTerritory['taxes'];
218 224
                                $status = $rateForUnionTerritory['status'];
219 225
                                $value = $rateForUnionTerritory['value'];
220 226
                            }
221
-                       } else {//If user from other Country
227
+                       } else {
228
+//If user from other Country
222 229
                            $taxClassId = Tax::where('state', $geoip_state)
223 230
                            ->orWhere('country', $geoip_country)
224 231
                            ->pluck('tax_classes_id')->first();
225
-                           if ($taxClassId) { //if state equals the user State or country equals user country
232
+                           if ($taxClassId) {
233
+//if state equals the user State or country equals user country
226 234
                                $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId,
227 235
                                 $productid, $status);
228 236
                                $taxes = $taxForSpecificCountry['taxes'];
229 237
                                $status = $taxForSpecificCountry['status'];
230 238
                                $value = $taxForSpecificCountry['value'];
231 239
                                $rate = $taxForSpecificCountry['value'];
232
-                           } else {//if Tax is selected for Any Country Any State
240
+                           } else {
241
+//if Tax is selected for Any Country Any State
233 242
                                $taxClassId = Tax::where('country', '')
234 243
                                ->where('state', 'Any State')
235 244
                                ->pluck('tax_classes_id')->first();
@@ -270,7 +279,8 @@  discard block
 block discarded – undo
270 279
                                          ]);
271 280
                            }
272 281
                        }
273
-                   } elseif ($tax_enable == 0) {//If Tax enable is 0
282
+                   } elseif ($tax_enable == 0) {
283
+//If Tax enable is 0
274 284
                        $status = 1;
275 285
                        if ($this->tax_option->findOrFail(1)->tax_enable == 0) {
276 286
                            $taxClassId = Tax::where('country', '')
@@ -295,13 +305,15 @@  discard block
 block discarded – undo
295 305
                                             'value'  => $value,
296 306
                                         ]);
297 307
                                }
298
-                           } else {//In case of other country
308
+                           } else {
309
+//In case of other country
299 310
                                //when tax is available and tax is not enabled
300 311
                                //(Applicable when Global Tax class for any country and state is not there)
301 312
                                $taxClassId = Tax::where('state', $geoip_state)
302 313
                                ->orWhere('country', $geoip_country)
303 314
                                ->pluck('tax_classes_id')->first();
304
-                               if ($taxClassId) { //if state equals the user State
315
+                               if ($taxClassId) {
316
+//if state equals the user State
305 317
                                    $taxes = $this->getTaxByPriority($taxClassId);
306 318
                                    $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
307 319
                                    if ($value == '') {
@@ -883,7 +895,8 @@  discard block
 block discarded – undo
883 895
         try {
884 896
             $currency = Setting::find(1)->default_currency;
885 897
             $currency_symbol = Setting::find(1)->default_symbol;
886
-            if (!\Auth::user()) {//When user is not logged in
898
+            if (!\Auth::user()) {
899
+//When user is not logged in
887 900
                 $location = \GeoIP::getLocation();
888 901
                 $country = \App\Http\Controllers\Front\CartController::findCountryByGeoip($location['iso_code']);
889 902
                 $userCountry = Country::where('country_code_char2', $country)->first();
@@ -901,7 +914,8 @@  discard block
 block discarded – undo
901 914
                 $currency = \Auth::user()->currency;
902 915
                 $currency_symbol = \Auth::user()->currency_symbol;
903 916
             }
904
-            if ($userid != '') {//For Admin Panel Clients
917
+            if ($userid != '') {
918
+//For Admin Panel Clients
905 919
                 $currencyAndSymbol = $this->getCurrency($userid);
906 920
                 $currency = $currencyAndSymbol['currency'];
907 921
                 $currency_symbol = $currencyAndSymbol['symbol'];
Please login to merge, or discard this patch.