@@ -150,9 +150,9 @@ |
||
150 | 150 | return \Response::json([]); |
151 | 151 | } |
152 | 152 | $users = User::where('email', 'LIKE', '%'.$term.'%') |
153 | - ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
154 | - ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
155 | - ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
153 | + ->orWhere('first_name', 'LIKE', '%'.$term.'%') |
|
154 | + ->orWhere('last_name', 'LIKE', '%'.$term.'%') |
|
155 | + ->select('id', 'email', 'profile_pic', 'first_name', 'last_name')->get(); |
|
156 | 156 | $formatted_tags = []; |
157 | 157 | |
158 | 158 | foreach ($users as $user) { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | try { |
59 | 59 | $merge_fields = $this->field($email); |
60 | 60 | $interestGroupIdForNo = $this->relation->is_paid_no; //Interest GroupId for IsPaid Is No |
61 | - $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
61 | + $interestGroupIdForYes = $this->relation->is_paid_yes; //Interest GroupId for IsPaid Is Yes |
|
62 | 62 | $result = $this->mailchimp->post("lists/$this->list_id/members", [ |
63 | 63 | 'status' => $this->mailchimp_set->subscribe_status, |
64 | 64 | 'email_address' => $email, |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $country = Country::where('country_code_char2', $user->country)->pluck('nicename')->first(); |
115 | 115 | if ($user) { |
116 | 116 | $fields = ['first_name', 'last_name', 'company', 'mobile', |
117 | - 'address', 'town', 'country', 'state', 'zip', 'active', 'role', 'source', ]; |
|
117 | + 'address', 'town', 'country', 'state', 'zip', 'active', 'role', 'source', ]; |
|
118 | 118 | $relation = $this->relation; |
119 | 119 | $merge_fields = []; |
120 | 120 | foreach ($fields as $field) { |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | |
242 | 242 | $this->addProductInterestFieldsToAgora(); //add all the fields in Product Section of Groups to the db |
243 | 243 | $group_fields = $this->groups->where('list_id', $this->list_id) |
244 | - ->select('category_name', 'category_option_id', 'category_id')->get()->toArray(); |
|
244 | + ->select('category_name', 'category_option_id', 'category_id')->get()->toArray(); |
|
245 | 245 | // dd($group_fields[0]); |
246 | 246 | $relations = MailchimpGroupAgoraRelation::where('id', '!=', 0) |
247 | - ->select('agora_product_id', 'mailchimp_group_cat_id') |
|
248 | - ->orderBy('id', 'asc')->get()->toArray(); |
|
247 | + ->select('agora_product_id', 'mailchimp_group_cat_id') |
|
248 | + ->orderBy('id', 'asc')->get()->toArray(); |
|
249 | 249 | $productList = []; |
250 | 250 | $categoryList = []; |
251 | 251 | if (count($relations) != 0) { |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | MailchimpGroupAgoraRelation::where('id', '!=', 0)->delete(); |
325 | 325 | foreach ($request->row as $key => $value) { |
326 | 326 | MailchimpGroupAgoraRelation::create(['agora_product_id'=> $value[0], |
327 | - 'mailchimp_group_cat_id' => $value[1], ]); |
|
327 | + 'mailchimp_group_cat_id' => $value[1], ]); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | return redirect()->back()->with('success', \Lang::get('message.updated-successfully')); |
@@ -135,18 +135,21 @@ |
||
135 | 135 | if ($this->checkPlanSession() === true) { |
136 | 136 | $planid = Session::get('plan'); |
137 | 137 | } |
138 | - if (!$planid) {//When Product Is Added from Cart |
|
138 | + if (!$planid) { |
|
139 | +//When Product Is Added from Cart |
|
139 | 140 | $planid = Plan::where('product', $productid)->pluck('id')->first(); |
140 | 141 | } |
141 | 142 | $plan = Plan::where('id', $planid)->where('product', $productid)->first(); |
142 | - if ($plan) { //Get the Total Plan Cost if the Plan Exists For a Product |
|
143 | + if ($plan) { |
|
144 | +//Get the Total Plan Cost if the Plan Exists For a Product |
|
143 | 145 | $months = 1; |
144 | 146 | $cont = new CartController(); |
145 | 147 | $currency = $cont->currency($userid); |
146 | 148 | $product = Product::find($productid); |
147 | 149 | $days = $plan->periods->pluck('days')->first(); |
148 | 150 | $price = ($product->planRelation->find($planid)->planPrice->where('currency', $currency['currency'])->first()->add_price); |
149 | - if ($days) { //If Period Is defined for a Particular Plan ie no. of Days Generated |
|
151 | + if ($days) { |
|
152 | +//If Period Is defined for a Particular Plan ie no. of Days Generated |
|
150 | 153 | $months = $days >= '365' ? $days / 30 / 12 : $days / 30; |
151 | 154 | } |
152 | 155 | $finalPrice = str_replace(',', '', $price); |
@@ -50,18 +50,18 @@ discard block |
||
50 | 50 | } |
51 | 51 | if ($interestGroupIdForNo && $productGroupId) { |
52 | 52 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
53 | - 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true], |
|
54 | - ]); |
|
53 | + 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false, $productGroupId =>true], |
|
54 | + ]); |
|
55 | 55 | //refer to https://us7.api.mailchimp.com/playground |
56 | 56 | } elseif ($interestGroupIdForNo && $productGroupId == null) { |
57 | 57 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
58 | - 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false], |
|
59 | - ]); |
|
58 | + 'interests' => [$interestGroupIdForNo => true, $interestGroupIdForYes=>false], |
|
59 | + ]); |
|
60 | 60 | //refer to https://us7.api.mailchimp.com/playground |
61 | 61 | } elseif ($productGroupId && $interestGroupIdForNo == null || $interestGroupIdForYes == null) { |
62 | 62 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
63 | - 'interests' => [$productGroupId =>true], |
|
64 | - ]); |
|
63 | + 'interests' => [$productGroupId =>true], |
|
64 | + ]); |
|
65 | 65 | } |
66 | 66 | } catch (Exception $ex) { |
67 | 67 | $exe = json_decode($ex->getMessage(), true); |
@@ -85,22 +85,22 @@ discard block |
||
85 | 85 | } |
86 | 86 | if ($interestGroupIdForNo && $productGroupId) { |
87 | 87 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
88 | - 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true], |
|
89 | - //refer to https://us7.api.mailchimp.com/playground |
|
90 | - ]); |
|
88 | + 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true, $productGroupId =>true], |
|
89 | + //refer to https://us7.api.mailchimp.com/playground |
|
90 | + ]); |
|
91 | 91 | } elseif ($interestGroupIdForNo && $productGroupId == null) { |
92 | 92 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
93 | - 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true], |
|
94 | - ]); |
|
93 | + 'interests' => [$interestGroupIdForNo => false, $interestGroupIdForYes=>true], |
|
94 | + ]); |
|
95 | 95 | //refer to https://us7.api.mailchimp.com/playground |
96 | 96 | } elseif ($productGroupId && $interestGroupIdForNo == null || $interestGroupIdForYes == null) { |
97 | 97 | $result = $this->mailchimp->patch("lists/$this->list_id/members/$hash", [ |
98 | - 'interests' => [$productGroupId =>true], |
|
99 | - ]); |
|
98 | + 'interests' => [$productGroupId =>true], |
|
99 | + ]); |
|
100 | 100 | } |
101 | 101 | //refer to https://us7.api.mailchimp.com/playground |
102 | 102 | } catch (Exception $ex) { |
103 | - } |
|
103 | + } |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | public function getMergeFields() |
@@ -121,8 +121,8 @@ discard block |
||
121 | 121 | |
122 | 122 | public function addToMailchimp($product,$user_id,$item) |
123 | 123 | { |
124 | - $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
|
125 | - if ($mailchimpStatus == 1) { |
|
124 | + $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
|
125 | + if ($mailchimpStatus == 1) { |
|
126 | 126 | $mailchimp = new \App\Http\Controllers\Common\MailChimpController(); |
127 | 127 | $email = User::where('id', $user_id)->pluck('email')->first(); |
128 | 128 | if ($item->subtotal > 0) { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } else { |
131 | 131 | $r = $mailchimp->updateSubscriberForFreeProduct($email, $product); |
132 | 132 | } |
133 | - } |
|
133 | + } |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | $data = $template->data; |
285 | 285 | $replace = [ |
286 | 286 | 'name' => $user->first_name.' '.$user->last_name, |
287 | - 'serialkeyurl' => $myaccounturl, |
|
287 | + 'serialkeyurl' => $myaccounturl, |
|
288 | 288 | 'downloadurl' => $downloadurl, |
289 | 289 | 'invoiceurl' => $invoiceurl, |
290 | 290 | 'product' => $product, |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $end = '--'; |
23 | 23 | $ends = $model->subscription()->first(); |
24 | 24 | if ($ends) { |
25 | - if (strtotime($ends->update_ends_at) >1) { |
|
25 | + if (strtotime($ends->update_ends_at) > 1) { |
|
26 | 26 | $date1 = new DateTime($ends->update_ends_at); |
27 | 27 | $tz = \Auth::user()->timezone()->first()->name; |
28 | 28 | $date1->setTimezone(new DateTimeZone($tz)); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $this->addSubscription($order->id, $plan_id, $version, $product, $serial_key); |
110 | 110 | $this->sendOrderMail($user_id, $order->id, $item->id); |
111 | 111 | //Update Subscriber To Mailchimp |
112 | - $this->addtoMailchimp($product,$user_id,$item); |
|
112 | + $this->addtoMailchimp($product, $user_id, $item); |
|
113 | 113 | |
114 | 114 | } catch (\Exception $ex) { |
115 | 115 | Bugsnag::notifyException($ex); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | |
122 | - public function addToMailchimp($product,$user_id,$item) |
|
122 | + public function addToMailchimp($product, $user_id, $item) |
|
123 | 123 | { |
124 | 124 | $mailchimpStatus = StatusSetting::first()->value('mailchimp_status'); |
125 | 125 | if ($mailchimpStatus == 1) { |