Merge pull request #4429 from jitendra-webkul/master

Email marketing added
This commit is contained in:
Jitendra Singh 2021-01-05 11:50:53 +05:30 committed by GitHub
commit b14a16be06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
85 changed files with 5530 additions and 160 deletions

View File

@ -19,7 +19,9 @@
"ext-tokenizer": "*", "ext-tokenizer": "*",
"algolia/algoliasearch-client-php": "^2.2", "algolia/algoliasearch-client-php": "^2.2",
"astrotomic/laravel-translatable": "^11.0.0", "astrotomic/laravel-translatable": "^11.0.0",
"aws/aws-sdk-php": "^3.171",
"babenkoivan/elastic-scout-driver": "^1.1", "babenkoivan/elastic-scout-driver": "^1.1",
"bagisto/bagisto-package-generator": "9999999-dev",
"bagistobrasil/bagisto-product-social-share": "^0.1.2", "bagistobrasil/bagisto-product-social-share": "^0.1.2",
"barryvdh/laravel-debugbar": "^3.1", "barryvdh/laravel-debugbar": "^3.1",
"barryvdh/laravel-dompdf": "0.8.6", "barryvdh/laravel-dompdf": "0.8.6",
@ -109,7 +111,8 @@
"Webkul\\Velocity\\": "packages/Webkul/Velocity/src", "Webkul\\Velocity\\": "packages/Webkul/Velocity/src",
"Webkul\\BookingProduct\\": "packages/Webkul/BookingProduct/src", "Webkul\\BookingProduct\\": "packages/Webkul/BookingProduct/src",
"Webkul\\SocialLogin\\": "packages/Webkul/SocialLogin/src", "Webkul\\SocialLogin\\": "packages/Webkul/SocialLogin/src",
"Webkul\\DebugBar\\": "packages/Webkul/DebugBar/src" "Webkul\\DebugBar\\": "packages/Webkul/DebugBar/src",
"Webkul\\Marketing\\": "packages/Webkul/Marketing/src"
} }
}, },

1775
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -281,6 +281,7 @@ return [
Webkul\BookingProduct\Providers\BookingProductServiceProvider::class, Webkul\BookingProduct\Providers\BookingProductServiceProvider::class,
Webkul\SocialLogin\Providers\SocialLoginServiceProvider::class, Webkul\SocialLogin\Providers\SocialLoginServiceProvider::class,
Webkul\DebugBar\Providers\DebugBarServiceProvider::class, Webkul\DebugBar\Providers\DebugBarServiceProvider::class,
Webkul\Marketing\Providers\MarketingServiceProvider::class,
], ],
/* /*

View File

@ -24,6 +24,7 @@ return [
\Webkul\CMS\Providers\ModuleServiceProvider::class, \Webkul\CMS\Providers\ModuleServiceProvider::class,
\Webkul\Customer\Providers\ModuleServiceProvider::class, \Webkul\Customer\Providers\ModuleServiceProvider::class,
\Webkul\Inventory\Providers\ModuleServiceProvider::class, \Webkul\Inventory\Providers\ModuleServiceProvider::class,
\Webkul\Marketing\Providers\ModuleServiceProvider::class,
\Webkul\Payment\Providers\ModuleServiceProvider::class, \Webkul\Payment\Providers\ModuleServiceProvider::class,
\Webkul\Paypal\Providers\ModuleServiceProvider::class, \Webkul\Paypal\Providers\ModuleServiceProvider::class,
\Webkul\Product\Providers\ModuleServiceProvider::class, \Webkul\Product\Providers\ModuleServiceProvider::class,

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddColumnUrlPathToCategoryTranslations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('category_translations', function (Blueprint $table) {
$table->string('url_path', 2048)
->comment('maintained by database triggers');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('category_translations', function (Blueprint $table) {
$table->dropColumn('url_path');
});
}
}

View File

@ -0,0 +1,70 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class AddStoredFunctionToGetUrlPathOfCategory extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$dbPrefix = DB::getTablePrefix();
$functionSQL = <<< SQL
DROP FUNCTION IF EXISTS `get_url_path_of_category`;
CREATE FUNCTION get_url_path_of_category(
categoryId INT,
localeCode VARCHAR(255)
)
RETURNS VARCHAR(255)
DETERMINISTIC
BEGIN
DECLARE urlPath VARCHAR(255);
-- Category with id 1 is root by default
IF categoryId <> 1
THEN
SELECT
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO urlPath
FROM
${dbPrefix}categories AS node,
${dbPrefix}categories AS parent
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
WHERE
node._lft >= parent._lft
AND node._rgt <= parent._rgt
AND node.id = categoryId
AND parent.id <> 1
AND parent_translations.locale = localeCode
GROUP BY
node.id;
IF urlPath IS NULL
THEN
SET urlPath = (SELECT slug FROM ${dbPrefix}category_translations WHERE ${dbPrefix}category_translations.category_id = categoryId);
END IF;
ELSE
SET urlPath = '';
END IF;
RETURN urlPath;
END;
SQL;
DB::unprepared($functionSQL);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::unprepared('DROP FUNCTION IF EXISTS `get_url_path_of_category`;');
}
}

View File

@ -0,0 +1,103 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
use Webkul\Category\Models\CategoryTranslation;
class AddTriggerToCategoryTranslations extends Migration
{
private const TRIGGER_NAME_INSERT = 'trig_category_translations_insert';
private const TRIGGER_NAME_UPDATE = 'trig_category_translations_update';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$dbPrefix = DB::getTablePrefix();
$triggerBody = $this->getTriggerBody();
$insertTrigger = <<< SQL
CREATE TRIGGER %s
BEFORE INSERT ON ${dbPrefix}category_translations
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$updateTrigger = <<< SQL
CREATE TRIGGER %s
BEFORE UPDATE ON ${dbPrefix}category_translations
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
}
/**
* Returns trigger body as string
*
* @return string
*/
private function getTriggerBody()
{
$dbPrefix = DB::getTablePrefix();
return <<<SQL
DECLARE parentUrlPath varchar(255);
DECLARE urlPath varchar(255);
-- Category with id 1 is root by default
IF NEW.category_id <> 1
THEN
SELECT
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO parentUrlPath
FROM
${dbPrefix}categories AS node,
${dbPrefix}categories AS parent
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
WHERE
node._lft >= parent._lft
AND node._rgt <= parent._rgt
AND node.id = (SELECT parent_id FROM categories WHERE id = NEW.category_id)
AND parent.id <> 1
AND parent_translations.locale = NEW.locale
GROUP BY
node.id;
IF parentUrlPath IS NULL
THEN
SET urlPath = NEW.slug;
ELSE
SET urlPath = concat(parentUrlPath, '/', NEW.slug);
END IF;
SET NEW.url_path = urlPath;
END IF;
SQL;
}
}

View File

@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
use Webkul\Category\Models\CategoryTranslation;
class AddUrlPathToExistingCategoryTranslations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$sqlStoredFunction = <<< SQL
SELECT get_url_path_of_category(:category_id, :locale_code) AS url_path;
SQL;
$categoryTranslationsTableName = app(CategoryTranslation::class)->getTable();
foreach (DB::table($categoryTranslationsTableName)->get() as $categoryTranslation) {
$urlPathQueryResult = DB::selectOne($sqlStoredFunction, [
'category_id' => $categoryTranslation->category_id,
'locale_code' => $categoryTranslation->locale,
]);
$url_path = $urlPathQueryResult ? $urlPathQueryResult->url_path : '';
DB::table($categoryTranslationsTableName)
->where('id', $categoryTranslation->id)
->update(['url_path' => $url_path]);
}
}
}

View File

@ -0,0 +1,102 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class AddTriggerToCategories extends Migration
{
private const TRIGGER_NAME_INSERT = 'trig_categories_insert';
private const TRIGGER_NAME_UPDATE = 'trig_categories_update';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$triggerBody = $this->getTriggerBody();
$dbPrefix = DB::getTablePrefix();
$insertTrigger = <<< SQL
CREATE TRIGGER %s
AFTER INSERT ON ${dbPrefix}categories
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$updateTrigger = <<< SQL
CREATE TRIGGER %s
AFTER UPDATE ON ${dbPrefix}categories
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
}
/**
* Returns trigger body as string
*
* @return string
*/
private function getTriggerBody(): string
{
$dbPrefix = DB::getTablePrefix();
return <<< SQL
DECLARE urlPath VARCHAR(255);
DECLARE localeCode VARCHAR(255);
DECLARE done INT;
DECLARE curs CURSOR FOR (SELECT ${dbPrefix}category_translations.locale
FROM ${dbPrefix}category_translations
WHERE category_id = NEW.id);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
IF EXISTS (
SELECT *
FROM ${dbPrefix}category_translations
WHERE category_id = NEW.id
)
THEN
OPEN curs;
SET done = 0;
REPEAT
FETCH curs INTO localeCode;
SELECT get_url_path_of_category(NEW.id, localeCode) INTO urlPath;
UPDATE ${dbPrefix}category_translations
SET url_path = urlPath
WHERE ${dbPrefix}category_translations.category_id = NEW.id;
UNTIL done END REPEAT;
CLOSE curs;
END IF;
SQL;
}
}

View File

@ -0,0 +1,115 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class AlterTriggerCategoryTranslations extends Migration
{
private const TRIGGER_NAME_INSERT = 'trig_category_translations_insert';
private const TRIGGER_NAME_UPDATE = 'trig_category_translations_update';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$triggerBody = $this->getTriggerBody();
$dbPrefix = DB::getTablePrefix();
$insertTrigger = <<< SQL
CREATE TRIGGER %s
BEFORE INSERT ON ${dbPrefix}category_translations
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$updateTrigger = <<< SQL
CREATE TRIGGER %s
BEFORE UPDATE ON ${dbPrefix}category_translations
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$this->dropTriggers();
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$this->dropTriggers();
}
/**
* Drop the triggers
*/
private function dropTriggers()
{
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
}
/**
* Returns trigger body as string
*
* @return string
*/
private function getTriggerBody()
{
$dbPrefix = DB::getTablePrefix();
return <<<SQL
DECLARE parentUrlPath varchar(255);
DECLARE urlPath varchar(255);
IF NOT EXISTS (
SELECT id
FROM ${dbPrefix}categories
WHERE
id = NEW.category_id
AND parent_id IS NULL
)
THEN
SELECT
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO parentUrlPath
FROM
${dbPrefix}categories AS node,
${dbPrefix}categories AS parent
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
WHERE
node._lft >= parent._lft
AND node._rgt <= parent._rgt
AND node.id = (SELECT parent_id FROM ${dbPrefix}categories WHERE id = NEW.category_id)
AND node.parent_id IS NOT NULL
AND parent.parent_id IS NOT NULL
AND parent_translations.locale = NEW.locale
GROUP BY
node.id;
IF parentUrlPath IS NULL
THEN
SET urlPath = NEW.slug;
ELSE
SET urlPath = concat(parentUrlPath, '/', NEW.slug);
END IF;
SET NEW.url_path = urlPath;
END IF;
SQL;
}
}

View File

@ -0,0 +1,77 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Migrations\Migration;
class AlterStoredFunctionUrlPathCategory extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$dbPrefix = DB::getTablePrefix();
$functionSQL = <<< SQL
DROP FUNCTION IF EXISTS `get_url_path_of_category`;
CREATE FUNCTION get_url_path_of_category(
categoryId INT,
localeCode VARCHAR(255)
)
RETURNS VARCHAR(255)
DETERMINISTIC
BEGIN
DECLARE urlPath VARCHAR(255);
IF NOT EXISTS (
SELECT id
FROM ${dbPrefix}categories
WHERE
id = categoryId
AND parent_id IS NULL
)
THEN
SELECT
GROUP_CONCAT(parent_translations.slug SEPARATOR '/') INTO urlPath
FROM
${dbPrefix}categories AS node,
${dbPrefix}categories AS parent
JOIN ${dbPrefix}category_translations AS parent_translations ON parent.id = parent_translations.category_id
WHERE
node._lft >= parent._lft
AND node._rgt <= parent._rgt
AND node.id = categoryId
AND node.parent_id IS NOT NULL
AND parent.parent_id IS NOT NULL
AND parent_translations.locale = localeCode
GROUP BY
node.id;
IF urlPath IS NULL
THEN
SET urlPath = (SELECT slug FROM ${dbPrefix}category_translations WHERE ${dbPrefix}category_translations.category_id = categoryId);
END IF;
ELSE
SET urlPath = '';
END IF;
RETURN urlPath;
END;
SQL;
DB::unprepared($functionSQL);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::unprepared('DROP FUNCTION IF EXISTS `get_url_path_of_category`;');
}
}

View File

@ -0,0 +1,117 @@
<?php
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTriggerOnCategories extends Migration
{
private const TRIGGER_NAME_INSERT = 'trig_categories_insert';
private const TRIGGER_NAME_UPDATE = 'trig_categories_update';
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$triggerBody = $this->getTriggerBody();
$dbPrefix = DB::getTablePrefix();
$insertTrigger = <<< SQL
CREATE TRIGGER %s
AFTER INSERT ON ${dbPrefix}categories
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$updateTrigger = <<< SQL
CREATE TRIGGER %s
AFTER UPDATE ON ${dbPrefix}categories
FOR EACH ROW
BEGIN
$triggerBody
END;
SQL;
$this->dropTriggers();
DB::unprepared(sprintf($insertTrigger, self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf($updateTrigger, self::TRIGGER_NAME_UPDATE));
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$this->dropTriggers();
}
private function dropTriggers()
{
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_INSERT));
DB::unprepared(sprintf('DROP TRIGGER IF EXISTS %s;', self::TRIGGER_NAME_UPDATE));
}
/**
* Returns trigger body as string
*
* @return string
*/
private function getTriggerBody(): string
{
$dbPrefix = DB::getTablePrefix();
return <<< SQL
DECLARE urlPath VARCHAR(255);
DECLARE localeCode VARCHAR(255);
DECLARE done INT;
DECLARE curs CURSOR FOR (SELECT ${dbPrefix}category_translations.locale
FROM ${dbPrefix}category_translations
WHERE category_id = NEW.id);
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;
IF EXISTS (
SELECT *
FROM ${dbPrefix}category_translations
WHERE category_id = NEW.id
)
THEN
OPEN curs;
SET done = 0;
REPEAT
FETCH curs INTO localeCode;
SELECT get_url_path_of_category(NEW.id, localeCode) INTO urlPath;
IF NEW.parent_id IS NULL
THEN
SET urlPath = '';
END IF;
UPDATE ${dbPrefix}category_translations
SET url_path = urlPath
WHERE
${dbPrefix}category_translations.category_id = NEW.id
AND ${dbPrefix}category_translations.locale = localeCode;
UNTIL done END REPEAT;
CLOSE curs;
END IF;
SQL;
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('jobs');
}
}

View File

@ -392,51 +392,136 @@ return [
'route' => 'admin.tax-rates.delete', 'route' => 'admin.tax-rates.delete',
'sort' => 3, 'sort' => 3,
], [ ], [
'key' => 'promotions', 'key' => 'marketing',
'name' => 'admin::app.acl.marketing',
'route' => 'admin.cart-rules.index',
'sort' => 7,
], [
'key' => 'marketing.promotions',
'name' => 'admin::app.acl.promotions', 'name' => 'admin::app.acl.promotions',
'route' => 'admin.cart-rules.index', 'route' => 'admin.cart-rules.index',
'sort' => 7, 'sort' => 7,
], [ ], [
'key' => 'promotions.cart-rules', 'key' => 'marketing.promotions.cart-rules',
'name' => 'admin::app.acl.cart-rules', 'name' => 'admin::app.acl.cart-rules',
'route' => 'admin.cart-rules.index', 'route' => 'admin.cart-rules.index',
'sort' => 1, 'sort' => 1,
], [ ], [
'key' => 'promotions.cart-rules.create', 'key' => 'marketing.promotions.cart-rules.create',
'name' => 'admin::app.acl.create', 'name' => 'admin::app.acl.create',
'route' => 'admin.cart-rules.create', 'route' => 'admin.cart-rules.create',
'sort' => 1, 'sort' => 1,
], [ ], [
'key' => 'promotions.cart-rules.edit', 'key' => 'marketing.promotions.cart-rules.edit',
'name' => 'admin::app.acl.edit', 'name' => 'admin::app.acl.edit',
'route' => 'admin.cart-rules.edit', 'route' => 'admin.cart-rules.edit',
'sort' => 2, 'sort' => 2,
], [ ], [
'key' => 'promotions.cart-rules.delete', 'key' => 'marketing.promotions.cart-rules.delete',
'name' => 'admin::app.acl.delete', 'name' => 'admin::app.acl.delete',
'route' => 'admin.cart-rules.delete', 'route' => 'admin.cart-rules.delete',
'sort' => 3, 'sort' => 3,
], [ ], [
'key' => 'promotions.catalog-rules', 'key' => 'marketing.promotions.catalog-rules',
'name' => 'admin::app.acl.catalog-rules', 'name' => 'admin::app.acl.catalog-rules',
'route' => 'admin.catalog-rules.index', 'route' => 'admin.catalog-rules.index',
'sort' => 1, 'sort' => 1,
], [ ], [
'key' => 'promotions.catalog-rules.create', 'key' => 'marketing.promotions.catalog-rules.create',
'name' => 'admin::app.acl.create', 'name' => 'admin::app.acl.create',
'route' => 'admin.catalog-rules.index', 'route' => 'admin.catalog-rules.index',
'sort' => 1, 'sort' => 1,
], [ ], [
'key' => 'promotions.catalog-rules.edit', 'key' => 'marketing.promotions.catalog-rules.edit',
'name' => 'admin::app.acl.edit', 'name' => 'admin::app.acl.edit',
'route' => 'admin.catalog-rules.edit', 'route' => 'admin.catalog-rules.edit',
'sort' => 2, 'sort' => 2,
], [ ], [
'key' => 'promotions.catalog-rules.delete', 'key' => 'marketing.promotions.catalog-rules.delete',
'name' => 'admin::app.acl.delete', 'name' => 'admin::app.acl.delete',
'route' => 'admin.catalog-rules.delete', 'route' => 'admin.catalog-rules.delete',
'sort' => 3, 'sort' => 3,
], ], [
'key' => 'marketing.email-marketing',
'name' => 'admin::app.acl.email-marketing',
'route' => 'admin.email-templates.index',
'sort' => 7,
], [
'key' => 'marketing.email-marketing.email-templates',
'name' => 'admin::app.acl.email-templates',
'route' => 'admin.email-templates.index',
'sort' => 1,
], [
'key' => 'marketing.email-marketing.email-templates.create',
'name' => 'admin::app.acl.create',
'route' => 'admin.email-templates.create',
'sort' => 1,
], [
'key' => 'marketing.email-marketing.email-templates.edit',
'name' => 'admin::app.acl.edit',
'route' => 'admin.email-templates.edit',
'sort' => 2,
], [
'key' => 'marketing.email-marketing.email-templates.delete',
'name' => 'admin::app.acl.delete',
'route' => 'admin.email-templates.delete',
'sort' => 3,
], [
'key' => 'marketing.email-marketing.events',
'name' => 'admin::app.acl.events',
'route' => 'admin.events.index',
'sort' => 1,
], [
'key' => 'marketing.email-marketing.events.create',
'name' => 'admin::app.acl.create',
'route' => 'admin.events.create',
'sort' => 1,
], [
'key' => 'marketing.email-marketing.events.edit',
'name' => 'admin::app.acl.edit',
'route' => 'admin.events.edit',
'sort' => 2,
], [
'key' => 'marketing.email-marketing.events.delete',
'name' => 'admin::app.acl.delete',
'route' => 'admin.events.delete',
'sort' => 3,
], [
'key' => 'marketing.email-marketing.campaigns',
'name' => 'admin::app.acl.campaigns',
'route' => 'admin.campaigns.index',
'sort' => 1,
], [
'key' => 'marketing.email-marketing.campaigns.create',
'name' => 'admin::app.acl.create',
'route' => 'admin.campaigns.create',
'sort' => 1,
], [
'key' => 'marketing.email-marketing.campaigns.edit',
'name' => 'admin::app.acl.edit',
'route' => 'admin.campaigns.edit',
'sort' => 2,
], [
'key' => 'marketing.email-marketing.campaigns.delete',
'name' => 'admin::app.acl.delete',
'route' => 'admin.campaigns.delete',
'sort' => 3,
], [
'key' => 'marketing.email-marketing.subscribers',
'name' => 'admin::app.acl.subscribers',
'route' => 'admin.subscribers.index',
'sort' => 1,
], [
'key' => 'marketing.email-marketing.subscribers.edit',
'name' => 'admin::app.acl.edit',
'route' => 'admin.subscribers.edit',
'sort' => 2,
], [
'key' => 'marketing.email-marketing.subscribers.delete',
'name' => 'admin::app.acl.delete',
'route' => 'admin.subscribers.delete',
'sort' => 3,
]
]; ];
?> ?>

View File

@ -91,12 +91,6 @@ return [
'route' => 'admin.customer.review.index', 'route' => 'admin.customer.review.index',
'sort' => 3, 'sort' => 3,
'icon-class' => '', 'icon-class' => '',
], [
'key' => 'customers.subscribers',
'name' => 'admin::app.layouts.newsletter-subscriptions',
'route' => 'admin.customers.subscribers.index',
'sort' => 4,
'icon-class' => '',
], [ ], [
'key' => 'configuration', 'key' => 'configuration',
'name' => 'admin::app.layouts.configure', 'name' => 'admin::app.layouts.configure',
@ -182,23 +176,59 @@ return [
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'promotions', 'key' => 'marketing',
'name' => 'admin::app.layouts.promotions', 'name' => 'admin::app.layouts.marketing',
'route' => 'admin.catalog-rules.index', 'route' => 'admin.catalog-rules.index',
'sort' => 5, 'sort' => 5,
'icon-class' => 'promotion-icon', 'icon-class' => 'promotion-icon',
], [ ], [
'key' => 'promotions.catalog-rules', 'key' => 'marketing.promotions',
'name' => 'admin::app.layouts.promotions',
'route' => 'admin.catalog-rules.index',
'sort' => 1,
'icon-class' => '',
], [
'key' => 'marketing.promotions.catalog-rules',
'name' => 'admin::app.promotions.catalog-rules.title', 'name' => 'admin::app.promotions.catalog-rules.title',
'route' => 'admin.catalog-rules.index', 'route' => 'admin.catalog-rules.index',
'sort' => 1, 'sort' => 1,
'icon-class' => '', 'icon-class' => '',
], [ ], [
'key' => 'promotions.cart-rules', 'key' => 'marketing.promotions.cart-rules',
'name' => 'admin::app.promotions.cart-rules.title', 'name' => 'admin::app.promotions.cart-rules.title',
'route' => 'admin.cart-rules.index', 'route' => 'admin.cart-rules.index',
'sort' => 2, 'sort' => 2,
'icon-class' => '', 'icon-class' => '',
], [
'key' => 'marketing.email-marketing',
'name' => 'admin::app.layouts.email-marketing',
'route' => 'admin.email-templates.index',
'sort' => 2,
'icon-class' => '',
], [
'key' => 'marketing.email-marketing.email-templates',
'name' => 'admin::app.layouts.email-templates',
'route' => 'admin.email-templates.index',
'sort' => 1,
'icon-class' => '',
], [
'key' => 'marketing.email-marketing.events',
'name' => 'admin::app.layouts.events',
'route' => 'admin.events.index',
'sort' => 2,
'icon-class' => '',
], [
'key' => 'marketing.email-marketing.campaigns',
'name' => 'admin::app.layouts.campaigns',
'route' => 'admin.campaigns.index',
'sort' => 2,
'icon-class' => '',
], [
'key' => 'marketing.email-marketing.subscribers',
'name' => 'admin::app.layouts.newsletter-subscriptions',
'route' => 'admin.customers.subscribers.index',
'sort' => 3,
'icon-class' => '',
], [ ], [
'key' => 'cms', 'key' => 'cms',
'name' => 'admin::app.layouts.cms', 'name' => 'admin::app.layouts.cms',

View File

@ -0,0 +1,84 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Ui\DataGrid\DataGrid;
class CampaignDataGrid extends DataGrid
{
protected $index = 'id';
protected $sortOrder = 'desc';
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('marketing_campaigns')->addSelect('id', 'name', 'subject', 'status');
$this->setQueryBuilder($queryBuilder);
}
public function addColumns()
{
$this->addColumn([
'index' => 'id',
'label' => trans('admin::app.datagrid.id'),
'type' => 'number',
'searchable' => false,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'name',
'label' => trans('admin::app.datagrid.name'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'subject',
'label' => trans('admin::app.datagrid.subject'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.status'),
'type' => 'boolean',
'searchable' => true,
'sortable' => true,
'filterable' => true,
'wrapper' => function ($value) {
if ($value->status == 1) {
return trans('admin::app.datagrid.active');
} else {
return trans('admin::app.datagrid.inactive');
}
},
]);
}
public function prepareActions()
{
$this->addAction([
'title' => trans('admin::app.datagrid.edit'),
'method' => 'GET',
'route' => 'admin.campaigns.edit',
'icon' => 'icon pencil-lg-icon',
]);
$this->addAction([
'title' => trans('admin::app.datagrid.delete'),
'method' => 'POST',
'route' => 'admin.campaigns.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Campaign']),
'icon' => 'icon trash-icon',
]);
}
}

View File

@ -120,10 +120,12 @@ class CartRuleDataGrid extends DataGrid
'sortable' => true, 'sortable' => true,
'filterable' => true, 'filterable' => true,
'wrapper' => function ($value) { 'wrapper' => function ($value) {
if ($value->status == 1) { if ($value->status == 'active') {
return trans('admin::app.datagrid.active'); return trans('admin::app.datagrid.active');
} else { } else if ($value->status == 'inactive') {
return trans('admin::app.datagrid.inactive'); return trans('admin::app.datagrid.inactive');
} else {
return trans('admin::app.datagrid.draft');
} }
}, },
]); ]);

View File

@ -0,0 +1,77 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Ui\DataGrid\DataGrid;
class EmailTemplateDataGrid extends DataGrid
{
protected $index = 'id';
protected $sortOrder = 'desc';
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('marketing_templates')->addSelect('id', 'name', 'status');
$this->setQueryBuilder($queryBuilder);
}
public function addColumns()
{
$this->addColumn([
'index' => 'id',
'label' => trans('admin::app.datagrid.id'),
'type' => 'number',
'searchable' => false,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'name',
'label' => trans('admin::app.datagrid.name'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'status',
'label' => trans('admin::app.status'),
'type' => 'boolean',
'searchable' => true,
'sortable' => true,
'filterable' => true,
'wrapper' => function ($value) {
if ($value->status == 'active') {
return trans('admin::app.datagrid.active');
} else if ($value->status == 'inactive') {
return trans('admin::app.datagrid.inactive');
} else if ($value->status == 'draft') {
return trans('admin::app.datagrid.draft');
}
},
]);
}
public function prepareActions()
{
$this->addAction([
'title' => trans('admin::app.datagrid.edit'),
'method' => 'GET',
'route' => 'admin.email-templates.edit',
'icon' => 'icon pencil-lg-icon',
]);
$this->addAction([
'title' => trans('admin::app.datagrid.delete'),
'method' => 'POST',
'route' => 'admin.email-templates.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Email Template']),
'icon' => 'icon trash-icon',
]);
}
}

View File

@ -0,0 +1,68 @@
<?php
namespace Webkul\Admin\DataGrids;
use Illuminate\Support\Facades\DB;
use Webkul\Ui\DataGrid\DataGrid;
class EventDataGrid extends DataGrid
{
protected $index = 'id';
protected $sortOrder = 'desc';
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('marketing_events')->addSelect('id', 'name', 'date');
$this->setQueryBuilder($queryBuilder);
}
public function addColumns()
{
$this->addColumn([
'index' => 'id',
'label' => trans('admin::app.datagrid.id'),
'type' => 'number',
'searchable' => false,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'name',
'label' => trans('admin::app.datagrid.name'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
$this->addColumn([
'index' => 'date',
'label' => trans('admin::app.datagrid.date'),
'type' => 'date',
'searchable' => true,
'sortable' => true,
'filterable' => true,
]);
}
public function prepareActions()
{
$this->addAction([
'title' => trans('admin::app.datagrid.edit'),
'method' => 'GET',
'route' => 'admin.events.edit',
'icon' => 'icon pencil-lg-icon',
]);
$this->addAction([
'title' => trans('admin::app.datagrid.delete'),
'method' => 'POST',
'route' => 'admin.events.delete',
'confirm_text' => trans('ui::app.datagrid.massaction.delete', ['resource' => 'Event']),
'icon' => 'icon trash-icon',
]);
}
}

View File

@ -124,7 +124,7 @@ class CustomerGroupController extends Controller
if ($customerGroup->is_user_defined == 0) { if ($customerGroup->is_user_defined == 0) {
session()->flash('warning', trans('admin::app.customers.customers.group-default')); session()->flash('warning', trans('admin::app.customers.customers.group-default'));
} elseif (count($customerGroup->customer) > 0) { } elseif (count($customerGroup->customers) > 0) {
session()->flash('warning', trans('admin::app.response.customer-associate', ['name' => 'Customer Group'])); session()->flash('warning', trans('admin::app.response.customer-associate', ['name' => 'Customer Group']));
} else { } else {
try { try {

View File

@ -583,23 +583,6 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update'); Route::put('/account', 'Webkul\User\Http\Controllers\AccountController@update')->name('admin.account.update');
// Admin Store Front Settings Route
Route::get('/subscribers', 'Webkul\Core\Http\Controllers\SubscriptionController@index')->defaults('_config', [
'view' => 'admin::customers.subscribers.index',
])->name('admin.customers.subscribers.index');
//destroy a newsletter subscription item
Route::post('subscribers/delete/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@destroy')->name('admin.customers.subscribers.delete');
Route::get('subscribers/edit/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@edit')->defaults('_config', [
'view' => 'admin::customers.subscribers.edit',
])->name('admin.customers.subscribers.edit');
Route::put('subscribers/update/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@update')->defaults('_config', [
'redirect' => 'admin.customers.subscribers.index',
])->name('admin.customers.subscribers.update');
//slider index //slider index
Route::get('/slider', 'Webkul\Core\Http\Controllers\SliderController@index')->defaults('_config', [ Route::get('/slider', 'Webkul\Core\Http\Controllers\SliderController@index')->defaults('_config', [
'view' => 'admin::settings.sliders.index', 'view' => 'admin::settings.sliders.index',
@ -688,11 +671,11 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
Route::prefix('promotions')->group(function () { Route::prefix('promotions')->group(function () {
Route::get('cart-rules', 'Webkul\CartRule\Http\Controllers\CartRuleController@index')->defaults('_config', [ Route::get('cart-rules', 'Webkul\CartRule\Http\Controllers\CartRuleController@index')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.index', 'view' => 'admin::marketing.promotions.cart-rules.index',
])->name('admin.cart-rules.index'); ])->name('admin.cart-rules.index');
Route::get('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@create')->defaults('_config', [ Route::get('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@create')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.create', 'view' => 'admin::marketing.promotions.cart-rules.create',
])->name('admin.cart-rules.create'); ])->name('admin.cart-rules.create');
Route::post('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@store')->defaults('_config', [ Route::post('cart-rules/create', 'Webkul\CartRule\Http\Controllers\CartRuleController@store')->defaults('_config', [
@ -700,11 +683,11 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
])->name('admin.cart-rules.store'); ])->name('admin.cart-rules.store');
Route::get('cart-rules/copy/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@copy')->defaults('_config', [ Route::get('cart-rules/copy/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@copy')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.edit', 'view' => 'admin::marketing.promotions.cart-rules.edit',
])->name('admin.cart-rules.copy'); ])->name('admin.cart-rules.copy');
Route::get('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@edit')->defaults('_config', [ Route::get('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@edit')->defaults('_config', [
'view' => 'admin::promotions.cart-rules.edit', 'view' => 'admin::marketing.promotions.cart-rules.edit',
])->name('admin.cart-rules.edit'); ])->name('admin.cart-rules.edit');
Route::post('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@update')->defaults('_config', [ Route::post('cart-rules/edit/{id}', 'Webkul\CartRule\Http\Controllers\CartRuleController@update')->defaults('_config', [
@ -720,11 +703,11 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
//Catalog rules //Catalog rules
Route::get('catalog-rules', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@index')->defaults('_config', [ Route::get('catalog-rules', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@index')->defaults('_config', [
'view' => 'admin::promotions.catalog-rules.index', 'view' => 'admin::marketing.promotions.catalog-rules.index',
])->name('admin.catalog-rules.index'); ])->name('admin.catalog-rules.index');
Route::get('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@create')->defaults('_config', [ Route::get('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@create')->defaults('_config', [
'view' => 'admin::promotions.catalog-rules.create', 'view' => 'admin::marketing.promotions.catalog-rules.create',
])->name('admin.catalog-rules.create'); ])->name('admin.catalog-rules.create');
Route::post('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@store')->defaults('_config', [ Route::post('catalog-rules/create', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@store')->defaults('_config', [
@ -732,7 +715,7 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
])->name('admin.catalog-rules.store'); ])->name('admin.catalog-rules.store');
Route::get('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@edit')->defaults('_config', [ Route::get('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@edit')->defaults('_config', [
'view' => 'admin::promotions.catalog-rules.edit', 'view' => 'admin::marketing.promotions.catalog-rules.edit',
])->name('admin.catalog-rules.edit'); ])->name('admin.catalog-rules.edit');
Route::post('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@update')->defaults('_config', [ Route::post('catalog-rules/edit/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@update')->defaults('_config', [
@ -740,6 +723,95 @@ Route::group(['middleware' => ['web', 'admin_locale']], function () {
])->name('admin.catalog-rules.update'); ])->name('admin.catalog-rules.update');
Route::post('catalog-rules/delete/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@destroy')->name('admin.catalog-rules.delete'); Route::post('catalog-rules/delete/{id}', 'Webkul\CatalogRule\Http\Controllers\CatalogRuleController@destroy')->name('admin.catalog-rules.delete');
//Marketing campaigns routes
Route::get('campaigns', 'Webkul\Marketing\Http\Controllers\CampaignController@index')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.campaigns.index',
])->name('admin.campaigns.index');
Route::get('campaigns/create', 'Webkul\Marketing\Http\Controllers\CampaignController@create')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.campaigns.create',
])->name('admin.campaigns.create');
Route::post('campaigns/create', 'Webkul\Marketing\Http\Controllers\CampaignController@store')->defaults('_config', [
'redirect' => 'admin.campaigns.index',
])->name('admin.campaigns.store');
Route::get('campaigns/edit/{id}', 'Webkul\Marketing\Http\Controllers\CampaignController@edit')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.campaigns.edit',
])->name('admin.campaigns.edit');
Route::post('campaigns/edit/{id}', 'Webkul\Marketing\Http\Controllers\CampaignController@update')->defaults('_config', [
'redirect' => 'admin.campaigns.index',
])->name('admin.campaigns.update');
Route::post('campaigns/delete/{id}', 'Webkul\Marketing\Http\Controllers\CampaignController@destroy')->name('admin.campaigns.delete');
//Marketing emails templates routes
Route::get('email-templates', 'Webkul\Marketing\Http\Controllers\TemplateController@index')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.templates.index',
])->name('admin.email-templates.index');
Route::get('email-templates/create', 'Webkul\Marketing\Http\Controllers\TemplateController@create')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.templates.create',
])->name('admin.email-templates.create');
Route::post('email-templates/create', 'Webkul\Marketing\Http\Controllers\TemplateController@store')->defaults('_config', [
'redirect' => 'admin.email-templates.index',
])->name('admin.email-templates.store');
Route::get('email-templates/edit/{id}', 'Webkul\Marketing\Http\Controllers\TemplateController@edit')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.templates.edit',
])->name('admin.email-templates.edit');
Route::post('email-templates/edit/{id}', 'Webkul\Marketing\Http\Controllers\TemplateController@update')->defaults('_config', [
'redirect' => 'admin.email-templates.index',
])->name('admin.email-templates.update');
Route::post('email-templates/delete/{id}', 'Webkul\Marketing\Http\Controllers\TemplateController@destroy')->name('admin.email-templates.delete');
//Marketing events routes
Route::get('events', 'Webkul\Marketing\Http\Controllers\EventController@index')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.events.index',
])->name('admin.events.index');
Route::get('events/create', 'Webkul\Marketing\Http\Controllers\EventController@create')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.events.create',
])->name('admin.events.create');
Route::post('events/create', 'Webkul\Marketing\Http\Controllers\EventController@store')->defaults('_config', [
'redirect' => 'admin.events.index',
])->name('admin.events.store');
Route::get('events/edit/{id}', 'Webkul\Marketing\Http\Controllers\EventController@edit')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.events.edit',
])->name('admin.events.edit');
Route::post('events/edit/{id}', 'Webkul\Marketing\Http\Controllers\EventController@update')->defaults('_config', [
'redirect' => 'admin.events.index',
])->name('admin.events.update');
Route::post('events/delete/{id}', 'Webkul\Marketing\Http\Controllers\EventController@destroy')->name('admin.events.delete');
// Admin Store Front Settings Route
Route::get('/subscribers', 'Webkul\Core\Http\Controllers\SubscriptionController@index')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.subscribers.index',
])->name('admin.customers.subscribers.index');
//destroy a newsletter subscription item
Route::post('subscribers/delete/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@destroy')->name('admin.customers.subscribers.delete');
Route::get('subscribers/edit/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@edit')->defaults('_config', [
'view' => 'admin::marketing.email-marketing.subscribers.edit',
])->name('admin.customers.subscribers.edit');
Route::put('subscribers/update/{id}', 'Webkul\Core\Http\Controllers\SubscriptionController@update')->defaults('_config', [
'redirect' => 'admin.customers.subscribers.index',
])->name('admin.customers.subscribers.update');
}); });
Route::prefix('cms')->group(function () { Route::prefix('cms')->group(function () {

View File

@ -75,7 +75,11 @@ return [
'tax-categories' => 'فئات الضرائب', 'tax-categories' => 'فئات الضرائب',
'tax-rates' => 'المعدلات الضريبية', 'tax-rates' => 'المعدلات الضريبية',
'refunds' => 'المبالغ المستردة', 'refunds' => 'المبالغ المستردة',
'marketing' => 'Marketing',
'promotions' => 'الترقيات', 'promotions' => 'الترقيات',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'خصم', 'discount' => 'خصم',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -111,6 +115,7 @@ return [
'edit' => 'تعديل', 'edit' => 'تعديل',
'create' => 'أضف', 'create' => 'أضف',
'delete' => 'حذف', 'delete' => 'حذف',
'marketing' => 'Marketing',
'promotions' => 'الترقيات', 'promotions' => 'الترقيات',
'cart-rules' => 'قواعد سلة التسوق', 'cart-rules' => 'قواعد سلة التسوق',
'catalog-rules' => 'قواعد الكتالوج', 'catalog-rules' => 'قواعد الكتالوج',
@ -1130,6 +1135,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'إذهب إلى البيت', 'go-to-home' => 'إذهب إلى البيت',
'in-maitainace' => 'في الصيانة', 'in-maitainace' => 'في الصيانة',

View File

@ -72,9 +72,13 @@ return [
'roles' => 'Rollen', 'roles' => 'Rollen',
'sliders' => 'Slider', 'sliders' => 'Slider',
'taxes' => 'Steuern', 'taxes' => 'Steuern',
'marketing' => 'Marketing',
'promotions' => 'Promotions',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'tax-categories' => 'Steuer-Kategorien', 'tax-categories' => 'Steuer-Kategorien',
'tax-rates' => 'Steuersätze', 'tax-rates' => 'Steuersätze',
'promotions' => 'Promotions',
'discount' => 'Rabatt', 'discount' => 'Rabatt',
'cms' => 'CMS', 'cms' => 'CMS',
], ],
@ -110,6 +114,7 @@ return [
'edit' => 'Bearbeiten', 'edit' => 'Bearbeiten',
'create' => 'Hinzufügen', 'create' => 'Hinzufügen',
'delete' => 'Löschen', 'delete' => 'Löschen',
'marketing' => 'Marketing',
'promotions' => 'Promotions', 'promotions' => 'Promotions',
'cart-rules' => 'Warenkorbregeln', 'cart-rules' => 'Warenkorbregeln',
'catalog-rules' => 'Katalogregeln', 'catalog-rules' => 'Katalogregeln',
@ -1130,6 +1135,69 @@ return [
'attribute_family' => 'Attributgruppe', 'attribute_family' => 'Attributgruppe',
], ],
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => 'error' =>
[ [
'go-to-home' => 'HOME ÖFFNEN', 'go-to-home' => 'HOME ÖFFNEN',

View File

@ -75,7 +75,12 @@ return [
'taxes' => 'Taxes', 'taxes' => 'Taxes',
'tax-categories' => 'Tax Categories', 'tax-categories' => 'Tax Categories',
'tax-rates' => 'Tax Rates', 'tax-rates' => 'Tax Rates',
'marketing' => 'Marketing',
'promotions' => 'Promotions', 'promotions' => 'Promotions',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'events' => 'Events',
'discount' => 'Discount', 'discount' => 'Discount',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -111,9 +116,15 @@ return [
'edit' => 'Edit', 'edit' => 'Edit',
'create' => 'Add', 'create' => 'Add',
'delete' => 'Delete', 'delete' => 'Delete',
'marketing' => 'Marketing',
'promotions' => 'Promotions', 'promotions' => 'Promotions',
'cart-rules' => 'Cart Rules', 'cart-rules' => 'Cart Rules',
'catalog-rules' => 'Catalog Rules', 'catalog-rules' => 'Catalog Rules',
'email-marketing' => 'Email Marketing',
'email-templates' => 'Email Templates',
'campaigns' => 'Campaigns',
'subscribers' => 'Newsletter Subscribers',
'events' => 'Events'
], ],
'dashboard' => [ 'dashboard' => [
@ -213,6 +224,7 @@ return [
'end' => 'End', 'end' => 'End',
'active' => 'Active', 'active' => 'Active',
'inactive' => 'Inactive', 'inactive' => 'Inactive',
'draft' => 'Draft',
'true' => 'True', 'true' => 'True',
'false' => 'False', 'false' => 'False',
'approved' => 'Approved', 'approved' => 'Approved',
@ -227,7 +239,9 @@ return [
'view' => 'View', 'view' => 'View',
'rtl' => 'RTL', 'rtl' => 'RTL',
'ltr' => 'LTR', 'ltr' => 'LTR',
'update-status' => 'Update Status' 'update-status' => 'Update Status',
'subject' => 'Subject',
'date' => 'Date'
], ],
'account' => [ 'account' => [
@ -981,8 +995,8 @@ return [
], ],
'subscribers' => [ 'subscribers' => [
'title' => 'News Letter Subscribers', 'title' => 'Newsletter Subscribers',
'title-edit' => 'Edit News Letter Subscriber', 'title-edit' => 'Edit Newsletter Subscriber',
'email' => 'Email', 'email' => 'Email',
'is_subscribed' => 'Subscribed', 'is_subscribed' => 'Subscribed',
'edit-btn-title' => 'Update Subscriber', 'edit-btn-title' => 'Update Subscriber',
@ -1129,6 +1143,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'GO TO HOME', 'go-to-home' => 'GO TO HOME',
'in-maitainace' => 'In Maintenance', 'in-maitainace' => 'In Maintenance',
@ -1302,8 +1378,8 @@ return [
'money-transfer' => 'Money Transfer', 'money-transfer' => 'Money Transfer',
'paypal-standard' => 'PayPal Standard', 'paypal-standard' => 'PayPal Standard',
'business-account' => 'Business Account', 'business-account' => 'Business Account',
'newsletter' => 'NewsLetter Subscription', 'newsletter' => 'Newsletter Subscription',
'newsletter-subscription' => 'Allow NewsLetter Subscription', 'newsletter-subscription' => 'Allow Newsletter Subscription',
'email' => 'Email Verification', 'email' => 'Email Verification',
'email-verification' => 'Allow Email Verification', 'email-verification' => 'Allow Email Verification',
'sort_order' => 'Sort Order', 'sort_order' => 'Sort Order',

View File

@ -73,7 +73,11 @@ return [
'taxes' => 'Impuestos', 'taxes' => 'Impuestos',
'tax-categories' => 'Categorías de impuestos', 'tax-categories' => 'Categorías de impuestos',
'tax-rates' => 'Tasas de impuestos', 'tax-rates' => 'Tasas de impuestos',
'marketing' => 'Marketing',
'promotions' => 'Promociones', 'promotions' => 'Promociones',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'Descuento', 'discount' => 'Descuento',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -109,6 +113,7 @@ return [
'edit' => 'Editar', 'edit' => 'Editar',
'create' => 'Agregar', 'create' => 'Agregar',
'delete' => 'Borrar', 'delete' => 'Borrar',
'marketing' => 'Marketing',
'promotions' => 'Promociones', 'promotions' => 'Promociones',
'cart-rules' => 'Reglas del carrito', 'cart-rules' => 'Reglas del carrito',
'catalog-rules' => 'Reglas del catálogo', 'catalog-rules' => 'Reglas del catálogo',
@ -1122,6 +1127,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'REGRESAR AL INICIO', 'go-to-home' => 'REGRESAR AL INICIO',
'in-maitainace' => 'En mantenimiento', 'in-maitainace' => 'En mantenimiento',

View File

@ -74,7 +74,11 @@ return [
'taxes' => 'مالیات', 'taxes' => 'مالیات',
'tax-categories' => 'دسته بندی مالیات', 'tax-categories' => 'دسته بندی مالیات',
'tax-rates' => 'نرخ مالیات', 'tax-rates' => 'نرخ مالیات',
'promotion' => 'تبلیغات', 'marketing' => 'Marketing',
'promotions' => 'تبلیغات',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'تخفیف', 'discount' => 'تخفیف',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -110,7 +114,8 @@ return [
'edit' => 'ویاریش', 'edit' => 'ویاریش',
'create' => 'افزودن', 'create' => 'افزودن',
'delete' => 'حذف', 'delete' => 'حذف',
'promotion' => 'تبلیغات', 'marketing' => 'Marketing',
'promotions' => 'تبلیغات',
'cart-rules' => 'قوانین سبد خرید', 'cart-rules' => 'قوانین سبد خرید',
'catalog-rules' => 'قوانین فهرست', 'catalog-rules' => 'قوانین فهرست',
], ],
@ -992,7 +997,7 @@ return [
] ]
], ],
'promotion' => [ 'promotions' => [
'cart-rules' => [ 'cart-rules' => [
'title' => 'قوانین سبد خرید', 'title' => 'قوانین سبد خرید',
'add-title' => 'قانون سبد خرید را اضافه کنید', 'add-title' => 'قانون سبد خرید را اضافه کنید',
@ -1128,6 +1133,70 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'رفتن به خانه', 'go-to-home' => 'رفتن به خانه',
'in-maitainace' => 'در حال تعمیر و نگهداری', 'in-maitainace' => 'در حال تعمیر و نگهداری',

View File

@ -74,7 +74,11 @@ return [
'taxes' => 'IVA', 'taxes' => 'IVA',
'tax-categories' => 'Categorie IVA', 'tax-categories' => 'Categorie IVA',
'tax-rates' => 'Aliquote IVA', 'tax-rates' => 'Aliquote IVA',
'marketing' => 'Marketing',
'promotions' => 'Promozioni', 'promotions' => 'Promozioni',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'Sconti', 'discount' => 'Sconti',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -110,6 +114,7 @@ return [
'edit' => 'Modifica', 'edit' => 'Modifica',
'create' => 'Aggiungi', 'create' => 'Aggiungi',
'delete' => 'Elimina', 'delete' => 'Elimina',
'marketing' => 'Marketing',
'promotions' => 'Promozioni', 'promotions' => 'Promozioni',
'cart-rules' => 'Regole Carrello', 'cart-rules' => 'Regole Carrello',
'catalog-rules' => 'Regole Catalogo', 'catalog-rules' => 'Regole Catalogo',
@ -1133,6 +1138,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'TORNA A HOME', 'go-to-home' => 'TORNA A HOME',
'in-maitainace' => 'In Manutezione', 'in-maitainace' => 'In Manutezione',

View File

@ -74,7 +74,11 @@ return [
'taxes' => 'BTW', 'taxes' => 'BTW',
'tax-categories' => 'BTW-groepen', 'tax-categories' => 'BTW-groepen',
'tax-rates' => 'BTW-tarieven', 'tax-rates' => 'BTW-tarieven',
'marketing' => 'Marketing',
'promotions' => 'Promoties', 'promotions' => 'Promoties',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'Korting', 'discount' => 'Korting',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -110,6 +114,7 @@ return [
'edit' => 'Edit', 'edit' => 'Edit',
'create' => 'Add', 'create' => 'Add',
'delete' => 'Verwijder', 'delete' => 'Verwijder',
'marketing' => 'Marketing',
'promotions' => 'Promoties', 'promotions' => 'Promoties',
'cart-rules' => 'Cart Rules', 'cart-rules' => 'Cart Rules',
'catalog-rules' => 'Catalog Rules', 'catalog-rules' => 'Catalog Rules',
@ -1129,6 +1134,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'GA NAAR HUIS', 'go-to-home' => 'GA NAAR HUIS',
'in-maitainace' => 'In onderhoud', 'in-maitainace' => 'In onderhoud',

View File

@ -73,7 +73,11 @@ return [
'taxes' => 'Podatki', 'taxes' => 'Podatki',
'tax-categories' => 'Kategorie podatkowe', 'tax-categories' => 'Kategorie podatkowe',
'tax-rates' => 'Stawki podatkowe', 'tax-rates' => 'Stawki podatkowe',
'marketing' => 'Marketing',
'promotions' => 'Promocje', 'promotions' => 'Promocje',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'Rabat', 'discount' => 'Rabat',
'cms' => 'System CMS' 'cms' => 'System CMS'
], ],
@ -109,6 +113,7 @@ return [
'edit' => 'Edytuj', 'edit' => 'Edytuj',
'create' => 'Dodaj', 'create' => 'Dodaj',
'delete' => 'Usuń', 'delete' => 'Usuń',
'marketing' => 'Marketing',
'promotions' => 'Promocje', 'promotions' => 'Promocje',
'cart-rules' => 'Zasady koszyka', 'cart-rules' => 'Zasady koszyka',
'catalog-rules' => 'Zasady katalogu', 'catalog-rules' => 'Zasady katalogu',
@ -1130,6 +1135,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'IDŹ DO GŁÓWNEJ', 'go-to-home' => 'IDŹ DO GŁÓWNEJ',
'in-maitainace' => 'W konserwacji', 'in-maitainace' => 'W konserwacji',

View File

@ -74,7 +74,11 @@ return [
'taxes' => 'Impostos', 'taxes' => 'Impostos',
'tax-categories' => 'Categorias de Impostos', 'tax-categories' => 'Categorias de Impostos',
'tax-rates' => 'Impostos de Impostos', 'tax-rates' => 'Impostos de Impostos',
'promotion' => 'Promoções', 'marketing' => 'Marketing',
'promotions' => 'Promoções',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'Desconto', 'discount' => 'Desconto',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -110,6 +114,7 @@ return [
'edit' => 'Edit', 'edit' => 'Edit',
'create' => 'Add', 'create' => 'Add',
'delete' => 'Delete', 'delete' => 'Delete',
'marketing' => 'Marketing',
'promotions' => 'Promoções', 'promotions' => 'Promoções',
'cart-rules' => 'Regras do Carrinho', 'cart-rules' => 'Regras do Carrinho',
'catalog-rules' => 'Regras do Catálogo', 'catalog-rules' => 'Regras do Catálogo',
@ -993,7 +998,7 @@ return [
] ]
], ],
'promotion' => [ 'promotions' => [
'cart-rules' => [ 'cart-rules' => [
'title' => 'Regras do carrinho', 'title' => 'Regras do carrinho',
'add-title' => 'Adicionar regra de carrinho', 'add-title' => 'Adicionar regra de carrinho',
@ -1129,6 +1134,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'IR PARA PÁGINA INICIAL', 'go-to-home' => 'IR PARA PÁGINA INICIAL',
'in-maitainace' => 'Em manutenção', 'in-maitainace' => 'Em manutenção',

View File

@ -72,7 +72,11 @@ return [
'taxes' => 'Vergiler', 'taxes' => 'Vergiler',
'tax-categories' => 'Vergi Kategorileri', 'tax-categories' => 'Vergi Kategorileri',
'tax-rates' => 'Vergi Oranları', 'tax-rates' => 'Vergi Oranları',
'marketing' => 'Marketing',
'promotions' => 'Promosyon', 'promotions' => 'Promosyon',
'email-marketing' => 'Email Marketing',
'campaigns' => 'Campaigns',
'email-templates' => 'Email Templates',
'discount' => 'İndirim', 'discount' => 'İndirim',
'cms' => 'CMS' 'cms' => 'CMS'
], ],
@ -108,6 +112,7 @@ return [
'edit' => 'Düzenle', 'edit' => 'Düzenle',
'create' => 'Oluştur', 'create' => 'Oluştur',
'delete' => 'Sil', 'delete' => 'Sil',
'marketing' => 'Marketing',
'promotions' => 'Promosyonlar', 'promotions' => 'Promosyonlar',
'cart-rules' => 'Alışveriş Sepeti Kuralları', 'cart-rules' => 'Alışveriş Sepeti Kuralları',
'catalog-rules' => 'Katalog Kuralları', 'catalog-rules' => 'Katalog Kuralları',
@ -1117,6 +1122,68 @@ return [
] ]
], ],
'marketing' => [
'templates' => [
'title' => 'Email Templates',
'add-title' => 'Add Email Template',
'edit-title' => 'Edit Email Template',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'draft' => 'Draft',
'content' => 'Content',
'create-success' => 'Email template created successfully.',
'update-success' => 'Email template updated successfully.',
'delete-success' => 'Email template deleted successfully',
],
'campaigns' => [
'title' => 'Campaigns',
'add-title' => 'Add Campaign',
'edit-title' => 'Edit Campaign',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'status' => 'Status',
'active' => 'Active',
'inactive' => 'Inactive',
'subject' => 'Subject',
'email-template' => 'Email Template',
'audience' => 'Audience',
'channel' => 'Channel',
'customer-group' => 'Customer Group',
'schedule' => 'Schedule',
'schedule-type' => 'Schedule Type',
'once' => 'Once',
'events' => 'Events',
'schedule-date' => 'Schedule Date',
'spooling' => 'Spooling',
'event' => 'Event',
'birthday' => 'Birthday',
'create-success' => 'Campaign created successfully.',
'update-success' => 'Campaign updated successfully.',
'delete-success' => 'Campaign deleted successfully',
],
'events' => [
'title' => 'Events',
'add-title' => 'Add Event',
'edit-title' => 'Edit Event',
'save-btn-title' => 'Save',
'general' => 'General',
'name' => 'Name',
'description' => 'Description',
'date' => 'Date',
'create-success' => 'Event created successfully.',
'update-success' => 'Event updated successfully.',
'delete-success' => 'Event deleted successfully.',
'edit-error' => 'Can not edit this event.'
]
],
'error' => [ 'error' => [
'go-to-home' => 'ANA SAYFAYA GİT', 'go-to-home' => 'ANA SAYFAYA GİT',
'in-maitainace' => 'Bakım Modunda', 'in-maitainace' => 'Bakım Modunda',

View File

@ -0,0 +1,124 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.campaigns.add-title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.campaigns.store') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
{{ __('admin::app.marketing.campaigns.add-title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.campaigns.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
<accordian :title="'{{ __('admin::app.marketing.campaigns.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.marketing.campaigns.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('subject') ? 'has-error' : '']">
<label for="subject" class="required">{{ __('admin::app.marketing.campaigns.subject') }}</label>
<input v-validate="'required'" class="control" id="subject" name="subject" value="{{ old('subject') }}" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.subject') }}&quot;"/>
<span class="control-error" v-if="errors.has('subject')">@{{ errors.first('subject') }}</span>
</div>
<div class="control-group" :class="[errors.has('marketing_event_id') ? 'has-error' : '']">
<label for="event" class="required">{{ __('admin::app.marketing.campaigns.event') }}</label>
<select class="control" v-validate="'required'" id="marketing_event_id" name="marketing_event_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.event') }}&quot;">
@foreach (app('Webkul\Marketing\Repositories\EventRepository')->all() as $event)
<option value="{{ $event->id }}" {{ old('marketing_event_id') == $event->id ? 'selected' : '' }}>
{{ $event->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('marketing_event_id')">@{{ errors.first('marketing_event_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('marketing_template_id') ? 'has-error' : '']">
<label for="marketing_template_id" class="required">{{ __('admin::app.marketing.campaigns.email-template') }}</label>
<select v-validate="'required'" class="control" id="marketing_template_id" name="marketing_template_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.email-template') }}&quot;">
@foreach (app('Webkul\Marketing\Repositories\TemplateRepository')->all() as $template)
<option value="{{ $template->id }}" {{ old('marketing_template_id') == $template->id ? 'selected' : '' }}>
{{ $template->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('marketing_template_id')">@{{ errors.first('marketing_template_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
<label for="status" class="required">{{ __('admin::app.marketing.campaigns.status') }}</label>
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.display-mode') }}&quot;">
<option value="0" {{ old('status') == 0 ? 'selected' : '' }}>
{{ __('admin::app.marketing.campaigns.inactive') }}
</option>
<option value="1" {{ old('status') == 1 ? 'selected' : '' }}>
{{ __('admin::app.marketing.campaigns.active') }}
</option>
</select>
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
</div>
</div>
</accordian>
<accordian :title="'{{ __('admin::app.marketing.campaigns.audience') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
<label for="channel_id" class="required">{{ __('admin::app.marketing.campaigns.channel') }}</label>
<select v-validate="'required'" class="control" id="channel_id" name="channel_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.channel') }}&quot;">
@foreach (app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
<option value="{{ $channel->id }}" {{ old('channel_id') == $channel->id ? 'selected' : '' }}>
{{ $channel->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel_id')">@{{ errors.first('channel_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('customer_group_id') ? 'has-error' : '']">
<label for="customer_group_id" class="required">{{ __('admin::app.marketing.campaigns.customer-group') }}</label>
<select v-validate="'required'" class="control" id="customer_group_id" name="customer_group_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.customer-group') }}&quot;">
@foreach (app('Webkul\Customer\Repositories\CustomerGroupRepository')->all() as $customerGroup)
<option value="{{ $customerGroup->id }}" {{ old('customer_group_id') == $customerGroup->id ? 'selected' : '' }}>
{{ $customerGroup->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('customer_group_id')">@{{ errors.first('customer_group_id') }}</span>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,129 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.campaigns.edit-title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.campaigns.update', $campaign->id) }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
{{ __('admin::app.marketing.campaigns.edit-title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.campaigns.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
<accordian :title="'{{ __('admin::app.marketing.campaigns.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.marketing.campaigns.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $campaign->name }}" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('subject') ? 'has-error' : '']">
<label for="subject" class="required">{{ __('admin::app.marketing.campaigns.subject') }}</label>
<input v-validate="'required'" class="control" id="subject" name="subject" value="{{ old('subject') ?: $campaign->subject }}" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.subject') }}&quot;"/>
<span class="control-error" v-if="errors.has('subject')">@{{ errors.first('subject') }}</span>
</div>
<div class="control-group" :class="[errors.has('marketing_event_id') ? 'has-error' : '']">
<label for="marketing_event_id" class="required">{{ __('admin::app.marketing.campaigns.event') }}</label>
<?php $selectedOption = old('marketing_event_id') ?: $campaign->marketing_event_id ?>
<select class="control" v-validate="'required'" id="marketing_event_id" name="marketing_event_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.event') }}&quot;">
@foreach (app('Webkul\Marketing\Repositories\EventRepository')->all() as $event)
<option value="{{ $event->id }}" {{ $selectedOption == $event->id ? 'selected' : '' }}>
{{ $event->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('marketing_event_id')">@{{ errors.first('marketing_event_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('marketing_template_id') ? 'has-error' : '']">
<label for="marketing_template_id" class="required">{{ __('admin::app.marketing.campaigns.email-template') }}</label>
<?php $selectedOption = old('marketing_template_id') ?: $campaign->marketing_template_id ?>
<select v-validate="'required'" class="control" id="marketing_template_id" name="marketing_template_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.email-template') }}&quot;">
@foreach (app('Webkul\Marketing\Repositories\TemplateRepository')->all() as $template)
<option value="{{ $template->id }}" {{ $selectedOption == $template->id ? 'selected' : '' }}>
{{ $template->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('marketing_template_id')">@{{ errors.first('marketing_template_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
<label for="status" class="required">{{ __('admin::app.marketing.campaigns.status') }}</label>
<?php $selectedOption = old('status') ?: $campaign->status ?>
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.display-mode') }}&quot;">
<option value="0" {{ $selectedOption == 0 ? 'selected' : '' }}>
{{ __('admin::app.marketing.campaigns.inactive') }}
</option>
<option value="1" {{ $selectedOption == 1 ? 'selected' : '' }}>
{{ __('admin::app.marketing.campaigns.active') }}
</option>
</select>
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
</div>
</div>
</accordian>
<accordian :title="'{{ __('admin::app.marketing.campaigns.audience') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('channel_id') ? 'has-error' : '']">
<label for="channel_id" class="required">{{ __('admin::app.marketing.campaigns.channel') }}</label>
<?php $selectedOption = old('channel_id') ?: $campaign->channel_id ?>
<select v-validate="'required'" class="control" id="channel_id" name="channel_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.channel') }}&quot;">
@foreach (app('Webkul\Core\Repositories\ChannelRepository')->all() as $channel)
<option value="{{ $channel->id }}" {{ $selectedOption == $channel->id ? 'selected' : '' }}>
{{ $channel->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('channel_id')">@{{ errors.first('channel_id') }}</span>
</div>
<div class="control-group" :class="[errors.has('customer_group_id') ? 'has-error' : '']">
<label for="customer_group_id" class="required">{{ __('admin::app.marketing.campaigns.customer-group') }}</label>
<?php $selectedOption = old('customer_group_id') ?: $campaign->customer_group_id ?>
<select v-validate="'required'" class="control" id="customer_group_id" name="customer_group_id" data-vv-as="&quot;{{ __('admin::app.marketing.campaigns.customer-group') }}&quot;">
@foreach (app('Webkul\Customer\Repositories\CustomerGroupRepository')->all() as $customerGroup)
<option value="{{ $customerGroup->id }}" {{ $selectedOption == $customerGroup->id ? 'selected' : '' }}>
{{ $customerGroup->name }}
</option>
@endforeach
</select>
<span class="control-error" v-if="errors.has('customer_group_id')">@{{ errors.first('customer_group_id') }}</span>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,27 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.campaigns.title') }}
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.marketing.campaigns.title') }}</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.campaigns.create') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.campaigns.add-title') }}
</a>
</div>
</div>
<div class="page-content">
{!! app('Webkul\Admin\DataGrids\CampaignDataGrid')->render() !!}
</div>
</div>
@stop

View File

@ -0,0 +1,64 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.events.add-title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.events.store') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
{{ __('admin::app.marketing.events.add-title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.events.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.marketing.events.create.before') !!}
<accordian :title="'{{ __('admin::app.marketing.events.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.marketing.events.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as="&quot;{{ __('admin::app.marketing.events.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.marketing.events.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="description" data-vv-as="&quot;{{ __('admin::app.marketing.events.description') }}&quot;">{{ old('description') }}</textarea>
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
</div>
<div class="control-group" :class="[errors.has('date') ? 'has-error' : '']">
<label for="date" class="required">{{ __('admin::app.marketing.events.date') }}</label>
<date>
<input type="text" name="date" class="control" v-validate="'required'" value="{{ old('date') }}" data-vv-as="&quot;{{ __('admin::app.marketing.events.date') }}&quot;">
</date>
<span class="control-error" v-if="errors.has('date')">@{{ errors.first('date') }}</span>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.events.create.after') !!}
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,65 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.events.edit-title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.events.update', $event->id) }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
{{ __('admin::app.marketing.events.edit-title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.events.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.marketing.events.create.before') !!}
<accordian :title="'{{ __('admin::app.marketing.events.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.marketing.events.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $event->name }}" data-vv-as="&quot;{{ __('admin::app.marketing.events.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.marketing.events.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="description" data-vv-as="&quot;{{ __('admin::app.marketing.events.description') }}&quot;">{{ old('description') ?: $event->description }}</textarea>
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
</div>
<div class="control-group" :class="[errors.has('date') ? 'has-error' : '']">
<label for="date" class="required">{{ __('admin::app.marketing.events.date') }}</label>
<date>
<input type="text" name="date" class="control" v-validate="'required'" value="{{ old('date') ?: $event->date }}" data-vv-as="&quot;{{ __('admin::app.marketing.events.date') }}&quot;">
</date>
<span class="control-error" v-if="errors.has('date')">@{{ errors.first('date') }}</span>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.events.create.after') !!}
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,27 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.events.title') }}
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.marketing.events.title') }}</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.events.create') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.events.add-title') }}
</a>
</div>
</div>
<div class="page-content">
{!! app('Webkul\Admin\DataGrids\EventDataGrid')->render() !!}
</div>
</div>
@stop

View File

@ -0,0 +1,89 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.templates.add-title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.email-templates.store') }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
{{ __('admin::app.marketing.templates.add-title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.templates.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
<accordian :title="'{{ __('admin::app.marketing.templates.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.marketing.templates.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') }}" data-vv-as="&quot;{{ __('admin::app.marketing.templates.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
<label for="status" class="required">{{ __('admin::app.marketing.templates.status') }}</label>
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as="&quot;{{ __('admin::app.marketing.templates.display-mode') }}&quot;">
<option value="active" {{ old('status') == 'active' ? 'selected' : '' }}>
{{ __('admin::app.marketing.templates.active') }}
</option>
<option value="inactive" {{ old('status') == 'inactive' ? 'selected' : '' }}>
{{ __('admin::app.marketing.templates.inactive') }}
</option>
<option value="draft" {{ old('status') == 'draft' ? 'selected' : '' }}>
{{ __('admin::app.marketing.templates.draft') }}
</option>
</select>
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
</div>
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
<label for="content" class="required">{{ __('admin::app.marketing.templates.content') }}</label>
<textarea v-validate="'required'" class="control" id="content" name="content" data-vv-as="&quot;{{ __('admin::app.marketing.templates.content') }}&quot;">{{ old('content') }}</textarea>
<span class="control-error" v-if="errors.has('content')">@{{ errors.first('content') }}</span>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
</div>
</div>
</form>
</div>
@stop
@push('scripts')
<script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script>
<script>
$(document).ready(function () {
tinymce.init({
selector: 'textarea#content',
height: 200,
width: "100%",
plugins: 'image imagetools media wordcount save fullscreen code table lists link hr',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor link hr | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | code | table',
image_advtab: true
});
});
</script>
@endpush

View File

@ -0,0 +1,90 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.templates.edit-title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="{{ route('admin.email-templates.update', $template->id) }}" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="window.location = history.length > 1 ? document.referrer : '{{ route('admin.dashboard.index') }}'"></i>
{{ __('admin::app.marketing.templates.edit-title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.templates.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
{!! view_render_event('bagisto.admin.marketing.templates.create.before') !!}
<accordian :title="'{{ __('admin::app.marketing.templates.general') }}'" :active="true">
<div slot="body">
<div class="control-group" :class="[errors.has('name') ? 'has-error' : '']">
<label for="name" class="required">{{ __('admin::app.marketing.templates.name') }}</label>
<input v-validate="'required'" class="control" id="name" name="name" value="{{ old('name') ?: $template->name }}" data-vv-as="&quot;{{ __('admin::app.marketing.templates.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('status') ? 'has-error' : '']">
<label for="status" class="required">{{ __('admin::app.marketing.templates.status') }}</label>
<?php $selectedOption = old('status') ?: $template->status ?>
<select class="control" v-validate="'required'" id="status" name="status" data-vv-as="&quot;{{ __('admin::app.marketing.templates.display-mode') }}&quot;">
<option value="active" {{ $selectedOption == 'active' ? 'selected' : '' }}>
{{ __('admin::app.marketing.templates.active') }}
</option>
<option value="inactive" {{ $selectedOption == 'inactive' ? 'selected' : '' }}>
{{ __('admin::app.marketing.templates.inactive') }}
</option>
<option value="draft" {{ $selectedOption == 'draft' ? 'selected' : '' }}>
{{ __('admin::app.marketing.templates.draft') }}
</option>
</select>
<span class="control-error" v-if="errors.has('status')">@{{ errors.first('status') }}</span>
</div>
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
<label for="content" class="required">{{ __('admin::app.marketing.templates.content') }}</label>
<textarea v-validate="'required'" class="control" id="content" name="content" data-vv-as="&quot;{{ __('admin::app.marketing.templates.content') }}&quot;">{{ old('content') ?: $template->content }}</textarea>
<span class="control-error" v-if="errors.has('content')">@{{ errors.first('content') }}</span>
</div>
</div>
</accordian>
{!! view_render_event('bagisto.admin.marketing.templates.create.after') !!}
</div>
</div>
</form>
</div>
@stop
@push('scripts')
<script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script>
<script>
$(document).ready(function () {
tinymce.init({
selector: 'textarea#content',
height: 200,
width: "100%",
plugins: 'image imagetools media wordcount save fullscreen code table lists link hr',
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor link hr | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | code | table',
image_advtab: true
});
});
</script>
@endpush

View File

@ -0,0 +1,27 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.marketing.templates.title') }}
@stop
@section('content')
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.marketing.templates.title') }}</h1>
</div>
<div class="page-action">
<a href="{{ route('admin.email-templates.create') }}" class="btn btn-lg btn-primary">
{{ __('admin::app.marketing.templates.add-title') }}
</a>
</div>
</div>
<div class="page-content">
{!! app('Webkul\Admin\DataGrids\EmailTemplateDataGrid')->render() !!}
</div>
</div>
@stop

View File

@ -24,6 +24,7 @@ return [
\Webkul\CMS\Providers\ModuleServiceProvider::class, \Webkul\CMS\Providers\ModuleServiceProvider::class,
\Webkul\Customer\Providers\ModuleServiceProvider::class, \Webkul\Customer\Providers\ModuleServiceProvider::class,
\Webkul\Inventory\Providers\ModuleServiceProvider::class, \Webkul\Inventory\Providers\ModuleServiceProvider::class,
\Webkul\Marketing\Providers\ModuleServiceProvider::class,
\Webkul\Payment\Providers\ModuleServiceProvider::class, \Webkul\Payment\Providers\ModuleServiceProvider::class,
\Webkul\Paypal\Providers\ModuleServiceProvider::class, \Webkul\Paypal\Providers\ModuleServiceProvider::class,
\Webkul\Product\Providers\ModuleServiceProvider::class, \Webkul\Product\Providers\ModuleServiceProvider::class,

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddCustomerIdColumnInSubscribersListTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('subscribers_list', function (Blueprint $table) {
$table->integer('customer_id')->unsigned()->nullable();
$table->foreign('customer_id')->references('id')->on('customers')->onDelete('set null');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('subscribers_list', function (Blueprint $table) {
//
});
}
}

View File

@ -19,6 +19,7 @@ class SubscribersList extends Model implements SubscribersListContract
'email', 'email',
'is_subscribed', 'is_subscribed',
'token', 'token',
'customer_id',
'channel_id', 'channel_id',
]; ];

View File

@ -4,8 +4,11 @@ namespace Webkul\Customer\Http\Controllers;
use Hash; use Hash;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Mail;
use Webkul\Shop\Mail\SubscriptionEmail;
use Webkul\Customer\Repositories\CustomerRepository; use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Product\Repositories\ProductReviewRepository; use Webkul\Product\Repositories\ProductReviewRepository;
use Webkul\Core\Repositories\SubscribersListRepository;
class CustomerController extends Controller class CustomerController extends Controller
{ {
@ -30,16 +33,25 @@ class CustomerController extends Controller
*/ */
protected $productReviewRepository; protected $productReviewRepository;
/**
* SubscribersListRepository
*
* @var \Webkul\Core\Repositories\SubscribersListRepository
*/
protected $subscriptionRepository;
/** /**
* Create a new controller instance. * Create a new controller instance.
* *
* @param \Webkul\Customer\Repositories\CustomerRepository $customer * @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository
* @param \Webkul\Product\Repositories\ProductReviewRepository $productReview * @param \Webkul\Product\Repositories\ProductReviewRepository $productReviewRepository
* @param \Webkul\Core\Repositories\SubscribersListRepository $subscriptionRepository
* @return void * @return void
*/ */
public function __construct( public function __construct(
CustomerRepository $customerRepository, CustomerRepository $customerRepository,
ProductReviewRepository $productReviewRepository ProductReviewRepository $productReviewRepository,
SubscribersListRepository $subscriptionRepository
) )
{ {
$this->middleware('customer'); $this->middleware('customer');
@ -49,6 +61,8 @@ class CustomerController extends Controller
$this->customerRepository = $customerRepository; $this->customerRepository = $customerRepository;
$this->productReviewRepository = $productReviewRepository; $this->productReviewRepository = $productReviewRepository;
$this->subscriptionRepository = $subscriptionRepository;
} }
/** /**
@ -102,10 +116,13 @@ class CustomerController extends Controller
unset($data['date_of_birth']); unset($data['date_of_birth']);
} }
$data['subscribed_to_news_letter'] = isset($data['subscribed_to_news_letter']) ? 1 : 0;
if (isset ($data['oldpassword'])) { if (isset ($data['oldpassword'])) {
if ($data['oldpassword'] != "" || $data['oldpassword'] != null) { if ($data['oldpassword'] != "" || $data['oldpassword'] != null) {
if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) { if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) {
$isPasswordChanged = true; $isPasswordChanged = true;
$data['password'] = bcrypt($data['password']); $data['password'] = bcrypt($data['password']);
} else { } else {
session()->flash('warning', trans('shop::app.customer.account.profile.unmatch')); session()->flash('warning', trans('shop::app.customer.account.profile.unmatch'));
@ -120,13 +137,47 @@ class CustomerController extends Controller
Event::dispatch('customer.update.before'); Event::dispatch('customer.update.before');
if ($customer = $this->customerRepository->update($data, $id)) { if ($customer = $this->customerRepository->update($data, $id)) {
if ($isPasswordChanged) { if ($isPasswordChanged) {
Event::dispatch('user.admin.update-password', $customer); Event::dispatch('user.admin.update-password', $customer);
} }
Event::dispatch('customer.update.after', $customer); Event::dispatch('customer.update.after', $customer);
if ($data['subscribed_to_news_letter']) {
$subscription = $this->subscriptionRepository->findOneWhere(['email' => $data['email']]);
if ($subscription) {
$this->subscriptionRepository->update([
'customer_id' => $customer->id,
'is_subscribed' => 1,
], $subscription->id);
} else {
$this->subscriptionRepository->create([
'email' => $data['email'],
'customer_id' => $customer->id,
'channel_id' => core()->getCurrentChannel()->id,
'is_subscribed' => 1,
'token' => $token = uniqid(),
]);
try {
Mail::queue(new SubscriptionEmail([
'email' => $data['email'],
'token' => $token,
]));
} catch (\Exception $e) { }
}
} else {
$subscription = $this->subscriptionRepository->findOneWhere(['email' => $data['email']]);
if ($subscription) {
$this->subscriptionRepository->update([
'customer_id' => $customer->id,
'is_subscribed' => 0,
], $subscription->id);
}
}
Session()->flash('success', trans('shop::app.customer.account.profile.edit-success')); Session()->flash('success', trans('shop::app.customer.account.profile.edit-success'));
return redirect()->route($this->_config['redirect']); return redirect()->route($this->_config['redirect']);

View File

@ -3,13 +3,14 @@
namespace Webkul\Customer\Http\Controllers; namespace Webkul\Customer\Http\Controllers;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Event; use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Mail; use Illuminate\Support\Facades\Mail;
use Webkul\Customer\Mail\RegistrationEmail; use Webkul\Customer\Mail\RegistrationEmail;
use Webkul\Customer\Mail\VerificationEmail; use Webkul\Customer\Mail\VerificationEmail;
use Webkul\Shop\Mail\SubscriptionEmail;
use Webkul\Customer\Repositories\CustomerRepository; use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Repositories\CustomerGroupRepository; use Webkul\Customer\Repositories\CustomerGroupRepository;
use Webkul\Core\Repositories\SubscribersListRepository;
use Cookie; use Cookie;
class RegistrationController extends Controller class RegistrationController extends Controller
@ -35,17 +36,26 @@ class RegistrationController extends Controller
*/ */
protected $customerGroupRepository; protected $customerGroupRepository;
/**
* SubscribersListRepository
*
* @var \Webkul\Core\Repositories\SubscribersListRepository
*/
protected $subscriptionRepository;
/** /**
* Create a new Repository instance. * Create a new Repository instance.
* *
* @param \Webkul\Customer\Repositories\CustomerRepository $customer * @param \Webkul\Customer\Repositories\CustomerRepository $customer
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository * @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository
* @param \Webkul\Core\Repositories\SubscribersListRepository $subscriptionRepository
* *
* @return void * @return void
*/ */
public function __construct( public function __construct(
CustomerRepository $customerRepository, CustomerRepository $customerRepository,
CustomerGroupRepository $customerGroupRepository CustomerGroupRepository $customerGroupRepository,
SubscribersListRepository $subscriptionRepository
) )
{ {
$this->_config = request('_config'); $this->_config = request('_config');
@ -53,6 +63,8 @@ class RegistrationController extends Controller
$this->customerRepository = $customerRepository; $this->customerRepository = $customerRepository;
$this->customerGroupRepository = $customerGroupRepository; $this->customerGroupRepository = $customerGroupRepository;
$this->subscriptionRepository = $subscriptionRepository;
} }
/** /**
@ -79,22 +91,13 @@ class RegistrationController extends Controller
'password' => 'confirmed|min:6|required', 'password' => 'confirmed|min:6|required',
]); ]);
$data = request()->input(); $data = array_merge(request()->input(), [
'password' => bcrypt(request()->input('password')),
$data['password'] = bcrypt($data['password']); 'api_token' => Str::random(80),
$data['api_token'] = Str::random(80); 'is_verified' => core()->getConfigData('customer.settings.email.verification') ? 0 : 1,
'customer_group_id' => $this->customerGroupRepository->findOneWhere(['code' => 'general'])->id,
if (core()->getConfigData('customer.settings.email.verification')) { 'token' => md5(uniqid(rand(), true)),
$data['is_verified'] = 0; ]);
} else {
$data['is_verified'] = 1;
}
$data['customer_group_id'] = $this->customerGroupRepository->findOneWhere(['code' => 'general'])->id;
$verificationData['email'] = $data['email'];
$verificationData['token'] = md5(uniqid(rand(), true));
$data['token'] = $verificationData['token'];
Event::dispatch('customer.registration.before'); Event::dispatch('customer.registration.before');
@ -102,29 +105,59 @@ class RegistrationController extends Controller
Event::dispatch('customer.registration.after', $customer); Event::dispatch('customer.registration.after', $customer);
if ($customer) { if (! $customer) {
session()->flash('error', trans('shop::app.customer.signup-form.failed'));
return redirect()->back();
}
if (isset($data['is_subscribed'])) {
$subscription = $this->subscriptionRepository->findOneWhere(['email' => $data['email']]);
if ($subscription) {
$this->subscriptionRepository->update([
'customer_id' => $customer->id,
], $subscription->id);
} else {
$this->subscriptionRepository->create([
'email' => $data['email'],
'customer_id' => $customer->id,
'channel_id' => core()->getCurrentChannel()->id,
'is_subscribed' => 1,
'token' => $token = uniqid(),
]);
try {
Mail::queue(new SubscriptionEmail([
'email' => $data['email'],
'token' => $token,
]));
} catch (\Exception $e) { }
}
}
if (core()->getConfigData('customer.settings.email.verification')) { if (core()->getConfigData('customer.settings.email.verification')) {
try { try {
$configKey = 'emails.general.notifications.emails.general.notifications.verification'; if (core()->getConfigData('emails.general.notifications.emails.general.notifications.verification')) {
if (core()->getConfigData($configKey)) { Mail::queue(new VerificationEmail(['email' => $data['email'], 'token' => $data['token']]));
Mail::queue(new VerificationEmail($verificationData));
} }
session()->flash('success', trans('shop::app.customer.signup-form.success-verify')); session()->flash('success', trans('shop::app.customer.signup-form.success-verify'));
} catch (\Exception $e) { } catch (\Exception $e) {
report($e); report($e);
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent')); session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
} }
} else { } else {
try { try {
$configKey = 'emails.general.notifications.emails.general.notifications.registration'; if (core()->getConfigData('emails.general.notifications.emails.general.notifications.registration')) {
if (core()->getConfigData($configKey)) {
Mail::queue(new RegistrationEmail(request()->all())); Mail::queue(new RegistrationEmail(request()->all()));
} }
session()->flash('success', trans('shop::app.customer.signup-form.success-verify')); //customer registered successfully session()->flash('success', trans('shop::app.customer.signup-form.success-verify'));
} catch (\Exception $e) { } catch (\Exception $e) {
report($e); report($e);
session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent')); session()->flash('info', trans('shop::app.customer.signup-form.success-verify-email-unsent'));
} }
@ -132,11 +165,6 @@ class RegistrationController extends Controller
} }
return redirect()->route($this->_config['redirect']); return redirect()->route($this->_config['redirect']);
} else {
session()->flash('error', trans('shop::app.customer.signup-form.failed'));
return redirect()->back();
}
} }
/** /**
@ -166,8 +194,10 @@ class RegistrationController extends Controller
*/ */
public function resendVerificationEmail($email) public function resendVerificationEmail($email)
{ {
$verificationData['email'] = $email; $verificationData = [
$verificationData['token'] = md5(uniqid(rand(), true)); 'email' => $email,
'token' => md5(uniqid(rand(), true)),
];
$customer = $this->customerRepository->findOneByField('email', $email); $customer = $this->customerRepository->findOneByField('email', $email);
@ -185,6 +215,7 @@ class RegistrationController extends Controller
} }
} catch (\Exception $e) { } catch (\Exception $e) {
report($e); report($e);
session()->flash('error', trans('shop::app.customer.signup-form.verification-not-sent')); session()->flash('error', trans('shop::app.customer.signup-form.verification-not-sent'));
return redirect()->back(); return redirect()->back();

View File

@ -11,9 +11,9 @@ class CustomerGroup extends Model implements CustomerGroupContract
protected $fillable = ['name', 'code', 'is_user_defined']; protected $fillable = ['name', 'code', 'is_user_defined'];
/** /**
* Get the customer for this group. * Get the customers for this group.
*/ */
public function customer() public function customers()
{ {
return $this->hasMany(CustomerProxy::modelClass()); return $this->hasMany(CustomerProxy::modelClass());
} }

View File

@ -0,0 +1,53 @@
<?php
namespace Webkul\Marketing\Console\Commands;
use Illuminate\Console\Command;
use Webkul\Marketing\Helpers\Campaign;
class EmailsCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'campaign:process';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Process campaigns and send emails to the subscribed customers.';
/**
* Campaign object
*
* @var \Webkul\Marketing\Helpers\Campaign
*/
protected $campaignHelper;
/**
* Create a new command instance.
*
* @param \Webkul\Marketing\Repositories\Campaign $campaignHelper
* @return void
*/
public function __construct(Campaign $campaignHelper)
{
$this->campaignHelper = $campaignHelper;
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$this->campaignHelper->process();
}
}

View File

@ -0,0 +1,7 @@
<?php
namespace Webkul\Marketing\Contracts;
interface Campaign
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace Webkul\Marketing\Contracts;
interface Event
{
}

View File

@ -0,0 +1,7 @@
<?php
namespace Webkul\Marketing\Contracts;
interface Template
{
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMarketingTemplatesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('marketing_templates', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('status');
$table->text('content');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('marketing_templates');
}
}

View File

@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMarketingEventsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('marketing_events', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->text('description')->nullable();
$table->date('date')->nullable();
$table->timestamps();
});
DB::table('marketing_events')->insert([
'name' => 'Birthday',
'description' => 'Birthday',
]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('marketing_events');
}
}

View File

@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMarketingCampaignsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('marketing_campaigns', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('subject');
$table->boolean('status')->default(0);
$table->string('type');
$table->string('mail_to');
$table->string('spooling')->nullable();
$table->integer('channel_id')->unsigned()->nullable();
$table->foreign('channel_id')->references('id')->on('channels')->onDelete('set null');
$table->integer('customer_group_id')->unsigned()->nullable();
$table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('set null');
$table->integer('marketing_template_id')->unsigned()->nullable();
$table->foreign('marketing_template_id')->references('id')->on('marketing_templates')->onDelete('set null');
$table->integer('marketing_event_id')->unsigned()->nullable();
$table->foreign('marketing_event_id')->references('id')->on('marketing_events')->onDelete('set null');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('marketing_campaigns');
}
}

View File

@ -0,0 +1,134 @@
<?php
namespace Webkul\Marketing\Helpers;
use Carbon\Carbon;
use Illuminate\Support\Facades\Mail;
use Webkul\Marketing\Repositories\EventRepository;
use Webkul\Marketing\Repositories\CampaignRepository;
use Webkul\Marketing\Repositories\TemplateRepository;
use Webkul\Marketing\Mail\NewsletterMail;
class Campaign
{
/**
* EventRepository object
*
* @var \Webkul\Marketing\Repositories\EventRepository
*/
protected $eventRepository;
/**
* CampaignRepository object
*
* @var \Webkul\Marketing\Repositories\CampaignRepository
*/
protected $campaignRepository;
/**
* TemplateRepository object
*
* @var \Webkul\Marketing\Repositories\TemplateRepository
*/
protected $templateRepository;
/**
* Create a new helper instance.
*
* @param \Webkul\Marketing\Repositories\EventRepository $eventRepository
* @param \Webkul\Marketing\Repositories\CampaignRepository $campaignRepository
* @param \Webkul\Marketing\Repositories\TemplateRepository $templateRepository
*
* @return void
*/
public function __construct(
EventRepository $eventRepository,
CampaignRepository $campaignRepository,
CampaignRepository $templateRepository
)
{
$this->eventRepository = $eventRepository;
$this->campaignRepository = $campaignRepository;
$this->templateRepository = $templateRepository;
}
/**
* @return void
*/
public function process(): void
{
$campaigns = $this->campaignRepository->getModel()
->leftJoin('marketing_events', 'marketing_campaigns.marketing_event_id', 'marketing_events.id')
->select('marketing_campaigns.*')
->where('status', 1)
->where(function ($query) {
$query->where('marketing_events.date', Carbon::now()->format('Y-m-d'))
->orWhereNull('marketing_events.date');
})
->get();
foreach ($campaigns as $campaign) {
if ($campaign->event->name == 'Birthday') {
$emails = $this->getBirthdayEmails($campaign);
} else {
$emails = $this->getEmailAddresses($campaign);
}
foreach ($emails as $email) {
Mail::queue(new NewsletterMail($email, $campaign));
}
}
}
/**
* Build the message.
*
* @param \Webkul\Marketing\Contracts\Campaign $campaign
* @return array
*/
public function getEmailAddresses($campaign)
{
$newsletterEmails = app('\Webkul\Core\Repositories\SubscribersListRepository')->getModel()
->where('is_subscribed', 1)
->where('channel_id', $campaign->channel_id)
->get('email');
$customerGroupEmails = $campaign->customer_group->customers()->where('subscribed_to_news_letter', 1)->get('email');
$emails = [];
foreach ($newsletterEmails as $row) {
$emails[] = $row->email;
}
foreach ($customerGroupEmails as $row) {
$emails[] = $row->email;
}
return array_unique($emails);
}
/**
* Return customer's emails who has a birthday today
*
* @param \Webkul\Marketing\Contracts\Campaign $campaign
* @return array
*/
public function getBirthdayEmails($campaign)
{
$customerGroupEmails = $campaign->customer_group->customers()
->whereRaw('DATE_FORMAT(date_of_birth, "%m-%d") = ?', [Carbon::now()->format('m-d')])
->where('subscribed_to_news_letter', 1)
->get('email');
$emails = [];
foreach ($customerGroupEmails as $row) {
$emails[] = $row->email;
}
return $emails;
}
}

View File

@ -0,0 +1,149 @@
<?php
namespace Webkul\Marketing\Http\Controllers;
use Illuminate\Support\Facades\Event;
use Webkul\Marketing\Repositories\CampaignRepository;
class CampaignController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* CampaignRepository object
*
* @var \Webkul\Core\Repositories\CampaignRepository
*/
protected $campaignRepository;
/**
* Create a new controller instance.
*
* @param \Webkul\Core\Repositories\CampaignRepository $campaignRepository
* @return void
*/
public function __construct(CampaignRepository $campaignRepository)
{
$this->campaignRepository = $campaignRepository;
$this->_config = request('_config');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\View\View
*/
public function index()
{
return view($this->_config['view']);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\View\View
*/
public function create()
{
return view($this->_config['view']);
}
/**
* Store a newly created resource in storage.
*
* @return \Illuminate\Http\Response
*/
public function store()
{
$this->validate(request(), [
'name' => 'required',
'subject' => 'required',
'status' => 'required',
'marketing_template_id' => 'required',
'marketing_event_id' => 'required_if:schedule_type,event',
]);
Event::dispatch('marketing.campaigns.create.before');
$locale = $this->campaignRepository->create(request()->all());
Event::dispatch('marketing.campaigns.create.after', $locale);
session()->flash('success', trans('admin::app.marketing.campaigns.create-success'));
return redirect()->route($this->_config['redirect']);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\View\View
*/
public function edit($id)
{
$campaign = $this->campaignRepository->findOrFail($id);
return view($this->_config['view'], compact('campaign'));
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update($id)
{
$this->validate(request(), [
'name' => 'required',
'subject' => 'required',
'status' => 'required',
'marketing_template_id' => 'required',
'marketing_event_id' => 'required_if:schedule_type,event',
]);
Event::dispatch('marketing.campaigns.update.before', $id);
$locale = $this->campaignRepository->update(request()->all(), $id);
Event::dispatch('marketing.campaigns.update.after', $locale);
session()->flash('success', trans('admin::app.marketing.campaigns.update-success'));
return redirect()->route($this->_config['redirect']);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$locale = $this->campaignRepository->findOrFail($id);
try {
Event::dispatch('marketing.campaigns.delete.before', $id);
$this->campaignRepository->delete($id);
Event::dispatch('marketing.campaigns.delete.after', $id);
session()->flash('success', trans('admin::app.marketing.campaigns.delete-success'));
return response()->json(['message' => true], 200);
} catch(\Exception $e) {
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Email Campaign']));
}
return response()->json(['message' => false], 400);
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Webkul\Marketing\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}

View File

@ -0,0 +1,151 @@
<?php
namespace Webkul\Marketing\Http\Controllers;
use Illuminate\Support\Facades\Event;
use Webkul\Marketing\Repositories\EventRepository;
class EventController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* EventRepository object
*
* @var \Webkul\Marketing\Repositories\EventRepository
*/
protected $eventRepository;
/**
* Create a new controller instance.
*
* @param \Webkul\Marketing\Repositories\EventRepository $eventRepository
* @return void
*/
public function __construct(EventRepository $eventRepository)
{
$this->eventRepository = $eventRepository;
$this->_config = request('_config');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\View\View
*/
public function index()
{
return view($this->_config['view']);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\View\View
*/
public function create()
{
return view($this->_config['view']);
}
/**
* Store a newly created resource in storage.
*
* @return \Illuminate\Http\Response
*/
public function store()
{
$this->validate(request(), [
'name' => 'required',
'description' => 'required',
'date' => 'date|required',
]);
Event::dispatch('marketing.events.create.before');
$locale = $this->eventRepository->create(request()->all());
Event::dispatch('marketing.events.create.after', $locale);
session()->flash('success', trans('admin::app.marketing.events.create-success'));
return redirect()->route($this->_config['redirect']);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\View\View
*/
public function edit($id)
{
if ($id == 1) {
session()->flash('error', trans('admin::app.marketing.events.edit-error'));
return redirect()->back();
} else {
$event = $this->eventRepository->findOrFail($id);
return view($this->_config['view'], compact('event'));
}
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update($id)
{
$this->validate(request(), [
'name' => 'required',
'description' => 'required',
'date' => 'date|required',
]);
Event::dispatch('marketing.events.update.before', $id);
$locale = $this->eventRepository->update(request()->all(), $id);
Event::dispatch('marketing.events.update.after', $locale);
session()->flash('success', trans('admin::app.marketing.events.update-success'));
return redirect()->route($this->_config['redirect']);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$locale = $this->eventRepository->findOrFail($id);
try {
Event::dispatch('marketing.events.delete.before', $id);
$this->eventRepository->delete($id);
Event::dispatch('marketing.events.delete.after', $id);
session()->flash('success', trans('admin::app.marketing.events.delete-success'));
return response()->json(['message' => true], 200);
} catch(\Exception $e) {
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Event']));
}
return response()->json(['message' => false], 400);
}
}

View File

@ -0,0 +1,145 @@
<?php
namespace Webkul\Marketing\Http\Controllers;
use Illuminate\Support\Facades\Event;
use Webkul\Marketing\Repositories\TemplateRepository;
class TemplateController extends Controller
{
/**
* Contains route related configuration
*
* @var array
*/
protected $_config;
/**
* TemplateRepository object
*
* @var \Webkul\Core\Repositories\TemplateRepository
*/
protected $templateRepository;
/**
* Create a new controller instance.
*
* @param \Webkul\Core\Repositories\TemplateRepository $templateRepository
* @return void
*/
public function __construct(TemplateRepository $templateRepository)
{
$this->templateRepository = $templateRepository;
$this->_config = request('_config');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\View\View
*/
public function index()
{
return view($this->_config['view']);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\View\View
*/
public function create()
{
return view($this->_config['view']);
}
/**
* Store a newly created resource in storage.
*
* @return \Illuminate\Http\Response
*/
public function store()
{
$this->validate(request(), [
'name' => 'required',
'status' => 'required|in:active,inactive,draft',
'content' => 'required',
]);
Event::dispatch('marketing.templates.create.before');
$locale = $this->templateRepository->create(request()->all());
Event::dispatch('marketing.templates.create.after', $locale);
session()->flash('success', trans('admin::app.marketing.templates.create-success'));
return redirect()->route($this->_config['redirect']);
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\View\View
*/
public function edit($id)
{
$template = $this->templateRepository->findOrFail($id);
return view($this->_config['view'], compact('template'));
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update($id)
{
$this->validate(request(), [
'name' => 'required',
'status' => 'required|in:active,inactive,draft',
'content' => 'required',
]);
Event::dispatch('marketing.templates.update.before', $id);
$locale = $this->templateRepository->update(request()->all(), $id);
Event::dispatch('marketing.templates.update.after', $locale);
session()->flash('success', trans('admin::app.marketing.templates.update-success'));
return redirect()->route($this->_config['redirect']);
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$locale = $this->templateRepository->findOrFail($id);
try {
Event::dispatch('marketing.templates.delete.before', $id);
$this->templateRepository->delete($id);
Event::dispatch('marketing.templates.delete.after', $id);
session()->flash('success', trans('admin::app.marketing.templates.delete-success'));
return response()->json(['message' => true], 200);
} catch(\Exception $e) {
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Email Template']));
}
return response()->json(['message' => false], 400);
}
}

View File

@ -0,0 +1,3 @@
<?php
?>

View File

@ -0,0 +1,52 @@
<?php
namespace Webkul\Marketing\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
class NewsletterMail extends Mailable
{
use Queueable, SerializesModels;
/**
* @var string
*/
public $email;
/**
* The campaign instance.
*
* @var \Webkul\Marketing\Contracts\Campaign
*/
public $campaign;
/**
* Create a new message instance.
*
* @param string $email
* @param \Webkul\Marketing\Contracts\Campaign $campaign
* @return void
*/
public function __construct($email, $campaign)
{
$this->email = $email;
$this->campaign = $campaign;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name'])
->to([$this->email])
->subject($this->campaign->subject)
->html($this->campaign->email_template->content);
}
}

View File

@ -0,0 +1,61 @@
<?php
namespace Webkul\Marketing\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Core\Models\ChannelProxy;
use Webkul\Customer\Models\CustomerGroupProxy;
use Webkul\Marketing\Contracts\Campaign as CampaignContract;
class Campaign extends Model implements CampaignContract
{
protected $table = 'marketing_campaigns';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'subject',
'status',
'channel_id',
'customer_group_id',
'marketing_template_id',
'spooling',
'marketing_event_id',
];
/**
* Get the event
*/
public function event()
{
return $this->belongsTo(EventProxy::modelClass(), 'marketing_event_id');
}
/**
* Get the channel
*/
public function channel()
{
return $this->belongsTo(ChannelProxy::modelClass(), 'channel_id');
}
/**
* Get the customer group
*/
public function customer_group()
{
return $this->belongsTo(CustomerGroupProxy::modelClass(), 'customer_group_id');
}
/**
* Get the email template
*/
public function email_template()
{
return $this->belongsTo(TemplateProxy::modelClass(), 'marketing_template_id');
}
}

View File

@ -0,0 +1,10 @@
<?php
namespace Webkul\Marketing\Models;
use Konekt\Concord\Proxies\ModelProxy;
class CampaignProxy extends ModelProxy
{
}

View File

@ -0,0 +1,23 @@
<?php
namespace Webkul\Marketing\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Product\Models\ProductProxy;
use Webkul\Marketing\Contracts\Event as EventContract;
class Event extends Model implements EventContract
{
protected $table = 'marketing_events';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'description',
'date',
];
}

View File

@ -0,0 +1,10 @@
<?php
namespace Webkul\Marketing\Models;
use Konekt\Concord\Proxies\ModelProxy;
class EventProxy extends ModelProxy
{
}

View File

@ -0,0 +1,23 @@
<?php
namespace Webkul\Marketing\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Product\Models\ProductProxy;
use Webkul\Marketing\Contracts\Template as TemplateContract;
class Template extends Model implements TemplateContract
{
protected $table = 'marketing_templates';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'status',
'content',
];
}

View File

@ -0,0 +1,10 @@
<?php
namespace Webkul\Marketing\Models;
use Konekt\Concord\Proxies\ModelProxy;
class TemplateProxy extends ModelProxy
{
}

View File

@ -0,0 +1,39 @@
<?php
namespace Webkul\Marketing\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;
use Webkul\Marketing\Console\Commands\EmailsCommand;
class MarketingServiceProvider extends ServiceProvider
{
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
$this->loadMigrationsFrom(__DIR__ . '/../Database/Migrations');
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
$this->loadTranslationsFrom(__DIR__ . '/../Resources/lang', 'marketing');
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'marketing');
}
/**
* Register services.
*
* @return void
*/
public function register()
{
if ($this->app->runningInConsole()) {
$this->commands([EmailsCommand::class]);
}
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace Webkul\Marketing\Providers;
use Webkul\Core\Providers\CoreModuleServiceProvider;
class ModuleServiceProvider extends CoreModuleServiceProvider
{
protected $models = [
\Webkul\Marketing\Models\Campaign::class,
\Webkul\Marketing\Models\Template::class,
\Webkul\Marketing\Models\Event::class,
];
}

View File

@ -0,0 +1,18 @@
<?php
namespace Webkul\Marketing\Repositories;
use Webkul\Core\Eloquent\Repository;
class CampaignRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Marketing\Contracts\Campaign';
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Webkul\Marketing\Repositories;
use Webkul\Core\Eloquent\Repository;
class EventRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Marketing\Contracts\Event';
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Webkul\Marketing\Repositories;
use Webkul\Core\Eloquent\Repository;
class TemplateRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Marketing\Contracts\Template';
}
}

View File

@ -126,6 +126,7 @@ return [
'conditions' => 'Conditions', 'conditions' => 'Conditions',
'using' => 'by using this website', 'using' => 'by using this website',
'agreement' => 'Agreement', 'agreement' => 'Agreement',
'subscribe-to-newsletter' => 'Subscribe to newsletter',
'success' => 'Account created successfully.', 'success' => 'Account created successfully.',
'success-verify' => 'Account created successfully, an e-mail has been sent for verification.', 'success-verify' => 'Account created successfully, an e-mail has been sent for verification.',
'success-verify-email-unsent' => 'Account created successfully, but verification e-mail unsent.', 'success-verify-email-unsent' => 'Account created successfully, but verification e-mail unsent.',

View File

@ -100,6 +100,11 @@
<span class="control-error" v-if="errors.has('password_confirmation')">@{{ errors.first('password_confirmation') }}</span> <span class="control-error" v-if="errors.has('password_confirmation')">@{{ errors.first('password_confirmation') }}</span>
</div> </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' : ''}}>
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
</div>
{!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!} {!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!}
<div class="button-group"> <div class="button-group">

View File

@ -70,17 +70,19 @@
<span class="control-error" v-if="errors.has('agreement')">@{{ errors.first('agreement') }}</span> <span class="control-error" v-if="errors.has('agreement')">@{{ errors.first('agreement') }}</span>
</div> --}} </div> --}}
{{-- <span class="checkbox">
<input type="checkbox" id="checkbox1" name="checkbox[]">
<label class="checkbox-view" for="checkbox1"></label>
Checkbox Value 1
</span> --}}
<div class="control-group">
<input type="checkbox" id="checkbox2" name="is_subscribed">
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
</div>
{!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!} {!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!}
{{-- <div class="control-group" :class="[errors.has('agreement') ? 'has-error' : '']">
<input type="checkbox" id="checkbox2" name="agreement" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.signup-form.agreement') }}&quot;">
<span>{{ __('shop::app.customer.signup-form.agree') }}
<a href="">{{ __('shop::app.customer.signup-form.terms') }}</a> & <a href="">{{ __('shop::app.customer.signup-form.conditions') }}</a> {{ __('shop::app.customer.signup-form.using') }}.
</span>
<span class="control-error" v-if="errors.has('agreement')">@{{ errors.first('agreement') }}</span>
</div> --}}
<button class="btn btn-primary btn-lg" type="submit"> <button class="btn btn-primary btn-lg" type="submit">
{{ __('shop::app.customer.signup-form.button_title') }} {{ __('shop::app.customer.signup-form.button_title') }}
</button> </button>

View File

@ -178,6 +178,11 @@
</div> </div>
</div> </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;">
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
</div>
{!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!} {!! view_render_event('bagisto.shop.customers.account.profile.edit_form_controls.after', ['customer' => $customer]) !!}
<button <button

View File

@ -138,6 +138,11 @@
</span> </span>
</div> </div>
<div class="control-group">
<input type="checkbox" id="checkbox2" name="is_subscribed">
<span>{{ __('shop::app.customer.signup-form.subscribe-to-newsletter') }}</span>
</div>
{!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!} {!! view_render_event('bagisto.shop.customers.signup_form_controls.after') !!}
<button class="theme-btn" type="submit"> <button class="theme-btn" type="submit">

View File

@ -14,8 +14,9 @@ class NewsletterSubscriptionCest
$I->loginAsAdmin(); $I->loginAsAdmin();
$I->amOnAdminRoute('admin.dashboard.index'); $I->amOnAdminRoute('admin.dashboard.index');
$I->click(__('admin::app.layouts.customers'), '//*[contains(@class, "navbar-left")]'); $I->click(__('admin::app.layouts.marketing'), '//*[contains(@class, "navbar-left")]');
$I->click(__('admin::app.layouts.newsletter-subscriptions'), '//*[contains(@class, "aside-nav")]'); $I->click(__('admin::app.layouts.email-marketing'), '//*[contains(@class, "aside-nav")]');
$I->click(__('admin::app.layouts.newsletter-subscriptions'), '//*[contains(@class, "tabs")]');
$I->seeCurrentRouteIs('admin.customers.subscribers.index'); $I->seeCurrentRouteIs('admin.customers.subscribers.index');
$I->see($subscriber->id, '//script[@type="text/x-template"]'); $I->see($subscriber->id, '//script[@type="text/x-template"]');