admin search product

This commit is contained in:
Akhtar Khan 2020-07-23 10:33:51 +05:30
commit f14a6e5a13
43 changed files with 526 additions and 216 deletions

View File

@ -10,6 +10,7 @@ use Webkul\User\Database\Seeders\DatabaseSeeder as UserSeeder;
use Webkul\Customer\Database\Seeders\DatabaseSeeder as CustomerSeeder;
use Webkul\Inventory\Database\Seeders\DatabaseSeeder as InventorySeeder;
use Webkul\CMS\Database\Seeders\DatabaseSeeder as CMSSeeder;
use Webkul\SocialLogin\Database\Seeders\DatabaseSeeder as SocialLoginSeeder;
class DatabaseSeeder extends Seeder
{
@ -27,5 +28,6 @@ class DatabaseSeeder extends Seeder
$this->call(UserSeeder::class);
$this->call(CustomerSeeder::class);
$this->call(CMSSeeder::class);
$this->call(SocialLoginSeeder::class);
}
}
}

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

@ -408,12 +408,12 @@
<span class="locale"> [@{{ channel_locale }}] </span>
</label>
<select v-if="this.options.length" v-validate= "validations" class="control" :id = "name" :name = "name" v-model="this.result"
<select v-if="this.options.length" v-validate= "validations" class="control" :id = "name" :name = "name" v-model="savedValue"
:data-vv-as="field_name">
<option v-for='(option, index) in this.options' :value="option.value"> @{{ option.title }} </option>
</select>
<input v-else type="text" class="control" v-validate= "validations" :id = "name" :name = "name" v-model="this.result"
<input v-else type="text" class="control" v-validate= "validations" :id = "name" :name = "name" v-model="savedValue"
:data-vv-as="field_name">
<span class="control-error" v-if="errors.has(name)">
@ -436,12 +436,15 @@
return {
isRequire: false,
isVisible: false,
savedValue: "",
}
},
mounted: function () {
var this_this = this;
this_this.savedValue = this_this.result;
if (this_this.validations || (this_this.validations.indexOf("required") != -1)) {
this_this.isRequire = true;
}

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

@ -152,6 +152,15 @@ class Booking extends Virtual
return app($this->bookingHelper->getTypeHepler($bookingProduct->type))->isItemHaveQuantity($cartItem);
}
/**
* @param int $qty
* @return bool
*/
public function haveSufficientQuantity($qty)
{
return true;
}
/**
* Add product. Returns error message if can't prepare product.
*
@ -186,13 +195,13 @@ class Booking extends Virtual
continue;
}
$cartProducts = parent::prepareForCart([
$cartProducts = parent::prepareForCart(array_merge($data, [
'product_id' => $data['product_id'],
'quantity' => $qty,
'booking' => [
'ticket_id' => $ticketId,
],
]);
]));
if (is_string($cartProducts)) {
return $cartProducts;
@ -263,4 +272,4 @@ class Booking extends Virtual
return app($this->bookingHelper->getTypeHepler($bookingProduct->type))->validateCartItem($item);
}
}
}

View File

@ -3,6 +3,7 @@
namespace Webkul\CartRule\Helpers;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Webkul\CartRule\Repositories\CartRuleRepository;
use Webkul\CartRule\Repositories\CartRuleCouponRepository;
use Webkul\CartRule\Repositories\CartRuleCouponUsageRepository;
@ -144,7 +145,7 @@ class CartRule
if ($staticCartRules::$cartID === cart()->getCart()->id && $staticCartRules::$cartRules) {
return $staticCartRules::$cartRules;
}
$staticCartRules::$cartID = cart()->getCart()->id;
$customerGroupId = null;
@ -157,21 +158,7 @@ class CartRule
}
}
$cartRules = $this->cartRuleRepository->scopeQuery(function ($query) use ($customerGroupId) {
return $query->leftJoin('cart_rule_customer_groups', 'cart_rules.id', '=', 'cart_rule_customer_groups.cart_rule_id')
->leftJoin('cart_rule_channels', 'cart_rules.id', '=', 'cart_rule_channels.cart_rule_id')
->where('cart_rule_customer_groups.customer_group_id', $customerGroupId)
->where('cart_rule_channels.channel_id', core()->getCurrentChannel()->id)
->where(function ($query1) {
$query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))
->orWhereNull('cart_rules.starts_from');
})
->where(function ($query2) {
$query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))
->orWhereNull('cart_rules.ends_till');
})
->orderBy('sort_order', 'asc');
})->findWhere(['status' => 1]);
$cartRules = $this->getCartRuleQuery($customerGroupId, core()->getCurrentChannel()->id);
$staticCartRules::$cartRules = $cartRules;
return $cartRules;
@ -180,21 +167,22 @@ class CartRule
/**
* Check if cart rule can be applied
*
* @param \Webkul\CartRule\Contracts\CartRule $rule
* @param $cart
* @param \Webkul\CartRule\Contracts\CartRule $rule
*
* @return bool
*/
public function canProcessRule($rule): bool
public function canProcessRule($cart, $rule): bool
{
$cart = Cart::getCart();
if ($rule->coupon_type) {
if (strlen($cart->coupon_code)) {
$coupon = $this->cartRuleCouponRepository->findOneWhere([
'cart_rule_id' => $rule->id,
'code' => $cart->coupon_code,
]);
/** @var \Webkul\CartRule\Models\CartRule $rule */
if ($coupon) {
// 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;
if ($coupon && $coupon->code === $cart->coupon_code) {
if ($coupon->usage_limit && $coupon->times_used >= $coupon->usage_limit) {
return false;
}
@ -245,8 +233,10 @@ class CartRule
$appliedRuleIds = [];
foreach ($this->getCartRules() as $rule) {
if (! $this->canProcessRule($rule)) {
$cart = Cart::getCart();
foreach ($rules = $this->getCartRules() as $rule) {
if (! $this->canProcessRule($cart, $rule)) {
continue;
}
@ -368,8 +358,10 @@ class CartRule
$appliedRuleIds = [];
$cart = Cart::getCart();
foreach ($this->getCartRules() as $rule) {
if (! $this->canProcessRule($rule)) {
if (! $this->canProcessRule($cart, $rule)) {
continue;
}
@ -450,8 +442,10 @@ class CartRule
$appliedRuleIds = [];
$cart = Cart::getCart();
foreach ($this->getCartRules() as $rule) {
if (! $this->canProcessRule($rule)) {
if (! $this->canProcessRule($cart, $rule)) {
continue;
}
@ -495,12 +489,14 @@ class CartRule
*/
public function calculateCartItemTotals($items)
{
$cart = Cart::getCart();
foreach ($this->getCartRules() as $rule) {
if ($rule->action_type == 'cart_fixed') {
$totalPrice = $totalBasePrice = $validCount = 0;
foreach ($items as $item) {
if (! $this->canProcessRule($rule, $item)) {
if (! $this->canProcessRule($cart, $rule)) {
continue;
}
@ -564,4 +560,38 @@ class CartRule
}
}
}
}
/**
* @param $customerGroupId
* @param $channelId
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getCartRuleQuery($customerGroupId, $channelId): \Illuminate\Database\Eloquent\Collection
{
return $this->cartRuleRepository->scopeQuery(function ($query) use ($customerGroupId) {
/** @var Builder $query */
return $query->leftJoin('cart_rule_customer_groups', 'cart_rules.id', '=',
'cart_rule_customer_groups.cart_rule_id')
->leftJoin('cart_rule_channels', 'cart_rules.id', '=', 'cart_rule_channels.cart_rule_id')
->where('cart_rule_customer_groups.customer_group_id', $customerGroupId)
->where('cart_rule_channels.channel_id', core()->getCurrentChannel()->id)
->where(function ($query1) {
/** @var Builder $query1 */
$query1->where('cart_rules.starts_from', '<=', Carbon::now()->format('Y-m-d'))
->orWhereNull('cart_rules.starts_from');
})
->where(function ($query2) {
/** @var Builder $query2 */
$query2->where('cart_rules.ends_till', '>=', Carbon::now()->format('Y-m-d'))
->orWhereNull('cart_rules.ends_till');
})
->with([
'cart_rule_customer_groups',
'cart_rule_channels',
'cart_rule_coupon'
])
->orderBy('sort_order', 'asc');
})->findWhere(['status' => 1]);
}
}

View File

@ -2,13 +2,11 @@
namespace Webkul\CartRule\Models;
// use Webkul\Core\Eloquent\TranslatableModel;
use Illuminate\Database\Eloquent\Model;
use Webkul\CartRule\Contracts\CartRule as CartRuleContract;
use Webkul\Core\Models\ChannelProxy;
use Webkul\Customer\Models\CustomerGroupProxy;
// class CartRule extends TranslatableModel implements CartRuleContract
class CartRule extends Model implements CartRuleContract
{
protected $fillable = [
@ -40,42 +38,80 @@ class CartRule extends Model implements CartRuleContract
'conditions' => 'array',
];
// public $translatedAttributes = ['name'];
/**
* Get the channels that owns the cart rule.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function channels()
public function cart_rule_channels(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(ChannelProxy::modelClass(), 'cart_rule_channels');
}
/**
* Get the customer groups that owns the cart rule.
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*
* @deprecated laravel standard should be used
*/
public function customer_groups()
public function channels(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->cart_rule_channels();
}
/**
* Get the customer groups that owns the cart rule.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*/
public function cart_rule_customer_groups(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->belongsToMany(CustomerGroupProxy::modelClass(), 'cart_rule_customer_groups');
}
/**
* Get the coupons that owns the cart rule.
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
*
* @deprecated laravel standard should be used
*/
public function coupons()
public function customer_groups(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
{
return $this->cart_rule_customer_groups();
}
/**
* Get the coupons that owns the cart rule.
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function cart_rule_coupon(): \Illuminate\Database\Eloquent\Relations\HasOne
{
return $this->hasOne(CartRuleCouponProxy::modelClass());
}
/**
* Get primary coupon code for cart rule.
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*
* @deprecated laravel standard should be used
*/
public function coupon_code()
public function coupons(): \Illuminate\Database\Eloquent\Relations\HasOne
{
return $this->coupons()->where('is_primary', 1);
return $this->cart_rule_coupon();
}
/**
* Get primary coupon code for cart rule.
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function coupon_code(): \Illuminate\Database\Eloquent\Relations\HasOne
{
return $this->cart_rule_coupon()->where('is_primary', 1);
}
/**
* Get primary coupon code for cart rule.
*
* @return string|void
*/
public function getCouponCodeAttribute()
{

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

@ -35,10 +35,13 @@ class BundleOption extends AbstractProduct
{
$options = [];
# eager load all inventories for bundle options
$this->product->bundle_options->load('bundle_option_products.product.inventories');
foreach ($this->product->bundle_options as $option) {
$data = $this->getOptionItemData($option);
if (! count($data['products'])) {
if (! $option->is_required && ! count($data['products'])) {
continue;
}
@ -97,6 +100,8 @@ class BundleOption extends AbstractProduct
'product_id' => $bundleOptionProduct->product_id,
'is_default' => $bundleOptionProduct->is_default,
'sort_order' => $bundleOptionProduct->sort_order,
'in_stock' => $bundleOptionProduct->product->inventories->sum('qty') >= $bundleOptionProduct->qty,
'inventory' => $bundleOptionProduct->product->inventories->sum('qty'),
];
}

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') ){
@ -388,7 +384,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 +395,7 @@ class ProductRepository extends Repository
->orderBy('product_id', 'desc');
})->paginate(16);
}
return $results;
}
@ -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

@ -173,7 +173,7 @@ class Bundle extends AbstractType
if (count($optionProductsPrices)) {
$selectionMinPrice = min($optionProductsPrices);
if($option->is_required) {
if ($option->is_required) {
$minPrice += $selectionMinPrice;
} elseif (! $haveRequiredOptions) {
$minPrices[] = $selectionMinPrice;
@ -207,7 +207,7 @@ class Bundle extends AbstractType
if (count($optionProductsPrices)) {
$selectionMinPrice = min($optionProductsPrices);
if($option->is_required) {
if ($option->is_required) {
$minPrice += $selectionMinPrice;
} elseif (! $haveRequiredOptions) {
$minPrices[] = $selectionMinPrice;
@ -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>'
@ -585,7 +609,14 @@ class Bundle extends AbstractType
$bundleOptionQuantities[$option->id] = $qty;
}
$labels[] = $qty . ' x ' . $optionProduct->product->name . ' ' . core()->currency($optionProduct->product->getTypeInstance()->getMinimalPrice());
$label = $qty . ' x ' . $optionProduct->product->name;
$price = $optionProduct->product->getTypeInstance()->getMinimalPrice();
if($price != 0){
$label .= ' ' . core()->currency($price);
}
$labels[] = $label;
}
if (count($labels)) {
@ -674,4 +705,27 @@ class Bundle extends AbstractType
return $options;
}
/**
* @param int $qty
* @return bool
*/
public function haveSufficientQuantity($qty)
{
# to consider a bundle in stock we need to check that at least one product from each required group is available for the given quantity
foreach ($this->product->bundle_options as $option) {
if ($option->is_required) {
foreach ($option->bundle_option_products as $bundleOptionProduct) {
# as long as at least one product in the required group is available we can continue checking other groups
if($bundleOptionProduct->product->haveSufficientQuantity($bundleOptionProduct->qty * $qty)) {
continue 2;
}
}
# if any required option does not have any in-stock product option we will get here.
return false;
}
}
return true;
}
}

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

@ -62,6 +62,6 @@ class Virtual extends AbstractType
*/
public function haveSufficientQuantity($qty)
{
return true;
return $qty <= $this->totalQuantity() ? true : 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,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=b0ae98b46b290f0fca8b",
"/css/shop.css": "/css/shop.css?id=0664f52f2390473afc00"
"/js/shop.js": "/js/shop.js?id=d64fdfe9e3fe3e4b9ee4",
"/css/shop.css": "/css/shop.css?id=d5a7b8d843e219c2fa28"
}

View File

@ -815,7 +815,7 @@ section.slider-block {
img {
display: none;
}
input {
display: none;
}
@ -4566,4 +4566,52 @@ section.review {
}
}
}
}
//compare page
body {
overflow-x: hidden;
}
.comparison-component {
width: 100%;
padding-top: 20px;
}
.comparison-component > h1 {
display: inline-block;
}
td {
padding: 15px;
min-width: 250px;
max-width: 250px;
line-height: 30px;
vertical-align: top;
word-break: break-word;
}
.icon.remove-product {
top: 5px;
float: right;
cursor: pointer;
position: relative;
background-color: black;
}
.action > div {
display: inline-block;
}
.cart-wish-wrap .btn.btn-lg {
padding: 5px 10px;
}
.cart-wish-wrap {
display: flex;
}
.white-cross-sm-icon {
width: 24px;
height:24px;
}
.add-to-wishlist {
margin-left: 15px;
}

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

@ -27,7 +27,7 @@
@endif
<div class="horizontal-rule"></div>
</div>
{!! view_render_event('bagisto.shop.customers.account.address.list.before', ['addresses' => $addresses]) !!}
<div class="account-table-content">

View File

@ -3,69 +3,6 @@
$comparableAttributes = $attributeRepository->findByField('is_comparable', 1);
@endphp
@push('css')
<style>
body {
overflow-x: hidden;
}
.comparison-component {
width: 100%;
padding-top: 20px;
}
.comparison-component > h1 {
display: inline-block;
}
.cart-wish-wrap{
position: relative;
}
td {
padding: 15px;
min-width: 250px;
max-width: 250px;
line-height: 30px;
vertical-align: top;
word-break: break-word;
}
.icon.remove-product {
top: 15px;
float: right;
cursor: pointer;
position: relative;
background-color: black;
}
.action > div {
display: inline-block;
}
.wishlist-icon {
margin-left: 183px;
position: absolute;
margin-top: -39px;
}
table{
border-style: solid;
}
td{
vertical-align: top;
padding: 5px 20px;
}
tr:nth-child(odd){
background: #f2f2f2;
}
</style>
@endpush
@push('scripts')
<script type="text/x-template" id="compare-product-template">
<section class="comparison-component">
@ -243,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') }}");
@ -259,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

@ -0,0 +1,70 @@
<?php
namespace Webkul\SocialLogin\Database\Seeders;
use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class CustomerSocialAccountTableSeeder extends Seeder
{
public function run()
{
$now = Carbon::now();
DB::table('core_config')->insert(
[
'code' => 'customer.settings.social_login.enable_facebook',
'value' => '1',
'channel_code' => 'default',
'locale_code' => null,
'created_at' => $now,
'updated_at' => $now,
]
);
DB::table('core_config')->insert(
[
'code' => 'customer.settings.social_login.enable_twitter',
'value' => '1',
'channel_code' => 'default',
'locale_code' => null,
'created_at' => $now,
'updated_at' => $now,
]
);
DB::table('core_config')->insert(
[
'code' => 'customer.settings.social_login.enable_google',
'value' => '1',
'channel_code' => 'default',
'locale_code' => null,
'created_at' => $now,
'updated_at' => $now,
]
);
DB::table('core_config')->insert(
[
'code' => 'customer.settings.social_login.enable_linkedin',
'value' => '1',
'channel_code' => 'default',
'locale_code' => null,
'created_at' => $now,
'updated_at' => $now,
]
);
DB::table('core_config')->insert(
[
'code' => 'customer.settings.social_login.enable_github',
'value' => '1',
'channel_code' => 'default',
'locale_code' => null,
'created_at' => $now,
'updated_at' => $now,
]
);
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace Webkul\SocialLogin\Database\Seeders;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
$this->call(CustomerSocialAccountTableSeeder::class);
}
}

View File

@ -22,28 +22,3 @@
* @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'
]
];

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=ed145773873729794808",
"/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=02ba781fdeb5ad5b10eb"
"/css/velocity.css": "/css/velocity.css?id=49c1e646d73ed339dbc3"
}

View File

@ -387,6 +387,7 @@ class Helper extends Review
$productMetaDetails['slug'] = $product->url_key;
$productMetaDetails['image'] = $formattedProduct['image'];
$productMetaDetails['priceHTML'] = $formattedProduct['priceHTML'];
$productMetaDetails['new'] = $formattedProduct['new'];
$productMetaDetails['addToCartHtml'] = $formattedProduct['addToCartHtml'];
$productMetaDetails['galleryImages'] = $formattedProduct['galleryImages'];
$productMetaDetails['defaultAddToCart'] = $formattedProduct['defaultAddToCart'];
@ -397,7 +398,7 @@ class Helper extends Review
}
}
}
return $productCollection;
}
}

View File

@ -1,3 +1,4 @@
.vc-small-screen {
display: none !important;
}
@ -30,6 +31,7 @@
}
}
@media only screen and (max-width: 992px) {
}
@ -47,6 +49,36 @@
.footer .currency {
display: block !important;
}
.table {
width: 90%;
margin-bottom: 1rem;
margin-top: 68px;
color: #212529;
}
.per-page {
position: absolute;
margin-top: 66px;
margin-right: -1px;
margin-left: 17px;
width: 151px;
}
.filter-left {
position: relative;
margin-right: -6px!important;
}
.dropdown-filters {
margin-left: 15px;
}
button.btn.btn-sm.btn-primary.apply-filter {
margin-top: 10px;
margin-left: -158px;
}
}
@media only screen and (max-width: 992px) {

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

@ -6,7 +6,9 @@
@section('page-detail-wrapper')
@if ($addresses->isEmpty())
<a href="{{ route('customer.address.create') }}" class="theme-btn light unset" id="add-address-button">
<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;
}
position: absolute;
margin-top: 92px;
}
.address-button {
position: absolute;
margin-top: 92px;
}
</style>
@endif

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