This commit is contained in:
Shubham Mehrotra 2020-07-28 19:16:48 +05:30
commit d1bf19d96c
22 changed files with 131 additions and 83 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

@ -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

@ -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

@ -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,7 +111,7 @@ 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']) && !empty($params['limit']) ? $params['limit'] : 9;
}
@ -152,13 +152,17 @@ class ProductRepository extends Repository
if( isset($params['order']) && in_array($params['order'], ['desc', 'asc']) ){
$orderDirection = $params['order'];
} else {
$orderDirection = $this->getDefaultSortByOption()[1];
$sortOptions = $this->getDefaultSortByOption();
$orderDirection = !empty($sortOptions) ? $sortOptions[1] : 'asc';
}
if (isset($params['sort'])) {
$this->checkSortAttributeAndGenerateQuery($qb, $params['sort'], $orderDirection);
} else {
$this->checkSortAttributeAndGenerateQuery($qb, $this->getDefaultSortByOption()[0], $orderDirection);
$sortOptions = $this->getDefaultSortByOption();
if (!empty($sortOptions)) {
$this->checkSortAttributeAndGenerateQuery($qb, $sortOptions[0], $orderDirection);
}
}
if ( $priceFilter = request('price') ){
@ -456,8 +460,11 @@ class ProductRepository extends Repository
* @return array
*/
private function getDefaultSortByOption()
{
$config = core()->getConfigData('catalog.products.storefront.sort_by');
{
$value = core()->getConfigData('catalog.products.storefront.sort_by');
$config = $value ? $value : 'name-desc';
return explode('-', $config);
}

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->product->price) . '</span>';
. '<span class="final-price">' . core()->currency($this->getMinimalPrice()) . '</span>';
}
/**

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=d64fdfe9e3fe3e4b9ee4",
"/css/shop.css": "/css/shop.css?id=d5a7b8d843e219c2fa28"
"/css/shop.css": "/css/shop.css?id=72d87fe2508fdcd9f397"
}

View File

@ -3308,6 +3308,10 @@ section.review {
margin-top: 5.5%;
margin-bottom: 5.5%;
a.btn.btn-lg.btn-primary {
float: right;
}
.sidebar {
display: flex;
flex-direction: column;
@ -3564,6 +3568,7 @@ section.review {
}
}
.account-items-list , .edit-form {
margin-top: 20px;
@ -3648,6 +3653,8 @@ section.review {
height: 130px;
float: right;
border-collapse: collapse;
left: 3px;
position: relative;
tr {
@ -4331,6 +4338,10 @@ section.review {
float: left;
}
a.btn.btn-lg.btn-primary {
float: left;
}
.account-item-card {
.media-info .info {
margin-right: 20px;
@ -4584,7 +4595,7 @@ body {
td {
padding: 15px;
min-width: 250px;
min-width: 25px;
max-width: 250px;
line-height: 30px;
vertical-align: top;

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

View File

@ -1,5 +1,5 @@
{
"/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=49c1e646d73ed339dbc3"
"/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

@ -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

@ -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

@ -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

@ -105,7 +105,7 @@
class="product-image-container">
<img
loading="lazy"
loading="lazy"
class="card-img-top"
alt="{{ $product->name }}"
src="{{ $productBaseImage['large_image_url'] }}"

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

@ -165,7 +165,8 @@
/* positioning when .zoomWindow div available */
waitForEl('.zoomWindow', function() {
if ($('body').hasClass("rtl")) {
$('.zoomWindow').css('right', '522px');
let widthOfImage = $('.zoomContainer').width();
$('.zoomWindow').css('right', `${widthOfImage}px`);
}
});
});