Merge branch 'master' of https://github.com/bagisto/bagisto into locale_broken_image

This commit is contained in:
Akhtar Khan 2020-07-24 18:55:35 +05:30
commit af34c809a0
26 changed files with 168 additions and 112 deletions

View File

@ -108,8 +108,6 @@ class ShipmentController extends Controller
}
$this->validate(request(), [
'shipment.carrier_title' => 'required',
'shipment.track_number' => 'required',
'shipment.source' => 'required',
'shipment.items.*.*' => 'required|numeric|min:0',
]);

View File

@ -23,15 +23,15 @@ class Order
public function sendNewOrderMail($order)
{
try {
/* email to customer */
$configKey = 'emails.general.notifications.emails.general.notifications.new-order';
if (core()->getConfigData($configKey)) {
if (core()->getConfigData($configKey))
Mail::queue(new NewOrderNotification($order));
}
/* email to admin */
$configKey = 'emails.general.notifications.emails.general.notifications.new-admin';
if (core()->getConfigData($configKey)) {
app()->setLocale(env('APP_LOCALE'));
Mail::queue(new NewAdminNotification($order));
}
} catch (\Exception $e) {

View File

@ -5,9 +5,9 @@
@stop
@section('content-wrapper')
@section('content')
<div class="content full-page">
<div class="content">
{!! view_render_event('admin.customer.addresses.create.before') !!}
<form method="POST" action="{{ route('admin.customer.addresses.store', ['id' => $customer->id]) }}" @submit.prevent="onSubmit">

View File

@ -5,9 +5,9 @@
@stop
@section('content-wrapper')
@section('content')
<div class="content full-page">
<div class="content">
{!! view_render_event('admin.customer.addresses.edit.before', ['address' => $address]) !!}
<form method="post" action="{{ route('admin.customer.addresses.update', $address->id) }}" @submit.prevent="onSubmit">

View File

@ -21,7 +21,8 @@
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
<i class="icon angle-left-icon back-link"
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.promotions.cart-rules.add-title') }}
</h1>

View File

@ -26,7 +26,8 @@
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
<i class="icon angle-left-icon back-link"
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.promotions.cart-rules.edit-title') }}
</h1>

View File

@ -21,7 +21,8 @@
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
<i class="icon angle-left-icon back-link"
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.promotions.catalog-rules.add-title') }}
</h1>

View File

@ -21,7 +21,8 @@
<div class="page-header">
<div class="page-title">
<h1>
<i class="icon angle-left-icon back-link" @click="redirectBack('{{ url('/admin/dashboard') }}')"></i>
<i class="icon angle-left-icon back-link"
onclick="history.length > 1 ? history.go(-1) : window.location = '{{ url('/admin/dashboard') }}';"></i>
{{ __('admin::app.promotions.catalog-rules.edit-title') }}
</h1>

View File

@ -199,20 +199,14 @@
</span>
</div>
<div class="control-group" :class="[errors.has('shipment[carrier_title]') ? 'has-error' : '']" style="margin-top: 40px">
<label for="shipment[carrier_title]" class="required">{{ __('admin::app.sales.shipments.carrier-title') }}</label>
<input type="text" v-validate="'required'" class="control" id="shipment[carrier_title]" name="shipment[carrier_title]" data-vv-as="&quot;{{ __('admin::app.sales.shipments.carrier-title') }}&quot;"/>
<span class="control-error" v-if="errors.has('shipment[carrier_title]')">
@{{ errors.first('shipment[carrier_title]') }}
</span>
<div class="control-group" style="margin-top: 40px">
<label for="shipment[carrier_title]">{{ __('admin::app.sales.shipments.carrier-title') }}</label>
<input type="text" class="control" id="shipment[carrier_title]" name="shipment[carrier_title]"/>
</div>
<div class="control-group" :class="[errors.has('shipment[track_number]') ? 'has-error' : '']">
<label for="shipment[track_number]" class="required">{{ __('admin::app.sales.shipments.tracking-number') }}</label>
<input type="text" v-validate="'required'" class="control" id="shipment[track_number]" name="shipment[track_number]" data-vv-as="&quot;{{ __('admin::app.sales.shipments.tracking-number') }}&quot;"/>
<span class="control-error" v-if="errors.has('shipment[track_number]')">
@{{ errors.first('shipment[track_number]') }}
</span>
<div class="control-group">
<label for="shipment[track_number]">{{ __('admin::app.sales.shipments.tracking-number') }}</label>
<input type="text" class="control" id="shipment[track_number]" name="shipment[track_number]"/>
</div>
</div>
</div>

View File

@ -58,7 +58,7 @@ class CoreServiceProvider extends ServiceProvider
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'core');
Event::listen('bagisto.shop.layout.head', static function(ViewRenderEventManager $viewRenderEventManager) {
Event::listen('bagisto.shop.layout.body.after', static function(ViewRenderEventManager $viewRenderEventManager) {
$viewRenderEventManager->addTemplate('core::blade.tracer.style');
});

View File

@ -54,7 +54,7 @@
}
$(this).remove();
})
});
$('.path-hint').on('mouseover', function(e) {
e.stopPropagation();

View File

@ -113,7 +113,7 @@ class ProductRepository extends Repository
$perPage = isset($params['limit']) ? $params['limit'] : current($pages);
} else {
$perPage = isset($params['limit']) ? $params['limit'] : 9;
$perPage = isset($params['limit']) && !empty($params['limit']) ? $params['limit'] : 9;
}
$page = Paginator::resolveCurrentPage('page');
@ -151,18 +151,14 @@ class ProductRepository extends Repository
$orderDirection = 'asc';
if( isset($params['order']) && in_array($params['order'], ['desc', 'asc']) ){
$orderDirection = $params['order'];
} else {
$orderDirection = $this->getDefaultSortByOption()[1];
}
if (isset($params['sort'])) {
$attribute = $this->attributeRepository->findOneByField('code', $params['sort']);
if ($attribute) {
if ($attribute->code == 'price') {
$qb->orderBy('min_price', $orderDirection);
} else {
$qb->orderBy($params['sort'] == 'created_at' ? 'product_flat.created_at' : $attribute->code, $orderDirection);
}
}
$this->checkSortAttributeAndGenerateQuery($qb, $params['sort'], $orderDirection);
} else {
$this->checkSortAttributeAndGenerateQuery($qb, $this->getDefaultSortByOption()[0], $orderDirection);
}
if ( $priceFilter = request('price') ){
@ -453,4 +449,38 @@ class ProductRepository extends Repository
->orderBy('product_id', 'desc');
})->get();
}
/**
* Get default sort by option
*
* @return array
*/
private function getDefaultSortByOption()
{
$config = core()->getConfigData('catalog.products.storefront.sort_by');
return explode('-', $config);
}
/**
* Check sort attribute and generate query
*
* @param object $query
* @param string $sort
* @param string $direction
* @return object
*/
private function checkSortAttributeAndGenerateQuery($query, $sort, $direction)
{
$attribute = $this->attributeRepository->findOneByField('code', $sort);
if ($attribute) {
if ($attribute->code == 'price') {
$query->orderBy('min_price', $direction);
} else {
$query->orderBy($sort == 'created_at' ? 'product_flat.created_at' : $attribute->code, $direction);
}
}
return $query;
}
}

View File

@ -381,6 +381,25 @@ class Bundle extends AbstractType
];
}
/**
* Get bundle product special price
*
* @return boolean
*/
private function checkBundleProductHaveSpecialPrice()
{
$haveSpecialPrice = false;
foreach ($this->product->bundle_options as $option) {
foreach ($option->bundle_option_products as $index => $bundleOptionProduct) {
if ($bundleOptionProduct->product->getTypeInstance()->haveSpecialPrice()) {
$haveSpecialPrice = true;
break;
}
}
}
return $haveSpecialPrice;
}
/**
* Get product minimal price
*
@ -390,7 +409,12 @@ class Bundle extends AbstractType
{
$prices = $this->getProductPrices();
$priceHtml = '<div class="price-from">';
$priceHtml = '';
if ($this->checkBundleProductHaveSpecialPrice())
$priceHtml .= '<div class="sticker sale">' . trans('shop::app.products.sale') . '</div>';
$priceHtml .= '<div class="price-from">';
if ($prices['from']['regular_price']['price'] != $prices['from']['final_price']['price']) {
$priceHtml .= '<span class="regular-price">' . $prices['from']['regular_price']['formated_price'] . '</span>'

View File

@ -399,7 +399,7 @@ class Configurable extends AbstractType
{
return '<span class="price-label">' . trans('shop::app.products.price-label') . '</span>'
. ' '
. '<span class="final-price">' . core()->currency($this->getMinimalPrice()) . '</span>';
. '<span class="final-price">' . core()->currency($this->product->price) . '</span>';
}
/**

View File

@ -139,6 +139,23 @@ class Grouped extends AbstractType
return min($minPrices);
}
/**
* Get group product special price
*
* @return boolean
*/
private function checkGroupProductHaveSpecialPrice()
{
$haveSpecialPrice = false;
foreach ($this->product->grouped_products as $groupOptionProduct) {
if ($groupOptionProduct->associated_product->getTypeInstance()->haveSpecialPrice()) {
$haveSpecialPrice = true;
break;
}
}
return $haveSpecialPrice;
}
/**
* Get product minimal price
*
@ -146,9 +163,16 @@ class Grouped extends AbstractType
*/
public function getPriceHtml()
{
return '<span class="price-label">' . trans('shop::app.products.starting-at') . '</span>'
. ' '
. '<span class="final-price">' . core()->currency($this->getMinimalPrice()) . '</span>';
$html = '';
if ($this->checkGroupProductHaveSpecialPrice())
$html .= '<div class="sticker sale">' . trans('shop::app.products.sale') . '</div>';
$html .= '<span class="price-label">' . trans('shop::app.products.starting-at') . '</span>'
. ' '
. '<span class="final-price">' . core()->currency($this->getMinimalPrice()) . '</span>';
return $html;
}
/**

View File

@ -618,9 +618,9 @@ return [
'shipment' => [
'heading' => 'Shipment #:shipment_id has been generated for Order #:order_id',
'inventory-heading' => 'New shipment #:shipment_id had been generated for Order #:order_id',
'inventory-heading' => 'New shipment #:shipment_id has been generated for Order #:order_id',
'subject' => 'Shipment for your order #:order_id',
'inventory-subject' => 'New shipment had been generated for Order #:order_id',
'inventory-subject' => 'New shipment has been generated for Order #:order_id',
'summary' => 'Summary of Shipment',
'carrier' => 'Carrier',
'tracking-number' => 'Tracking Number',

View File

@ -180,6 +180,10 @@
} else {
this.$set(this, 'products', this.products.filter(product => product.id != productId));
}
window.flashMessages = [{'type': 'alert-success', 'message': response.data.message }];
this.$root.addFlashMessages();
})
.catch(error => {
console.log("{{ __('velocity::app.error.something_went_wrong') }}");
@ -196,6 +200,10 @@
}
this.setStorageValue('compared_product', updatedItems);
window.flashMessages = [{'type': 'alert-success', 'message': response.data.message }];
this.$root.addFlashMessages();
}
},

View File

@ -46,9 +46,9 @@
@if (in_array($category->display_mode, [null, 'products_only', 'products_and_description']))
<?php $products = $productRepository->getAll($category->id); ?>
@if ($products->count())
@include ('shop::products.list.toolbar')
@include ('shop::products.list.toolbar')
@if ($products->count())
@inject ('toolbarHelper', 'Webkul\Product\Helpers\Toolbar')

View File

@ -1,49 +0,0 @@
/* flatpickr v4.6.3, @license MIT */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/**
*
*
* @author Jerry Bendy <jerry@icewingcc.com>
* @licence MIT
*
*/
/**!
* @fileOverview Kickass library to create and place poppers near their reference elements.
* @version 1.16.1
* @license
* Copyright (c) 2016 Federico Zivolo and contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

View File

@ -36,3 +36,5 @@ return [
'value-here' => 'Wartość tutaj',
'numeric-value-here' => 'wartość liczbowa tutaj',
'submit' => 'Prześlij'
]
];

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,5 +1,5 @@
{
"/js/velocity.js": "/js/velocity.js?id=e7cb83bdbcabf25995cc",
"/js/velocity.js": "/js/velocity.js?id=4a39566e232d46c78c1e",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=612d35e452446366eef7",
"/css/velocity.css": "/css/velocity.css?id=a6ba44ccf2158be5a1d9"
"/css/velocity.css": "/css/velocity.css?id=49c1e646d73ed339dbc3"
}

View File

@ -776,7 +776,7 @@ a {
}
.scrollable {
max-height: 100vh;
max-height: 100%;
overflow-y: scroll;
scrollbar-width: none;
-ms-overflow-style: none;

View File

@ -308,7 +308,7 @@
searchedItem.forEach(item => {
let splitedItem = item.split('=');
updatedSearchedCollection[splitedItem[0]] = splitedItem[1];
updatedSearchedCollection[splitedItem[0]] = decodeURI(splitedItem[1]);
});
if (updatedSearchedCollection['image-search'] == 1) {

View File

@ -149,4 +149,25 @@
});
})()
</script>
<script>
$(document).ready(() => {
/* waiting for the window to appear */
let waitForEl = function(selector, callback) {
if (jQuery(selector).length) {
callback();
} else {
setTimeout(function() {waitForEl(selector, callback);}, 100);
}
};
/* positioning when .zoomWindow div available */
waitForEl('.zoomWindow', function() {
if ($('body').hasClass("rtl")) {
$('.zoomWindow').css('right', '522px');
}
});
});
</script>
@endpush