shipping methods #204 popup confirmation for address delete #228 bagisto icon clickable #183 currency rate display & #128 calender clickable

This commit is contained in:
rahul shukla 2018-12-07 10:55:33 +05:30
parent b50ef64cec
commit b78cc23797
34 changed files with 5254 additions and 102 deletions

View File

@ -0,0 +1,37 @@
<?php
namespace Webkul\Admin;
use Illuminate\Support\Facades\Config;
/**
* Facade for Configuartion.
*
* @author Rahul Shukla <rahulshukla.symfony517@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class Configuration {
/**
* ShippingMethods
*
* @var array
*/
protected $shippingMethods = [];
/**
* Collects shipping methods
*
* @return array
*/
public function getShippingMethod()
{
foreach(Config::get('carriers') as $shippingMethod) {
$object = new $shippingMethod['class'];
$shippingMethods[] = $object;
}
return $shippingMethods;
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Webkul\Admin\Facades;
use Illuminate\Support\Facades\Facade;
class Configuration extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'configuration';
}
}

View File

@ -4,6 +4,7 @@ namespace Webkul\Admin\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Admin\Facades\Configuration;
use Webkul\Core\Repositories\CoreConfigRepository as CoreConfig;
/**
@ -50,6 +51,86 @@ class ConfigurationController extends Controller
*/
public function index()
{
return view($this->_config['view']);
$shippingMethods = Configuration::getShippingMethod();
return view($this->_config['view'], compact('shippingMethods'));
}
/**
* Store a newly created resource in storage.
*
* @return \Illuminate\Http\Response
*/
public function store()
{
$data = request()->all();
unset($data['_token']);
if($data['locale'] || $data['channel']){
$locale = $data['locale'];
$channel = $data['channel'];
unset($data['locale']);
unset($data['channel']);
}
foreach($data as $key => $value) {
$reomoveUnderScore = explode ("_", $key);
$key= implode(".",$reomoveUnderScore);
$fieldName = end($reomoveUnderScore);
array_pop($reomoveUnderScore);
$fieldCode = end($reomoveUnderScore);
foreach(Configuration::getShippingMethod() as $fields) {
$code = $fields->getCode();
if($code == $fieldCode) {
$field = $fields->getFieldDetails($fieldName);
}
}
$channel_based = false;
$locale_based = false;
if(isset($field['channel_based']) && $field['channel_based']) {
$channel_based = true;
}
if(isset($field['locale_based']) && $field['locale_based']) {
$locale_based = true;
}
$coreConfigValue = $this->coreConfig->findOneWhere([
'code' => $key,
'value' => $value,
'locale_code' => $locale_based ? $locale : null,
'channel_code' => $channel_based ? $channel : null
]);
if(!$coreConfigValue) {
$this->coreConfig->create([
'code' => $key,
'value' => $value,
'locale_code' => $locale_based ? $locale : null,
'channel_code' => $channel_based ? $channel : null
]);
}else {
$updataData['code'] = $key;
$updataData['value'] = $value;
$updataData['locale_code'] = $locale_based ? $locale : null;
$updataData['channel_code'] = $channel_based ? $channel : null;
$this->coreConfig->update($updataData, $coreConfigValue->id);
}
}
session()->flash('success', 'Shipping Method is created successfully');
return redirect()->route($this->_config['redirect']);
}
}

View File

@ -5,8 +5,6 @@ namespace Webkul\Admin\Http\Controllers\Customer;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Admin\Http\Controllers\Controller;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Webkul\Customer\Repositories\CustomerRepository as Customer;
use Webkul\Customer\Repositories\CustomerGroupRepository as CustomerGroup;
use Webkul\Core\Repositories\ChannelRepository as Channel;

View File

@ -38,7 +38,7 @@ class ExportController extends Controller
if(request()->all()['format'] == 'csv') {
return Excel::download(new DataGridExport($results), $file_name.'.csv');
} else {
}else {
return Excel::download(new DataGridExport($results), $file_name.'.xlsx');
}
}

View File

@ -69,10 +69,15 @@ Route::group(['middleware' => ['web']], function () {
])->name('admin.customer.review.index');
//Customers Management Routes
Route::get('configuration/sales/general', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [
'view' => 'admin::configuration.sales.general'
])->name('admin.configuration.sales.general');
//Shipping Methods Routes
Route::get('configuration/sales/shipping-methods', 'Webkul\Admin\Http\Controllers\ConfigurationController@index')->defaults('_config', [
'view' => 'admin::configuration.sales.shipping-method'
])->name('admin.configuration.sales.shipping_methods');
Route::post('configuration/sales/shipping-methods', 'Webkul\Admin\Http\Controllers\ConfigurationController@store')->defaults('_config', [
'redirect' => 'admin.configuration.sales.shipping_methods'
])->name('admin.configuration.sales.shipping_methods.store');
// Reviews Routes

View File

@ -8,6 +8,9 @@ use Illuminate\Support\Facades\Blade;
use Webkul\Admin\Providers\EventServiceProvider;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Webkul\Admin\Exceptions\Handler;
use Illuminate\Foundation\AliasLoader;
use Webkul\Admin\Facades\Configuration as ConfigurationFacade;
use Webkul\Admin\Configuration;
class AdminServiceProvider extends ServiceProvider
{
@ -45,6 +48,7 @@ class AdminServiceProvider extends ServiceProvider
*/
public function register()
{
$this->registerFacades();
}
/**
@ -98,4 +102,19 @@ class AdminServiceProvider extends ServiceProvider
$this->app['config']->set($key, array_merge($config, require $path));
}
/**
* Register Bouncer as a singleton.
*
* @return void
*/
protected function registerFacades()
{
$loader = AliasLoader::getInstance();
$loader->alias('configuration', ConfigurationFacade::class);
$this->app->singleton('configuration', function () {
return new Configuration();
});
}
}

View File

@ -115,19 +115,19 @@ class EventServiceProvider extends ServiceProvider
'sort' => 1,
'icon-class' => '',
],
// [
// 'key' => 'configuration.sales',
// 'name' => 'Sales',
// 'route' => 'admin.configuration.sales.general',
// 'sort' => 1,
// 'icon-class' => '',
// ], [
// 'key' => 'configuration.sales.general',
// 'name' => 'General',
// 'route' => 'admin.configuration.sales.general',
// 'sort' => 1,
// 'icon-class' => '',
// ],
[
'key' => 'configuration.sales',
'name' => 'Sales',
'route' => 'admin.configuration.sales.shipping_methods',
'sort' => 1,
'icon-class' => '',
], [
'key' => 'configuration.sales.shipping_method',
'name' => 'Shipping Methods',
'route' => 'admin.configuration.sales.shipping_methods',
'sort' => 1,
'icon-class' => '',
],
[
'key' => 'settings',
'name' => 'Settings',

View File

@ -348,9 +348,12 @@ return [
],
'sales' => [
'general' => [
'title' => 'General',
'save-btn-title' => 'Save'
'shipping-method' => [
'title' => 'Shipping Methods',
'save-btn-title' => 'Save',
'description' => 'Description',
'active' => 'Active',
'status' => 'Status'
]
]
],

View File

@ -0,0 +1,25 @@
<select v-validate="'{{$validations}}'" class="control" id="{{ $name }}" name="{{ $name }}" data-vv-as="&quot;{{ $fieldDetail['name'] }}&quot;" >
@foreach($fieldDetail['options'] as $option)
<?php
if($option['value']) {
$value = 1;
}else {
$value = 0;
}
$selectedOption = $configData['value'] ? $configData['value'] : '';
?>
<option value="{{ $value }}" {{ $value == $selectedOption ? 'selected' : ''}}>
{{ $option['title'] }}
</option>
@endforeach
</select>

View File

@ -0,0 +1,8 @@
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $name }}" name="{{ $name }}" value="{{ old($fieldDetail['name']) ?: $configData['value'] }}" data-vv-as="&quot;{{ $fieldDetail['name'] }}&quot;">

View File

@ -0,0 +1 @@
<textarea v-validate="'{{$validations}}'" class="control" id="{{ $name }}" name="{{ $name }}" data-vv-as="&quot;{{ $fieldDetail['name'] }}&quot;">{{ old($fieldDetail['name']) ?: $configData['value'] }}</textarea>

View File

@ -1,33 +0,0 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.sales.general.title') }}
@stop
@section('content')
<div class="content">
<form method="POST" action="" @submit.prevent="onSubmit">
<div class="page-header">
<div class="page-title">
<h1>
{{ __('admin::app.configuration.sales.general.title') }}
</h1>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.sales.general.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
</div>
</div>
</form>
</div>
@stop

View File

@ -0,0 +1,145 @@
@extends('admin::layouts.content')
@section('page_title')
{{ __('admin::app.configuration.sales.shipping-method.title') }}
@stop
@section('content')
<div class="content">
<?php $locale = request()->get('locale') ?: app()->getLocale(); ?>
<?php $channel = request()->get('channel') ?: core()->getDefaultChannelCode(); ?>
<form method="POST" action="" @submit.prevent="onSubmit" enctype="multipart/form-data">
<div class="page-header">
<div class="page-title">
<h1>
{{ __('admin::app.configuration.sales.shipping-method.title') }}
</h1>
<div class="control-group">
<select class="control" id="channel-switcher" name="channel">
@foreach(core()->getAllChannels() as $channelModel)
<option value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }}
</option>
@endforeach
</select>
</div>
<div class="control-group">
<select class="control" id="locale-switcher" name="locale">
@foreach(core()->getAllLocales() as $localeModel)
<option value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }}
</option>
@endforeach
</select>
</div>
</div>
<div class="page-action">
<button type="submit" class="btn btn-lg btn-primary">
{{ __('admin::app.configuration.sales.shipping-method.save-btn-title') }}
</button>
</div>
</div>
<div class="page-content">
<div class="form-container">
@csrf()
@foreach($shippingMethods as $fields)
<?php
$methodFields = $fields->getConfigFields();
$code = $fields->getCode();
?>
<accordian :active="true">
<div slot="body">
@foreach($methodFields as $fieldDetail)
<?php
$validations = [];
$disabled = false;
if(isset($fieldDetail['validation'])) {
array_push($validations, $fieldDetail['validation']);
}else {
$disabled = true;
}
$validations = implode('|', array_filter($validations));
?>
@if(view()->exists($typeView = 'admin::configuration.sales.field-types.' . $fieldDetail['type']))
<?php
$name = 'carrires'.'.'.$code.'.'.$fieldDetail['name'];
?>
<div class="control-group {{ $fieldDetail['type'] }}" :class="[errors.has('{{ $name }}') ? 'has-error' : '']">
<label for="{{ $name }}" {{ $disabled == false ? 'class=required' : '' }}>
{{ $fieldDetail['title'] }}
<?php
$channel_locale = [];
if(isset($fieldDetail['channel_based']) && $fieldDetail['channel_based'])
{
array_push($channel_locale, $channel);
}
if(isset($fieldDetail['locale_based']) && $fieldDetail['locale_based']) {
array_push($channel_locale, $locale);
}
?>
@if(count($channel_locale))
<span class="locale">[{{ implode(' - ', $channel_locale) }}]</span>
@endif
</label>
<?php
$configData = core()->getConfigData($name, current($channel_locale), next($channel_locale));
?>
@include ($typeView)
<span class="control-error" v-if="errors.has('{{ $name }}')">@{{ errors.first('{!! $name !!}') }}</span>
</div>
@endif
@endforeach
</div>
</accordian>
@endforeach
</div>
</div>
</form>
</div>
@stop
@push('scripts')
<script>
$(document).ready(function () {
$('#channel-switcher, #locale-switcher').on('change', function (e) {
$('#channel-switcher').val()
var query = '?channel=' + $('#channel-switcher').val() + '&locale=' + $('#locale-switcher').val();
window.location.href = "{{ route('admin.configuration.sales.shipping_methods') }}" + query;
})
});
</script>
@endpush

View File

@ -23,7 +23,6 @@
</div>
<div class="page-content">
<div class="form-container">
@csrf()
@ -36,8 +35,8 @@
</div>
</div>
</div>
</form>
</div>
@stop

View File

@ -18,7 +18,7 @@
</div>
<div class="page-content">
<div class="dashboard-stats">
<div class="dashboard-card">
@ -34,19 +34,19 @@
<span class="icon graph-down-icon"></span>
{{ __('admin::app.dashboard.decreased', [
'progress' => -number_format($statistics['total_customers']['progress'], 1)
])
])
}}
@else
<span class="icon graph-up-icon"></span>
{{ __('admin::app.dashboard.increased', [
'progress' => number_format($statistics['total_customers']['progress'], 1)
])
])
}}
@endif
</span>
</div>
</div>
</div>
<div class="dashboard-card">
<div class="title">
{{ __('admin::app.dashboard.total-orders') }}
@ -60,18 +60,18 @@
<span class="icon graph-down-icon"></span>
{{ __('admin::app.dashboard.decreased', [
'progress' => -number_format($statistics['total_orders']['progress'], 1)
])
])
}}
@else
<span class="icon graph-up-icon"></span>
{{ __('admin::app.dashboard.increased', [
'progress' => number_format($statistics['total_orders']['progress'], 1)
])
])
}}
@endif
</span>
</div>
</div>
</div>
<div class="dashboard-card">
<div class="title">
@ -86,18 +86,18 @@
<span class="icon graph-down-icon"></span>
{{ __('admin::app.dashboard.decreased', [
'progress' => -number_format($statistics['total_sales']['progress'], 1)
])
])
}}
@else
<span class="icon graph-up-icon"></span>
{{ __('admin::app.dashboard.increased', [
'progress' => number_format($statistics['total_sales']['progress'], 1)
])
])
}}
@endif
</span>
</div>
</div>
</div>
<div class="dashboard-card">
<div class="title">
@ -112,19 +112,19 @@
<span class="icon graph-down-icon"></span>
{{ __('admin::app.dashboard.decreased', [
'progress' => -number_format($statistics['avg_sales']['progress'], 1)
])
])
}}
@else
<span class="icon graph-up-icon"></span>
{{ __('admin::app.dashboard.increased', [
'progress' => number_format($statistics['avg_sales']['progress'], 1)
])
])
}}
@endif
</span>
</div>
</div>
</div>
</div>
<div class="graph-stats">
@ -138,7 +138,7 @@
<div class="card-info">
<canvas id="myChart" style="width: 100%; height: 87%"></canvas>
</div>
</div>
</div>
@ -153,7 +153,7 @@
<ul>
@foreach ($statistics['top_selling_categories'] as $item)
<li>
<a href="{{ route('admin.catalog.categories.edit', $item->category_id) }}">
<div class="description">
@ -171,7 +171,7 @@
<span class="icon angle-right-icon"></span>
</a>
</li>
@endforeach
</ul>
@ -204,7 +204,7 @@
<ul>
@foreach ($statistics['top_selling_products'] as $item)
<li>
<a href="{{ route('admin.catalog.products.edit', $item->product_id) }}">
<div class="product image">
@ -226,7 +226,7 @@
<span class="icon angle-right-icon"></span>
</a>
</li>
@endforeach
</ul>
@ -273,7 +273,7 @@
&nbsp;.&nbsp;
{{ __('admin::app.dashboard.revenue', [
'total' => core()->formatBasePrice($item->total_base_grand_total)
])
])
}}
</div>
</div>
@ -334,7 +334,7 @@
<span class="icon angle-right-icon"></span>
</a>
</li>
@endforeach
</ul>
@ -367,7 +367,7 @@
<div class="control-group date">
<date @onChange="applyFilter('start', $event)"><input type="text" class="control" id="start_date" value="{{ $startDate->format('Y-m-d') }}" placeholder="{{ __('admin::app.dashboard.from') }}" v-model="start"/></date>
</div>
<div class="control-group date">
<date @onChange="applyFilter('end', $event)"><input type="text" class="control" id="end_date" value="{{ $endDate->format('Y-m-d') }}" placeholder="{{ __('admin::app.dashboard.to') }}" v-model="end"/></date>
</div>
@ -392,7 +392,7 @@
}
}
});
$(document).ready(function () {
var ctx = document.getElementById("myChart").getContext('2d');

View File

@ -1,7 +1,9 @@
<div class="navbar-top">
<div class="navbar-top-left">
<div class="brand-logo">
<img src="{{ asset('vendor/webkul/ui/assets/images/logo.png') }}" alt="Bagisto"/>
<a href="{{ route('admin.dashboard.index') }}">
<img src="{{ asset('vendor/webkul/ui/assets/images/logo.png') }}" alt="Bagisto"/>
</a>
</div>
</div>

View File

@ -50,13 +50,15 @@
<div class="control-group" :class="[errors.has('target_currency') ? 'has-error' : '']">
<select v-validate="'required'" class="control" name="target_currency" data-vv-as="&quot;{{ __('admin::app.settings.exchange_rates.target_currency') }}&quot;">
@foreach($currencies as $currency)
<option value="{{ $currency->id }}">{{ $currency->name }}</option>
@if(is_null($currency->CurrencyExchangeRate))
<option value="{{ $currency->id }}">{{ $currency->name }}</option>
@endif
@endforeach
</select>
</select>
<span class="control-error" v-if="errors.has('target_currency')">@{{ errors.first('target_currency') }}</span>
</div>
</td>
<td>
<div class="control-group" :class="[errors.has('rate') ? 'has-error' : '']">
<input v-validate="'required'" class="control" id="rate" name="rate" data-vv-as="&quot;{{ __('admin::app.settings.exchange_rates.rate') }}&quot;" value="{{ old('rate') }}"/>

View File

@ -9,6 +9,7 @@ use Webkul\Core\Repositories\CountryRepository;
use Webkul\Core\Repositories\CountryStateRepository;
use Webkul\Core\Repositories\ChannelRepository;
use Webkul\Core\Repositories\LocaleRepository;
use Webkul\Core\Repositories\CoreConfigRepository;
use Illuminate\Support\Facades\Config;
class Core
@ -55,6 +56,13 @@ class Core
*/
protected $localeRepository;
/**
* CoreConfigRepository class
*
* @var mixed
*/
protected $coreConfigRepository;
/**
* Create a new instance.
*
@ -64,6 +72,7 @@ class Core
* @param Webkul\Core\Repositories\CountryRepository $countryRepository
* @param Webkul\Core\Repositories\CountryStateRepository $countryStateRepository
* @param Webkul\Core\Repositories\LocaleRepository $localeRepository
* @param Webkul\Core\Repositories\CoreConfigRepository $coreConfigRepository
* @return void
*/
public function __construct(
@ -72,7 +81,8 @@ class Core
ExchangeRateRepository $exchangeRateRepository,
CountryRepository $countryRepository,
CountryStateRepository $countryStateRepository,
LocaleRepository $localeRepository
LocaleRepository $localeRepository,
CoreConfigRepository $coreConfigRepository
)
{
$this->channelRepository = $channelRepository;
@ -86,6 +96,8 @@ class Core
$this->countryStateRepository = $countryStateRepository;
$this->localeRepository = $localeRepository;
$this->coreConfigRepository = $coreConfigRepository;
}
/**
@ -468,13 +480,21 @@ class Core
*
* @return mixed
*/
public function getConfigData($field, $channelId = null)
public function getConfigData($field, $channel = null, $locale = null)
{
if (null === $channelId) {
$channelId = $this->getCurrentChannel()->id;
if (null === $channel) {
$channel = $this->getCurrentChannel()->code;
}
return Config::get($field);
if (null === $locale) {
$locale = app()->getLocale();
}
$coreConfigValue = $this->coreConfigRepository->findOneWhere([
'code' => $field
]);
return $coreConfigValue;
}
/**

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class DropForeignKeyCoreConfigTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('core_config', function (Blueprint $table) {
$table->dropForeign('core_config_channel_id_foreign');
$table->renameColumn('channel_id', 'channel_code');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('core_config', function (Blueprint $table) {
$table->dropForeign('core_config_channel_id_foreign');
$table->renameColumn('channel_id', 'channel_code');
});
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterCoreConfigTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('core_config', function (Blueprint $table) {
$table->string('channel_code')->nullable()->change();
$table->string('locale_code')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('core_config', function (Blueprint $table) {
$table->string('channel_code')->nullable()->change();
$table->string('locale_code')->nullable();
$table->timestamps();
});
}
}

View File

@ -71,7 +71,7 @@ class ExchangeRateController extends Controller
*/
public function create()
{
$currencies = $this->currency->all();
$currencies = $this->currency->with('CurrencyExchangeRate')->all();
return view($this->_config['view'], compact('currencies'));
}

View File

@ -6,4 +6,17 @@ use Illuminate\Database\Eloquent\Model;
class CoreConfig extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $table = 'core_config';
protected $fillable = [
'code', 'value','channel_code','locale_code'
];
protected $hidden = ['token'];
}

View File

@ -3,6 +3,7 @@
namespace Webkul\Core\Models;
use Illuminate\Database\Eloquent\Model;
use Webkul\Core\Models\CurrencyExchangeRate;
class Currency extends Model
{
@ -14,4 +15,12 @@ class Currency extends Model
protected $fillable = [
'code', 'name'
];
/**
* Get the currency_exchange associated with the currency.
*/
public function CurrencyExchangeRate()
{
return $this->hasOne(CurrencyExchangeRate::class, 'target_currency');
}
}

View File

@ -65,6 +65,8 @@ class RegistrationController extends Controller
$data['is_verified'] = 0;
$data['customer_group_id'] = 1;
$verificationData['email'] = $data['email'];
$verificationData['token'] = md5(uniqid(rand(), true));
$data['token'] = $verificationData['token'];

View File

@ -19,6 +19,42 @@ class FlatRate extends AbstractShipping
*/
protected $code = 'flatrate';
/**
* Contains field details
*
* @var string
*/
protected $fields = [
[
'name' => 'title',
'title' => 'Title',
'type' => 'text',
'validation' => 'required',
'channel_based' => true,
'locale_based' => true
], [
'name' => 'description',
'title' => 'Description',
'type' => 'textarea',
'channel_based' => true,
'locale_based' => false
], [
'name' => 'active',
'title' => 'Status',
'type' => 'select',
'options' => [
[
'title' => 'Active',
'value' => true
], [
'title' => 'Inactive',
'value' => false
]
],
'validation' => 'required'
]
];
/**
* Returns rate for flatrate
*
@ -41,4 +77,28 @@ class FlatRate extends AbstractShipping
return $object;
}
/**
* Returns Configfields for flatrate
*
* @return array
*/
public function getConfigFields()
{
return $this->fields;
}
/**
* Returns fieldDetails for flatrate
*
* @return array
*/
public function getFieldDetails($fieldName)
{
foreach ($this->fields as $field) {
if ($fieldName == $field['name']) {
return $field;
}
}
}
}

View File

@ -19,6 +19,42 @@ class Free extends AbstractShipping
*/
protected $code = 'free';
/**
* Contains field details
*
* @var string
*/
protected $fields = [
[
'name' => 'title',
'title' => 'Title',
'type' => 'text',
'validation' => 'required',
'channel_based' => false,
'locale_based' => true
], [
'name' => 'description',
'title' => 'Description',
'type' => 'textarea',
'channel_based' => false,
'locale_based' => true
], [
'name' => 'active',
'title' => 'Status',
'type' => 'select',
'options' => [
[
'title' => 'Active',
'value' => true
], [
'title' => 'Inactive',
'value' => false
]
],
'validation' => 'required'
]
];
/**
* Returns rate for flatrate
*
@ -41,4 +77,28 @@ class Free extends AbstractShipping
return $object;
}
/**
* Returns Configfields for flatrate
*
* @return array
*/
public function getConfigFields()
{
return $this->fields;
}
/**
* Returns fieldDetails for flatrate
*
* @return array
*/
public function getFieldDetails($fieldName)
{
foreach ($this->fields as $field) {
if ($fieldName == $field['name']) {
return $field;
}
}
}
}

View File

@ -52,7 +52,7 @@
</span>
<span>
<a href="{{ route('address.delete', $address->id) }}">
<a href="{{ route('address.delete', $address->id) }}" onclick="deleteAddress('Do you really want to do this?')">
{{ __('shop::app.customer.account.address.index.delete') }}
</a>
</span>
@ -75,3 +75,12 @@
</div>
</div>
@endsection
@push('scripts')
<script>
function deleteAddress(message){
if(!confirm(message))
event.preventDefault();
}
</script>
@endpush

View File

@ -25,10 +25,10 @@
@foreach($reviews as $review)
<div class="account-item-card mt-15 mb-15">
<div class="media-info">
<?php $image = $productImageHelper->getGalleryImages($review->product); ?>
<?php $image = $productImageHelper->getProductBaseImage($review->product); ?>
<a href="{{ url()->to('/').'/products/'.$review->product->url_key }}" title="{{ $review->product->name }}">
<img class="media" src="{{ $image[0]['small_image_url'] }}"/>
<img class="media" src="{{ $image['small_image_url'] }}"/>
</a>
<div class="info">

View File

@ -138,7 +138,7 @@
if(thumbList && productHeroImage){
for(let i=0 ; i < thumbFrame.length ; i++){
for(let i=0; i < thumbFrame.length ; i++) {
thumbFrame[i].style.height = (productHeroImage.offsetHeight/4) + "px";
thumbFrame[i].style.width = (productHeroImage.offsetHeight/4)+ "px";
}
@ -151,7 +151,7 @@
window.onresize = function() {
if(thumbList && productHeroImage){
for(let i=0 ; i < thumbFrame.length ; i++){
for(let i=0; i < thumbFrame.length; i++) {
thumbFrame[i].style.height = (productHeroImage.offsetHeight/4) + "px";
thumbFrame[i].style.width = (productHeroImage.offsetHeight/4)+ "px";
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=b25a07d206dd0b89048f",
"/css/ui.css": "/css/ui.css?id=45a46d4f278c4eca0003"
"/js/ui.js": "/js/ui.js",
"/css/ui.css": "/css/ui.css"
}

View File

@ -477,6 +477,7 @@ h2 {
vertical-align: middle;
margin-left: -34px;
margin-top: 2px;
pointer-events: none;
}
}