diff --git a/README.md b/README.md
index 30a18d51b..28af95aee 100755
--- a/README.md
+++ b/README.md
@@ -10,15 +10,15 @@
-# Topics
-1. ### [Introduction](#1-introduction-)
-2. ### [Documentation](#2-documentation-)
-3. ### [Requirements](#2-requirements-)
-4. ### [Installation & Configuration](#3-installation--configuration-)
-5. ### [License](#4-license-)
-6. ### [Miscellaneous](#5-miscellaneous-)
+## Topics
+1. [Introduction](#introduction)
+2. [Documentation](#documentation)
+3. [Requirements](#requirements)
+4. [Installation & Configuration](#installation-and-configuration)
+5. [License](#license)
+6. [Miscellaneous](#miscellaneous)
-### 1. Introduction
@csrf()
- {{ __('admin::app.settings.sliders.title') }}
+ {{ __('admin::app.settings.sliders.title') }}
@{{ errors.first('title') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/settings/sliders/edit.blade.php b/packages/Webkul/Admin/src/Resources/views/settings/sliders/edit.blade.php
index 853ed2e2a..18f3a9cd7 100755
--- a/packages/Webkul/Admin/src/Resources/views/settings/sliders/edit.blade.php
+++ b/packages/Webkul/Admin/src/Resources/views/settings/sliders/edit.blade.php
@@ -29,7 +29,7 @@
@csrf()
- {{ __('admin::app.settings.sliders.title') }}
+ {{ __('admin::app.settings.sliders.title') }}
@{{ errors.first('title') }}
diff --git a/packages/Webkul/Attribute/src/Database/Migrations/2019_07_29_142734_add_use_in_flat_column_in_attributes_table.php b/packages/Webkul/Attribute/src/Database/Migrations/2019_07_29_142734_add_use_in_flat_column_in_attributes_table.php
new file mode 100644
index 000000000..d52675871
--- /dev/null
+++ b/packages/Webkul/Attribute/src/Database/Migrations/2019_07_29_142734_add_use_in_flat_column_in_attributes_table.php
@@ -0,0 +1,32 @@
+boolean('use_in_flat')->default(1);
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('attributes', function (Blueprint $table) {
+ //
+ });
+ }
+}
diff --git a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php
index 7d24e2e9e..380710c38 100755
--- a/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php
+++ b/packages/Webkul/Attribute/src/Database/Seeders/AttributeTableSeeder.php
@@ -16,30 +16,50 @@ class AttributeTableSeeder extends Seeder
$now = Carbon::now();
DB::table('attributes')->insert([
- ['id' => '1','code' => 'sku','admin_name' => 'SKU','type' => 'text','validation' => NULL,'position' => '1','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '2','code' => 'name','admin_name' => 'Name','type' => 'text','validation' => NULL,'position' => '2','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '3','code' => 'url_key','admin_name' => 'URL Key','type' => 'text','validation' => NULL,'position' => '3','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '4','code' => 'tax_category_id','admin_name' => 'Tax Category','type' => 'select','validation' => NULL,'position' => '4','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '5','code' => 'new','admin_name' => 'New','type' => 'boolean','validation' => NULL,'position' => '5','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '6','code' => 'featured','admin_name' => 'Featured','type' => 'boolean','validation' => NULL,'position' => '6','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '7','code' => 'visible_individually','admin_name' => 'Visible Individually','type' => 'boolean','validation' => NULL,'position' => '7','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '8','code' => 'status','admin_name' => 'Status','type' => 'boolean','validation' => NULL,'position' => '8','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '9','code' => 'short_description','admin_name' => 'Short Description','type' => 'textarea','validation' => NULL,'position' => '9','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '10','code' => 'description','admin_name' => 'Description','type' => 'textarea','validation' => NULL,'position' => '10','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '11','code' => 'price','admin_name' => 'Price','type' => 'price','validation' => 'decimal','position' => '11','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '12','code' => 'cost','admin_name' => 'Cost','type' => 'price','validation' => 'decimal','position' => '12','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '13','code' => 'special_price','admin_name' => 'Special Price','type' => 'price','validation' => 'decimal','position' => '13','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '14','code' => 'special_price_from','admin_name' => 'Special Price From','type' => 'date','validation' => NULL,'position' => '14','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '15','code' => 'special_price_to','admin_name' => 'Special Price To','type' => 'date','validation' => NULL,'position' => '15','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '16','code' => 'meta_title','admin_name' => 'Meta Title','type' => 'textarea','validation' => NULL,'position' => '16','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '17','code' => 'meta_keywords','admin_name' => 'Meta Keywords','type' => 'textarea','validation' => NULL,'position' => '17','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '18','code' => 'meta_description','admin_name' => 'Meta Description','type' => 'textarea','validation' => NULL,'position' => '18','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '19','code' => 'width','admin_name' => 'Width','type' => 'text','validation' => 'decimal','position' => '19','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '20','code' => 'height','admin_name' => 'Height','type' => 'text','validation' => 'decimal','position' => '20','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '21','code' => 'depth','admin_name' => 'Depth','type' => 'text','validation' => 'decimal','position' => '21','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '22','code' => 'weight','admin_name' => 'Weight','type' => 'text','validation' => 'decimal','position' => '22','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '23','code' => 'color','admin_name' => 'Color','type' => 'select','validation' => NULL,'position' => '23','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
- ['id' => '24','code' => 'size','admin_name' => 'Size','type' => 'select','validation' => NULL,'position' => '24','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now]
+ ['id' => '1','code' => 'sku','admin_name' => 'SKU','type' => 'text','validation' => NULL,'position' => '1','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '2','code' => 'name','admin_name' => 'Name','type' => 'text','validation' => NULL,'position' => '2','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '3','code' => 'url_key','admin_name' => 'URL Key','type' => 'text','validation' => NULL,'position' => '3','is_required' => '1','is_unique' => '1','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '4','code' => 'tax_category_id','admin_name' => 'Tax Category','type' => 'select','validation' => NULL,'position' => '4','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '5','code' => 'new','admin_name' => 'New','type' => 'boolean','validation' => NULL,'position' => '5','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '6','code' => 'featured','admin_name' => 'Featured','type' => 'boolean','validation' => NULL,'position' => '6','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '7','code' => 'visible_individually','admin_name' => 'Visible Individually','type' => 'boolean','validation' => NULL,'position' => '7','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','created_at' => $now,
+ 'use_in_flat' => '1','updated_at' => $now],
+ ['id' => '8','code' => 'status','admin_name' => 'Status','type' => 'boolean','validation' => NULL,'position' => '8','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '9','code' => 'short_description','admin_name' => 'Short Description','type' => 'textarea','validation' => NULL,'position' => '9','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0',
+ 'is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '10','code' => 'description','admin_name' => 'Description','type' => 'textarea','validation' => NULL,'position' => '10','is_required' => '1','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '11','code' => 'price','admin_name' => 'Price','type' => 'price','validation' => 'decimal','position' => '11','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '12','code' => 'cost','admin_name' => 'Cost','type' => 'price','validation' => 'decimal','position' => '12','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '13','code' => 'special_price','admin_name' => 'Special Price','type' => 'price','validation' => 'decimal','position' => '13','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '14','code' => 'special_price_from','admin_name' => 'Special Price From','type' => 'date','validation' => NULL,'position' => '14','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '15','code' => 'special_price_to','admin_name' => 'Special Price To','type' => 'date','validation' => NULL,'position' => '15','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0',
+ 'use_in_flat' => '1','is_visible_on_front' => '0','created_at' => $now,'updated_at' => $now],
+ ['id' => '16','code' => 'meta_title','admin_name' => 'Meta Title','type' => 'textarea','validation' => NULL,'position' => '16','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '17','code' => 'meta_keywords','admin_name' => 'Meta Keywords','type' => 'textarea','validation' => NULL,'position' => '17','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '18','code' => 'meta_description','admin_name' => 'Meta Description','type' => 'textarea','validation' => NULL,'position' => '18','is_required' => '0','is_unique' => '0','value_per_locale' => '1','value_per_channel' => '1','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0','use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '19','code' => 'width','admin_name' => 'Width','type' => 'text','validation' => 'decimal','position' => '19','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '20','code' => 'height','admin_name' => 'Height','type' => 'text','validation' => 'decimal','position' => '20','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '21','code' => 'depth','admin_name' => 'Depth','type' => 'text','validation' => 'decimal','position' => '21','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '1','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '22','code' => 'weight','admin_name' => 'Weight','type' => 'text','validation' => 'decimal','position' => '22','is_required' => '1','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '0','is_configurable' => '0','is_user_defined' => '0','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '23','code' => 'color','admin_name' => 'Color','type' => 'select','validation' => NULL,'position' => '23','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now],
+ ['id' => '24','code' => 'size','admin_name' => 'Size','type' => 'select','validation' => NULL,'position' => '24','is_required' => '0','is_unique' => '0','value_per_locale' => '0','value_per_channel' => '0','is_filterable' => '1','is_configurable' => '1','is_user_defined' => '1','is_visible_on_front' => '0',
+ 'use_in_flat' => '1','created_at' => $now,'updated_at' => $now]
]);
diff --git a/packages/Webkul/Attribute/src/Models/Attribute.php b/packages/Webkul/Attribute/src/Models/Attribute.php
index e6bf8ba94..244d94497 100755
--- a/packages/Webkul/Attribute/src/Models/Attribute.php
+++ b/packages/Webkul/Attribute/src/Models/Attribute.php
@@ -9,7 +9,7 @@ class Attribute extends TranslatableModel implements AttributeContract
{
public $translatedAttributes = ['name'];
- protected $fillable = ['code', 'admin_name', 'type', 'position', 'is_required', 'is_unique', 'validation', 'value_per_locale', 'value_per_channel', 'is_filterable', 'is_configurable', 'is_visible_on_front', 'is_user_defined', 'swatch_type'];
+ protected $fillable = ['code', 'admin_name', 'type', 'position', 'is_required', 'is_unique', 'validation', 'value_per_locale', 'value_per_channel', 'is_filterable', 'is_configurable', 'is_visible_on_front', 'is_user_defined', 'swatch_type', 'use_in_flat'];
// protected $with = ['options'];
diff --git a/packages/Webkul/Core/src/Database/Migrations/2019_07_23_033128_alter_locales_table.php b/packages/Webkul/Core/src/Database/Migrations/2019_07_23_033128_alter_locales_table.php
new file mode 100644
index 000000000..bcca3d042
--- /dev/null
+++ b/packages/Webkul/Core/src/Database/Migrations/2019_07_23_033128_alter_locales_table.php
@@ -0,0 +1,30 @@
+enum('direction', ['ltr', 'rtl'])->default('ltr');
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+
+ }
+}
diff --git a/packages/Webkul/Core/src/Http/Controllers/LocaleController.php b/packages/Webkul/Core/src/Http/Controllers/LocaleController.php
index ff8f5f058..16b28287e 100755
--- a/packages/Webkul/Core/src/Http/Controllers/LocaleController.php
+++ b/packages/Webkul/Core/src/Http/Controllers/LocaleController.php
@@ -72,7 +72,8 @@ class LocaleController extends Controller
{
$this->validate(request(), [
'code' => ['required', 'unique:locales,code', new \Webkul\Core\Contracts\Validations\Code],
- 'name' => 'required'
+ 'name' => 'required',
+ 'direction' => 'in:ltr,rtl'
]);
Event::fire('core.locale.create.before');
@@ -110,7 +111,8 @@ class LocaleController extends Controller
{
$this->validate(request(), [
'code' => ['required', 'unique:locales,code,' . $id, new \Webkul\Core\Contracts\Validations\Code],
- 'name' => 'required'
+ 'name' => 'required',
+ 'direction' => 'in:ltr,rtl'
]);
Event::fire('core.locale.update.before', $id);
diff --git a/packages/Webkul/Core/src/Models/Locale.php b/packages/Webkul/Core/src/Models/Locale.php
index b12be89de..572e576a5 100755
--- a/packages/Webkul/Core/src/Models/Locale.php
+++ b/packages/Webkul/Core/src/Models/Locale.php
@@ -13,6 +13,6 @@ class Locale extends Model implements LocaleContract
* @var array
*/
protected $fillable = [
- 'code', 'name'
+ 'code', 'name', 'direction'
];
-}
\ No newline at end of file
+}
diff --git a/packages/Webkul/Product/src/Listeners/ProductFlat.php b/packages/Webkul/Product/src/Listeners/ProductFlat.php
index fc6ca23b0..d02227ddc 100644
--- a/packages/Webkul/Product/src/Listeners/ProductFlat.php
+++ b/packages/Webkul/Product/src/Listeners/ProductFlat.php
@@ -103,7 +103,7 @@ class ProductFlat
*/
public function afterAttributeCreatedUpdated($attribute)
{
- if(! $attribute->is_user_defined || $attribute->is_visible_on_front) {
+ if (! $attribute->is_user_defined || ! $attribute->use_in_flat) {
return false;
}
diff --git a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php
index f35094bd9..d29abd4ed 100644
--- a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php
+++ b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php
@@ -44,10 +44,12 @@ class ProductFlatRepository extends Repository
*/
public function getCategoryProductMaximumPrice($categoryId)
{
- return $this->model
- ->leftJoin('product_categories', 'product_flat.product_id', 'product_categories.product_id')
- ->where('product_categories.category_id', $categoryId)
- ->max('price');
+ // return $this->model
+ // ->leftJoin('product_categories', 'product_flat.product_id', 'product_categories.product_id')
+ // ->where('product_categories.category_id', $categoryId)
+ // ->max('price');
+
+ return $this->model->max('price');
}
/**
diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php
index bab0bffad..c639af542 100755
--- a/packages/Webkul/Product/src/Repositories/ProductRepository.php
+++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php
@@ -500,28 +500,39 @@ class ProductRepository extends Repository
}
}
- $qb = $qb->where(function($query1) {
- foreach (['product_flat', 'flat_variants'] as $alias) {
- $query1 = $query1->orWhere(function($query2) use($alias) {
- $attributes = $this->attribute->getProductDefaultAttributes(array_keys(request()->input()));
+ $qb = $qb->leftJoin('products as variants', 'products.id', '=', 'variants.parent_id');
- foreach ($attributes as $attribute) {
- $column = $alias . '.' . $attribute->code;
+ $qb = $qb->where(function($query1) use($qb) {
+ $aliases = [
+ 'products' => 'filter_',
+ 'variants' => 'variant_filter_'
+ ];
- $queryParams = explode(',', request()->get($attribute->code));
+ foreach($aliases as $table => $alias) {
+ $query1 = $query1->orWhere(function($query2) use($qb, $table, $alias) {
+
+ foreach ($this->attribute->getProductDefaultAttributes(array_keys(request()->input())) as $code => $attribute) {
+ $aliasTemp = $alias . $attribute->code;
+
+ $qb = $qb->leftJoin('product_attribute_values as ' . $aliasTemp, $table . '.id', '=', $aliasTemp . '.product_id');
+
+ $column = ProductAttributeValue::$attributeTypeFields[$attribute->type];
+
+ $temp = explode(',', request()->get($attribute->code));
if ($attribute->type != 'price') {
- $query2 = $query2->where(function($query3) use($column, $queryParams) {
- foreach ($queryParams as $filterValue) {
- $query3 = $query3->orwhereRaw("find_in_set($filterValue, $column)");
+ $query2 = $query2->where($aliasTemp . '.attribute_id', $attribute->id);
+
+ $query2 = $query2->where(function($query3) use($aliasTemp, $column, $temp) {
+ foreach($temp as $code => $filterValue) {
+ $columns = $aliasTemp . '.' . $column;
+ $query3 = $query3->orwhereRaw("find_in_set($filterValue, $columns)");
}
});
} else {
- if ($attribute->code != 'price') {
- $query2 = $query2->where($column, '>=', current($queryParams))->where($column, '<=', end($queryParams));
- } else {
- $query2 = $query2->where($column, '>=', core()->convertToBasePrice(current($queryParams)))->where($column, '<=', core()->convertToBasePrice(end($queryParams)));
- }
+ $query2 = $query2->where($aliasTemp . '.' . $column, '>=', core()->convertToBasePrice(current($temp)))
+ ->where($aliasTemp . '.' . $column, '<=', core()->convertToBasePrice(end($temp)))
+ ->where($aliasTemp . '.attribute_id', $attribute->id);
}
}
});
diff --git a/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php b/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php
index 368893ba7..190b3df2e 100755
--- a/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php
+++ b/packages/Webkul/Shop/src/Resources/views/layouts/master.blade.php
@@ -1,3 +1,7 @@
+@php
+ $locale = Webkul\Core\Models\Locale::where('code', app()->getLocale())->first();
+@endphp
+
@@ -30,7 +34,7 @@
-getLocale() == 'ar') class="rtl" @endif style="scroll-behavior: smooth;">
+direction == 'rtl') class="rtl" @endif style="scroll-behavior: smooth;">
{!! view_render_event('bagisto.shop.layout.body.before') !!}
diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php
index 7d81738ad..45f3ce06d 100755
--- a/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php
+++ b/packages/Webkul/Shop/src/Resources/views/products/view/gallery.blade.php
@@ -108,7 +108,9 @@
this.currentOriginalImageUrl = image.original_image_url;
- $('img#pro-img').data('zoom-image', image.original_image_url).ezPlus();
+ if ($(window).width() > 580) {
+ $('img#pro-img').data('zoom-image', image.original_image_url).ezPlus();
+ }
},
moveThumbs: function(direction) {
@@ -152,7 +154,9 @@