fixing as per comment
This commit is contained in:
parent
98d8738744
commit
142f04ad41
|
|
@ -97,7 +97,6 @@ class RegistrationController extends Controller
|
|||
'is_verified' => core()->getConfigData('customer.settings.email.verification') ? 0 : 1,
|
||||
'customer_group_id' => $this->customerGroupRepository->findOneWhere(['code' => 'general'])->id,
|
||||
'token' => md5(uniqid(rand(), true)),
|
||||
'subscribed_to_news_letter' => isset(request()->input()['is_subscribed']) ? 1 : 0,
|
||||
]);
|
||||
|
||||
Event::dispatch('customer.registration.before');
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
|||
use Tymon\JWTAuth\Contracts\JWTSubject;
|
||||
use Webkul\Checkout\Models\CartProxy;
|
||||
use Webkul\Sales\Models\OrderProxy;
|
||||
use Webkul\Core\Models\SubscribersListProxy;
|
||||
use Webkul\Product\Models\ProductReviewProxy;
|
||||
use Webkul\Customer\Notifications\CustomerResetPassword;
|
||||
use Webkul\Customer\Contracts\Customer as CustomerContract;
|
||||
|
|
@ -160,4 +161,12 @@ class Customer extends Authenticatable implements CustomerContract, JWTSubject
|
|||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the customer's subscription.
|
||||
*/
|
||||
public function subscription()
|
||||
{
|
||||
return $this->hasOne(SubscribersListProxy::modelClass(), 'customer_id');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<input type="checkbox" id="checkbox2" name="subscribed_to_news_letter" value="{{ $customer->subscribed_to_news_letter }}" {{ $customer->subscribed_to_news_letter ? 'checked' : ''}}>
|
||||
<input type="checkbox" id="checkbox2" name="subscribed_to_news_letter"@if (isset($customer->subscription)) value="{{ $customer->subscription->is_subscribed }}" {{ $customer->subscription->is_subscribed ? 'checked' : ''}} @endif>
|
||||
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@
|
|||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<input type="checkbox" id="checkbox2" name="subscribed_to_news_letter" value="{{ $customer->subscribed_to_news_letter }}" {{ $customer->subscribed_to_news_letter ? 'checked' : ''}} style="width: auto;">
|
||||
<input type="checkbox" id="checkbox2" name="subscribed_to_news_letter"@if (isset($customer->subscription)) value="{{ $customer->subscription->is_subscribed }}" {{ $customer->subscription->is_subscribed ? 'checked' : ''}} @endif style="width: auto;">
|
||||
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue