diff --git a/packages/Webkul/Admin/src/Config/menu.php b/packages/Webkul/Admin/src/Config/menu.php
index 3ac298f81..2c73ae44d 100755
--- a/packages/Webkul/Admin/src/Config/menu.php
+++ b/packages/Webkul/Admin/src/Config/menu.php
@@ -188,15 +188,13 @@ return [
'route' => 'admin.cart-rule.index',
'sort' => 1,
'icon-class' => '',
- ],
- // , [
- // 'key' => 'promotions.catalog-rule',
- // 'name' => 'admin::app.promotion.catalog-rule',
- // 'route' => 'admin.catalog-rule.index',
- // 'sort' => 1,
- // 'icon-class' => '',
- // ]
- [
+ ], [
+ 'key' => 'promotions.catalog-rule',
+ 'name' => 'admin::app.promotion.catalog-rule',
+ 'route' => 'admin.catalog-rule.index',
+ 'sort' => 1,
+ 'icon-class' => '',
+ ], [
'key' => 'cms',
'name' => 'admin::app.layouts.cms',
'route' => 'admin.cms.index',
diff --git a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php
index c208c060d..346f74f83 100644
--- a/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/promotions/catalog-rule/create.blade.php
@@ -95,7 +95,7 @@
-
+
@{{ errors.first('starts_from') }}
@@ -105,7 +105,7 @@
-
+
@{{ errors.first('ends_till') }}
diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130433_create_catalog_rules_table.php b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130433_create_catalog_rules_table.php
similarity index 80%
rename from packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130433_create_catalog_rules_table.php
rename to packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130433_create_catalog_rules_table.php
index bfec5eb68..73343f834 100644
--- a/packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130433_create_catalog_rules_table.php
+++ b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130433_create_catalog_rules_table.php
@@ -22,10 +22,9 @@ class CreateCatalogRulesTable extends Migration
$table->boolean('status')->default(0);
$table->json('conditons')->nullable();
$table->json('actions')->nullable();
- $table->boolean('end_other_rules')->default(1);
- $table->integer('sort_order')->unsigned()->default(0);
- $table->string('action');
- $table->decimal('discount_amount', 12, 4)->default(0);
+ $table->boolean('end_other_rules')->default(0);
+ $table->string('action_code')->nullable();
+ $table->decimal('discount_amount', 20, 4)->default(0.0000);
$table->timestamps();
});
}
diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130451_create_catalog_rule_customer_groups_table.php b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130451_create_catalog_rule_customer_groups_table.php
similarity index 100%
rename from packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130451_create_catalog_rule_customer_groups_table.php
rename to packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130451_create_catalog_rule_customer_groups_table.php
diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130458_create_catalog_rule_channels_table.php b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130458_create_catalog_rule_channels_table.php
similarity index 100%
rename from packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130458_create_catalog_rule_channels_table.php
rename to packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130458_create_catalog_rule_channels_table.php
diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130550_create_catalog_rule_products_table.php b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130550_create_catalog_rule_products_table.php
similarity index 78%
rename from packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130550_create_catalog_rule_products_table.php
rename to packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130550_create_catalog_rule_products_table.php
index 73ae26989..2f456559e 100644
--- a/packages/Webkul/Discount/src/Database/Migrations/2019_07_22_130550_create_catalog_rule_products_table.php
+++ b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130550_create_catalog_rule_products_table.php
@@ -14,7 +14,7 @@ class CreateCatalogRuleProductsTable extends Migration
public function up()
{
Schema::create('catalog_rule_products', function (Blueprint $table) {
- $table->increments('id');
+ $table->bigIncrements('id');
$table->integer('catalog_rule_id')->unsigned();
$table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade');
$table->datetime('starts_from')->nullable();
@@ -23,9 +23,10 @@ class CreateCatalogRuleProductsTable extends Migration
$table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade');
$table->integer('channel_id')->unsigned();
$table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade');
- $table->string('action_operator')->nullable();
- $table->decimal('action_amount', 12, 4)->default(0);
- $table->decimal('price', 12, 4)->default(0);
+ $table->integer('product_id')->unsigned();
+ $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
+ $table->string('action_code')->nullable();
+ $table->decimal('action_amount', 20, 4)->default(0.0000);
$table->timestamps();
});
}
diff --git a/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130583_create_catalog_rule_product_price_table.php b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130583_create_catalog_rule_product_price_table.php
new file mode 100644
index 000000000..740ce6f3c
--- /dev/null
+++ b/packages/Webkul/Discount/src/Database/Migrations/2019_08_08_130583_create_catalog_rule_product_price_table.php
@@ -0,0 +1,42 @@
+bigIncrements('id');
+ $table->integer('channel_id')->unsigned();
+ $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade');
+ $table->integer('customer_group_id')->unsigned();
+ $table->foreign('customer_group_id')->references('id')->on('customer_groups')->onDelete('cascade');
+ $table->integer('product_id')->unsigned();
+ $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
+ $table->integer('catalog_rule_id')->unsigned();
+ $table->foreign('catalog_rule_id')->references('id')->on('catalog_rules')->onDelete('cascade');
+ $table->decimal('rule_price', 20, 4)->default(0.0000);
+ $table->datetime('starts_from')->nullable();
+ $table->datetime('ends_till')->nullable();
+ $table->timestamps();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::dropIfExists('catalog_rule_product_price');
+ }
+}