Merge branch 'master' into patch4

This commit is contained in:
Akhtar Khan 2020-07-29 09:50:05 +05:30 committed by GitHub
commit abfac60381
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
44 changed files with 354 additions and 210 deletions

View File

@ -241,6 +241,8 @@ class DashboardController extends Controller
->addSelect('id', 'customer_id', 'customer_email', 'customer_first_name', 'customer_last_name')
->where('orders.created_at', '>=', $this->startDate)
->where('orders.created_at', '<=', $this->endDate)
->where('orders.status', '<>', 'closed')
->where('orders.status', '<>', 'canceled')
->groupBy('customer_email')
->orderBy('total_base_grand_total', 'DESC')
->limit(5)

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

@ -16,22 +16,22 @@ class Order
{
/**
* Send new order Mail to the customer and admin
*
*
* @param \Webkul\Sales\Contracts\Order $order
* @return void
*/
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) {
@ -41,7 +41,7 @@ class Order
/**
* Send new invoice mail to the customer
*
*
* @param \Webkul\Sales\Contracts\Invoice $invoice
* @return void
*/
@ -64,7 +64,7 @@ class Order
/**
* Send new refund mail to the customer
*
*
* @param \Webkul\Sales\Contracts\Refund $refund
* @return void
*/
@ -83,7 +83,7 @@ class Order
/**
* Send new shipment mail to the customer
*
*
* @param \Webkul\Sales\Contracts\Shipment $shipment
* @return void
*/

View File

@ -418,7 +418,7 @@
optionRowCount: 0,
optionRows: [],
show_swatch: "{{ $attribute->type == 'select' ? true : false }}",
swatch_type: "{{ $attribute->swatch_type }}",
swatch_type: "{{ $attribute->swatch_type == '' ? 'dropdown' : $attribute->swatch_type }}",
isNullOptionChecked: false,
idNullOption: null
}

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

@ -33,7 +33,7 @@ class AttributeOption extends TranslatableModel implements AttributeOptionContra
public function swatch_value_url()
{
if ($this->swatch_value && $this->attribute->swatch_type == 'image') {
return Storage::url($this->swatch_value);
return url('cache/small/'.$this->swatch_value);
}
return;

View File

@ -177,10 +177,9 @@ class CartRule
if ($rule->coupon_type) {
if (strlen($cart->coupon_code)) {
/** @var \Webkul\CartRule\Models\CartRule $rule */
// Laravel relation is used instead of repository for performance
// reasons (cart_rule_coupon-relation is pre-loaded by self::getCartRuleQuery())
$coupon = $rule->cart_rule_coupon;
$coupon = $rule->cart_rule_coupon->where('code', $cart->coupon_code)->first();
if ($coupon && $coupon->code === $cart->coupon_code) {
if ($coupon->usage_limit && $coupon->times_used >= $coupon->usage_limit) {
@ -444,29 +443,34 @@ class CartRule
$cart = Cart::getCart();
foreach ($this->getCartRules() as $rule) {
if (! $this->canProcessRule($cart, $rule)) {
continue;
}
foreach ($cart->items->all() as $item) {
if (! $this->validator->validate($rule, $cart)) {
continue;
}
foreach ($this->getCartRules() as $rule) {
if (! $rule || ! $rule->free_shipping) {
continue;
}
if (! $this->canProcessRule($cart, $rule)) {
continue;
}
$selectedShipping->price = 0;
/* given CartItem instance to the validator */
if (! $this->validator->validate($rule, $item)) {
continue;
}
$selectedShipping->base_price = 0;
if (! $rule || ! $rule->free_shipping) {
continue;
}
$selectedShipping->save();
$selectedShipping->price = 0;
$appliedRuleIds[$rule->id] = $rule->id;
$selectedShipping->base_price = 0;
if ($rule->end_other_rules) {
break;
$selectedShipping->save();
$appliedRuleIds[$rule->id] = $rule->id;
if ($rule->end_other_rules) {
break;
}
}
}

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

@ -95,7 +95,7 @@ class Toolbar extends AbstractProduct
$sortBy = core()->getConfigData('catalog.products.storefront.sort_by')
? core()->getConfigData('catalog.products.storefront.sort_by')
: 'created_at-asc';
if ($key == $sortBy) {
return true;
}
@ -155,4 +155,27 @@ class Toolbar extends AbstractProduct
? core()->getConfigData('catalog.products.storefront.mode')
: 'grid';
}
/**
* Returns the view option if mode is set by param then it will overwrite default one and return new mode
*
* @return string
*/
public function getViewOption()
{
/* checking default option first */
$viewOption = core()->getConfigData('catalog.products.storefront.mode');
/* checking mode param if exist then overwrite the default option */
if ($this->isModeActive('grid')) {
$viewOption = 'grid';
}
/* checking mode param if exist then overwrite the default option */
if ($this->isModeActive('list')) {
$viewOption = 'list';
}
return $viewOption;
}
}

View File

@ -111,9 +111,9 @@ class ProductRepository extends Repository
if (core()->getConfigData('catalog.products.storefront.products_per_page')) {
$pages = explode(',', core()->getConfigData('catalog.products.storefront.products_per_page'));
$perPage = isset($params['limit']) ? $params['limit'] : current($pages);
$perPage = isset($params['limit']) ? (!empty($params['limit']) ? $params['limit'] : 9) : current($pages);
} else {
$perPage = isset($params['limit']) ? $params['limit'] : 9;
$perPage = isset($params['limit']) && !empty($params['limit']) ? $params['limit'] : 9;
}
$page = Paginator::resolveCurrentPage('page');
@ -125,7 +125,7 @@ class ProductRepository extends Repository
$qb = $query->distinct()
->select('product_flat.*')
->join('product_flat as variants', 'product_flat.id', '=', DB::raw('COALESCE(variants.parent_id, variants.id)'))
->join('product_flat as variants', 'product_flat.id', '=', DB::raw('COALESCE('.DB::getTablePrefix().'variants.parent_id, '.DB::getTablePrefix().'variants.id)'))
->leftJoin('product_categories', 'product_categories.product_id', '=', 'product_flat.product_id')
->leftJoin('product_attribute_values', 'product_attribute_values.product_id', '=', 'variants.product_id')
->where('product_flat.channel', $channel)
@ -151,17 +151,17 @@ class ProductRepository extends Repository
$orderDirection = 'asc';
if( isset($params['order']) && in_array($params['order'], ['desc', 'asc']) ){
$orderDirection = $params['order'];
} else {
$sortOptions = $this->getDefaultSortByOption();
$orderDirection = !empty($sortOptions) ? $sortOptions[1] : 'asc';
}
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 {
$sortOptions = $this->getDefaultSortByOption();
if (!empty($sortOptions)) {
$this->checkSortAttributeAndGenerateQuery($qb, $sortOptions[0], $orderDirection);
}
}
@ -388,7 +388,7 @@ class ProductRepository extends Repository
->where('product_flat.channel', $channel)
->where('product_flat.locale', $locale)
->whereNotNull('product_flat.url_key')
->where(function($subQuery) use ($term) {
->where(function($subQuery) use ($term) {
$queries = explode('_', $term);
foreach (array_map('trim', $queries) as $value) {
@ -399,7 +399,7 @@ class ProductRepository extends Repository
->orderBy('product_id', 'desc');
})->paginate(16);
}
return $results;
}
@ -453,4 +453,41 @@ class ProductRepository extends Repository
->orderBy('product_id', 'desc');
})->get();
}
/**
* Get default sort by option
*
* @return array
*/
private function getDefaultSortByOption()
{
$value = core()->getConfigData('catalog.products.storefront.sort_by');
$config = $value ? $value : 'name-desc';
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

@ -278,7 +278,7 @@ class Bundle extends AbstractType
if (! $bundleOptionProduct->product->getTypeInstance()->isSaleable()) {
continue;
}
if (in_array($option->type, ['multiselect', 'checkbox'])) {
if (! isset($optionPrices[$option->id][0])) {
$optionPrices[$option->id][0] = 0;
@ -315,7 +315,7 @@ class Bundle extends AbstractType
if (! $bundleOptionProduct->product->getTypeInstance()->isSaleable()) {
continue;
}
if (in_array($option->type, ['multiselect', 'checkbox'])) {
if (! isset($optionPrices[$option->id][0])) {
$optionPrices[$option->id][0] = 0;
@ -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>'
@ -426,6 +450,8 @@ class Bundle extends AbstractType
*/
public function prepareForCart($data)
{
$bundleQuantity = $data['quantity'];
if (isset($data['bundle_options'])) {
$data['bundle_options'] = array_filter($this->validateBundleOptionForCart($data['bundle_options']));
}
@ -437,8 +463,14 @@ class Bundle extends AbstractType
$products = parent::prepareForCart($data);
foreach ($this->getCartChildProducts($data) as $productId => $data) {
$product = $this->productRepository->find($productId);
/* need to check each individual quantity as well if don't have then show error */
if (! $product->getTypeInstance()->haveSufficientQuantity($data['quantity'] * $bundleQuantity)) {
return trans('shop::app.checkout.cart.quantity.inventory_warning');
}
if (! $product->getTypeInstance()->isSaleable()) {
continue;
}

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

@ -579,7 +579,7 @@ return [
'final-summary' => 'Thanks for showing your interest in our store we will send you tracking number once it shipped',
'help' => 'If you need any kind of help please contact us at :support_email',
'thanks' => 'Thanks!',
'comment' => [
'subject' => 'New comment added to your order',
'dear' => 'Dear :customer_name',
@ -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

@ -21,7 +21,7 @@
@if ($order->canCancel())
<a href="{{ route('customer.orders.cancel', $order->id) }}" class="btn btn-lg btn-primary" v-alert:message="'{{ __('shop::app.customer.account.order.view.cancel-confirm-msg') }}'">
<a href="{{ route('customer.orders.cancel', $order->id) }}" class="btn btn-lg btn-primary" v-alert:message="'{{ __('shop::app.customer.account.order.view.cancel-confirm-msg') }}'" style="float: right">
{{ __('shop::app.customer.account.order.view.cancel-btn-title') }}
</a>
@endif
@ -158,7 +158,7 @@
@if ($order->base_discount_amount > 0)
<tr>
<td>{{ __('shop::app.customer.account.order.view.discount') }}
<td>{{ __('shop::app.customer.account.order.view.discount') }}
@if ($order->coupon_code)
({{ $order->coupon_code }})
@endif

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

@ -35,4 +35,6 @@ return [
'items-per-page' => 'Przedmioty na stronę',
'value-here' => 'Wartość tutaj',
'numeric-value-here' => 'wartość liczbowa tutaj',
'submit' => 'Prześlij'
'submit' => 'Prześlij'
]
];

View File

@ -544,7 +544,7 @@
newParams = '';
for(i = 0; i < this.filters.length; i++) {
if (this.filters[i].column == 'status') {
if (this.filters[i].column == 'status' || this.filters[i].column == 'value_per_locale' || this.filters[i].column == 'value_per_channel' || this.filters[i].column == 'is_unique') {
if (this.filters[i].val.includes("True")) {
this.filters[i].val = 1;
} else if (this.filters[i].val.includes("False")) {

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=c18e7d7ccfb80712f078",
"/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=36aea00f600c674a2a60"
}

View File

@ -82,6 +82,7 @@ class ComparisonController extends Controller
$productFlat = $productFlatRepository
->where('id', $productId)
->orWhere('parent_id', $productId)
->orWhere('id', $productId)
->get()
->first();

View File

@ -153,7 +153,7 @@ class ContentRepository extends Repository
'content_type' => $content->content_type,
]);
}
return $formattedContent;
}
}

View File

@ -41,8 +41,8 @@
this.$http.post(url, {
'quantity': 1,
'_token': this.csrfToken,
'product_id': this.productId,
'_token': this.csrfToken.split("&#039;").join(""),
})
.then(response => {
this.isButtonEnable = true;

View File

@ -691,7 +691,7 @@
.product-quantity {
.quantity {
float: left;
label {
display: none !important;
}
@ -1152,7 +1152,7 @@
input {
display: none;
}
img.preview {
width: 100%;
height: 100%;
@ -2265,6 +2265,7 @@
}
.selective-div {
width: 150px;
-webkit-appearance: none;
}

View File

@ -42,16 +42,14 @@ body {
}
.mini-cart-container {
#mini-cart {
.badge {
top: -6px;
left: 90%;
}
.cart-text {
left: 24px;
vertical-align: top;
}
~ .compare-btn,
~ .wishlist-btn {
.badge-container {
.badge {
top: -28px;
left: -2px;
}
}
}
~ .wishlist-btn , ~ .compare-btn {

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

@ -136,7 +136,17 @@
3 => [],
2 => [],
];
$advertisement = json_decode($metaData->get('advertisement')->all()[0]->advertisement, true);
$index = 0;
$currentLocale = request()->get('locale') ?: core()->getCurrentLocale();
foreach ($metaData->get('locale')->all() as $key => $value) {
if ($value->locale == $currentLocale) {
$index = $key;
}
}
$advertisement = json_decode($metaData->get('advertisement')->all()[$index]->advertisement, true);
@endphp
@if(! isset($advertisement[4]))

View File

@ -251,11 +251,20 @@
href="?locale={{ $locale->code }}"
@endif>
<div class="category-logo">
<img
@if( $locale->code == 'en')
<div class="category-logo">
<img
class="category-icon"
src="{{ asset('/themes/velocity/assets/images/flags/en.png') }}" />
</div>
@else
<div class="category-logo">
<img
class="category-icon"
src="{{ asset('/storage/' . $locale->locale_image) }}" />
</div>
</div>
@endif
<span>
{{ isset($serachQuery) ? $locale->title : $locale->name }}

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

@ -498,7 +498,7 @@
name="billing[phone]"
v-validate="'required'"
v-model="address.billing.phone"
@keyup="validateForm('address-form')"
@change="validateForm('address-form')"
data-vv-as="&quot;{{ __('shop::app.checkout.onepage.phone') }}&quot;" />
<span class="control-error" v-if="errors.has('address-form.billing[phone]')">

View File

@ -6,7 +6,9 @@
@section('page-detail-wrapper')
@if ($addresses->isEmpty())
<a href="{{ route('customer.address.create') }}" class="theme-btn light unset address-button">
{{ __('shop::app.customer.account.address.index.add') }}
</a>
@endif
@ -83,9 +85,16 @@
@if ($addresses->isEmpty())
<style>
a#add-address-button {
position: absolute;
margin-top: 92px;
}
.address-button {
position: absolute;
margin-top: 92px;
}
</style>
@endif

View File

@ -23,6 +23,28 @@
$productBaseImage = $productImageHelper->getProductBaseImage($product);
$totalReviews = $reviewHelper->getTotalReviews($product);
$avgRatings = ceil($reviewHelper->getAverageRating($product));
$galleryImages = $productImageHelper->getGalleryImages($product);
$priceHTML = view('shop::products.price', ['product' => $product])->render();
$product->__set('priceHTML', $priceHTML);
$product->__set('avgRating', $avgRatings);
$product->__set('totalReviews', $totalReviews);
$product->__set('galleryImages', $galleryImages);
$product->__set('shortDescription', $product->short_description);
$product->__set('firstReviewText', trans('velocity::app.products.be-first-review'));
$product->__set('addToCartHtml', view('shop::products.add-to-cart', [
'product' => $product,
'addWishlistClass' => ! (isset($list) && $list) ? '' : '',
'showCompare' => core()->getConfigData('general.content.shop.compare_option') == "1"
? true : false,
'btnText' => null,
'moveToCart' => null,
'addToCartBtnClass' => '',
])->render());
@endphp
{!! view_render_event('bagisto.shop.products.list.card.before', ['product' => $product]) !!}
@ -36,6 +58,8 @@
<img
src="{{ $productBaseImage['medium_image_url'] }}"
:onerror="`this.src='${this.$root.baseUrl}/vendor/webkul/ui/assets/images/product/large-product-placeholder.png'`" />
<product-quick-view-btn :quick-view-details="{{ json_encode($product) }}"></product-quick-view-btn>
</a>
</div>
@ -81,13 +105,14 @@
class="product-image-container">
<img
loading="lazy"
loading="lazy"
class="card-img-top"
alt="{{ $product->name }}"
src="{{ $productBaseImage['large_image_url'] }}"
:onerror="`this.src='${this.$root.baseUrl}/vendor/webkul/ui/assets/images/product/large-product-placeholder.png'`" />
{{-- <product-quick-view-btn :quick-view-details="product"></product-quick-view-btn> --}}
<product-quick-view-btn :quick-view-details="{{ json_encode($product) }}"></product-quick-view-btn>
</a>
<div class="card-body">

View File

@ -8,40 +8,22 @@
<script type="text/x-template" id="toolbar-template">
<div class="toolbar-wrapper" v-if='!isMobile()'>
<div class="view-mode">
@if (
! ($toolbarHelper->isModeActive('grid')
|| $toolbarHelper->isModeActive('list'))
)
<div class="rango-view-grid-container active">
<span class="rango-view-grid fs24"></span>
</div>
@else
@if ($toolbarHelper->isModeActive('grid'))
<div class="rango-view-grid-container active">
<span class="rango-view-grid fs24"></span>
</div>
@else
<div class="rango-view-grid-container">
<a href="{{ $toolbarHelper->getModeUrl('grid') }}" class="grid-view unset">
<span class="rango-view-grid fs24"></span>
</a>
</div>
@endif
@endif
@php
$viewOption = $toolbarHelper->getViewOption();
@endphp
@if ($toolbarHelper->isModeActive('list'))
<div class="rango-view-list-container active">
<div class="rango-view-grid-container {{ $viewOption === 'grid' ? 'active' : '' }}">
<a href="{{ $toolbarHelper->getModeUrl('grid') }}" class="grid-view unset">
<span class="rango-view-grid fs24"></span>
</a>
</div>
<div class="rango-view-list-container {{ $viewOption === 'list' ? 'active' : '' }}">
<a
href="{{ $toolbarHelper->getModeUrl('list') }}"
class="list-view unset">
<span class="rango-view-list fs24"></span>
</div>
@else
<div class="rango-view-list-container">
<a
href="{{ $toolbarHelper->getModeUrl('list') }}"
class="list-view unset">
<span class="rango-view-list fs24"></span>
</a>
</div>
@endif
</a>
</div>
</div>
<div class="sorter">

View File

@ -149,4 +149,26 @@
});
})()
</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")) {
let widthOfImage = $('.zoomContainer').width();
$('.zoomWindow').css('right', `${widthOfImage}px`);
}
});
});
</script>
@endpush

View File

@ -35,6 +35,32 @@
style="padding-left: 50px !important;"
class="container category-page-wrapper"
>
<search-component></search-component>
</div>
@endsection
@push('scripts')
<script type="text/x-template" id="image-search-result-component-template">
<div class="image-search-result">
<div class="searched-image">
<img :src="searchedImageUrl"/>
</div>
<div class="searched-terms">
<h3 class="fw6 fs20 mb-4">
{{ __('shop::app.search.analysed-keywords') }}
</h3>
<div class="term-list">
<a v-for="term in searched_terms" :href="'{{ route('shop.search.index') }}?term=' + term.slug">
@{{ term.name }}
</a>
</div>
</div>
</div>
</script>
<script type="text/x-template" id="seach-component-template">
<section class="search-container row category-container">
@if (request('image-search'))
<image-search-result-component></image-search-result-component>
@ -82,31 +108,13 @@
@endif
@endif
</section>
</div>
@endsection
@push('scripts')
<script type="text/x-template" id="image-search-result-component-template">
<div class="image-search-result">
<div class="searched-image">
<img :src="searchedImageUrl"/>
</div>
<div class="searched-terms">
<h3 class="fw6 fs20 mb-4">
{{ __('shop::app.search.analysed-keywords') }}
</h3>
<div class="term-list">
<a v-for="term in searched_terms" :href="'{{ route('shop.search.index') }}?term=' + term.slug">
@{{ term.name }}
</a>
</div>
</div>
</div>
</script>
<script>
Vue.component('search-component', {
template: '#seach-component-template',
});
Vue.component('image-search-result-component', {
template: '#image-search-result-component-template',