This commit is contained in:
Prashant Singh 2019-07-30 13:54:25 +05:30
commit d8086091cb
25 changed files with 263 additions and 109 deletions

View File

@ -10,15 +10,15 @@
<a href="#sponsors"><img src="https://opencollective.com/bagisto/sponsors/badge.svg" alt="Sponsors on Open Collective"></a>
</p>
# 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 <a name="#1-introduction-"></a>:
### Introduction
[Bagisto](https://www.bagisto.com) is a hand tailored E-Commerce framework designed on some of the hottest opensource technologies
such as [Laravel](https://laravel.com) a [PHP](https://secure.php.net/) framework, [Vue.js](https://vuejs.org)
@ -54,11 +54,11 @@ It packs in lots of demanding features that allows your business to scale in no
Dev guys can take advantage of two of the hottest frameworks used in this project Laravel and Vue.js, both of these frameworks have been used in Bagisto.
Bagisto is using power of both of these frameworks and making best out of it out of the box.
### 2. Documentation <a name="#-documentation-"></a>:
### Documentation
#### Bagisto Documentation [https://devdocs.bagisto.com](https://devdocs.bagisto.com)
### 3. Requirements <a name="#requirements"></a>:
### Requirements
* **OS**: Ubuntu 16.04 LTS or higher.
* **SERVER**: Apache 2 or NGINX
@ -70,7 +70,7 @@ Bagisto is using power of both of these frameworks and making best out of it out
* **Node**: 8.11.3 LTS or higher.
* **Composer**: 1.6.5 or higher.
### 4. Installation & Configuration <a name="#configuration"></a>:
### Installation and Configuration
**1. Try our new GUI installer to install Bagisto:**
@ -172,36 +172,26 @@ password:admin123
> *http(s)://example.com/customer/register*
### 5. License <a name="#license"></a>:
### License
Bagisto is a truly opensource E-Commerce framework which will always be free under the [MIT License](https://github.com/bagisto/bagisto/blob/master/LICENSE).
### 6. Miscellaneous <a name="#miscellaneous"></a>:
### Miscellaneous
#### Contributors
This project exists thanks to all the people who contribute.
<a href="https://github.com/bagisto/bagisto/graphs/contributors"><img src="https://opencollective.com/bagisto/contributors.svg?width=890&button=false" /></a>
This project is on [Open Collective](https://opencollective.com/bagisto) and it exists thanks to this people who contribute.
<a href="https://github.com/bagisto/bagisto/graphs/contributors"><img src="https://opencollective.com/bagisto/contributors.svg?width=890&button=false"/></a>
#### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/bagisto#backer)]
<a href="https://opencollective.com/bagisto#backers" target="_blank"><img src="https://opencollective.com/bagisto/backers.svg?width=890"></a>
Thank you to all our backers! 🙏
<a href="https://opencollective.com/bagisto#contributors" target="_blank"><img src="https://opencollective.com/bagisto/backers.svg?width=890"></a>
#### Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/bagisto#sponsor)]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
<a href="https://opencollective.com/bagisto/sponsor/0/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/1/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/2/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/3/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/4/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/5/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/6/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/7/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/8/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/sponsor/9/website" target="_blank"><img src="https://opencollective.com/bagisto/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/bagisto/contribute/sponsor-7372/checkout" target="_blank"><img src="https://images.opencollective.com/static/images/become_sponsor.svg"></a>

View File

@ -58,7 +58,7 @@ class CategoryDataGrid extends DataGrid
$this->addColumn([
'index' => 'position',
'label' => trans('admin::app.datagrid.position'),
'type' => 'string',
'type' => 'number',
'searchable' => false,
'sortable' => true,
'filterable' => true

View File

@ -19,7 +19,7 @@ class LocalesDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('locales')->addSelect('id', 'code', 'name');
$queryBuilder = DB::table('locales')->addSelect('id', 'code', 'name', 'direction');
$this->setQueryBuilder($queryBuilder);
}
@ -52,6 +52,15 @@ class LocalesDataGrid extends DataGrid
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
'index' => 'direction',
'label' => trans('admin::app.datagrid.direction'),
'type' => 'select',
'searchable' => true,
'sortable' => true,
'filterable' => true
]);
}
public function prepareActions() {

View File

@ -114,6 +114,7 @@ return [
'code' => 'Code',
'admin-name' => 'Name',
'name' => 'Name',
'direction' => 'Direction',
'fullname' => 'Full Name',
'type' => 'Type',
'required' => 'Required',
@ -446,7 +447,8 @@ return [
'swatch' => 'Swatch',
'image' => 'Image',
'file' => 'File',
'checkbox' => 'Checkbox'
'checkbox' => 'Checkbox',
'use_in_flat' => "Create in Product Flat Table"
],
'families' => [
'title' => 'Families',
@ -561,6 +563,7 @@ return [
'general' => 'General',
'code' => 'Code',
'name' => 'Name',
'direction' => 'Direction',
'create-success' => 'Locale created successfully.',
'update-success' => 'Locale updated successfully.',
'delete-success' => 'Locale deleted successfully.',

View File

@ -36,7 +36,7 @@
{!! view_render_event('bagisto.admin.catalog.attribute.create_form_accordian.general.controls.before') !!}
<div class="control-group" :class="[errors.has('code') ? 'has-error' : '']">
<label for="code">{{ __('admin::app.catalog.attributes.code') }}</label>
<label for="code" class="required">{{ __('admin::app.catalog.attributes.code') }}</label>
<input type="text" v-validate="'required'" class="control" id="code" name="code" value="{{ old('code') }}" data-vv-as="&quot;{{ __('admin::app.catalog.attributes.code') }}&quot;" v-code/>
<span class="control-error" v-if="errors.has('code')">@{{ errors.first('code') }}</span>
</div>
@ -205,6 +205,14 @@
</select>
</div>
<div class="control-group">
<label for="use_in_flat">{{ __('admin::app.catalog.attributes.use_in_flat') }}</label>
<select class="control" id="use_in_flat" name="use_in_flat">
<option value="0">{{ __('admin::app.catalog.attributes.no') }}</option>
<option value="1">{{ __('admin::app.catalog.attributes.yes') }}</option>
</select>
</div>
{!! view_render_event('bagisto.admin.catalog.attribute.create_form_accordian.configuration.controls.after') !!}
</div>

View File

@ -266,6 +266,18 @@
</select>
</div>
<div class="control-group">
<label for="use_in_flat">{{ __('admin::app.catalog.attributes.use_in_flat') }}</label>
<select class="control" id="use_in_flat" name="use_in_flat">
<option value="0" {{ $attribute->use_in_flat ? '' : 'selected' }}>
{{ __('admin::app.catalog.attributes.no') }}
</option>
<option value="1" {{ $attribute->use_in_flat ? 'selected' : '' }}>
{{ __('admin::app.catalog.attributes.yes') }}
</option>
</select>
</div>
{!! view_render_event('bagisto.admin.catalog.attribute.edit_form_accordian.configuration.controls.after', ['attribute' => $attribute]) !!}
</div>

View File

@ -61,7 +61,7 @@
}
if (! isset($field['options'])) {
$field['options'] = [['title' => 'No', 'value' => 0],['title' => 'Yes', 'value' => 1]];
$field['options'] = '';
}
$selectedOption = core()->getConfigData($name) ?? '';
@ -73,7 +73,7 @@
:validations = "'{{ $validations }}'"
:depand = "'{{ $firstField }}[{{ $secondField }}][{{ $thirdField }}][{{ $depandField }}]'"
:value = "'{{ $depandValue }}'"
:field_name = "'{{ $field['title'] }}'"
:field_name = "'{{ trans($field['title']) }}'"
:channel_loacle = "'{{ $channel_locale }}'"
:result = "'{{ $selectedOption }}'"
></depands>
@ -400,11 +400,14 @@
<span class="locale"> [@{{ channel_loacle }}] </span>
</label>
<select v-validate= "validations" class="control" :id = "name" :name = "name" v-model="this.result"
<select v-if="this.options.length" v-validate= "validations" class="control" :id = "name" :name = "name" v-model="this.result"
:data-vv-as="field_name">
<option v-for='(option, index) in this.options' :value="option.value"> @{{ option.title }} </option>
</select>
<input v-else type="text" class="control" v-validate= "validations" :id = "name" :name = "name" v-model="this.result"
:data-vv-as="field_name">
<span class="control-error" v-if="errors.has(name)">
@{{ errors.first(name) }}
</span>

View File

@ -1,3 +1,7 @@
@php
$locale = Webkul\Core\Models\Locale::where('code', app()->getLocale())->first();
@endphp
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
@ -67,7 +71,7 @@
{!! view_render_event('bagisto.admin.layout.head') !!}
</head>
<body @if (app()->getLocale() == 'ar') class="rtl" @endif style="scroll-behavior: smooth;">
<body @if ($locale->direction == 'rtl') class="rtl" @endif style="scroll-behavior: smooth;">
<div id="app" class="container">
<flash-wrapper ref='flashes'></flash-wrapper>
@ -131,4 +135,4 @@
<div class="modal-overlay"></div>
</body>
</html>
</html>

View File

@ -1,3 +1,7 @@
@php
$locale = Webkul\Core\Models\Locale::where('code', app()->getLocale())->first();
@endphp
<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
@ -19,7 +23,7 @@
</head>
<body @if (app()->getLocale() == 'ar') class="rtl" @endif style="scroll-behavior: smooth;">
<body @if ($locale->direction == 'rtl') class="rtl" @endif style="scroll-behavior: smooth;">
{!! view_render_event('bagisto.admin.layout.body.before') !!}
<div id="app">

View File

@ -41,6 +41,15 @@
<input v-validate="'required'" class="control" id="name" name="name" data-vv-as="&quot;{{ __('admin::app.settings.locales.name') }}&quot;"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('direction') ? 'has-error' : '']">
<label for="direction" class="required">{{ __('admin::app.settings.locales.direction') }}</label>
<select v-validate="'required'" class="control" id="direction" name="direction" data-vv-as="&quot;{{ __('admin::app.settings.locales.direction') }}&quot;">
<option value="ltr" selected title="Text direction left to right">ltr</option>
<option value="rtl" title="Text direction right to left">rtl</option>
</select>
<span class="control-error" v-if="errors.has('direction')">@{{ errors.first('direction') }}</span>
</div>
</div>
</accordian>

View File

@ -44,6 +44,15 @@
<input v-validate="'required'" class="control" id="name" name="name" data-vv-as="&quot;{{ __('admin::app.settings.locales.name') }}&quot;" value="{{ old('name') ?: $locale->name }}"/>
<span class="control-error" v-if="errors.has('name')">@{{ errors.first('name') }}</span>
</div>
<div class="control-group" :class="[errors.has('direction') ? 'has-error' : '']">
<label for="direction" class="required">{{ __('admin::app.settings.locales.direction') }}</label>
<select v-validate="'required'" class="control" id="direction" name="direction" data-vv-as="&quot;{{ __('admin::app.settings.locales.direction') }}&quot;">
<option value="ltr" {{ old('direction') == 'ltr' ? 'selected' : '' }} title="Text direction left to right">ltr</option>
<option value="rtl" {{ old('direction') == 'rtl' ? 'selected' : '' }} title="Text direction right to left">rtl</option>
</select>
<span class="control-error" v-if="errors.has('direction')">@{{ errors.first('direction') }}</span>
</div>
</div>
</accordian>

View File

@ -27,7 +27,7 @@
<div class="form-container">
@csrf()
<div class="control-group" :class="[errors.has('title') ? 'has-error' : '']">
<label for="title">{{ __('admin::app.settings.sliders.title') }}</label>
<label for="title" class="required">{{ __('admin::app.settings.sliders.title') }}</label>
<input type="text" class="control" name="title" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.settings.sliders.title') }}&quot;">
<span class="control-error" v-if="errors.has('title')">@{{ errors.first('title') }}</span>
</div>

View File

@ -29,7 +29,7 @@
@csrf()
<div class="control-group" :class="[errors.has('title') ? 'has-error' : '']">
<label for="title">{{ __('admin::app.settings.sliders.title') }}</label>
<label for="title" class="required">{{ __('admin::app.settings.sliders.title') }}</label>
<input type="text" class="control" name="title" v-validate="'required'" data-vv-as="&quot;{{ __('admin::app.settings.sliders.title') }}&quot;" value="{{ $slider->title ?: old('title') }}">
<span class="control-error" v-if="errors.has('title')">@{{ errors.first('title') }}</span>
</div>

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddUseInFlatColumnInAttributesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('attributes', function (Blueprint $table) {
$table->boolean('use_in_flat')->default(1);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('attributes', function (Blueprint $table) {
//
});
}
}

View File

@ -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]
]);

View File

@ -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'];

View File

@ -0,0 +1,30 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterLocalesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('locales', function (Blueprint $table) {
$table->enum('direction', ['ltr', 'rtl'])->default('ltr');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}

View File

@ -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);

View File

@ -13,6 +13,6 @@ class Locale extends Model implements LocaleContract
* @var array
*/
protected $fillable = [
'code', 'name'
'code', 'name', 'direction'
];
}
}

View File

@ -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;
}

View File

@ -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');
}
/**

View File

@ -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);
}
}
});

View File

@ -1,3 +1,7 @@
@php
$locale = Webkul\Core\Models\Locale::where('code', app()->getLocale())->first();
@endphp
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
@ -30,7 +34,7 @@
</head>
<body @if (app()->getLocale() == 'ar') class="rtl" @endif style="scroll-behavior: smooth;">
<body @if ($locale->direction == 'rtl') class="rtl" @endif style="scroll-behavior: smooth;">
{!! view_render_event('bagisto.shop.layout.body.before') !!}

View File

@ -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 @@
<script>
$(document).ready(function() {
$('img#pro-img').data('zoom-image', $('img#pro-img').data('image')).ezPlus();
if ($(window).width() > 580) {
$('img#pro-img').data('zoom-image', $('img#pro-img').data('image')).ezPlus();
}
$(document).mousemove(function(event) {
if ($('.add-to-wishlist').length) {

View File

@ -2,13 +2,11 @@
namespace Webkul\User\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Event;
use Exception;
use Webkul\User\Http\Requests\UserForm;
use Illuminate\Support\Facades\{ Event, Hash };
use Webkul\User\Repositories\AdminRepository as Admin;
use Webkul\User\Repositories\RoleRepository as Role;
use Webkul\User\Http\Requests\UserForm;
use Hash;
/**
* Admin user controller
@ -42,8 +40,8 @@ class UserController extends Controller
/**
* Create a new controller instance.
*
* @param \Webkul\User\Repositories\AdminRepository $admin
* @param \Webkul\User\Repositories\RoleRepository $role
* @param \Webkul\User\Repositories\AdminRepository $admin
* @param \Webkul\User\Repositories\RoleRepository $role
* @return void
*/
public function __construct(Admin $admin, Role $role)
@ -60,7 +58,7 @@ class UserController extends Controller
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
* @return \Illuminate\View\View
*/
public function index()
{
@ -70,7 +68,7 @@ class UserController extends Controller
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
* @return \Illuminate\View\View
*/
public function create()
{
@ -83,11 +81,11 @@ class UserController extends Controller
* Store a newly created resource in storage.
*
* @param \Webkul\User\Http\Requests\UserForm $request
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\RedirectResponse
*/
public function store(UserForm $request)
{
$data = request()->all();
$data = $request->all();
if (isset($data['password']) && $data['password'])
$data['password'] = bcrypt($data['password']);
@ -107,7 +105,7 @@ class UserController extends Controller
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
* @return \Illuminate\View\View
*/
public function edit($id)
{
@ -123,11 +121,11 @@ class UserController extends Controller
*
* @param \Webkul\User\Http\Requests\UserForm $request
* @param int $id
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\RedirectResponse
*/
public function update(UserForm $request, $id)
{
$data = request()->all();
$data = $request->all();
if (! $data['password'])
unset($data['password']);
@ -155,7 +153,7 @@ class UserController extends Controller
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\RedirectResponse
*/
public function destroy($id)
{
@ -178,7 +176,7 @@ class UserController extends Controller
Event::fire('user.admin.delete.after', $id);
return response()->json(['message' => true], 200);
} catch (\Exception $e) {
} catch (Exception $e) {
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Admin']));
}
}