admin scroller bug fixed

This commit is contained in:
prateek srivastava 2019-04-03 15:23:12 +05:30
commit 1cb03f9ac3
106 changed files with 1343 additions and 1003 deletions

View File

@ -16,7 +16,7 @@ DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
SESSION_LIFETIME=10
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1

View File

@ -9,6 +9,12 @@
"type": "project",
"require": {
"php": "^7.1.3",
"ext-openssl": "*",
"ext-pdo": "*",
"ext-mbstring": "*",
"ext-tokenizer": "*",
"ext-pdo_mysql": "*",
"ext-curl": "*",
"barryvdh/laravel-dompdf": "^0.8.0@dev",
"dimsav/laravel-translatable": "^9.0",
"doctrine/dbal": "^2.9@dev",

View File

@ -16,7 +16,7 @@ return [
'enabled' => env('DEBUGBAR_ENABLED', null),
'except' => [
//
'telescope*'
],
/*

View File

@ -9,13 +9,13 @@ return array(
|
| Enter the routes name to enable dynamic imagecache manipulation.
| This handle will define the first part of the URI:
|
|
| {route}/{template}/{filename}
|
|
| Examples: "images", "img/cache"
|
*/
'route' => 'cache',
/*
@ -23,13 +23,13 @@ return array(
| Storage paths
|--------------------------------------------------------------------------
|
| The following paths will be searched for the image filename, submited
| by URI.
|
| The following paths will be searched for the image filename, submited
| by URI.
|
| Define as many directories as you like.
|
*/
'paths' => array(
storage_path('app/public'),
public_path('storage')
@ -41,7 +41,7 @@ return array(
|--------------------------------------------------------------------------
|
| Here you may specify your own manipulation filter templates.
| The keys of this array will define which templates
| The keys of this array will define which templates
| are available in the URI:
|
| {route}/{template}/{filename}
@ -50,7 +50,7 @@ return array(
| will be applied, by its fully qualified name.
|
*/
'templates' => array(
'small' => 'Webkul\Product\CacheFilters\Small',
'medium' => 'Webkul\Product\CacheFilters\Medium',
@ -65,7 +65,7 @@ return array(
| Lifetime in minutes of the images handled by the imagecache route.
|
*/
'lifetime' => 43200,
);
);

View File

@ -29,9 +29,9 @@ return [
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'lifetime' => env('SESSION_LIFETIME', 10),
'expire_on_close' => false,
'expire_on_close' => true,
/*
|--------------------------------------------------------------------------

View File

@ -2,6 +2,21 @@
return [
/*
|--------------------------------------------------------------------------
| Console Commands
|--------------------------------------------------------------------------
|
| This option allows you to add additional Artisan commands that should
| be available within the Tinker environment. Once the command is in
| this array you may execute the command in Tinker using its name.
|
*/
'commands' => [
// App\Console\Commands\ExampleCommand::class,
],
/*
|--------------------------------------------------------------------------
| Alias Blacklist

View File

@ -113,4 +113,4 @@ return [
|
*/
'to_array_always_loads_translations' => true,
];
];

View File

@ -20,4 +20,4 @@ $factory->define(App\User::class, function (Faker $faker) {
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10),
];
});
});

View File

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

View File

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

View File

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

View File

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

View File

@ -19,7 +19,7 @@ class TaxRateDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('tax_rates')->addSelect('id', 'identifier', 'state', 'country', 'tax_rate');
$queryBuilder = DB::table('tax_rates')->addSelect('id', 'identifier', 'state', 'country', 'zip_code', 'zip_from', 'zip_to', 'tax_rate');
$this->setQueryBuilder($queryBuilder);
}
@ -62,6 +62,33 @@ class TaxRateDataGrid extends DataGrid
'filterable' => true
]);
$this->addColumn([
'index' => 'zip_code',
'label' => trans('admin::app.configuration.tax-rates.zip_code'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
'index' => 'zip_from',
'label' => trans('admin::app.configuration.tax-rates.zip_from'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
'index' => 'zip_to',
'label' => trans('admin::app.configuration.tax-rates.zip_to'),
'type' => 'string',
'searchable' => true,
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
'index' => 'tax_rate',
'label' => trans('admin::app.datagrid.tax-rate'),

View File

@ -45,13 +45,12 @@ class CustomerController extends Controller
*/
protected $channel;
/**
/**
* Create a new controller instance.
*
* @param Webkul\Customer\Repositories\CustomerRepository as customer;
* @param Webkul\Customer\Repositories\CustomerGroupRepository as customerGroup;
* @param Webkul\Core\Repositories\ChannelRepository as Channel;
* @return void
* @param \Webkul\Customer\Repositories\CustomerRepository $customer
* @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroup
* @param \Webkul\Core\Repositories\ChannelRepository $channel
*/
public function __construct(Customer $customer, CustomerGroup $customerGroup, Channel $channel)
{

View File

@ -50,30 +50,30 @@ class ExportController extends Controller
}
}
if($proceed) {
$gridInstance = new $path;
if(! $proceed) {
return redirect()->back();
}
$gridInstance = new $path;
$records = array();
$records = $gridInstance->export();
$records = $gridInstance->export();
if(count($records) == 0) {
session()->flash('warning', trans('admin::app.export.no-records'));
if (count($records) == 0) {
session()->flash('warning', trans('admin::app.export.no-records'));
return redirect()->back();
}
if ($format == 'csv') {
return Excel::download(new DataGridExport($records), last($gridName).'.csv');
} else if($format == 'xls') {
return Excel::download(new DataGridExport($records), last($gridName).'.xlsx');
} else {
session()->flash('warning', trans('admin::app.export.illegal-format'));
return redirect()->back();
}
} else {
return redirect()->back();
}
if ($format == 'csv') {
return Excel::download(new DataGridExport($records), last($gridName).'.csv');
}
if ($format == 'xls') {
return Excel::download(new DataGridExport($records), last($gridName).'.xlsx');
}
session()->flash('warning', trans('admin::app.export.illegal-format'));
return redirect()->back();
}
}

View File

@ -65,14 +65,35 @@ class AdminServiceProvider extends ServiceProvider
view()->composer(['admin::layouts.nav-left', 'admin::layouts.nav-aside', 'admin::layouts.tabs'], function ($view) {
$tree = Tree::create();
foreach (config('menu.admin') as $item) {
if (bouncer()->hasPermission($item['key'])) {
$tree->add($item, 'menu');
$permissionType = auth()->guard('admin')->user()->role->permission_type;
$allowedPermissions = auth()->guard('admin')->user()->role->permissions;
foreach (config('menu.admin') as $index => $item) {
if (! bouncer()->hasPermission($item['key'])) {
continue;
}
if ($index + 1 < count(config('menu.admin')) && $permissionType != 'all') {
$permission = config('menu.admin')[$index + 1];
if (substr_count($permission['key'], '.') == 2 && substr_count($item['key'], '.') == 1) {
foreach ($allowedPermissions as $key => $value) {
if ($item['key'] == $value) {
$neededItem = $allowedPermissions[$key + 1];
foreach (config('menu.admin') as $key1 => $findMatced) {
if ($findMatced['key'] == $neededItem) {
$item['route'] = $findMatced['route'];
}
}
}
}
}
}
$tree->add($item, 'menu');
}
$tree->items = core()->sortItems($tree->items);
$view->with('menu', $tree);
});
@ -135,4 +156,4 @@ class AdminServiceProvider extends ServiceProvider
dirname(__DIR__) . '/Config/system.php', 'core'
);
}
}
}

View File

@ -52,7 +52,6 @@ window.onload = function () {
}
});
}
}
});
};

View File

@ -626,7 +626,7 @@ return [
],
'sliders' => [
'title' => 'Sliders',
'title' => 'Title',
'add-title' => 'Create Slider',
'edit-title' => 'Edit Slider',
'save-btn-title' => 'Save Slider',
@ -854,4 +854,4 @@ return [
'business-account' => 'Business Account'
]
]
];
];

View File

@ -12,7 +12,7 @@
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.catalog.attributes.add-title') }}
</h1>
</div>
@ -99,7 +99,7 @@
<accordian :title="'{{ __('admin::app.catalog.attributes.options') }}'" :active="true" :id="'options'">
<div slot="body">
{!! view_render_event('bagisto.admin.catalog.attribute.create_form_accordian.options.controls.before') !!}
<option-wrapper></option-wrapper>
@ -119,7 +119,7 @@
<div slot="body">
{!! view_render_event('bagisto.admin.catalog.attribute.create_form_accordian.options.controls.before') !!}
<div class="control-group">
<label for="is_required">{{ __('admin::app.catalog.attributes.is_required') }}</label>
<select class="control" id="is_required" name="is_required">
@ -246,7 +246,7 @@
<thead>
<tr>
<th v-if="show_swatch && (swatch_type == 'color' || swatch_type == 'image')">{{ __('admin::app.catalog.attributes.swatch') }}</th>
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
@foreach (Webkul\Core\Models\Locale::all() as $locale)
@ -317,21 +317,26 @@
$('#options').parent().removeClass('hide')
}
})
});
var optionWrapper = Vue.component('option-wrapper', {
template: '#options-template',
Vue.component('option-wrapper', {
data: () => ({
optionRowCount: 0,
optionRows: [],
show_swatch: false,
swatch_type: ''
}),
template: '#options-template',
created () {
var this_this = this;
inject: ['$validator'],
data: () => ({
optionRowCount: 0,
optionRows: [],
show_swatch: false,
swatch_type: ''
}),
created () {
var this_this = this;
$(document).ready(function () {
$('#type').on('change', function (e) {
if (['select'].indexOf($(e.target).val()) === -1) {
this_this.show_swatch = false;
@ -339,46 +344,38 @@
this_this.show_swatch = true;
}
});
});
},
methods: {
addOptionRow () {
var rowCount = this.optionRowCount++;
var row = {'id': 'option_' + rowCount};
@foreach (Webkul\Core\Models\Locale::all() as $locale)
row['{{ $locale->code }}'] = '';
@endforeach
this.optionRows.push(row);
},
methods: {
addOptionRow () {
var rowCount = this.optionRowCount++;
var row = {'id': 'option_' + rowCount};
removeRow (row) {
var index = this.optionRows.indexOf(row)
Vue.delete(this.optionRows, index);
},
@foreach (Webkul\Core\Models\Locale::all() as $locale)
row['{{ $locale->code }}'] = '';
@endforeach
adminName (row) {
return 'options[' + row.id + '][admin_name]';
},
this.optionRows.push(row);
},
localeInputName (row, locale) {
return 'options[' + row.id + '][' + locale + '][label]';
},
removeRow (row) {
var index = this.optionRows.indexOf(row)
Vue.delete(this.optionRows, index);
},
adminName (row) {
return 'options[' + row.id + '][admin_name]';
},
localeInputName (row, locale) {
return 'options[' + row.id + '][' + locale + '][label]';
},
sortOrderName (row) {
return 'options[' + row.id + '][sort_order]';
}
sortOrderName (row) {
return 'options[' + row.id + '][sort_order]';
}
})
new Vue({
el: '#options',
components: {
optionWrapper: optionWrapper
},
})
});
}
})
</script>
@endpush

View File

@ -12,7 +12,7 @@
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.catalog.attributes.edit-title') }}
</h1>
</div>
@ -118,22 +118,22 @@
<accordian :title="'{{ __('admin::app.catalog.attributes.options') }}'" :active="true" :id="'options'">
<div slot="body">
{!! view_render_event('bagisto.admin.catalog.attribute.edit_form_accordian.options.controls.before', ['attribute' => $attribute]) !!}
<option-wrapper></option-wrapper>
{!! view_render_event('bagisto.admin.catalog.attribute.edit_form_accordian.options.controls.after', ['attribute' => $attribute]) !!}
</div>
</accordian>
{!! view_render_event('bagisto.admin.catalog.attribute.edit_form_accordian.options.after', ['attribute' => $attribute]) !!}
</div>
{!! view_render_event('bagisto.admin.catalog.attribute.edit_form_accordian.validations.before', ['attribute' => $attribute]) !!}
<accordian :title="'{{ __('admin::app.catalog.attributes.validations') }}'" :active="true">
<div slot="body">
@ -207,7 +207,7 @@
</select>
<input type="hidden" name="value_per_locale" value="{{ $attribute->value_per_locale }}"/>
</div>
<div class="control-group">
<label for="value_per_channel">{{ __('admin::app.catalog.attributes.value_per_channel') }}</label>
<select class="control" id="value_per_channel" name="value_per_channel" disabled>
@ -220,7 +220,7 @@
</select>
<input type="hidden" name="value_per_channel" value="{{ $attribute->value_per_channel }}"/>
</div>
<div class="control-group">
<label for="is_filterable">{{ __('admin::app.catalog.attributes.is_filterable') }}</label>
<select class="control" id="is_filterable" name="is_filterable">
@ -232,7 +232,7 @@
</option>
</select>
</div>
<div class="control-group">
<label for="is_configurable">{{ __('admin::app.catalog.attributes.is_configurable') }}</label>
<select class="control" id="is_configurable" name="is_configurable">
@ -244,7 +244,7 @@
</option>
</select>
</div>
<div class="control-group">
<label for="is_visible_on_front">{{ __('admin::app.catalog.attributes.is_visible_on_front') }}</label>
<select class="control" id="is_visible_on_front" name="is_visible_on_front">
@ -302,11 +302,11 @@
<th v-if="show_swatch && (swatch_type == 'color' || swatch_type == 'image')">{{ __('admin::app.catalog.attributes.swatch') }}</th>
<th>{{ __('admin::app.catalog.attributes.admin_name') }}</th>
@foreach (Webkul\Core\Models\Locale::all() as $locale)
<th>{{ $locale->name . ' (' . $locale->code . ')' }}</th>
@endforeach
<th>{{ __('admin::app.catalog.attributes.position') }}</th>
@ -314,7 +314,7 @@
<th></th>
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in optionRows">
<td v-if="show_swatch && swatch_type == 'color'">
@ -366,7 +366,9 @@
<script>
Vue.component('option-wrapper', {
template: '#options-template',
template: '#options-template',
inject: ['$validator'],
data: () => ({
optionRowCount: 0,

View File

@ -94,8 +94,8 @@
</div>
<div class="control-group" :class="[errors.has('description') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="description" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old('description') }}</textarea>
<label for="description" id="descript-label" class="required">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea v-validate="''" class="control" id="description" name="description" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old('description') }}</textarea>
<span class="control-error" v-if="errors.has('description')">@{{ errors.first('description') }}</span>
</div>
@ -189,6 +189,14 @@
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | code',
image_advtab: true
});
$('#display_mode').on('change', function (e) {
if ($('#display_mode').val() != 'products_only') {
$("#descript-label").addClass("required");
} else {
$("#descript-label").removeClass("required");
}
})
});
</script>
@endpush

View File

@ -107,8 +107,8 @@
</div>
<div class="control-group" :class="[errors.has('{{$locale}}[description]') ? 'has-error' : '']">
<label for="description" class="required">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea v-validate="'required'" class="control" id="description" name="{{$locale}}[description]" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old($locale)['description'] ?: $category->translate($locale)['description'] }}</textarea>
<label for="description">{{ __('admin::app.catalog.categories.description') }}</label>
<textarea class="control" id="description" name="{{$locale}}[description]" data-vv-as="&quot;{{ __('admin::app.catalog.categories.description') }}&quot;">{{ old($locale)['description'] ?: $category->translate($locale)['description'] }}</textarea>
<span class="control-error" v-if="errors.has('{{$locale}}[description]')">@{{ errors.first('{!!$locale!!}[description]') }}</span>
</div>

View File

@ -146,14 +146,14 @@
<td>
<div class="control-group" :class="[errors.has(variantInputName + '[price]') ? 'has-error' : '']">
<input type="text" v-validate="'required'" v-model="variant.price" :name="[variantInputName + '[price]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.price') }}&quot;"/>
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.price" :name="[variantInputName + '[price]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.price') }}&quot;"/>
<span class="control-error" v-if="errors.has(variantInputName + '[price]')">@{{ errors.first(variantInputName + '[price]') }}</span>
</div>
</td>
<td>
<div class="control-group" :class="[errors.has(variantInputName + '[weight]') ? 'has-error' : '']">
<input type="text" v-validate="'required'" v-model="variant.weight" :name="[variantInputName + '[weight]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.weight') }}&quot;"/>
<input type="number" v-validate="'required|min_value:0.0001'" v-model="variant.weight" :name="[variantInputName + '[weight]']" class="control" data-vv-as="&quot;{{ __('admin::app.catalog.products.weight') }}&quot;"/>
<span class="control-error" v-if="errors.has(variantInputName + '[weight]')">@{{ errors.first(variantInputName + '[weight]') }}</span>
</div>
</td>

View File

@ -55,7 +55,7 @@
<label for="type" class="required">{{ __('admin::app.catalog.products.product-type') }}</label>
<select class="control" v-validate="'required'" id="type" name="type" {{ $familyId ? 'disabled' : '' }} data-vv-as="&quot;{{ __('admin::app.catalog.products.product-type') }}&quot;">
@foreach($productTypes as $key => $productType)
<option value="{{ $key }}">{{ $productType['name'] }}</option>
<option value="{{ $key }}" {{ $key == $productType['key'] ? 'selected' : '' }}>{{ $productType['name'] }}</option>
@endforeach
</select>
@ -82,7 +82,7 @@
<div class="control-group" :class="[errors.has('sku') ? 'has-error' : '']">
<label for="sku" class="required">{{ __('admin::app.catalog.products.sku') }}</label>
<input type="text" v-validate="'required'" class="control" id="sku" name="sku" value="{{ $sku ?: old('sku') }}" data-vv-as="&quot;{{ __('admin::app.catalog.products.sku') }}&quot;"/>
<input type="text" v-validate="{ required: true, regex: /^[a-z0-9]+(?:-[a-z0-9]+)*$/ }" class="control" id="sku" name="sku" value="{{ $sku ?: old('sku') }}" data-vv-as="&quot;{{ __('admin::app.catalog.products.sku') }}&quot;"/>
<span class="control-error" v-if="errors.has('sku')">@{{ errors.first('sku') }}</span>
</div>

View File

@ -66,7 +66,7 @@
@if (isset($field['repository']))
@foreach ($value as $key => $option)
<option value="{{ $key }}" {{ $option == $selectedOption ? 'selected' : ''}}>
<option value="{{ $key }}" {{ $key == $selectedOption ? 'selected' : ''}}>
{{ trans($option) }}
</option>
@ -100,7 +100,7 @@
@if (isset($field['repository']))
@foreach ($value as $key => $option)
<option value="{{ $value[$key] }}" {{ in_array($value[$key], explode(',', $selectedOption)) ? 'selected' : ''}}>
<option value="{{ $key }}" {{ in_array($key, explode(',', $selectedOption)) ? 'selected' : ''}}>
{{ trans($value[$key]) }}
</option>

View File

@ -47,7 +47,7 @@
<div class="control-group" :class="[errors.has('image') ? 'has-error' : '']">
<label for="new_image">{{ __('admin::app.settings.sliders.image') }}</label>
<image-wrapper :button-label="'{{ __('admin::app.settings.sliders.image') }}'" input-name="image" :multiple="false"></image-wrapper>
<image-wrapper :button-label="'{{ __('admin::app.settings.sliders.image') }}'" input-name="image" :multiple="false" :required="true"></image-wrapper>
</div>
<div class="control-group" :class="[errors.has('content') ? 'has-error' : '']">
@ -82,4 +82,4 @@
});
});
</script>
@endpush
@endpush

View File

@ -48,7 +48,7 @@
</div>
<div class="control-group">
<image-wrapper :button-label="'{{ __('admin::app.settings.sliders.image') }}'" input-name="image" :multiple="false" :images='"{{ url('storage/'.$slider->path) }}"'></image-wrapper>
<image-wrapper :button-label="'{{ __('admin::app.settings.sliders.image') }}'" input-name="image" :multiple="false" :images='"{{ url('storage/'.$slider->path) }}"' :required="true"></image-wrapper>
</div>
<div class="control-group">
@ -86,4 +86,4 @@
});
});
</script>
@endpush
@endpush

View File

@ -77,7 +77,7 @@
<div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']">
<label for="tax_rate" class="required">{{ __('admin::app.configuration.tax-rates.tax_rate') }}</label>
<input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" data-vv-as="&quot;{{ __('admin::app.configuration.tax-rates.tax_rate') }}&quot;" value="{{ old('tax_rate') }}"/>
<input v-validate="'required|min_value:0.0001'" class="control" id="tax_rate" name="tax_rate" data-vv-as="&quot;{{ __('admin::app.configuration.tax-rates.tax_rate') }}&quot;" value="{{ old('tax_rate') }}"/>
<span class="control-error" v-if="errors.has('tax_rate')">@{{ errors.first('tax_rate') }}</span>
</div>
</div>

View File

@ -62,7 +62,7 @@
<div class="control-group" :class="[errors.has('tax_rate') ? 'has-error' : '']">
<label for="tax_rate" class="required">{{ __('admin::app.configuration.tax-rates.tax_rate') }}</label>
<input v-validate="'required'" class="control" id="tax_rate" name="tax_rate" data-vv-as="&quot;{{ __('admin::app.configuration.tax-rates.tax_rate') }}&quot;" value="{{ $taxRate->tax_rate }}" />
<input v-validate="'required|min_value:0.0001'" class="control" id="tax_rate" name="tax_rate" data-vv-as="&quot;{{ __('admin::app.configuration.tax-rates.tax_rate') }}&quot;" value="{{ $taxRate->tax_rate }}" />
<span class="control-error" v-if="errors.has('tax_rate')">@{{ errors.first('tax_rate') }}</span>
</div>

View File

@ -73,7 +73,7 @@
} else {
$('.tree-container').addClass('hide')
}
})
});
</script>

View File

@ -75,7 +75,8 @@ class CategoryController extends Controller
$this->validate(request(), [
'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug],
'name' => 'required',
'image.*' => 'mimes:jpeg,jpg,bmp,png'
'image.*' => 'mimes:jpeg,jpg,bmp,png',
'description' => 'required_if:display_mode,==,description_only,products_and_description'
]);
if (strtolower(request()->input('name')) == 'root') {

View File

@ -16,6 +16,17 @@ class Currency extends Model implements CurrencyContract
'code', 'name'
];
/**
* Set currency code in capital
*
* @param string $value
* @return void
*/
public function setCodeAttribute($code)
{
$this->attributes['code'] = strtoupper($code);
}
/**
* Get the currency_exchange associated with the currency.
*/

View File

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

View File

@ -70,7 +70,7 @@ class AddressController extends Controller
public function store()
{
request()->merge(['address1' => implode(PHP_EOL, array_filter(request()->input('address1')))]);
$data = collect(request()->input())->except('_token')->toArray();
$this->validate(request(), [
@ -107,9 +107,15 @@ class AddressController extends Controller
*/
public function edit($id)
{
$address = $this->address->find($id);
$addresses = $this->customer->addresses;
return view($this->_config['view'], compact('address'));
foreach ($addresses as $address) {
if ($id == $address->id) {
return view($this->_config['view'], compact('address'));
}
}
return redirect()->route('customer.address.index');
}
/**
@ -133,9 +139,19 @@ class AddressController extends Controller
$data = collect(request()->input())->except('_token')->toArray();
$this->address->update($data, $id);
$addresses = $this->customer->addresses;
session()->flash('success', trans('shop::app.customer.account.address.edit.success'));
foreach($addresses as $address) {
if($id == $address->id) {
session()->flash('success', trans('shop::app.customer.account.address.edit.success'));
$this->address->update($data, $id);
return redirect()->route('customer.address.index');
}
}
session()->flash('warning', trans('shop::app.security-warning'));
return redirect()->route('customer.address.index');
}
@ -169,10 +185,18 @@ class AddressController extends Controller
*/
public function destroy($id)
{
$this->address->delete($id);
$addresses = $this->customer->addresses;
session()->flash('success', trans('shop::app.customer.account.address.delete.success'));
foreach($addresses as $address) {
if($id == $address->id) {
$this->address->delete($id);
return redirect()->back();
session()->flash('success', trans('shop::app.customer.account.address.delete.success'));
return redirect()->route('customer.address.index');
}
}
return redirect()->route('customer.address.index');
}
}

View File

@ -77,7 +77,7 @@ class CustomerController extends Controller
*
* @return View
*/
public function editIndex()
public function edit()
{
$customer = $this->customer->find(auth()->guard('customer')->user()->id);
@ -89,7 +89,7 @@ class CustomerController extends Controller
*
* @return Redirect.
*/
public function edit()
public function update()
{
$id = auth()->guard('customer')->user()->id;
@ -124,34 +124,14 @@ class CustomerController extends Controller
if ($this->customer->update($data, $id)) {
Session()->flash('success', trans('shop::app.customer.account.profile.edit-success'));
return redirect()->back();
return redirect()->route($this->_config['redirect']);
} else {
Session()->flash('success', trans('shop::app.customer.account.profile.edit-fail'));
return redirect()->back();
return redirect()->back($this->_config['redirect']);
}
}
/**
* Load the view for the customer account panel, showing orders in a table.
*
* @return Mixed
*/
public function orders()
{
return view($this->_config['view']);
}
/**
* Load the view for the customer account panel, showing wishlist items.
*
* @return Mixed
*/
public function wishlist()
{
return view($this->_config['view']);
}
/**
* Load the view for the customer account panel, showing approved reviews.
*
@ -159,18 +139,8 @@ class CustomerController extends Controller
*/
public function reviews()
{
$reviews = $this->productReview->getCustomerReview();
$reviews = auth()->guard('customer')->user()->all_reviews;
return view($this->_config['view'], compact('reviews'));
}
/**
* Load the view for the customer account panel, shows the customer address.
*
* @return Mixed
*/
public function address()
{
return view($this->_config['view']);
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace Webkul\Shop\Http\Controllers;
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
@ -67,9 +67,7 @@ class OrderController extends Controller
*/
public function index()
{
$orders = $this->order->findWhere([
'customer_id' => auth()->guard('customer')->user()->id
]);
$orders = auth()->guard('customer')->user()->all_orders;
return view($this->_config['view'], compact('orders'));
}
@ -82,9 +80,15 @@ class OrderController extends Controller
*/
public function view($id)
{
$order = $this->order->find($id);
$orders = auth()->guard('customer')->user()->all_orders;
return view($this->_config['view'], compact('order'));
if(isset($orders) && count($orders)) {
$order = $orders->first();
return view($this->_config['view'], compact('order'));
} else {
return redirect()->route( 'customer.orders.index');
}
}
/**
@ -101,4 +105,4 @@ class OrderController extends Controller
return $pdf->download('invoice-' . $invoice->created_at->format('d-m-Y') . '.pdf');
}
}
}

View File

@ -11,8 +11,7 @@ use Cart;
use Auth;
/**
* Customer controlller for the customer basically for the tasks of customers which will be done
* after customer authenticastion.
* Customer controller
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
@ -40,8 +39,6 @@ class WishlistController extends Controller
$this->_config = request('_config');
$this->customer = $customer;
$this->wishlist = $wishlist;
$this->product = $product;
@ -67,6 +64,10 @@ class WishlistController extends Controller
public function add($itemId) {
$product = $this->product->findOneByField('id', $itemId);
if(!$product->status) {
return redirect()->back();
}
$data = [
'channel_id' => core()->getCurrentChannel()->id,
'product_id' => $itemId,
@ -104,29 +105,22 @@ class WishlistController extends Controller
* @param integer $itemId
*/
public function remove($itemId) {
$found = $this->wishlist->find($itemId);
if(isset($found)) {
$found = true;
} else {
$found = false;
}
$customerWishlistItems = auth()->guard('customer')->user()->wishlist_items;
if($found) {
$result = $this->wishlist->deleteWhere(['customer_id' => auth()->guard('customer')->user()->id, 'channel_id' => core()->getCurrentChannel()->id, 'id' => $itemId]);
foreach($customerWishlistItems as $customerWishlistItem) {
if($itemId == $customerWishlistItem->id) {
$this->wishlist->delete($itemId);
if ($result) {
session()->flash('success', trans('customer::app.wishlist.removed'));
return redirect()->back();
} else {
session()->flash('error', trans('customer::app.wishlist.remove-fail'));
return redirect()->back();
}
} else {
return redirect()->back();
}
session()->flash('error', trans('customer::app.wishlist.remove-fail'));
return redirect()->back();
}
/**
@ -136,6 +130,13 @@ class WishlistController extends Controller
*/
public function move($itemId) {
$wishlistItem = $this->wishlist->findOneByField('id', $itemId);
if(!isset($wishlistItem) || $wishlistItem->customer_id != auth()->guard('customer')->user()->id) {
session()->flash('warning', trans('shop::app.security-warning'));
return redirect()->route( 'customer.wishlist.index');
}
$result = Cart::moveToCart($wishlistItem);
if ($result == 1) {
@ -151,16 +152,10 @@ class WishlistController extends Controller
return redirect()->back();
}
} else if ($result == 0) {
Session('error', trans('shop::app.wishlist.error'));
session()->flash('error', trans('shop::app.wishlist.error'));
return redirect()->back();
} else if ($result == -1) {
if (! $wishlistItem->delete()) {
session()->flash('error', trans('shop::app.wishlist.move-error'));
return redirect()->back();
}
session()->flash('info', trans('shop::app.checkout.cart.add-config-warning'));
return redirect()->route('shop.products.index', $wishlistItem->product->url_key);
@ -184,4 +179,4 @@ class WishlistController extends Controller
session()->flash('success', trans('customer::app.wishlist.remove-all-success'));
return redirect()->back();
}
}
}

View File

@ -96,4 +96,11 @@ class Customer extends Authenticatable implements CustomerContract
public function all_reviews() {
return $this->hasMany(ProductReviewProxy::modelClass(), 'customer_id');
}
/**
* get all orders of a customer
*/
public function all_orders() {
return $this->hasMany(OrderProxy::modelClass(), 'customer_id');
}
}

View File

@ -0,0 +1,71 @@
<?php
return array(
/*
|--------------------------------------------------------------------------
| Name of route
|--------------------------------------------------------------------------
|
| Enter the routes name to enable dynamic imagecache manipulation.
| This handle will define the first part of the URI:
|
| {route}/{template}/{filename}
|
| Examples: "images", "img/cache"
|
*/
'route' => 'cache',
/*
|--------------------------------------------------------------------------
| Storage paths
|--------------------------------------------------------------------------
|
| The following paths will be searched for the image filename, submited
| by URI.
|
| Define as many directories as you like.
|
*/
'paths' => array(
storage_path('app/public'),
public_path('storage')
),
/*
|--------------------------------------------------------------------------
| Manipulation templates
|--------------------------------------------------------------------------
|
| Here you may specify your own manipulation filter templates.
| The keys of this array will define which templates
| are available in the URI:
|
| {route}/{template}/{filename}
|
| The values of this array will define which filter class
| will be applied, by its fully qualified name.
|
*/
'templates' => array(
'small' => 'Webkul\Product\CacheFilters\Small',
'medium' => 'Webkul\Product\CacheFilters\Medium',
'large' => 'Webkul\Product\CacheFilters\Large',
),
/*
|--------------------------------------------------------------------------
| Image Cache Lifetime
|--------------------------------------------------------------------------
|
| Lifetime in minutes of the images handled by the imagecache route.
|
*/
'lifetime' => 43200,
);

View File

@ -219,7 +219,11 @@ class ProductController extends Controller
$productIds = explode(',', request()->input('indexes'));
foreach ($productIds as $productId) {
$this->product->delete($productId);
$product = $this->product->find($productId);
if(isset($product)) {
$this->product->delete($productId);
}
}
session()->flash('success', trans('admin::app.catalog.products.mass-delete-success'));

View File

@ -23,6 +23,10 @@ class ProductServiceProvider extends ServiceProvider
$this->app->register(ModuleServiceProvider::class);
$this->composeView();
$this->publishes([
dirname(__DIR__) . '/Config/imagecache.php' => config_path('imagecache.php'),
]);
}
/**

View File

@ -37,9 +37,17 @@ class SearchRepository extends Repository
}
public function search($data) {
$term = $data['term'];
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
$searchTerm = explode("?", $query);
$serachQuery = '';
$products = $this->product->searchProductByAttribute($term);
foreach($searchTerm as $term){
if (strpos($term, 'term') !== false) {
$serachQuery = last(explode("=", $term));
}
}
$products = $this->product->searchProductByAttribute($serachQuery);
return $products;
}

View File

@ -4,6 +4,7 @@ namespace Webkul\Sales\Repositories;
use Illuminate\Container\Container as App;
use Webkul\Core\Eloquent\Repository;
use Illuminate\Support\Facades\Event;
/**
* ShipmentItem Reposotory
@ -31,16 +32,16 @@ class ShipmentItemRepository extends Repository
{
if (! $data['product'])
return;
$orderedInventory = $data['product']->ordered_inventories()
->where('channel_id', $data['shipment']->order->channel->id)
->first();
if ($orderedInventory) {
if (($orderedQty = $orderedInventory->qty - $data['qty']) < 0) {
$orderedQty = 0;
}
$orderedInventory->update([
'qty' => $orderedQty
]);
@ -59,7 +60,7 @@ class ShipmentItemRepository extends Repository
if (!$inventory)
return;
if (($qty = $inventory->qty - $data['qty']) < 0) {
$qty = 0;
}
@ -67,5 +68,7 @@ class ShipmentItemRepository extends Repository
$inventory->update([
'qty' => $qty
]);
Event::fire('catalog.product.update.after', $data['product']);
}
}

View File

@ -20,6 +20,7 @@
"dependencies": {
"vee-validate": "2.0.0-rc.26",
"vue-flatpickr": "^2.3.0",
"vue-slider-component": "^2.7.5"
"vue-slider-component": "^2.7.5",
"ez-plus": "^1.2.1"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="8px" height="8px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>icon-dropdown</title>
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>arrow-down</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="icon-dropdown" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<polygon id="" fill="#242424" transform="translate(4.000000, 4.514496) rotate(-270.000000) translate(-4.000000, -4.514496) " points="1.48080444 8.51449585 4.54690552 4.51449585 1.48080444 0.51449585 3.48550415 0.51449585 6.51919556 4.51449585 3.48550415 8.51449585"></polygon>
<g id="arrow-down" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<polygon id="Rectangle-2" fill="#A5A5A5" transform="translate(9.000000, 8.000000) rotate(-45.000000) translate(-9.000000, -8.000000) " points="6 5 12 11 6 11"></polygon>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 633 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=391400bc9a994e60b97f",
"/css/shop.css": "/css/shop.css?id=460297557fd9ee391499"
}
"/js/shop.js": "/js/shop.js?id=412d129ed770afb5dee3",
"/css/shop.css": "/css/shop.css?id=068329de73da5012af0d"
}

View File

@ -34,6 +34,7 @@ class OrderDataGrid extends DataGrid
'type' => 'number',
'searchable' => false,
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
@ -42,6 +43,7 @@ class OrderDataGrid extends DataGrid
'type' => 'datetime',
'searchable' => true,
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
@ -50,6 +52,7 @@ class OrderDataGrid extends DataGrid
'type' => 'price',
'searchable' => true,
'sortable' => true,
'filterable' => true
]);
$this->addColumn([
@ -74,7 +77,8 @@ class OrderDataGrid extends DataGrid
return '<span class="badge badge-md badge-warning">Pending Payment</span>';
else if ($value->status == "fraud")
return '<span class="badge badge-md badge-danger">Fraud</span>';
}
},
'filterable' => true
]);
}

View File

@ -8,6 +8,7 @@ use Webkul\Checkout\Repositories\CartRepository;
use Webkul\Checkout\Repositories\CartItemRepository;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Repositories\WishlistRepository;
use Webkul\Product\Helpers\ProductImage;
use Webkul\Product\Helpers\View as ProductView;
use Illuminate\Support\Facades\Event;
@ -46,13 +47,23 @@ class CartController extends Controller
protected $productView;
protected $suppressFlash = false;
/**
* WishlistRepository Repository object
*
* @var array
*/
protected $wishlist;
public function __construct(
CartRepository $cart,
CartItemRepository $cartItem,
CustomerRepository $customer,
ProductRepository $product,
ProductImage $productImage,
ProductView $productView
ProductView $productView,
WishlistRepository $wishlist
)
{
@ -70,6 +81,8 @@ class CartController extends Controller
$this->productView = $productView;
$this->wishlist = $wishlist;
$this->_config = request('_config');
}
@ -102,7 +115,19 @@ class CartController extends Controller
if ($result) {
session()->flash('success', trans('shop::app.checkout.cart.item.success'));
return redirect()->route($this->_config['redirect']);
if (auth()->guard('customer')->user()) {
$customer = auth()->guard('customer')->user();
if (count($customer->wishlist_items)) {
foreach ($customer->wishlist_items as $wishlist) {
if ($wishlist->product_id == $id) {
$this->wishlist->delete($wishlist->id);
}
}
}
}
return redirect()->back();
} else {
session()->flash('warning', trans('shop::app.checkout.cart.item.error-add'));
@ -153,7 +178,6 @@ class CartController extends Controller
}
}
foreach ($request['qty'] as $key => $value) {
$item = $this->cartItem->findOneByField('id', $key);
@ -161,7 +185,11 @@ class CartController extends Controller
Event::fire('checkout.cart.update.before', $key);
Cart::updateItem($item->product_id, $data, $key);
$result = Cart::updateItem($item->product_id, $data, $key);
if ($result == false) {
$this->suppressFlash = true;
}
Event::fire('checkout.cart.update.after', $item);
@ -171,6 +199,12 @@ class CartController extends Controller
Cart::collectTotals();
if ($this->suppressFlash) {
session()->forget('success');
session()->forget('warning');
session()->flash('info', trans('shop::app.checkout.cart.partial-cart-update'));
}
return redirect()->back();
}

View File

@ -100,7 +100,7 @@ class ReviewController extends Controller
}
/**
* Display reviews accroding to product.
* Display reviews of particular product.
*
* @param string $slug
* @return \Illuminate\Http\Response
@ -113,21 +113,31 @@ class ReviewController extends Controller
}
/**
* Delete the review of the current product
* Customer delete a reviews from their account
*
* @return response
*/
public function destroy($id)
{
$this->productReview->delete($id);
$reviews = auth()->guard('customer')->user()->all_reviews;
session()->flash('success', trans('shop::app.response.delete-success', ['name' => 'Product Review']));
if ($reviews->count() > 0) {
foreach ($reviews as $review) {
if($review->id == $id) {
$this->productReview->delete($id);
return redirect()->back();
session()->flash('success', trans('shop::app.response.delete-success', ['name' => 'Product Review']));
return redirect()->route($this->_config['redirect']);
}
}
}
return redirect()->route($this->_config['redirect']);
}
/**
* Function to delete all reviews
* Customer delete all reviews from their account
*
* @return Mixed Response & Boolean
*/
@ -142,6 +152,6 @@ class ReviewController extends Controller
session()->flash('success', trans('shop::app.reviews.delete-all'));
return redirect()->back();
return redirect()->route($this->_config['redirect']);
}
}
}

View File

@ -29,7 +29,17 @@ class Currency
*/
public function handle($request, Closure $next)
{
if ($currency = $request->get('currency')) {
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
$currencyTerm = preg_split('/(\?|&)/', $query);
$currencyCode = '';
foreach($currencyTerm as $term){
if (strpos($term, 'currency') !== false) {
$currencyCode = last(explode("=", $term));
}
}
if ($currency = $currencyCode) {
if ($this->currency->findOneByField('code', $currency)) {
session()->put('currency', $currency);
}

View File

@ -29,7 +29,17 @@ class Locale
*/
public function handle($request, Closure $next)
{
if ($locale = $request->get('locale')) {
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
$localeTerm = preg_split('/(\?|&)/', $query);
$localCode = '';
foreach($localeTerm as $term){
if (strpos($term, 'locale') !== false) {
$localCode = last(explode("=", $term));
}
}
if ($locale = $localCode) {
if ($this->locale->findOneByField('code', $locale)) {
app()->setLocale($locale);

View File

@ -1,54 +0,0 @@
<?php
namespace Webkul\Shop\Http\ViewComposers;
use Illuminate\View\View;
use Illuminate\Support\Collection;
use Webkul\Category\Repositories\CategoryRepository as Category;
/**
* Category List Composer on Navigation Menu
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CategoryComposer
{
/**
* The category implementation.
*
* for shop bundle's navigation
* menu
*/
protected $category;
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function __construct(Category $category)
{
$this->category = $category;
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$categories = [];
foreach ($this->category->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category) {
if ($category->slug)
array_push($categories, $category);
}
$view->with('categories', $categories);
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace Webkul\Shop\Http\ViewComposers;
use Illuminate\View\View;
use Illuminate\Support\Collection;
use Webkul\Product\Repositories\ProductRepository as Product;
/**
* Featured Products page
*
* @author Jitendra Singh <jitendra@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class FeaturedProductListComposer
{
/**
* ProductRepository object
*
* @var array
*/
protected $product;
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function __construct(Product $product)
{
$this->product = $product;
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$products = $this->product->getFeaturedProducts();
$view->with('products', $products);
}
}

View File

@ -1,47 +0,0 @@
<?php
namespace Webkul\Shop\Http\ViewComposers;
use Illuminate\View\View;
use Illuminate\Support\Collection;
use Webkul\Product\Repositories\ProductRepository as Product;
/**
* New Products page
*
* @author Jitendra Singh <jitendra@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class NewProductListComposer
{
/**
* ProductRepository object
*
* @var array
*/
protected $product;
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function __construct(Product $product)
{
$this->product = $product;
}
/**
* Bind data to the view.
*
* @param View $view
* @return void
*/
public function compose(View $view)
{
$products = $this->product->getNewProducts();
$view->with('products', $products);
}
}

View File

@ -191,13 +191,13 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function
])->name('customer.profile.index');
//Customer Profile Edit Form Show
Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editIndex')->defaults('_config', [
Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@edit')->defaults('_config', [
'view' => 'shop::customers.account.profile.edit'
])->name('customer.profile.edit');
//Customer Profile Edit Form Store
Route::post('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@edit')->defaults('_config', [
'view' => 'shop::customers.account.profile.edit'
Route::post('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@update')->defaults('_config', [
'redirect' => 'shop::customers.account.index'
])->name('customer.profile.edit');
/* Profile Routes Ends Here */
@ -242,17 +242,17 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function
/* Orders route */
//Customer orders(listing)
Route::get('orders', 'Webkul\Shop\Http\Controllers\OrderController@index')->defaults('_config', [
Route::get('orders', 'Webkul\Customer\Http\Controllers\OrderController@index')->defaults('_config', [
'view' => 'shop::customers.account.orders.index'
])->name('customer.orders.index');
//Customer orders view summary and status
Route::get('orders/view/{id}', 'Webkul\Shop\Http\Controllers\OrderController@view')->defaults('_config', [
Route::get('orders/view/{id}', 'Webkul\Customer\Http\Controllers\OrderController@view')->defaults('_config', [
'view' => 'shop::customers.account.orders.view'
])->name('customer.orders.view');
//Prints invoice
Route::get('orders/print/{id}', 'Webkul\Shop\Http\Controllers\OrderController@print')->defaults('_config', [
Route::get('orders/print/{id}', 'Webkul\Customer\Http\Controllers\OrderController@print')->defaults('_config', [
'view' => 'shop::customers.account.orders.print'
])->name('customer.orders.print');

View File

@ -1,41 +0,0 @@
<?php
namespace Webkul\Shop\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Webkul\Product\Helpers\ProductImage;
use View;
/**
* Composer service provider
*
* @author Jitendra Singh <jitendra@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class ComposerServiceProvider extends ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function boot()
{
View::composer(
['shop::layouts.header.index', 'shop::layouts.footer.footer'],
'Webkul\Shop\Http\ViewComposers\CategoryComposer'
);
View::composer(
['shop::home.new-products'],
'Webkul\Shop\Http\ViewComposers\NewProductListComposer'
);
View::composer(
['shop::home.featured-products'],
'Webkul\Shop\Http\ViewComposers\FeaturedProductListComposer'
);
}
}

View File

@ -9,7 +9,6 @@ use Illuminate\Pagination\Paginator;
use Webkul\Shop\Http\Middleware\Locale;
use Webkul\Shop\Http\Middleware\Theme;
use Webkul\Shop\Http\Middleware\Currency;
use Webkul\Shop\Providers\ComposerServiceProvider;
use Webkul\Core\Tree;
/**
@ -41,8 +40,6 @@ class ShopServiceProvider extends ServiceProvider
$router->aliasMiddleware('theme', Theme::class);
$router->aliasMiddleware('currency', Currency::class);
$this->app->register(ComposerServiceProvider::class);
$this->composeView();
Paginator::defaultView('shop::partials.pagination');

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="8px" height="8px" viewBox="0 0 8 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50 (54983) - http://www.bohemiancoding.com/sketch -->
<title>icon-dropdown</title>
<svg width="18px" height="18px" viewBox="0 0 18 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 50.2 (55047) - http://www.bohemiancoding.com/sketch -->
<title>arrow-down</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="icon-dropdown" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<polygon id="" fill="#242424" transform="translate(4.000000, 4.514496) rotate(-270.000000) translate(-4.000000, -4.514496) " points="1.48080444 8.51449585 4.54690552 4.51449585 1.48080444 0.51449585 3.48550415 0.51449585 6.51919556 4.51449585 3.48550415 8.51449585"></polygon>
<g id="arrow-down" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<polygon id="Rectangle-2" fill="#A5A5A5" transform="translate(9.000000, 8.000000) rotate(-45.000000) translate(-9.000000, -8.000000) " points="6 5 12 11 6 11"></polygon>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 743 B

After

Width:  |  Height:  |  Size: 633 B

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -3,6 +3,7 @@ window.Vue = require("vue");
window.VeeValidate = require("vee-validate");
window.axios = require("axios");
require("./bootstrap");
require("ez-plus/src/jquery.ez-plus.js");
Vue.use(VeeValidate);
Vue.prototype.$http = axios

View File

@ -443,6 +443,8 @@ input {
max-width: 280px;
margin-bottom: 10px;
background: $background-color;
min-height: 300px;
min-width: 250px;
img {
display: block;
@ -931,7 +933,7 @@ section.slider-block {
width: 300px;
.btn.btn-sm {
padding: 9px 30px;
padding: 9px 25px;
}
}
@ -1067,7 +1069,7 @@ section.slider-block {
color: $font-color;
text-decoration: none;
padding: 0.8em 0.3em 0.8em 0.5em;
text-transform: uppercase;
text-transform: capitalize;
letter-spacing: -0.38px;
position: relative;
}
@ -1083,7 +1085,6 @@ section.slider-block {
.nav li {
position: relative;
height:45px;
}
.nav > li {
@ -1101,6 +1102,9 @@ section.slider-block {
.nav li li a {
margin-top: 1px;
white-space: initial;
word-break: break-word;
width: 200px;
}
.nav li a:first-child:nth-last-child(2):before {
@ -1120,7 +1124,7 @@ section.slider-block {
white-space: nowrap;
border: 1px solid $border-color;
background-color:white;
z-index: 1;
z-index: 10000;
left: -99999em;
}
@ -1808,7 +1812,7 @@ section.product-detail {
.addtocart {
width: 49%;
background: black;
white-space: nowrap;
white-space: normal;
text-transform: uppercase;
}
@ -1822,6 +1826,7 @@ section.product-detail {
.details {
width: 50%;
overflow-wrap: break-word;
.product-price {
margin-bottom: 14px;
@ -3483,7 +3488,6 @@ section.review {
}
}
/// rtl css start here
.rtl {
direction: rtl;
@ -3653,7 +3657,7 @@ section.review {
// product card
.main-container-wrapper .product-card .sticker {
left: auto;
right: 10px;
right: 20px;
}
.main-container-wrapper .product-card .cart-wish-wrap .addtocart {
@ -4025,6 +4029,14 @@ section.review {
left: auto;
}
}
.product-list {
.product-card .product-information {
padding-left: 0px;
padding-right: 30px;
float: left;
}
}
}
/// rtl css end here

View File

@ -9,7 +9,7 @@ return [
'wishlist' => 'قائمة الأماني',
'orders' => 'الأوامر',
],
'common' => [
'error' => 'حدث شيء خاطئ ، رجاء حاول ثانية لاحقا.'
],
@ -385,7 +385,8 @@ return [
],
'quantity-error' => 'الكمية المطلوبة غير متوفرة',
'cart-subtotal' => 'المجموع الفرعي للعربات',
'cart-remove-action' => 'هل تريد حقا أن تفعل هذا ؟'
'cart-remove-action' => 'هل تريد حقا أن تفعل هذا ؟',
'partial-cart-update' => 'Only some of the product(s) were updated'
],
'onepage' => [

View File

@ -1,6 +1,9 @@
<?php
return [
'security-warning' => 'Suspicious Activity Found!!!',
'nothing-to-delete' => 'Nothing to delete',
'layouts' => [
'my-account' => 'My Account',
'profile' => 'Profile',
@ -216,8 +219,9 @@ return [
'edit' => [
'page-title' => 'Customer - Edit Address',
'title' => 'Edit Address',
'street-address' => 'Street Address',
'submit' => 'Save Address',
'success' => 'Address Updated Successfully.'
'success' => 'Address Updated Successfully.',
],
'delete' => [
'success' => 'Address Successfully Deleted',
@ -389,7 +393,8 @@ return [
],
'quantity-error' => 'Requested Quantity Is Not Available',
'cart-subtotal' => 'Cart Subtotal',
'cart-remove-action' => 'Do you really want to do this ?'
'cart-remove-action' => 'Do you really want to do this ?',
'partial-cart-update' => 'Only some of the product(s) were updated'
],
'onepage' => [
@ -498,4 +503,4 @@ return [
'delete-success' => ':name deleted successfully.',
'submit-success' => ':name submitted successfully.'
],
];
];

View File

@ -58,7 +58,7 @@ return [
'already' => 'Você já está inscrito em nossa lista de assinaturas',
'unsubscribed' => 'Você não está inscrito em nossa lista de assinaturas',
'already-unsub' => 'Você não está mais inscrito em nossa lista de assinaturas',
'not-subscribed' => 'Erro! Emai lnão pode ser enviado, por favor, tente novamente mais tarde'
'not-subscribed' => 'Erro! Email não pode ser enviado, por favor, tente novamente mais tarde'
],
'search' => [
@ -202,7 +202,7 @@ return [
'page-title' => 'Cliente - Adicionar Endereço',
'title' => 'Novo Endereço',
'address1' => 'Endereço Linha 1',
'address2' => 'Endereço Linha 2',
'street-address' => 'Endereço',
'country' => 'País',
'state' => 'Estado',
'select-state' => 'Select a region, state or province',
@ -390,7 +390,8 @@ return [
],
'quantity-error' => 'Quantidade solicitada não está disponível',
'cart-subtotal' => 'Subtotal do carrinho',
'cart-remove-action' => 'Você realmente quer fazer isso ?'
'cart-remove-action' => 'Você realmente quer fazer isso ?',
'partial-cart-update' => 'Only some of the product(s) were updated'
],
'onepage' => [

View File

@ -108,11 +108,11 @@
</div>
<div class="control-group" :class="[errors.has('address-form.billing[address1][]') ? 'has-error' : '']">
<label for="billing[address1][]" class="required">
<label for="billing_address_0" class="required">
{{ __('shop::app.checkout.onepage.address1') }}
</label>
<input type="text" v-validate="'required'" class="control" id="billing[address1][]" name="billing[address1][]" v-model="address.billing.address1[0]" data-vv-as="&quot;{{ __('shop::app.checkout.onepage.address1') }}&quot;"/>
<input type="text" v-validate="'required'" class="control" id="billing_address_0" name="billing[address1][]" v-model="address.billing.address1[0]" data-vv-as="&quot;{{ __('shop::app.checkout.onepage.address1') }}&quot;"/>
<span class="control-error" v-if="errors.has('address-form.billing[address1][]')">
@{{ errors.first('address-form.billing[address1][]') }}
@ -122,7 +122,7 @@
@if (core()->getConfigData('customer.settings.address.street_lines') && core()->getConfigData('customer.settings.address.street_lines') > 1)
<div class="control-group" style="margin-top: -25px;">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<input type="text" class="control" name="address1[]" v-model="address.billing.address1[{{$i}}]">
<input type="text" class="control" name="billing[address1][{{ $i }}]" id="billing_address_{{ $i }}" v-model="address.billing.address1[{{$i}}]">
@endfor
</div>
@endif
@ -324,11 +324,11 @@
</div>
<div class="control-group" :class="[errors.has('address-form.shipping[address1][]') ? 'has-error' : '']">
<label for="shipping[address1][]" class="required">
<label for="shipping_address_0" class="required">
{{ __('shop::app.checkout.onepage.address1') }}
</label>
<input type="text" v-validate="'required'" class="control" id="shipping[address1][]" name="shipping[address1][]" v-model="address.shipping.address1[0]" data-vv-as="&quot;{{ __('shop::app.checkout.onepage.address1') }}&quot;"/>
<input type="text" v-validate="'required'" class="control" id="shipping_address_0" name="shipping[address1][]" v-model="address.shipping.address1[0]" data-vv-as="&quot;{{ __('shop::app.checkout.onepage.address1') }}&quot;"/>
<span class="control-error" v-if="errors.has('address-form.shipping[address1][]')">
@{{ errors.first('address-form.shipping[address1][]') }}
@ -338,7 +338,7 @@
@if (core()->getConfigData('customer.settings.address.street_lines') && core()->getConfigData('customer.settings.address.street_lines') > 1)
<div class="control-group" style="margin-top: -25px;">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<input type="text" class="control" name="address1[]" v-model="address.shipping.address1[{{$i}}]">
<input type="text" class="control" name="shipping[address1][{{ $i }}]" id="shipping_address_{{ $i }}" v-model="address.shipping.address1[{{$i}}]">
@endfor
</div>
@endif

View File

@ -27,15 +27,15 @@
{!! view_render_event('bagisto.shop.customers.account.address.create_form_controls.before') !!}
<div class="control-group" :class="[errors.has('address1[]') ? 'has-error' : '']">
<label for="address1[]" class="required">{{ __('shop::app.customer.account.address.create.street-address') }}</label>
<input type="text" class="control" name="address1[]" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.street-address') }}&quot;">
<label for="address_0" class="required">{{ __('shop::app.customer.account.address.create.street-address') }}</label>
<input type="text" class="control" name="address1[]" id="address_0" v-validate="'required'" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.street-address') }}&quot;">
<span class="control-error" v-if="errors.has('address1[]')">@{{ errors.first('address1[]') }}</span>
</div>
@if (core()->getConfigData('customer.settings.address.street_lines') && core()->getConfigData('customer.settings.address.street_lines') > 1)
<div class="control-group" style="margin-top: -25px;">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<input type="text" class="control" name="address1[]">
<input type="text" class="control" name="address1[{{ $i }}]" id="address_{{ $i }}">
@endfor
</div>
@endif

View File

@ -31,15 +31,15 @@
<?php $addresses = explode(PHP_EOL, $address->address1); ?>
<div class="control-group" :class="[errors.has('address1[]') ? 'has-error' : '']">
<label for="first_name" class="required">{{ __('shop::app.customer.account.address.create.street-address') }}</label>
<input type="text" class="control" name="address1[]" v-validate="'required'" value="{{ isset($addresses[0]) ? $addresses[0] : '' }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.street-address') }}&quot;">
<label for="address_0" class="required">{{ __('shop::app.customer.account.address.edit.street-address') }}</label>
<input type="text" class="control" name="address1[]" id="address_0" v-validate="'required'" value="{{ isset($addresses[0]) ? $addresses[0] : '' }}" data-vv-as="&quot;{{ __('shop::app.customer.account.address.create.street-address') }}&quot;">
<span class="control-error" v-if="errors.has('address1[]')">@{{ errors.first('address1[]') }}</span>
</div>
@if (core()->getConfigData('customer.settings.address.street_lines') && core()->getConfigData('customer.settings.address.street_lines') > 1)
<div class="control-group" style="margin-top: -25px;">
@for ($i = 1; $i < core()->getConfigData('customer.settings.address.street_lines'); $i++)
<input type="text" class="control" name="address1[]" value="{{ isset($addresses[$i]) ? $addresses[$i] : '' }}">
<input type="text" class="control" name="address1[{{ $i }}]" id="address_{{ $i }}" value="{{ isset($addresses[$i]) ? $addresses[$i] : '' }}">
@endfor
</div>
@endif

View File

@ -31,18 +31,16 @@
@php
$image = $productImageHelper->getProductBaseImage($item->product);
@endphp
<img class="media" src="{{ $image['small_image_url'] }}" />
{{-- <a href="{{ url()->to('/').'/products/'.$item->product->url_key }}" title="{{ $item->product->name }}">
</a> --}}
<img class="media" src="{{ $image['small_image_url'] }}" />
<div class="info">
<div class="product-name">
{{$item->product->name}}
{{-- <a href="{{ url()->to('/').'/products/'.$item->product->url_key }}" title="{{ $item->product->name }}">
</a> --}}
</div>
@inject ('reviewHelper', 'Webkul\Product\Helpers\Review')
<span class="stars" style="display: inline">
@for($i=1;$i<=$reviewHelper->getAverageRating($item->product);$i++)
<span class="icon star-icon"></span>
@ -59,6 +57,7 @@
</div>
<div class="horizontal-rule mb-10 mt-10"></div>
@endforeach
@else
<div class="empty">
{{ __('customer::app.wishlist.empty') }}

View File

@ -1,15 +1,15 @@
@if ($products->count())
@if (app('Webkul\Product\Repositories\ProductRepository')->getFeaturedProducts()->count())
<section class="featured-products">
<div class="featured-heading">
{{ __('shop::app.home.featured-products') }}<br/>
<span class="featured-seperator" style="color:lightgrey;">_____</span>
</div>
<div class="featured-grid product-grid-4">
@foreach ($products as $productFlat)
@foreach (app('Webkul\Product\Repositories\ProductRepository')->getFeaturedProducts() as $productFlat)
@include ('shop::products.list.card', ['product' => $productFlat->product])

View File

@ -9,7 +9,7 @@
{!! view_render_event('bagisto.shop.home.content.before') !!}
{!! DbView::make(core()->getCurrentChannel())->field('home_page_content')->with(['sliderData' => $sliderData])->render() !!}
{{ view_render_event('bagisto.shop.home.content.after') }}
@endsection

View File

@ -1,4 +1,4 @@
@if ($products->count())
@if (app('Webkul\Product\Repositories\ProductRepository')->getNewProducts()->count())
<section class="featured-products">
<div class="featured-heading">
@ -8,14 +8,14 @@
</div>
<div class="product-grid-4">
@foreach ($products as $productFlat)
@foreach (app('Webkul\Product\Repositories\ProductRepository')->getNewProducts() as $productFlat)
@include ('shop::products.list.card', ['product' => $productFlat->product])
@endforeach
</div>
</section>
@endif

View File

@ -2,6 +2,15 @@
<div class="footer-content">
<div class="footer-list-container">
<?php
$categories = [];
foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category){
if ($category->slug)
array_push($categories, $category);
}
?>
@if (count($categories))
<div class="list-container">
<span class="list-heading">Categories</span>
@ -30,13 +39,28 @@
</form>
</div>
<?php
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
$searchTerm = explode("?", $query);
foreach($searchTerm as $term){
if (strpos($term, 'term') !== false) {
$serachQuery = $term;
}
}
?>
<span class="list-heading">{{ __('shop::app.footer.locale') }}</span>
<div class="form-container">
<div class="control-group">
<select class="control locale-switcher" onchange="window.location.href = this.value">
@foreach (core()->getCurrentChannel()->locales as $locale)
<option value="?locale={{ $locale->code }}" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}>{{ $locale->name }}</option>
@if(isset($serachQuery))
<option value="?{{ $serachQuery }}?locale={{ $locale->code }}" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}>{{ $locale->name }}</option>
@else
<option value="?locale={{ $locale->code }}" {{ $locale->code == app()->getLocale() ? 'selected' : '' }}>{{ $locale->name }}</option>
@endif
@endforeach
</select>
@ -50,7 +74,11 @@
<select class="control locale-switcher" onchange="window.location.href = this.value">
@foreach (core()->getCurrentChannel()->currencies as $currency)
<option value="?currency={{ $currency->code }}" {{ $currency->code == core()->getCurrentCurrencyCode() ? 'selected' : '' }}>{{ $currency->code }}</option>
@if(isset($serachQuery))
<option value="?{{ $serachQuery }}?currency={{ $currency->code }}" {{ $currency->code == core()->getCurrentCurrencyCode() ? 'selected' : '' }}>{{ $currency->code }}</option>
@else
<option value="?currency={{ $currency->code }}" {{ $currency->code == core()->getCurrentCurrencyCode() ? 'selected' : '' }}>{{ $currency->code }}</option>
@endif
@endforeach
</select>

View File

@ -28,6 +28,16 @@
</ul>
</div>
<?php
$query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);
$searchTerm = explode("?", $query);
foreach($searchTerm as $term){
if (strpos($term, 'term') !== false) {
$serachQuery = $term;
}
}
?>
<div class="right-content">
@ -48,7 +58,11 @@
<ul class="dropdown-list currency">
@foreach (core()->getCurrentChannel()->currencies as $currency)
<li>
<a href="?currency={{ $currency->code }}">{{ $currency->code }}</a>
@if(isset($serachQuery))
<a href="?{{ $serachQuery }}?currency={{ $currency->code }}">{{ $currency->code }}</a>
@else
<a href="?currency={{ $currency->code }}">{{ $currency->code }}</a>
@endif
</li>
@endforeach
</ul>

View File

@ -1,5 +1,16 @@
{!! view_render_event('bagisto.shop.layout.header.category.before') !!}
<?php
$categories = [];
foreach (app('Webkul\Category\Repositories\CategoryRepository')->getVisibleCategoryTree(core()->getCurrentChannel()->root_category_id) as $category) {
if ($category->slug)
array_push($categories, $category);
}
?>
<category-nav categories='@json($categories)' url="{{url()->to('/')}}"></category-nav>
{!! view_render_event('bagisto.shop.layout.header.category.after') !!}

View File

@ -72,7 +72,7 @@
</div>
</div>
<script type="text/javascript">
window.flashMessages = [];

View File

@ -27,8 +27,8 @@
<i class="icon arrow-up-white-icon"></i>
</li>
<li class="thumb-frame" v-for='(thumb, index) in thumbs' @mouseover="changeImage(thumb)" :class="[thumb.large_image_url == currentLargeImageUrl ? 'active' : '']">
<img :src="thumb.small_image_url"/>
<li class="thumb-frame" v-for='(thumb, index) in thumbs' @mouseover="changeImage(thumb)" :class="[thumb.large_image_url == currentLargeImageUrl ? 'active' : '']" id="thumb-frame">
<img :src="thumb.small_image_url" :data-image="thumb.large_image_url" :data-zoom-image="thumb.original_image_url"/>
</li>
<li class="gallery-control bottom" @click="moveThumbs('bottom')" v-if="(thumbs.length > 4) && this.is_move.down">
@ -143,4 +143,21 @@
</script>
<script>
$(document).ready(function() {
var image = $('#thumb-frame img');
var zoomImage = $('img#pro-img');
zoomImage.ezPlus();
image.mouseover( function(){
$('.zoomContainer').remove();
zoomImage.removeData('elevateZoom');
zoomImage.attr('src', $(this).data('image'));
zoomImage.data('zoom-image', $(this).data('zoom-image'));
zoomImage.ezPlus();
});
})
</script>
@endpush

View File

@ -84,7 +84,7 @@ class TaxRateController extends Controller
'zip_to' => 'nullable|required_with:is_zip,zip_from',
'state' => 'required|string',
'country' => 'required|string',
'tax_rate' => 'required|numeric'
'tax_rate' => 'required|numeric|min:0.0001'
]);
$data = request()->all();
@ -134,7 +134,7 @@ class TaxRateController extends Controller
'zip_to' => 'nullable|required_with:is_zip,zip_from',
'state' => 'required|string',
'country' => 'required|string',
'tax_rate' => 'required|numeric'
'tax_rate' => 'required|numeric|min:0.0001'
]);
Event::fire('tax.tax_rate.update.before', $id);
@ -189,11 +189,20 @@ class TaxRateController extends Controller
foreach ($excelData as $data) {
foreach ($data as $column => $uploadData) {
if (!is_null($uploadData['zip_from']) && !is_null($uploadData['zip_to'])) {
$uploadData['is_zip'] = 1;
}
$validator = Validator::make($uploadData, [
'identifier' => 'required|string',
'state' => 'required|string',
'country' => 'required|string',
'tax_rate' => 'required|numeric'
'tax_rate' => 'required|numeric|min:0.0001',
'is_zip' => 'sometimes',
'zip_code' => 'sometimes|required_without:is_zip',
'zip_from' => 'nullable|required_with:is_zip',
'zip_to' => 'nullable|required_with:is_zip,zip_from',
]);
if ($validator->fails()) {
@ -230,6 +239,12 @@ class TaxRateController extends Controller
$errorMsg[$coulmn] = $fail->first('country');
} else if ($fail->first('state')) {
$errorMsg[$coulmn] = $fail->first('state');
} else if ($fail->first('zip_code')) {
$errorMsg[$coulmn] = $fail->first('zip_code');
} else if ($fail->first('zip_from')) {
$errorMsg[$coulmn] = $fail->first('zip_from');
} else if ($fail->first('zip_to')) {
$errorMsg[$coulmn] = $fail->first('zip_to');
}
}
@ -250,6 +265,11 @@ class TaxRateController extends Controller
foreach ($excelData as $data) {
foreach ($data as $column => $uploadData) {
if (!is_null($uploadData['zip_from']) && !is_null($uploadData['zip_to'])) {
$uploadData['is_zip'] = 1;
$uploadData['zip_code'] = NULL;
}
if (isset($rateIdentifier)) {
$id = array_search($uploadData['identifier'], $rateIdentifier);
if ($id) {
@ -275,4 +295,4 @@ class TaxRateController extends Controller
return redirect()->route($this->_config['redirect']);
}
}
}

View File

@ -2,7 +2,7 @@
<label class="image-item" :for="_uid" v-bind:class="{ 'has-image': imageData.length > 0 }">
<input type="hidden" :name="finalInputName"/>
<input type="file" v-validate="'mimes:image/*'" accept="image/*" :name="finalInputName" ref="imageInput" :id="_uid" @change="addImageView($event)"/>
<input type="file" v-validate="'mimes:image/*'" accept="image/*" :name="finalInputName" ref="imageInput" :id="_uid" @change="addImageView($event)" :required="required ? true : false" />
<img class="preview" :src="imageData" v-if="imageData.length > 0">
@ -27,6 +27,12 @@
type: Object,
required: false,
default: null
},
required: {
type: Boolean,
required: false,
default: false
}
},
@ -73,4 +79,4 @@
}
}
}
</script>
</script>

View File

@ -1,11 +1,12 @@
<template>
<div>
<div class="image-wrapper">
<image-item
v-for='(image, index) in items'
:key='image.id'
:image="image"
:input-name="inputName"
<image-item
v-for='(image, index) in items'
:key='image.id'
:image="image"
:input-name="inputName"
:required="required"
:remove-button-label="removeButtonLabel"
@onRemoveImage="removeImage($event)"
></image-item>
@ -46,6 +47,12 @@
type: Boolean,
required: false,
default: true
},
required: {
type: Boolean,
required: false,
default: false
}
},
@ -58,7 +65,7 @@
created () {
var this_this = this;
if(this.multiple) {
if(this.images.length) {
this.images.forEach(function(image) {
@ -103,4 +110,4 @@
}
}
</script>
</script>

View File

@ -18,7 +18,7 @@ class Bouncer
if (! auth()->guard('admin')->check() || ! auth()->guard('admin')->user()->hasPermission($permission))
return false;
}
return true;
}
@ -31,6 +31,6 @@ class Bouncer
public static function allow($permission)
{
if (! auth()->guard('admin')->check() || ! auth()->guard('admin')->user()->hasPermission($permission))
abort(401, 'This action is unauthorized.');
abort(401, 'This action is unauthorized');
}
}

View File

@ -1,18 +1,9 @@
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
</head>
<body>
<div class="container admin" id="admin">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src="Images/logo.svg">
<div class="initial-display">
<p>Admin Details</p>
<form action="AdminConfig.php" method= "POST" id="admin-form">
@ -33,13 +24,13 @@
<div class="control-group" id="admin_password">
<label for="admin_password" class="required">Password</label>
<input type="password" name="admin_password" class="control"
data-validation="length required" data-validation-length="max50">
data-validation="length required" data-validation-length="min6">
</div>
<div class="control-group" id="admin_re_password">
<label for="admin_re_password" class="required">Re-Password</label>
<input type="password" name="admin_re_password" class="control"
data-validation="length required" data-validation-length="max50">
data-validation="length required" data-validation-length="min6">
</div>
</div>
</div>
@ -49,10 +40,6 @@
</form>
</div>
<div class="footer">
<img class="left-patern" src="Images/left-side.svg">
<img class="right-patern" src="Images/right-side.svg">
</div>
</div>
</body>
@ -63,7 +50,6 @@
$.validate({});
</script>
<script>
$(document).ready(function() {
// process the form
@ -77,10 +63,12 @@
'admin_password' : $('input[name=admin_password]').val(),
'admin_re_password' : $('input[name=admin_re_password]').val(),
};
var adminTarget = window.location.href.concat('/AdminConfig.php');
// process the form
$.ajax({
type : 'POST', // define the type of HTTP verb we want to use (POST for our form)
url : 'AdminConfig.php', // the url where we want to POST
url : adminTarget, // the url where we want to POST
data : formData, // our data object
dataType : 'json', // what type of data do we expect back from the server
encode : true

View File

@ -41,17 +41,16 @@ $data = array();
$envFile = $desiredLocation . '/' . '.env';
// reading env content
$str= file_get_contents($envFile);
// converting env content to key/value pair
$data = explode(PHP_EOL,$str);
$data = file($envFile);
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION'];
$key = $value = [];
if ($data) {
foreach ($data as $line) {
$line = preg_replace('/\s+/', '', $line);
$rowValues = explode('=', $line);
if (count($rowValues) === 2) {
if (strlen($line) !== 0) {
if (in_array($rowValues[0], $databaseArray)) {
$key[] = $rowValues[0];
$value[] = $rowValues[1];

View File

@ -1,112 +0,0 @@
<?php
class Permission {
/**
* @var array
*/
protected $results = [];
/**
* Set the result array permissions and errors.
*
* @return mixed
*/
public function __construct()
{
$this->results['permissions'] = [];
$this->results['errors'] = null;
}
/**
* Check for the folders permissions.
*
* @param array $folders
* @return array
*/
public function check()
{
$folders = [
// 'permissions' => [
'storage/framework/' => '775',
'storage/logs/' => '775',
'bootstrap/cache/' => '775'
// ]
];
foreach($folders as $folder => $permission)
{
if (!($this->getPermission($folder) >= $permission)) {
$this->addFileAndSetErrors($folder, $permission, false);
} else {
$this->addFile($folder, $permission, true);
}
}
return $this->results;
}
/**
* Get a folder permission.
*
* @param $folder
* @return string
*/
private function getPermission($folder)
{
$location = str_replace('\\', '/', getcwd());
$currentLocation = explode("/", $location);
array_pop($currentLocation);
array_pop($currentLocation);
$desiredLocation = implode("/", $currentLocation);
$fileLocation = $desiredLocation . '/' .$folder;
return substr(sprintf('%o', fileperms($fileLocation)), -4);
}
/**
* Add the file to the list of results.
*
* @param $folder
* @param $permission
* @param $isSet
*/
private function addFile($folder, $permission, $isSet)
{
array_push($this->results['permissions'], [
'folder' => $folder,
'permission' => $permission,
'isSet' => $isSet
]);
}
/**
* Add the file and set the errors.
*
* @param $folder
* @param $permission
* @param $isSet
*/
private function addFileAndSetErrors($folder, $permission, $isSet)
{
$this->addFile($folder, $permission, $isSet);
$this->results['errors'] = true;
}
/**
* Render view for class.
*
*/
public function render()
{
ob_start();
$permissions = $this->check();
include __DIR__ . '/../Views/permission.blade.php';
return ob_get_clean();
}
}

View File

@ -116,6 +116,30 @@ class Requirement {
];
}
/**
* Check composer installation.
*
* @return array
*/
public function composerInstall()
{
$location = str_replace('\\', '/', getcwd());
$currentLocation = explode("/", $location);
array_pop($currentLocation);
array_pop($currentLocation);
$desiredLocation = implode("/", $currentLocation);
$autoLoadFile = $desiredLocation . '/' . 'vendor' . '/' . 'autoload.php';
if (file_exists($autoLoadFile)) {
$data['composer_install'] = 0;
} else {
$data['composer_install'] = 1;
$data['composer'] = 'Composer dependencies is not Installed.Go to root of project, run "composer install" command to install composer dependencies & refresh page again.';
}
return $data;
}
/**
* Render view for class.
*
@ -126,6 +150,8 @@ class Requirement {
$phpVersion = $this->checkPHPversion();
$composerInstall = $this->composerInstall();
ob_start();
include __DIR__ . '/../Views/requirements.blade.php';

View File

@ -1,25 +1,7 @@
<?php
// array to pass back data
$data = array();
$location = str_replace('\\', '/', getcwd());
$currentLocation = explode("/", $location);
array_pop($currentLocation);
array_pop($currentLocation);
$desiredLocation = implode("/", $currentLocation);
$autoLoadFile = $desiredLocation . '/' . 'vendor' . '/' . 'autoload.php';
if (file_exists($autoLoadFile)) {
$data['install'] = 0;
} else {
$data['install'] = 1;
$data['composer'] = 'Composer dependencies is not Installed.Go to root of project, run "composer install" command to install composer dependencies & refresh page again.';
}
// return a response
//return all our data to an AJAX call
$data['install'] = 0;
echo json_encode($data);

View File

@ -24,9 +24,6 @@ $data = array();
if (empty($_POST['user_name']))
$errors['user_name'] = 'User Name is required.';
if (empty($_POST['user_password']))
$errors['user_password'] = 'User Password is required.';
if (empty($_POST['port_name']))
$errors['port_name'] = 'Port Name is required.';
@ -83,20 +80,16 @@ $data = array();
}
// reading env content
$str= file_get_contents($envFile);
// converting env content to key/value pair
$data = explode(PHP_EOL,$str);
$data = file($envFile);
$keyValueData = [];
if ($data) {
foreach ($data as $line) {
$line = preg_replace('/\s+/', '', $line);
$rowValues = explode('=', $line);
if (count($rowValues) === 2) {
if (strlen($line) !== 0) {
$keyValueData[$rowValues[0]] = $rowValues[1];
} else if (count($rowValues) > 2) {
$eqPos = strpos($line, '=');
$keyValueData[substr($line, 0, $eqPos)] = substr($line,$eqPos+1);
}
}
}

View File

@ -1,102 +1,87 @@
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<link rel="stylesheet" type="text/css" href="CSS/style.css">
</head>
<body>
<div class="container environment" id="environment">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src="Images/logo.svg">
<div class="initial-display">
<p>Environment Configuration</p>
<form action="EnvConfig.php" method="POST" id="environment-form">
<div class="content">
<div class="databse-error" style="text-align: center; padding-top: 10px" id="database_error">
<form action="EnvConfig.php" method="POST" id="environment-form">
<div class="content">
<div class="databse-error" style="text-align: center; padding-top: 10px" id="database_error">
</div>
<div class="form-container" style="padding: 10%; padding-top: 35px">
<div class="control-group" id="app_name">
<label for="app_name" class="required">App Name</label>
<input type = "text" name = "app_name" class = "control"
value = "Bagisto_"
data-validation="required length" data-validation-length="max50"
>
</div>
<div class="form-container" style="padding: 10%; padding-top: 35px">
<div class="control-group" id="app_name">
<label for="app_name" class="required">App Name</label>
<input type = "text" name = "app_name" class = "control"
value = "Bagisto_"
data-validation="required length" data-validation-length="max50"
>
</div>
<div class="control-group" id="app_url">
<label for="app_url" class="required">App URL</label>
<input type="text" name="app_url" class="control"
placeholder="http://localhost"
data-validation="required length" data-validation-length="max50">
</div>
<div class="control-group" id="app_url">
<label for="app_url" class="required">App URL</label>
<input type="text" name="app_url" class="control"
placeholder="http://localhost"
data-validation="required length" data-validation-length="max50">
</div>
<div class="control-group">
<label for="database_connection" class="required">
Database Connection
</label>
<select name="database_connection" id="database_connection" class="control">
<option value="mysql" selected>Mysql</option>
<option value="sqlite">SQlite</option>
<option value="pgsql">pgSQL</option>
<option value="sqlsrv">SQLSRV</option>
</select>
</div>
<div class="control-group">
<label for="database_connection" class="required">
Database Connection
</label>
<select name="database_connection" id="database_connection" class="control">
<option value="mysql" selected>Mysql</option>
<option value="sqlite">SQlite</option>
<option value="pgsql">pgSQL</option>
<option value="sqlsrv">SQLSRV</option>
</select>
</div>
<div class="control-group" id="port_name">
<label for="port_name" class="required">Database Port</label>
<input type="text" name="port_name" class="control"
placeholder="3306"
data-validation="required alphanumeric number length" data-validation-length="max4">
</div>
<div class="control-group" id="port_name">
<label for="port_name" class="required">Database Port</label>
<input type="text" name="port_name" class="control"
placeholder="3306"
data-validation="required alphanumeric number length" data-validation-length="max4">
</div>
<div class="control-group" id="host_name">
<label for="host_name" class="required">Database Host</label>
<input type="text" name="host_name" class="control"
placeholder="127.0.0.1"
data-validation="required length" data-validation-length="max50">
</div>
<div class="control-group" id="host_name">
<label for="host_name" class="required">Database Host</label>
<input type="text" name="host_name" class="control"
placeholder="127.0.0.1"
data-validation="required length" data-validation-length="max50">
</div>
<div class="control-group" id="database_name">
<label for="database_name" class="required">Database Name</label>
<input type="text" name="database_name" class="control"
placeholder="database name"
data-validation="length required" data-validation-length="max50">
</div>
<div class="control-group" id="database_name">
<label for="database_name" class="required">Database Name</label>
<input type="text" name="database_name" class="control"
placeholder="database name"
data-validation="length required" data-validation-length="max50">
</div>
<div class="control-group" id="user_name">
<label for="user_name" class="required">User Name</label>
<input type="text" name="user_name" class="control"
value = "bagisto_"
data-validation="length required" data-validation-length="max50">
</div>
<div class="control-group" id="user_name">
<label for="user_name" class="required">User Name</label>
<input type="text" name="user_name" class="control"
value = "bagisto_"
data-validation="length required" data-validation-length="max50">
</div>
<div class="control-group" id="user_password">
<label for="user_password" class="required">User Password</label>
<input type="text" name="user_password" class="control"
placeholder="database password"
data-validation="length required" data-validation-length="max50">
</div>
<div class="control-group" id="user_password">
<label for="user_password" class="required">User Password</label>
<input type="text" name="user_password" class="control"
placeholder="database password">
</div>
</div>
<div>
<button class="prepare-btn" id="environment-check">Save & Continue</button>
<div style="cursor: pointer; margin-top:10px">
<span id="envronment-back">back</span>
</div>
</div>
<div>
<button class="prepare-btn" id="environment-check">Save & Continue</button>
<div style="cursor: pointer; margin-top:10px">
<span id="envronment-back">back</span>
</div>
</form>
</div>
</form>
</div>
<div class="footer">
<img class="left-patern" src="Images/left-side.svg">
<img class="right-patern" src="Images/right-side.svg">
</div>
</div>
</body>
@ -125,13 +110,14 @@
'user_name' : $('input[name=user_name]').val(),
'user_password' : $('input[name=user_password]').val(),
'database_connection' : $("#database_connection" ).val(),
};
var target = window.location.href.concat('/EnvConfig.php');
// process the form
$.ajax({
type : 'POST',
url : 'EnvConfig.php',
url : target,
data : formData,
dataType : 'json',
encode : true

View File

@ -1,16 +1,9 @@
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
</head>
<body>
<div class="container finish" id="finish">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src="Images/logo.svg">
<div class="initial-display">
<p>Finish Installment</p>
<div class="content">
<div class="content-container" style="padding: 20px">
@ -23,10 +16,6 @@
<button class="prepare-btn" onclick="finish()">Finish</button>
</div>
<div class="footer">
<img class="left-patern" src="Images/left-side.svg">
<img class="right-patern" src="Images/right-side.svg">
</div>
</div>
</body>
@ -37,8 +26,8 @@
function finish() {
lastIndex = window.location.href.lastIndexOf("/");
secondlast = window.location.href.slice(0,lastIndex).lastIndexOf("/");
next = window.location.href.slice(0,secondlast);
secondlast = window.location.href.slice(0, lastIndex).lastIndexOf("/");
next = window.location.href.slice(0, secondlast);
next = next.concat('/admin/login');
window.location.href = next;
}

View File

@ -1,10 +1,4 @@
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
</head>
<style>
.window {
@ -59,8 +53,7 @@
<body>
<div class="container migration" id="migration">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src="Images/logo.svg">
<div class="initial-display">
<p>Migration & Seed</p>
<div class="cp-spinner cp-round" id="loader">
@ -82,9 +75,6 @@
<div style="text-align: center;">
<span> Click the below button to run following : </span>
</div>
<div class="message" style="margin-top: 20px">
<span> Check Composer dependency </span>
</div>
<div class="message">
<span>Database Migartion </span>
</div>
@ -115,10 +105,6 @@
</form>
</div>
<div class="footer">
<img class="left-patern" src="Images/left-side.svg">
<img class="right-patern" src="Images/right-side.svg">
</div>
</div>
</body>
@ -144,10 +130,12 @@
$('#storage').hide();
$('#composer').hide();
var composerTarget = window.location.href.concat('/Composer.php');
// process form
$.ajax({
type : 'POST',
url : 'Composer.php',
url : composerTarget,
dataType : 'json',
encode : true
})
@ -163,10 +151,12 @@
if (data['install'] == 0) {
$('#composer-migrate').show();
var migrationTarget = window.location.href.concat('/MigrationRun.php');
// post the request again
$.ajax({
type : 'POST',
url : 'MigrationRun.php',
url : migrationTarget,
dataType : 'json',
encode : true
})
@ -178,9 +168,11 @@
if (data['results'] == 0) {
$('#composer-seed').show();
var seederTarget = window.location.href.concat('/Seeder.php');
$.ajax({
type : 'POST',
url : 'Seeder.php',
url : seederTarget,
dataType : 'json',
encode : true
})

View File

@ -1,5 +1,7 @@
<?php
ini_set('max_execution_time', 300);
// array to pass back data
$data = array();

View File

@ -6,7 +6,7 @@ $data = array();
// run command on terminal
$key = 'cd ../.. && php artisan key:generate 2>&1';
$seeder = 'cd ../.. && php artisan db:seed 2>&1';
$publish = 'cd ../.. && php artisan vendor:publish 2>&1';
$publish = 'cd ../.. && php artisan vendor:publish --all --force 2>&1';
$key_output = exec($key, $data['key'], $data['key_results']);
$seeder_output = exec($seeder, $data['seeder'], $data['seeder_results']);

View File

@ -1,61 +0,0 @@
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
</head>
<body>
<div class="container permission" id="permission">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src="Images/logo.svg">
<p>Permission</p>
<div class="content">
<div class="title" style="text-align: center; margin-top: 10px">
Please wait while we are checking the permissions
</div>
<?php foreach($permissions['permissions'] as $permission): ?>
<div class="check" style="margin-left: 20%">
<?php if($permission['isSet'] ? $src = 'Images/green-check.svg' : $src = 'Images/red-check.svg' ): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span style="margin-left: 10px"><b><?php echo $permission['folder'] ?></b></span>
<span>(<?php echo $permission['permission'] ?> folder permission Required)</span>
</div>
<?php endforeach; ?>
</div>
<?php if(!isset($permissions['errors'])): ?>
<div>
<button class="prepare-btn" id="permission-check">Continue</button>
</div>
<div style="cursor: pointer; margin-top:10px">
<span id="permission-back">back</span>
</div>
<?php endif; ?>
</div>
<div class="footer">
<img class="left-patern" src="Images/left-side.svg">
<img class="right-patern" src="Images/right-side.svg">
</div>
</div>
</body>
</html>

View File

@ -1,16 +1,16 @@
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
</head>
<?php
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$greenCheck = $actual_link .'/'. 'Images/green-check.svg';
$redCheck = $actual_link .'/'. 'Images/red-check.svg';
?>
<body>
<div class="container requirement" id="requirement">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src="Images/logo.svg">
<div class="initial-display">
<p>Requirement</p>
<div class="content">
@ -19,7 +19,7 @@
</div>
<div class="check" style="margin-left: 25%">
<?php if($phpVersion['supported'] ? $src = 'Images/green-check.svg' : $src = 'Images/red-check.svg' ): ?>
<?php if($phpVersion['supported'] ? $src = $greenCheck : $src = $redCheck): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span style="margin-left: 10px"><b>PHP</b></span>
@ -30,7 +30,7 @@
<?php foreach($requirements['requirements'][$type] as $extention => $enabled) : ?>
<div class="check" style="margin-left: 25%">
<?php if($enabled ? $src = 'Images/green-check.svg' : $src = 'Images/red-check.svg' ): ?>
<?php if($enabled ? $src = $greenCheck : $src = $redCheck ): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span style="margin-left: 10px"><b><?php echo $extention ?></b></span>
@ -39,9 +39,23 @@
<?php endforeach; ?>
<?php endforeach; ?>
<php class="check" style="margin-left: 25%">
<?php if(($composerInstall['composer_install'] == 0) ? $src = $greenCheck : $src = $redCheck ): ?>
<img src="<?php echo $src ?>">
<span style="margin-left: 10px"><b>Composer</b></span>
<?php endif; ?>
</php>
<div style="margin-left: 30%;">
<?php if(!($composerInstall['composer_install'] == 0)): ?>
<span style="margin-left: 10px; color: red;"><?php echo $composerInstall['composer'] ?></span>
<?php endif; ?>
</div>
</div>
<?php if(!isset($requirements['errors']) && $phpVersion['supported']): ?>
<?php if(!isset($requirements['errors']) && ($phpVersion['supported'] && $composerInstall['composer_install'] == 0)): ?>
<div>
<button type="button" class="prepare-btn" id="requirement-check">Continue</button>
</div>
@ -49,11 +63,6 @@
<?php endif; ?>
</div>
<div class="footer">
<img class="left-patern" src="Images/left-side.svg">
<img class="right-patern" src="Images/right-side.svg">
</div>
</div>
</body>

View File

@ -1,14 +1,9 @@
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<link rel="stylesheet" type="text/css" href="CSS/style.css">
<body>
<div class="container welcome" id="welcome">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src="Images/logo.svg">
<div class="initial-display">
<p>Welcome to Bagisto</p>
<div class="content">
@ -31,11 +26,6 @@
<button type="button" class="prepare-btn" id="welcome-check">Accept</button>
</div>
</div>
<div class="footer">
<img class="left-patern" src="Images/left-side.svg">
<img class="right-patern" src="Images/right-side.svg">
</div>
</div>
</body>

View File

@ -1,104 +1,141 @@
<?php
// getting env file
$location = str_replace('\\', '/', getcwd());
$currentLocation = explode("/", $location);
array_pop($currentLocation);
array_pop($currentLocation);
$desiredLocation = implode("/", $currentLocation);
$envFile = $desiredLocation . '/' . '.env';
<html>
$installed = false;
if (file_exists($envFile)) {
// reading env content
$str= file_get_contents($envFile);
// converting env content to key/value pair
$data = explode(PHP_EOL,$str);
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION','DB_PORT'];
$key = $value = [];
if ($data) {
foreach ($data as $line) {
$rowValues = explode('=', $line);
if (count($rowValues) === 2) {
if (in_array($rowValues[0], $databaseArray)) {
$key[] = $rowValues[0];
$value[] = $rowValues[1];
}
}
}
}
$databaseData['DB_HOST'] = $databaseData['DB_USERNAME'] = $databaseData['DB_PASSWORD'] = $databaseData['DB_DATABASE'] = $databaseData['DB_CONNECTION'] = $databaseData['DB_PORT'] = '';
$databaseData = array_combine($key, $value);
// getting database info
$servername = $databaseData['DB_HOST'];
$username = $databaseData['DB_USERNAME'];
$password = $databaseData['DB_PASSWORD'];
$dbname = $databaseData['DB_DATABASE'];
$connection = $databaseData['DB_CONNECTION'];
$port = $databaseData['DB_PORT'];
if ($connection == 'mysql') {
@$conn = new mysqli($servername, $username, $password, $dbname, $port);
if (!$conn->connect_error) {
// retrieving admin entry
$sql = "SELECT id, name FROM admins";
$result = $conn->query($sql);
if ($result) {
$installed = true;
}
}
$conn->close();
} else {
$installed = true;
}
}
if (!$installed) {
// including classes
include __DIR__ . '/Classes/Permission.php';
include __DIR__ . '/Classes/Requirement.php';
include __DIR__ . '/Classes/Welcome.php';
// including php files
include __DIR__ . '/Environment.php';
include __DIR__ . '/Migration.php';
include __DIR__ . '/Admin.php';
include __DIR__ . '/Finish.php';
// including js
include __DIR__ . '/JS/script';
// object creation
$requirement = new Requirement();
$permission = new Permission();
$welcome = new Welcome();
// calling render function for template
echo $requirement->render();
echo $permission->render();
echo $welcome->render();
$storage_output = exec('cd ../.. && php artisan storage:link 2>&1');
} else {
// getting url
<?php
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url = explode("/", $actual_link);
array_pop($url);
array_pop($url);
$url = implode("/", $url);
$url = $url . '/404';
$cssUrl = $actual_link .'/'. 'CSS/style.css';
$logo = $actual_link .'/'. 'Images/logo.svg';
$leftIcon = $actual_link .'/'. 'Images/left-side.svg';
$rightIcon = $actual_link .'/'. 'Images/right-side.svg';
?>
// redirecting to 404 error page
header("Location: $url");
}
?>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.3.26/jquery.form-validator.min.js"></script>
<link rel="stylesheet" type="text/css" href= "<?php echo $cssUrl; ?> ">
</head>
<body>
<div class="container requirement">
<div class="initial-display" style="padding-top: 100px;">
<img class="logo" src= "<?php echo $logo; ?>" >
</div>
<div class="footer">
<img class="left-patern" src= "<?php echo $leftIcon; ?>" >
<img class="right-patern" src= "<?php echo $rightIcon; ?>" >
</div>
</div>
<?php
// getting env file
$location = str_replace('\\', '/', getcwd());
$currentLocation = explode("/", $location);
array_pop($currentLocation);
array_pop($currentLocation);
$desiredLocation = implode("/", $currentLocation);
$envFile = $desiredLocation . '/' . '.env';
$installed = false;
if (file_exists($envFile)) {
// reading env content
$data = file($envFile);
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION','DB_PORT'];
$key = $value = [];
if ($data) {
foreach ($data as $line) {
$line = preg_replace('/\s+/', '', $line);
$rowValues = explode('=', $line);
if (strlen($line) !== 0) {
if (in_array($rowValues[0], $databaseArray)) {
$key[] = $rowValues[0];
$value[] = $rowValues[1];
}
}
}
}
$databaseData = array_combine($key, $value);
if (isset($databaseData['DB_HOST'])) {
$servername = $databaseData['DB_HOST'];
}
if (isset($databaseData['DB_USERNAME'])) {
$username = $databaseData['DB_USERNAME'];
}
if (isset($databaseData['DB_PASSWORD'])) {
$password = $databaseData['DB_PASSWORD'];
}
if (isset($databaseData['DB_DATABASE'])) {
$dbname = $databaseData['DB_DATABASE'];
}
if (isset($databaseData['DB_CONNECTION'])) {
$connection = $databaseData['DB_CONNECTION'];
}
if (isset($databaseData['DB_PORT'])) {
$port = $databaseData['DB_PORT'];
}
if (isset($connection) && $connection == 'mysql') {
@$conn = new mysqli($servername, $username, $password, $dbname, (int)$port);
if (!$conn->connect_error) {
// retrieving admin entry
$sql = "SELECT id, name FROM admins";
$result = $conn->query($sql);
if ($result) {
$installed = true;
}
}
$conn->close();
} else {
$installed = true;
}
}
if (!$installed) {
// including classes
include __DIR__ . '/Classes/Requirement.php';
// including php files
include __DIR__ . '/Environment.php';
include __DIR__ . '/Migration.php';
include __DIR__ . '/Admin.php';
include __DIR__ . '/Finish.php';
// including js
include __DIR__ . '/JS/script';
// object creation
$requirement = new Requirement();
echo $requirement->render();
$storage_output = exec('cd ../.. && php artisan storage:link 2>&1');
} else {
// getting url
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$url = explode("/", $actual_link);
array_pop($url);
array_pop($url);
$url = implode("/", $url);
$url = $url . '/404';
// redirecting to 404 error page
header("Location: $url");
}
?>
</body>
</html>

View File

@ -11,18 +11,16 @@
if (file_exists($envFile)) {
// reading env content
$str = file_get_contents($envFile);
// converting env content to key/value pair
$data = explode(PHP_EOL,$str);
$data = file($envFile);
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION','DB_PORT'];
$key = $value = [];
if ($data) {
foreach ($data as $line) {
$line = preg_replace('/\s+/', '', $line);
$rowValues = explode('=', $line);
if (count($rowValues) === 2) {
if (strlen($line) !== 0) {
if (in_array($rowValues[0], $databaseArray)) {
$key[] = $rowValues[0];
$value[] = $rowValues[1];
@ -31,20 +29,29 @@
}
}
$databaseData['DB_HOST'] = $databaseData['DB_USERNAME'] = $databaseData['DB_PASSWORD'] = $databaseData['DB_DATABASE'] = $databaseData['DB_CONNECTION'] = $databaseData['DB_PORT'] = '';
$databaseData = array_combine($key, $value);
// getting database info
$servername = $databaseData['DB_HOST'];
$username = $databaseData['DB_USERNAME'];
$password = $databaseData['DB_PASSWORD'];
$dbname = $databaseData['DB_DATABASE'];
$connection = $databaseData['DB_CONNECTION'];
$port = $databaseData['DB_PORT'];
if (isset($databaseData['DB_HOST'])) {
$servername = $databaseData['DB_HOST'];
}
if (isset($databaseData['DB_USERNAME'])) {
$username = $databaseData['DB_USERNAME'];
}
if (isset($databaseData['DB_PASSWORD'])) {
$password = $databaseData['DB_PASSWORD'];
}
if (isset($databaseData['DB_DATABASE'])) {
$dbname = $databaseData['DB_DATABASE'];
}
if (isset($databaseData['DB_CONNECTION'])) {
$connection = $databaseData['DB_CONNECTION'];
}
if (isset($databaseData['DB_PORT'])) {
$port = $databaseData['DB_PORT'];
}
if ($connection == 'mysql') {
@$conn = new mysqli($servername, $username, $password, $dbname, $port);
if (isset($connection) && $connection == 'mysql') {
@$conn = new mysqli($servername, $username, $password, $dbname, (int)$port);
if (!$conn->connect_error) {
// retrieving admin entry
@ -75,4 +82,7 @@
} else {
return null;
}
?>
?>

19
resources/lang/pt_BR/auth.php Executable file
View File

@ -0,0 +1,19 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used during authentication for various
| messages that we need to display to the user. You are free to modify
| these language lines according to your application's requirements.
|
*/
'failed' => 'Essas credenciais não correspondem aos nossos registros.',
'throttle' => 'Muitas tentativas de login. Tente novamente em :seconds segundos.',
];

Some files were not shown because too many files have changed in this diff Show More