Merge branch 'master' of https://github.com/bagisto/bagisto into velocity-updated

This commit is contained in:
shubhammehrotra.symfony@webkul.com 2020-02-19 18:59:52 +05:30
commit e16fad3ac8
44 changed files with 513 additions and 344 deletions

View File

@ -52,6 +52,24 @@
* #2449 [fixed] - error clicking empty cart.
* #2458 [fixed] - Payment method is not updating on checkout page.
* #2459 [fixed] - shipping address field warning for guest customer not translated.
* #2469 [fixed] - Displaying wrong amount for bundle product in cart.
* #2479 [fixed] - showing total review in recent view product list.
* #2480 [fixed] - Exception is thrown by mini cart when catalog rule is applied on configurable product.
* #2488 [fixed] - ErrorException When Editing product in different language.
* #2490 [fixed] - missing zip code & country field in checkout page.
* #2491 [fixed] - Exception on Create/Edit bundle product.
* #2494 [fixed] - Product total inventory for all locale is showing wrong.
## **v1.0.0-BETA1(5th of February 2020)** - *Release*
* [feature] Updated to laravel version 6.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,39 @@
/*!
* Sizzle CSS Selector Engine v2.3.4
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2019-04-08
*/
/*!
* Vue.js v2.6.11
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/
/*!
* jQuery JavaScript Library v3.4.1
* https://jquery.com/
*
* Includes Sizzle.js
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2019-05-01T21:04Z
*/
/**
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=8c0724bfd64081ee94bf",
"/css/admin.css": "/css/admin.css?id=51bad88a58200b49c06a"
"/js/admin.js": "/js/admin.js?id=c7c2ef0a298910b82304",
"/css/admin.css": "/css/admin.css?id=f2c6fe51889bca1fb79d"
}

View File

@ -45,7 +45,7 @@ class ProductDataGrid extends DataGrid
'product_flat.status',
'product_flat.price',
'attribute_families.name as attribute_family',
DB::raw('SUM(' . DB::getTablePrefix() . 'product_inventories.qty) as quantity')
DB::raw('SUM(DISTINCT ' . DB::getTablePrefix() . 'product_inventories.qty) as quantity')
);
if ($this->locale !== 'all') {

View File

@ -408,9 +408,13 @@ Route::group(['middleware' => ['web']], function () {
//delete backend user
Route::post('/users/delete/{id}', 'Webkul\User\Http\Controllers\UserController@destroy')->name('admin.users.delete');
Route::post('/confirm/destroy', 'Webkul\User\Http\Controllers\UserController@destroySelf')->defaults('_config', [
Route::get('/users/confirm/{id}', 'Webkul\User\Http\Controllers\UserController@confirm')->defaults('_config', [
'view' => 'admin::customers.confirm-password'
])->name('super.users.confirm');
Route::post('/users/confirm/{id}', 'Webkul\User\Http\Controllers\UserController@destroySelf')->defaults('_config', [
'redirect' => 'admin.users.index'
])->name('admin.users.confirm.destroy');
])->name('admin.users.destroy');
// User Role Routes
Route::get('/roles', 'Webkul\User\Http\Controllers\RoleController@index')->defaults('_config', [

View File

@ -140,7 +140,12 @@
.filter-row-one .dropdown-filters {
right: unset;
position: static !important;
left: 25px;
.per-page-label {
position: static !important;
}
}
}

View File

@ -6,6 +6,7 @@
@section('content')
<div class="content">
<?php $locale = request()->get('locale') ?: app()->getLocale(); ?>
<form method="POST" action="" @submit.prevent="onSubmit" enctype="multipart/form-data">

View File

@ -6,6 +6,9 @@
@section('content')
<div class="content">
<?php $locale = request()->get('locale') ?: app()->getLocale(); ?>
<?php $channel = request()->get('channel') ?: core()->getDefaultChannelCode(); ?>
{!! view_render_event('bagisto.admin.catalog.product.edit.before', ['product' => $product]) !!}
<form method="POST" action="" @submit.prevent="onSubmit" enctype="multipart/form-data">
@ -25,7 +28,7 @@
@foreach (core()->getAllChannels() as $channelModel)
<option
value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channelCode ? 'selected' : '' }}>
value="{{ $channelModel->code }}" {{ ($channelModel->code) == $channel ? 'selected' : '' }}>
{{ $channelModel->name }}
</option>
@ -38,7 +41,7 @@
@foreach (core()->getAllLocales() as $localeModel)
<option
value="{{ $localeModel->code }}" {{ ($localeModel->code) == $localeCode ? 'selected' : '' }}>
value="{{ $localeModel->code }}" {{ ($localeModel->code) == $locale ? 'selected' : '' }}>
{{ $localeModel->name }}
</option>
@ -111,11 +114,11 @@
$channel_locale = [];
if ($attribute->value_per_channel) {
array_push($channel_locale, $channelCode);
array_push($channel_locale, $channel);
}
if ($attribute->value_per_locale) {
array_push($channel_locale, $localeCode);
array_push($channel_locale, $locale);
}
?>

View File

@ -8,15 +8,15 @@
<div class="content">
<div class="page-header">
<div class="page-title">
<h1>{{ __('admin::app.users.users.confirm-delete-title') }}</h1>
</div>
<div class="page-action">
<h1>
<i class="icon angle-left-icon back-link" onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.users.users.confirm-delete-title') }}
</h1>
</div>
</div>
<div class="page-content">
<form action="{{ route('admin.users.confirm.destroy') }}" method="POST" @submit.prevent="onSubmit">
<form action="{{ route('admin.users.destroy', $user->id) }}" method="POST" @submit.prevent="onSubmit">
@csrf
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
<label for="password" class="required">

View File

@ -39,9 +39,8 @@ class CategoryController extends Controller
/**
* Create a new controller instance.
*
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
*
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
* @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository
* @return void
*/
public function __construct(
@ -75,7 +74,7 @@ class CategoryController extends Controller
{
$categories = $this->categoryRepository->getCategoryTree(null, ['id']);
$attributes = $this->attributeRepository->findWhere(['is_filterable' => 1]);
$attributes = $this->attributeRepository->findWhere(['is_filterable' => 1]);
return view($this->_config['view'], compact('categories', 'attributes'));
}
@ -88,10 +87,10 @@ class CategoryController extends Controller
public function store()
{
$this->validate(request(), [
'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug],
'name' => 'required',
'image.*' => 'mimes:jpeg,jpg,bmp,png',
'description' => 'required_if:display_mode,==,description_only,products_and_description',
'slug' => ['required', 'unique:category_translations,slug', new \Webkul\Core\Contracts\Validations\Slug],
'name' => 'required',
'image.*' => 'mimes:jpeg,jpg,bmp,png',
'description' => 'required_if:display_mode,==,description_only,products_and_description'
]);
if (strtolower(request()->input('name')) == 'root') {
@ -99,14 +98,14 @@ class CategoryController extends Controller
$result = $categoryTransalation->where('name', request()->input('name'))->get();
if (count($result) > 0) {
if(count($result) > 0) {
session()->flash('error', trans('admin::app.response.create-root-failure'));
return redirect()->back();
}
}
$this->categoryRepository->create(request()->all());
$category = $this->categoryRepository->create(request()->all());
session()->flash('success', trans('admin::app.response.create-success', ['name' => 'Category']));
@ -117,7 +116,6 @@ class CategoryController extends Controller
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return \Illuminate\View\View
*/
public function edit($id)
@ -126,25 +124,15 @@ class CategoryController extends Controller
$categories = $this->categoryRepository->getCategoryTreeWithoutDescendant($id);
$attributes = $this->attributeRepository->findWhere(['is_filterable' => 1]);
$attributes = $this->attributeRepository->findWhere(['is_filterable' => 1]);
$locale = request()->get('locale')
?: core()->getDefaultChannel()->default_locale->code
?: app()->getLocale();
return view($this->_config['view'], compact(
'category',
'categories',
'attributes',
'locale'
));
return view($this->_config['view'], compact('category', 'categories', 'attributes'));
}
/**
* Update the specified resource in storage.
*
* @param int $id
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update($id)
@ -158,7 +146,7 @@ class CategoryController extends Controller
}
}],
$locale . '.name' => 'required',
'image.*' => 'mimes:jpeg,jpg,bmp,png',
'image.*' => 'mimes:jpeg,jpg,bmp,png'
]);
$this->categoryRepository->update(request()->all(), $id);
@ -171,15 +159,14 @@ class CategoryController extends Controller
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$category = $this->categoryRepository->findOrFail($id);
if (strtolower($category->name) == "root") {
if(strtolower($category->name) == "root") {
session()->flash('warning', trans('admin::app.response.delete-category-root', ['name' => 'Category']));
} else {
try {
@ -192,7 +179,7 @@ class CategoryController extends Controller
session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Category']));
return response()->json(['message' => true], 200);
} catch (\Exception $e) {
} catch(\Exception $e) {
session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Category']));
}
}
@ -205,8 +192,7 @@ class CategoryController extends Controller
*
* @return response \Illuminate\Http\Response
*/
public function massDestroy()
{
public function massDestroy() {
$suppressFlash = false;
if (request()->isMethod('delete') || request()->isMethod('post')) {
@ -219,7 +205,7 @@ class CategoryController extends Controller
$this->categoryRepository->delete($value);
Event::dispatch('catalog.category.delete.after', $value);
} catch (\Exception $e) {
} catch(\Exception $e) {
$suppressFlash = true;
continue;

View File

@ -738,8 +738,11 @@ class Cart {
foreach ($taxRates as $rate) {
$haveTaxRate = false;
if ($rate->state != '' && $rate->state != $address->state)
if ($rate->state != '' && $rate->state != $address->state) {
$this->setItemTaxToZero($item);
continue;
}
if (! $rate->is_zip) {
if ($rate->zip_code == '*' || $rate->zip_code == $address->postcode)
@ -757,24 +760,30 @@ class Cart {
$item->save();
break;
} else {
$item->tax_percent = 0;
$item->tax_amount = 0;
$item->base_tax_amount = 0;
$this->setItemTaxToZero($item);
$item->save();
break;
}
}
} else {
$item->tax_percent = 0;
$item->tax_amount = 0;
$item->base_tax_amount = 0;
$item->save();
$this->setItemTaxToZero($item);
}
}
}
/**
* Set Item tax to zero.
*
* @return void
*/
protected function setItemTaxToZero($item) {
$item->tax_percent = 0;
$item->tax_amount = 0;
$item->base_tax_amount = 0;
$item->save();
}
/**
* Checks if cart has any error
*

View File

@ -135,9 +135,6 @@ class Core
'https://' . request()->getHttpHost(),
])->first();
if (! $channel)
$channel = $this->channelRepository->findOneByField('code', config('app.channel'));
if (! $channel)
$channel = $this->channelRepository->first();

View File

@ -16,7 +16,12 @@ class CurrencyTableSeeder extends Seeder
DB::table('currencies')->insert([
'id' => 1,
'code' => 'USD',
'name' => 'US Dollar'
'name' => 'US Dollar'
], [
'id' => 2,
'code' => 'EUR',
'name' => 'Euro',
'symbol' => '€'
]);
}
}
}

View File

@ -10,19 +10,7 @@ use Webkul\Core\Contracts\Channel as ChannelContract;
class Channel extends Model implements ChannelContract
{
protected $fillable = [
'code',
'name',
'description',
'theme',
'home_page_content',
'footer_content',
'hostname',
'default_locale_id',
'base_currency_id',
'root_category_id',
'home_seo',
];
protected $fillable = ['code', 'name', 'description', 'theme', 'home_page_content', 'footer_content', 'hostname', 'default_locale_id', 'base_currency_id', 'root_category_id', 'home_seo'];
/**
* Get the channel locales.

View File

@ -73,13 +73,12 @@ class ProductController extends Controller
/**
* Create a new controller instance.
*
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
* @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
* @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository
* @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository
* @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource
*
* @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository
* @param \Webkul\Product\Repositories\ProductRepository $productRepository
* @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository
* @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository
* @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository
* @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySource
* @return void
*/
public function __construct(
@ -150,7 +149,7 @@ class ProductController extends Controller
if (ProductType::hasVariants(request()->input('type'))
&& (! request()->has('super_attributes')
|| ! count(request()->get('super_attributes')))) {
|| ! count(request()->get('super_attributes')))) {
session()->flash('error', trans('admin::app.catalog.products.configurable-error'));
@ -158,9 +157,9 @@ class ProductController extends Controller
}
$this->validate(request(), [
'type' => 'required',
'type' => 'required',
'attribute_family_id' => 'required',
'sku' => ['required', 'unique:products,sku', new \Webkul\Core\Contracts\Validations\Slug],
'sku' => ['required', 'unique:products,sku', new \Webkul\Core\Contracts\Validations\Slug]
]);
$product = $this->productRepository->create(request()->all());
@ -173,8 +172,7 @@ class ProductController extends Controller
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @param int $id
* @return \Illuminate\View\View
*/
public function edit($id)
@ -185,25 +183,14 @@ class ProductController extends Controller
$inventorySources = $this->inventorySourceRepository->all();
$channel = request()->get('channel') ?: core()->getDefaultChannel();
$channelCode = $channel->code;
$localeCode = request()->get('localeCode') ?: $channel->default_locale->code ?: app()->getLocale();
return view($this->_config['view'], compact('product',
'categories',
'inventorySources',
'channel',
'channelCode',
'localeCode'
));
return view($this->_config['view'], compact('product', 'categories', 'inventorySources'));
}
/**
* Update the specified resource in storage.
*
* @param \Webkul\Product\Http\Requests\ProductForm $request
* @param int $id
*
* @param \Webkul\Product\Http\Requests\ProductForm $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(ProductForm $request, $id)
@ -218,8 +205,7 @@ class ProductController extends Controller
/**
* Uploads downloadable file
*
* @param int $id
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function uploadLink($id)
@ -232,8 +218,7 @@ class ProductController extends Controller
/**
* Uploads downloadable sample file
*
* @param int $id
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function uploadSample($id)
@ -246,8 +231,7 @@ class ProductController extends Controller
/**
* Remove the specified resource from storage.
*
* @param int $id
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
@ -303,7 +287,7 @@ class ProductController extends Controller
return redirect()->back();
}
if (! $data['massaction-type'] == 'update') {
if (!$data['massaction-type'] == 'update') {
return redirect()->back();
}
@ -312,8 +296,8 @@ class ProductController extends Controller
foreach ($productIds as $productId) {
$this->productRepository->update([
'channel' => null,
'locale' => null,
'status' => $data['update-options'],
'locale' => null,
'status' => $data['update-options']
], $productId);
}
@ -344,10 +328,10 @@ class ProductController extends Controller
foreach ($this->productRepository->searchProductByAttribute(request()->input('query')) as $row) {
$results[] = [
'id' => $row->product_id,
'sku' => $row->sku,
'name' => $row->name,
];
'id' => $row->product_id,
'sku' => $row->sku,
'name' => $row->name,
];
}
return response()->json($results);
@ -356,18 +340,17 @@ class ProductController extends Controller
}
}
/**
/**
* Download image or file
*
* @param int $productId , $attributeId
*
* @param int $productId, $attributeId
* @return \Illuminate\Http\Response
*/
public function download($productId, $attributeId)
{
$productAttribute = $this->productAttributeValue->findOneWhere([
'product_id' => $productId,
'attribute_id' => $attributeId,
'attribute_id' => $attributeId
]);
return Storage::download($productAttribute['text_value']);

View File

@ -2,7 +2,6 @@
namespace Webkul\Product\Models;
use Webkul\Core\Models\Channel;
use Illuminate\Database\Eloquent\Model;
use Webkul\Attribute\Models\AttributeFamilyProxy;
use Webkul\Category\Models\CategoryProxy;
@ -182,8 +181,8 @@ class Product extends Model implements ProductContract
public function inventory_source_qty($inventorySourceId)
{
return $this->inventories()
->where('inventory_source_id', $inventorySourceId)
->sum('qty');
->where('inventory_source_id', $inventorySourceId)
->sum('qty');
}
/**
@ -244,7 +243,6 @@ class Product extends Model implements ProductContract
*
* @param Group $group
* @param bool $skipSuperAttribute
*
* @return Collection
*/
public function getEditableAttributes($group = null, $skipSuperAttribute = true)
@ -255,8 +253,7 @@ class Product extends Model implements ProductContract
/**
* Get an attribute from the model.
*
* @param string $key
*
* @param string $key
* @return mixed
*/
public function getAttribute($key)
@ -265,9 +262,8 @@ class Product extends Model implements ProductContract
if (isset($this->id)) {
$this->attributes[$key] = '';
$attribute = core()
->getSingletonInstance(\Webkul\Attribute\Repositories\AttributeRepository::class)
->getAttributeByCode($key);
$attribute = core()->getSingletonInstance(\Webkul\Attribute\Repositories\AttributeRepository::class)
->getAttributeByCode($key);
$this->attributes[$key] = $this->getCustomAttributeValue($attribute);
@ -288,9 +284,8 @@ class Product extends Model implements ProductContract
$hiddenAttributes = $this->getHidden();
if (isset($this->id)) {
$familyAttributes = core()
->getSingletonInstance(\Webkul\Attribute\Repositories\AttributeRepository::class)
->getFamilyAttributes($this->attribute_family);
$familyAttributes = core()->getSingletonInstance(\Webkul\Attribute\Repositories\AttributeRepository::class)
->getFamilyAttributes($this->attribute_family);
foreach ($familyAttributes as $attribute) {
if (in_array($attribute->code, $hiddenAttributes)) {
@ -311,41 +306,24 @@ class Product extends Model implements ProductContract
*/
public function getCustomAttributeValue($attribute)
{
if (! $attribute) {
if (! $attribute)
return;
}
$channel = request()->get('channel') ?: (core()->getCurrentChannelCode() ?: core()->getDefaultChannelCode());
$locale = $this->determineLocale($channel);
$locale = request()->get('locale') ?: app()->getLocale();
if ($attribute->value_per_channel) {
if ($attribute->value_per_locale) {
$attributeValue = $this
->attribute_values()
->where('channel', $channel)
->where('locale', $locale)
->where('attribute_id', $attribute->id)
->first();
$attributeValue = $this->attribute_values()->where('channel', $channel)->where('locale', $locale)->where('attribute_id', $attribute->id)->first();
} else {
$attributeValue = $this
->attribute_values()
->where('channel', $channel)
->where('attribute_id', $attribute->id)
->first();
$attributeValue = $this->attribute_values()->where('channel', $channel)->where('attribute_id', $attribute->id)->first();
}
} else {
if ($attribute->value_per_locale) {
$attributeValue = $this
->attribute_values()
->where('locale', $locale)
->where('attribute_id', $attribute->id)
->first();
$attributeValue = $this->attribute_values()->where('locale', $locale)->where('attribute_id', $attribute->id)->first();
} else {
$attributeValue = $this
->attribute_values()
->where('attribute_id', $attribute->id)
->first();
$attributeValue = $this->attribute_values()->where('attribute_id', $attribute->id)->first();
}
}
@ -355,8 +333,7 @@ class Product extends Model implements ProductContract
/**
* Overrides the default Eloquent query builder
*
* @param \Illuminate\Database\Eloquent\Builder $query
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function newEloquentBuilder($query)
@ -379,24 +356,4 @@ class Product extends Model implements ProductContract
{
return $this;
}
/**
* Determine if the given channel has a default locale configured.
* If not, return the channel given in the request.
* If none given, return the fallback channel given in the application configuration
*
* @param string $channel
*
* @return string
*/
private function determineLocale(string $channel): string
{
$channelModel = Channel::where(['code' => $channel])->first();
if ($channelModel) {
return $channelModel->default_locale->code;
}
return request()->get('locale') ?: app()->getLocale();
}
}

View File

@ -35,8 +35,9 @@ class ProductFlatRepository extends Repository
}
/**
* get Category Product
* get Category Product Attribute
*
* @param CategoryId $categoryId
* @return array
*/
public function getCategoryProductAttribute($categoryId)
@ -61,4 +62,35 @@ class ProductFlatRepository extends Repository
return $productCategoryArrributes;
}
/**
* get Filterable Attributes.
*
* @param array $category
* @param array $products
* @return collection
*/
public function getFilterableAttributes($category, $products) {
$filterAttributes = [];
if (count($category->filterableAttributes) > 0 && count($products)) {
$filterAttributes = $category->filterableAttributes;
} else {
$categoryProductAttributes = $this->getCategoryProductAttribute($category->id);
if ($categoryProductAttributes) {
foreach (app('Webkul\Attribute\Repositories\AttributeRepository')->getFilterAttributes() as $filterAttribute) {
if (in_array($filterAttribute->id, $categoryProductAttributes)) {
$filterAttributes[] = $filterAttribute;
} else if ($filterAttribute ['code'] == 'price') {
$filterAttributes[] = $filterAttribute;
}
}
$filterAttributes = collect($filterAttributes);
}
}
return $filterAttributes;
}
}

View File

@ -25,6 +25,6 @@
"ez-plus": "^1.2.1",
"vee-validate": "^2.2.15",
"vue-flatpickr": "^2.3.0",
"vue-slider-component": "^2.7.5"
"vue-slider-component": "^3.1.0"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=6d8ea335fbfa47e80e72",
"/css/shop.css": "/css/shop.css?id=66ee90f14efb050a20e5"
"/css/shop.css": "/css/shop.css?id=ccf417b825955d8bd301"
}

View File

@ -5,6 +5,7 @@ namespace Webkul\Shop\Http\Controllers;
use Webkul\Customer\Repositories\WishlistRepository;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Checkout\Contracts\Cart as CartModel;
use Illuminate\Support\Facades\Event;
use Cart;
/**
@ -85,8 +86,10 @@ class CartController extends Controller
if ($customer = auth()->guard('customer')->user())
$this->wishlistRepository->deleteWhere(['product_id' => $id, 'customer_id' => $customer->id]);
if (request()->get('is_buy_now'))
if (request()->get('is_buy_now')) {
Event::dispatch('shop.item.buy-now', $id);
return redirect()->route('shop.checkout.onepage.index');
}
}
} catch(\Exception $e) {
session()->flash('error', trans($e->getMessage()));
@ -214,4 +217,4 @@ class CartController extends Controller
private function onWarningAddingToCart($result): bool {
return is_array($result) && isset($result['warning']);
}
}
}

View File

@ -32,6 +32,7 @@ $shadow-color: #ccc;
$shadow-color1: #cccccc;
$outline-hvr: #eaeaec;
$review-details: #5e5e5e;
$slider-color: rgb(255, 100, 114);
//shop variables ends here
//

View File

@ -2156,6 +2156,56 @@ section.product-detail {
}
}
.vue-slider {
.vue-slider-rail {
background-color: #ccc;
cursor: pointer;
}
.vue-slider-dot-handle {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: $btn-background-color;
box-shadow: 0.5px 0.5px 2px 1px rgba(0,0,0,.32);
}
.vue-slider-dot-tooltip-inner {
border-color: $slider-color !important;
background-color: $slider-color !important;
}
.vue-slider-dot-tooltip-text {
display: block;
font-size: 14px;
min-width: 20px;
padding: 2px 5px;
text-align: center;
border-radius: 5px;
white-space: nowrap;
color: $btn-background-color;
border-color: $slider-color !important;
background-color: $slider-color !important;
}
.vue-slider-dot-tooltip-text::before {
content: "";
position: absolute;
bottom: -10px;
left: 50%;
width: 0;
height: 0;
border: 5px solid transparent;
border: 6px solid transparent\0;
border-top-color: inherit;
transform: translate(-50%);
}
.vue-slider-process {
background-color: $slider-color !important;
}
}
// product pages responsive css start here
@media only screen and (max-width: 720px) {
section.product-detail div.layouter .form-container {
@ -3759,6 +3809,12 @@ section.review {
.rtl {
direction: rtl;
.dropdown-filters {
.per-page-label {
position: static !important;
}
}
//header css start here
.header {
.header-top {

View File

@ -404,10 +404,12 @@
newBillingAddress: function() {
this.new_billing_address = true;
this.address.billing.address_id = null;
},
newShippingAddress: function() {
this.new_shipping_address = true;
this.address.shipping.address_id = null;
},
backToSavedBillingAddress: function() {

View File

@ -34,7 +34,7 @@
</li>
<li class="mb-15">
@{{ addresses.country }}.
@{{ addresses.country }} @{{ addresses.postcode }}
</li>
<li>

View File

@ -10,26 +10,22 @@
if (isset($category)) {
$products = $productRepository->getAll($category->id);
if (count($category->filterableAttributes) > 0 && count($products)) {
$filterAttributes = $category->filterableAttributes;
} else {
$categoryProductAttributes = $productFlatRepository->getCategoryProductAttribute($category->id);
if ($categoryProductAttributes) {
foreach ($attributeRepository->getFilterAttributes() as $filterAttribute) {
if (in_array($filterAttribute->id, $categoryProductAttributes)) {
$filterAttributes[] = $filterAttribute;
} else if ($filterAttribute ['code'] == 'price') {
$filterAttributes[] = $filterAttribute;
}
}
$filterAttributes = collect($filterAttributes);
}
}
$filterAttributes = $productFlatRepository->getFilterableAttributes($category, $products);
} else {
$filterAttributes = $attributeRepository->getFilterAttributes();
}
foreach ($filterAttributes as $attribute) {
if ($attribute->code <> 'price') {
if (! $attribute->options->isEmpty()) {
$attributes[] = $attribute;
}
} else {
$attributes[] = $attribute;
}
}
$filterAttributes = collect($attributes);
?>
<div class="layered-filter-wrapper">
@ -99,7 +95,7 @@
:tooltip-style="sliderConfig.tooltipStyle"
:max="sliderConfig.max"
:lazy="true"
@callback="priceRangeUpdated($event)"
@change="priceRangeUpdated($event)"
></vue-slider>
</div>
@ -116,7 +112,7 @@
data: function() {
return {
attributes: @json($filterAttributes),
appliedFilters: {}
}
},
@ -187,7 +183,7 @@
created: function () {
if (!this.index)
this.active = false;
this.active = true;
if (this.appliedFilterValues && this.appliedFilterValues.length) {
this.appliedFilters = this.appliedFilterValues;

View File

@ -685,7 +685,12 @@
_method : element.getAttribute('data-method')
}).then(function(response) {
this.result = response;
location.reload();
if (response.data.redirect) {
window.location.href = response.data.redirect;
} else {
location.reload();
}
}).catch(function (error) {
location.reload();
});

View File

@ -172,7 +172,9 @@ class UserController extends Controller
Event::dispatch('user.admin.delete.before', $id);
if (auth()->guard('admin')->user()->id == $id) {
return view('admin::customers.confirm-password');
return response()->json([
'redirect' => route('super.users.confirm', ['id' => $id]),
]);
}
try {
@ -191,6 +193,19 @@ class UserController extends Controller
return response()->json(['message' => false], 400);
}
/**
* Show the form for confirming the user password.
*
* @param integer $id
* @return \Illuminate\View\View
*/
public function confirm($id)
{
$user = $this->adminRepository->findOrFail($id);
return view($this->_config['view'], compact('user'));
}
/**
* destroy current after confirming
*

View File

@ -226,7 +226,7 @@ return [
'products' => [
'text' => 'Products',
'details' => 'Details',
'reviews' => 'Reviews',
'reviews-title' => 'Reviews',
'reviewed' => 'Reviewed',
'review-by' => 'Review by',
'quick-view' => 'Quick View',

View File

@ -478,7 +478,7 @@
newBillingAddress: function() {
this.new_billing_address = true;
this.isPlaceOrderEnabled = false;
this.address.shipping.address_id = null;
this.address.billing.address_id = null;
},
newShippingAddress: function() {

View File

@ -8,26 +8,22 @@
if (isset($category)) {
$products = $productRepository->getAll($category->id);
if (count($category->filterableAttributes) > 0 && count($products)) {
$filterAttributes = $category->filterableAttributes;
} else {
$categoryProductAttributes = $productFlatRepository->getCategoryProductAttribute($category->id);
if ($categoryProductAttributes) {
foreach ($attributeRepository->getFilterAttributes() as $filterAttribute) {
if (in_array($filterAttribute->id, $categoryProductAttributes)) {
$filterAttributes[] = $filterAttribute;
} else if ($filterAttribute ['code'] == 'price') {
$filterAttributes[] = $filterAttribute;
}
}
$filterAttributes = collect($filterAttributes);
}
}
$filterAttributes = $productFlatRepository->getFilterableAttributes($category, $products);
} else {
$filterAttributes = $attributeRepository->getFilterAttributes();
}
foreach ($filterAttributes as $attribute) {
if ($attribute->code <> 'price') {
if (! $attribute->options->isEmpty()) {
$attributes[] = $attribute;
}
} else {
$attributes[] = $attribute;
}
}
$filterAttributes = collect($attributes);
?>
<div class="layered-filter-wrapper left">

View File

@ -120,7 +120,7 @@
{{-- customer reviews --}}
<div slot="header" class="col-lg-12 no-padding">
<h3 class="display-inbl">
{{ __('velocity::app.products.reviews') }}
{{ __('velocity::app.products.reviews-title') }}
</h3>
<i class="rango-arrow"></i>
@ -161,7 +161,7 @@
</accordian>
@else
<h3 class="display-inbl mb20 col-lg-12 no-padding">
{{ __('velocity::app.products.reviews') }}
{{ __('velocity::app.products.reviews-title') }}
</h3>
<div class="customer-reviews">

View File

@ -4,11 +4,17 @@ body {
font-family: "Montserrat", sans-serif;
color: #000311;
text-align: center;
background: white;
background: #fff;
position: relative;
height: 100%;
}
a { color: rgb(0, 65, 255); text-decoration: none;}
.initial-display{
padding-top: 50px;
}
.initial-display .logo {
width: 150px;
}
@ -18,7 +24,7 @@ body {
color: #333333;
text-align: center;
font-weight: 600;
margin-top: 50px;
margin-top: 30px;
}
.prepare-btn {
@ -34,6 +40,10 @@ body {
margin-top: 20px;
}
.warning {
margin-left: 15%;
}
.footer {
bottom: 0;
position: absolute;
@ -54,13 +64,76 @@ body {
}
.content {
border: 1px solid #979797;
border-radius: 3px;
border-radius: 5px;
box-shadow: 1px 8px 18px rgba(62, 85, 120, 0.45);
min-height: 300px;
width: 600px;
height: 392px;
margin-left: calc(50% - 300px);
text-align: left;
overflow-x: scroll;
overflow-y: auto;
}
.requirements_list {
width: 90%;
list-style: none;
margin-left: 5%;
padding:0;
}
.requirements_list li {
padding: 0 8px 8px;
margin-bottom: 8px;
border-bottom: 1px dashed #dcdcdc;
line-height: normal;
}
.requirements_list li:last-child { border-bottom: 0;}
.requirements_list small {
font-size: 13px;
color:#9b9b9b;
}
.content .cp-round {
position: auto !important;
}
.content .cp-round:before {
border-radius: 50%;
content: " ";
width: 48px;
height: 48px;
display: inline-block;
box-sizing: border-box;
border-top: solid 6px #bababa;
border-right: solid 6px #bababa;
border-bottom: solid 6px #bababa;
border-left: solid 6px #bababa;
position: absolute;
top: calc(40% - 14px);
left: calc(50% - 24px);
}
.content .cp-round:after {
border-radius: 50%;
content: " ";
width: 48px;
height: 48px;
display: inline-block;
box-sizing: border-box;
border-top: solid 6px #0041FF;
border-right: solid 6px #bababa;
border-bottom: solid 6px #bababa;
border-left: solid 6px #bababa;
position: absolute;
top: calc(40% - 14px);
left: calc(50% - 24px);
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.title {
@ -70,6 +143,7 @@ body {
text-align: left;
margin-top: 30px;
margin-bottom: 10px;
text-align: center;
}
span {
@ -138,46 +212,9 @@ pre.bash {
height: 100%;
}
.cp-round:before {
border-radius: 50%;
content: " ";
width: 48px;
height: 48px;
display: inline-block;
box-sizing: border-box;
border-top: solid 6px #bababa;
border-right: solid 6px #bababa;
border-bottom: solid 6px #bababa;
border-left: solid 6px #bababa;
position: absolute;
top: calc(50% - 24px);
left: calc(50% - 24px);
}
.check {
line-height: 40px;
}
.cp-round:after {
border-radius: 50%;
content: " ";
width: 48px;
height: 48px;
display: inline-block;
box-sizing: border-box;
border-top: solid 6px #0041FF;
border-right: solid 6px #bababa;
border-bottom: solid 6px #bababa;
border-left: solid 6px #bababa;
position: absolute;
top: calc(50% - 24px);
left: calc(50% - 24px);
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
line-height: 35px;
margin-left: 25%;
}
.composer {
@ -189,3 +226,33 @@ pre.bash {
.message {
padding-left: 140px;
}
@media (min-width: 1281px) {
.content {
padding: 2rem 0;
}
.content {
max-height: 484px;
margin: 20px auto;
}
}
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
.initial-display{
padding-top: 15px;
}
.content {
padding: 1rem 0;
}
.content {
max-height: 488px;
margin: 30px auto;
}
.initial-display p {
margin-top: 4px;
}
}

View File

@ -134,7 +134,7 @@ class Requirement {
$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.';
$data['composer'] = 'Bagisto has detected that the required composer dependencies are not installed.<br />Go to the root directory of Bagisto and run "composer install".';
}
return $data;

View File

@ -1,7 +1,6 @@
<?php
$data = array();
$data = array();
$data['install'] = 0;
echo json_encode($data);

View File

@ -8,9 +8,9 @@
<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 class="databse-error" style="text-align: center; padding-top: 5px" id="database_error">
</div>
<div class="form-container" style="padding: 10%; padding-top: 35px">
<div class="form-container" style="padding: 10%; padding-top: 10px">
<div class="control-group" id="app_name">
<label for="app_name" class="required">App Name</label>
<input type = "text" name = "app_name" class = "control"
@ -21,7 +21,7 @@
<div class="control-group" id="app_url">
<label for="app_url" class="required">App URL</label>
<input type="text" name="app_url" class="control"
<input type="text" name="app_url" class="control" value="https://<?php echo $_SERVER['HTTP_HOST']; ?>"
placeholder="http://localhost"
data-validation="required length" data-validation-length="max50">
</div>
@ -40,14 +40,13 @@
<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"
<input type="text" name="port_name" class="control" value="3306" placeholder="3306"
data-validation="required alphanumeric number length" data-validation-length="max5">
</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"
<input type="text" name="host_name" class="control" value="127.0.0.1"
placeholder="127.0.0.1"
data-validation="required length" data-validation-length="max50">
</div>
@ -68,7 +67,7 @@
<div class="control-group" id="user_password">
<label for="user_password" class="required">User Password</label>
<input type="text" name="user_password" class="control"
<input type="password" name="user_password" class="control"
placeholder="database password">
</div>
</div>

View File

@ -7,12 +7,12 @@
<div class="content-container" style="padding: 20px">
<span>
Bagisto is successfully installed on your system.<br>
Click the below button to launch Admin Panel.
Click the below button to launch the admin panel.
</span>
</div>
</div>
<button class="prepare-btn" onclick="finish()">Finish</button>
<button class="prepare-btn" onclick="finish()">Continue</button>
</div>
</div>
</body>

View File

@ -11,6 +11,8 @@
var welcomeCheck = document.getElementById('welcome-check');
var requirementCheck = document.getElementById('requirement-check');
var requirementsRefresh = document.getElementById('requirements-refresh');
var permisssionCheck = document.getElementById('permission-check');
var environmentCheck = document.getElementById('environment-check');
var continue_to_admin = document.getElementById('continue');
@ -24,6 +26,10 @@
requirementCheck.addEventListener('click', myFunction);
}
if (requirementsRefresh) {
requirementsRefresh.addEventListener('click', myFunction);
}
if (welcomeCheck) {
welcomeCheck.addEventListener('click', myFunction);
}
@ -56,7 +62,6 @@
migrationBack.addEventListener('click', myFunction);
}
function myFunction() {
if(this.id == 'welcome-check') {
requirement.style.display = "block";
@ -76,6 +81,8 @@
} else if (this.id == 'migration-back') {
migration.style.display = "none";
environment.style.display ="block";
} else if (this.id == 'requirements-refresh') {
location.reload();
}
}
};

View File

@ -56,10 +56,8 @@
<div class="initial-display">
<p>Migration & Seed</p>
<div class="cp-spinner cp-round" id="loader">
</div>
<div class="content" id="migration-result">
<div class="cp-spinner cp-round" id="loader"></div>
<div class="window" id="migrate">
</div>
<div class="window" id="key">

View File

@ -3,7 +3,7 @@
ini_set('max_execution_time', 300);
// array to pass back data
$data = array();
$data = array();
// run command on terminal
$command = 'cd ../.. && php artisan migrate --force';

View File

@ -11,60 +11,57 @@
<div class="container requirement" id="requirement">
<div class="initial-display">
<p>Requirements</p>
<p>Server Requirements</p>
<div class="content">
<div class="title" style="text-align: center; margin-top: 10px">
Please wait while we are checking the requirements
</div>
<ul class="requirements_list">
<li>
<?php if($phpVersion['supported'] ? $src = $greenCheck : $src = $redCheck): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span><b>PHP</b></span>
<small>(<?php echo $phpVersion['minimum'] ?> or higher)</small>
<br>
<?php if(!($phpVersion['supported'] == 1)): ?>
<small style="color: red;">
Bagisto has detected that your PHP version (<?php echo $phpVersion['current']; ?>) is not supported.<br>
Contact your provider if you are not the server administrator.
</small>
<?php endif; ?>
</li>
<div class="check" style="margin-left: 25%">
<?php if($phpVersion['supported'] ? $src = $greenCheck : $src = $redCheck): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span style="margin-left: 10px"><b>PHP</b></span>
<span>(<?php echo $phpVersion['minimum'] ?> or Higher)</span>
</div>
<?php foreach($requirements['requirements'] as $type => $require): ?>
<?php foreach($requirements['requirements'][$type] as $extention => $enabled) : ?>
<div class="check" style="margin-left: 25%">
<?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>
<span>(<?php echo $extention ?> Required)</span>
</div>
<?php foreach($requirements['requirements'] as $type => $require): ?>
<?php foreach($requirements['requirements'][$type] as $extention => $enabled) : ?>
<li>
<?php if($enabled ? $src = $greenCheck : $src = $redCheck ): ?>
<img src="<?php echo $src ?>">
<?php endif; ?>
<span><b><?php echo $extention ?></b></span>
</li>
<?php endforeach; ?>
<?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>
<li>
<?php if(($composerInstall['composer_install'] == 0) ? $src = $greenCheck : $src = $redCheck ): ?>
<img src="<?php echo $src ?>">
<span><b>composer</b></span>
<?php endif; ?>
<br>
<?php if(!($composerInstall['composer_install'] == 0)): ?>
<small style="color: red;">
<?php echo $composerInstall['composer'] ?>
</small>
<?php endif; ?>
</li>
</ul>
</div>
<?php if(!isset($requirements['errors']) && ($phpVersion['supported'] && $composerInstall['composer_install'] == 0)): ?>
<div>
<button type="button" class="prepare-btn" id="requirement-check">Continue</button>
</div>
<div><button type="button" class="prepare-btn" id="requirement-check">Continue</button></div>
<?php elseif(!($phpVersion['supported'] && $composerInstall['composer_install'] == 0)): ?>
<div><button type="button" class="prepare-btn" id="requirements-refresh">Refresh</button></div>
<?php endif; ?>
</div>
</div>
</body>
</html>

View File

@ -1,5 +1,4 @@
<html>
<?php
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
@ -10,22 +9,25 @@
?>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Bagisto Installer</title>
<link rel="icon" sizes="16x16" href="Images/favicon.ico">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:400,500">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" type="text/css" href= "<?php echo $cssUrl; ?> ">
<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;">
<div class="container">
<div class="initial-display">
<img class="logo" src= "<?php echo $logo; ?>" >
</div>
</div>
<?php
@ -134,10 +136,9 @@
}
?>
<div style="margin-bottom: 10px; margin-top: 10px;">
Powered by <a href="https://bagisto.com/" target="_blank" style="color: blue">Bagisto</a>, A Community Project by
<a href="https://webkul.com/" target="_blank" style="color: blue">Webkul</a>
<div style="margin-bottom: 5px; margin-top: 30px;">
Powered by <a href="https://bagisto.com/" target="_blank">Bagisto</a>, a community project by
<a href="https://webkul.com/" target="_blank">Webkul</a>
</div>
</body>
</html>