removed provider issues in GTM and Webfont

This commit is contained in:
Prashant Singh 2019-09-02 19:52:39 +05:30
parent b2249e3a22
commit 3794dc2e7c
14 changed files with 186 additions and 153 deletions

View File

@ -15,14 +15,12 @@ class EventServiceProvider extends ServiceProvider
*/
public function boot()
{
if (core()->getConfigData('general.gtm.values.status')) {
Event::listen('bagisto.shop.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('gtm::head');
});
Event::listen('bagisto.shop.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('gtm::head');
});
Event::listen('bagisto.shop.layout.body.before', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('gtm::body');
});
}
Event::listen('bagisto.shop.layout.body.before', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('gtm::body');
});
}
}

View File

@ -1,17 +1,21 @@
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ core()->getConfigData('general.gtm.values.container_id') }}" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
@if (core()->getConfigData('general.gtm.values.status'))
@if (\Route::current()->getName() == 'shop.products.index')
@include('gtm::product')
@endif
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ core()->getConfigData('general.gtm.values.container_id') }}" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
@if (\Route::current()->getName() == 'shop.categories.index')
@include('gtm::category')
@endif
@if (\Route::current()->getName() == 'shop.products.index')
@include('gtm::product')
@endif
@if (\Route::current()->getName() == 'shop.checkout.cart.index')
@include('gtm::cart')
@endif
@if (\Route::current()->getName() == 'shop.categories.index')
@include('gtm::category')
@endif
@if (\Route::current()->getName() == 'shop.checkout.cart.index')
@include('gtm::cart')
@endif
@if (\Route::current()->getName() == 'shop.checkout.success')
@include('gtm::checkout-success')
@endif
@if (\Route::current()->getName() == 'shop.checkout.success')
@include('gtm::checkout-success')
@endif

View File

@ -1 +1,3 @@
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','{{ core()->getConfigData('general.gtm.values.container_id') }}');</script>
@if (core()->getConfigData('general.gtm.values.status'))
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','{{ core()->getConfigData('general.gtm.values.container_id') }}');</script>
@endif

View File

@ -5,13 +5,13 @@ return [
'title' => 'Cash On Delivery',
'description' => 'shop::app.checkout.onepage.cash-desc',
'class' => 'Webkul\Payment\Payment\CashOnDelivery',
'active' => true,
'active' => false,
'sort' => 1
],
'moneytransfer' => [
'code' => 'moneytransfer',
'title' => 'Money Transfer',
'title' => 'Invoice',
'description' => 'shop::app.checkout.onepage.money-desc',
'class' => 'Webkul\Payment\Payment\MoneyTransfer',
'active' => true,
@ -24,7 +24,7 @@ return [
'description' => 'shop::app.checkout.onepage.paypal-desc',
'class' => 'Webkul\Paypal\Payment\Standard',
'sandbox' => true,
'active' => true,
'active' => false,
'business_account' => 'test@webkul.com',
'sort' => 3
]

View File

@ -5,7 +5,6 @@ namespace Webkul\SAASCustomizer\Exceptions;
use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Database\Eloquent\PDOException;
use Illuminate\Database\Eloquent\ErrorException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
@ -29,7 +28,7 @@ class Handler extends ExceptionHandler
public function render($request, Exception $exception)
{
$path = 'saas';
dd($exception);
if ($exception->getMessage() == 'domain_not_found') {
return $this->response($path, 400, trans('saas::app.exceptions.domain-not-found'), 'domain_not_found');
}
@ -58,8 +57,6 @@ class Handler extends ExceptionHandler
return $this->response($path, 404);
} else if ($exception instanceof PDOException) {
return $this->response($path, 500);
} else {
return $this->response($path, 500);
}
return parent::render($request, $exception);

View File

@ -118,6 +118,7 @@ class DataPurger
'code' => 'guest',
'name' => 'Guest',
'is_user_defined' => 0,
'company_id' => $this->company->id
];
$customerGroup0 = $this->customerGroup->create($data);

View File

@ -36,8 +36,13 @@ class PurgeController extends Controller
$channel = $this->dataSeed->prepareChannelData();
// need to get executed only first time
if (Company::count() == 1)
$this->dataSeed->prepareCountryStateData();
if (Company::count() == 1) {
try {
$this->dataSeed->prepareCountryStateData();
} catch (\Exception $e) {
}
}
$this->dataSeed->prepareCustomerGroupData();

View File

@ -4,7 +4,7 @@ namespace Webkul\SAASCustomizer\Listeners;
use Company;
use Illuminate\Support\Facades\Mail;
use Webkul\SAASCustomizer\Mail\NewCompanyNotification;
use Webkul\SAASCustomizer\Notifications\NewCompanyNotification;
/**
* New company registered events handler
@ -24,6 +24,10 @@ class CompanyRegistered
$poolInstance->createPreOrderData($company->id);
}
Mail::queue(new NewCompanyNotification($company));
try {
Mail::queue(new NewCompanyNotification($company));
} catch (\Exception $e) {
}
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace Webkul\SAASCustomizer\Mail;
namespace Webkul\SAASCustomizer\Notifications;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;

View File

@ -0,0 +1,9 @@
@extends('saas::companies.layouts.master')
@section('page_title')
Seller Registration
@endsection
@section('content-wrapper')
@endsection

View File

@ -3,8 +3,8 @@
return [
'stripe' => [
'code' => 'stripe',
'title' => 'Stripe',
'description' => 'Stripe Payments',
'title' => 'RazzoPay',
'description' => 'RazzoPay Payments',
'class' => 'Webkul\StripeConnect\Payment\StripePayment',
'sandbox' => true,
'active' => true

View File

@ -3,7 +3,22 @@
namespace Webkul\Webfont\Listeners;
class Webfont {
public function load() {
return view('webfont::webfont');
public function handleFrontFont()
{
if (core()->getConfigData('general.design.webfont.status') && core()->getConfigData('general.design.webfont.enable_frontend')) {
Event::listen('bagisto.shop.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('webfont::webfont');
});
}
}
public function handleBackFont()
{
if (core()->getConfigData('general.design.webfont.status') && core()->getConfigData('general.design.webfont.enable_backend')) {
Event::listen('bagisto.admin.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('webfont::webfont');
});
}
}
}

View File

@ -15,16 +15,12 @@ class EventServiceProvider extends ServiceProvider
*/
public function boot()
{
if (core()->getConfigData('general.design.webfont.status') && core()->getConfigData('general.design.webfont.enable_backend')) {
Event::listen('bagisto.admin.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('webfont::webfont');
});
}
Event::listen('bagisto.admin.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('webfont::webfont');
});
if (core()->getConfigData('general.design.webfont.status') && core()->getConfigData('general.design.webfont.enable_frontend')) {
Event::listen('bagisto.shop.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('webfont::webfont');
});
}
Event::listen('bagisto.shop.layout.head', function($viewRenderEventManager) {
$viewRenderEventManager->addTemplate('webfont::webfont');
});
}
}

View File

@ -1,115 +1,117 @@
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>
@if(core()->getConfigData('general.design.webfont.status') && core()->getConfigData('general.design.webfont.enable_backend') || (core()->getConfigData('general.design.webfont.status') && core()->getConfigData('general.design.webfont.enable_frontend')))
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>
@php
$activatedFont = app('Webkul\Webfont\Repositories\WebfontRepository');
@php
$activatedFont = app('Webkul\Webfont\Repositories\WebfontRepository');
$primaryColor = core()->getConfigData('general.design.webfont.primary_color') ?? '#02bb89';
$primaryColor = core()->getConfigData('general.design.webfont.primary_color') ?? '#02bb89';
$secondaryColor = core()->getConfigData('general.design.webfont.secondary_color') ?? '#436be0';
$secondaryColor = core()->getConfigData('general.design.webfont.secondary_color') ?? '#436be0';
$font = $activatedFont->findOneWhere([
'activated' => 1
]);
$font = $activatedFont->findOneWhere([
'activated' => 1
]);
if (isset($font)) {
$activeFont = $font->font;
if (isset($font)) {
$activeFont = $font->font;
$font = explode(',', $activeFont)[0];
$font = explode(',', $activeFont)[0];
$family = explode(',', $activeFont)[1];
} else {
$font = 'Montserrat';
$family = explode(',', $activeFont)[1];
} else {
$font = 'Montserrat';
$family = 'sans-serif';
$family = 'sans-serif';
}
@endphp
<script>
WebFont.load({
google: {
families: ['{{ $font }}']
}
});
</script>
<style>
* {
font-family: "{{ $font }}", {{ $family }};
}
*::-webkit-input-placeholder {
font-family: $font-montserrat;
}
*::-webkit-input-placeholder {
font-family: $font-montserrat;
}
input {
font-family: $font-montserrat;
}
body {
font-family: "{{ $font }}", {{ $family }};
}
.btn.btn-primary {
background: {{ $primaryColor }};
color: #fff;
}
.btn.btn-black {
background: {{ $secondaryColor }};
color: #fff;
}
.btn.btn-white {
background: #c7c7c7;
color: #fff;
}
.btn:disabled, .btn[disabled="disabled"], .btn[disabled="disabled"]:hover, .btn[disabled="disabled"]:active {
cursor: not-allowed;
background: {{ $secondaryColor }};
-webkit-box-shadow: none;
box-shadow: none;
opacity: 1;
}
.tabs ul li.active a {
border-bottom: 3px solid {{ $secondaryColor }};
}
.dropdown-list .dropdown-container ul li a:hover {
color: {{ $secondaryColor }};
}
a:hover {
color: {{ $secondaryColor }};
}
a:link, a:hover, a:visited, a:focus, a:active {
color: {{ $secondaryColor }};
}
.control-group .control:focus {
border-color: {{ $primaryColor }};
}
.account-content .menu-block .menubar li.active a {
color: {{ $primaryColor }};
}
.dashboard .dashboard-stats .dashboard-card .title {
color: {{ $primaryColor }}
}
.dashboard .dashboard-stats .dashboard-card .data {
color: {{ $secondaryColor }}
}
.dashboard .card .card-info ul li .description .name {
color: {{ $primaryColor }}
}
}
@endphp
<script>
WebFont.load({
google: {
families: ['{{ $font }}']
}
});
</script>
<style>
* {
font-family: "{{ $font }}", {{ $family }};
}
*::-webkit-input-placeholder {
font-family: $font-montserrat;
}
*::-webkit-input-placeholder {
font-family: $font-montserrat;
}
input {
font-family: $font-montserrat;
}
body {
font-family: "{{ $font }}", {{ $family }};
}
.btn.btn-primary {
background: {{ $primaryColor }};
color: #fff;
}
.btn.btn-black {
background: {{ $secondaryColor }};
color: #fff;
}
.btn.btn-white {
background: #c7c7c7;
color: #fff;
}
.btn:disabled, .btn[disabled="disabled"], .btn[disabled="disabled"]:hover, .btn[disabled="disabled"]:active {
cursor: not-allowed;
background: {{ $secondaryColor }};
-webkit-box-shadow: none;
box-shadow: none;
opacity: 1;
}
.tabs ul li.active a {
border-bottom: 3px solid {{ $secondaryColor }};
}
.dropdown-list .dropdown-container ul li a:hover {
color: {{ $secondaryColor }};
}
a:hover {
color: {{ $secondaryColor }};
}
a:link, a:hover, a:visited, a:focus, a:active {
color: {{ $secondaryColor }};
}
.control-group .control:focus {
border-color: {{ $primaryColor }};
}
.account-content .menu-block .menubar li.active a {
color: {{ $primaryColor }};
}
.dashboard .dashboard-stats .dashboard-card .title {
color: {{ $primaryColor }}
}
.dashboard .dashboard-stats .dashboard-card .data {
color: {{ $secondaryColor }}
}
.dashboard .card .card-info ul li .description .name {
color: {{ $primaryColor }}
}
}
</style>
</style>
@endif