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

This commit is contained in:
Akhtar Khan 2020-07-16 12:41:34 +05:30
commit 8c1561c142
44 changed files with 764 additions and 82 deletions

View File

@ -0,0 +1,5 @@
<?php
return [
'refresh_documents' => env('ELASTIC_SCOUT_DRIVER_REFRESH_DOCUMENTS', false)
];

View File

@ -1,6 +1,16 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Blade File Tracer
|--------------------------------------------------------------------------
|
| Shows blade file path in front
|
*/
'tracer' => false,
/*
|--------------------------------------------------------------------------

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

@ -94,7 +94,7 @@
<tbody>
<variant-item v-for='(variant, index) in variants' :variant="variant" :key="index" :index="index" @onRemoveVariant="removeVariant($event)"></variant-item>
<variant-item v-for='(variant, index) in variants' :variant="variant" :key="index" :index="variant.id" @onRemoveVariant="removeVariant($event)"></variant-item>
</tbody>

View File

@ -1,4 +1,4 @@
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }} data-vv-as="&quot;{{ $attribute->admin_name }}&quot;" {{ $attribute->code == 'name' ? 'v-slugify-target=\'url_key\'' : '' }} />
<input type="text" v-validate="'{{$validations}}'" class="control" id="{{ $attribute->code }}" name="{{ $attribute->code }}" value="{{ old($attribute->code) ?: $product[$attribute->code] }}" {{ in_array($attribute->code, ['sku', 'url_key']) ? 'v-slugify' : '' }} data-vv-as="&quot;{{ $attribute->admin_name }}&quot;" {{ $attribute->code == 'name' && ! $product[$attribute->code] ? 'v-slugify-target=\'url_key\'' : '' }} />

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

@ -138,14 +138,14 @@
{!! view_render_event('sales.order.customer_email.after', ['order' => $order]) !!}
@if (! is_null($order->customer))
@if (! is_null($order->customer) && ! is_null($order->customer->group))
<div class="row">
<span class="title">
{{ __('admin::app.customers.customers.customer_group') }}
</span>
<span class="value">
{{ $order->customer->group['name'] }}
{{ $order->customer->group->name }}
</span>
</div>
@endif

View File

@ -10,13 +10,10 @@
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.19.0",
"cross-env": "^6.0.3",
"jquery": "^3.4.1",
"laravel-mix": "^5.0.0",
"laravel-mix-merge-manifest": "^0.1.2",
"sass": "^1.25.0",
"sass-loader": "^8.0.2",
"vue": "^2.6.10"
"sass-loader": "^8.0.2"
}
}

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

@ -0,0 +1,91 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Search Engine
|--------------------------------------------------------------------------
|
| This option controls the default search connection that gets used while
| using Laravel Scout. This connection is used when syncing all models
| to the search service. You should adjust this based on your needs.
|
| Supported: "algolia", "null"
|
*/
'driver' => env('SCOUT_DRIVER', null),
/*
|--------------------------------------------------------------------------
| Index Prefix
|--------------------------------------------------------------------------
|
| Here you may specify a prefix that will be applied to all search index
| names used by Scout. This prefix may be useful if you have multiple
| "tenants" or applications sharing the same search infrastructure.
|
*/
'prefix' => env('SCOUT_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Queue Data Syncing
|--------------------------------------------------------------------------
|
| This option allows you to control if the operations that sync your data
| with your search engines are queued. When this is set to "true" then
| all automatic data syncing will get queued for better performance.
|
*/
'queue' => env('SCOUT_QUEUE', true),
/*
|--------------------------------------------------------------------------
| Chunk Sizes
|--------------------------------------------------------------------------
|
| These options allow you to control the maximum chunk size when you are
| mass importing data into the search engine. This allows you to fine
| tune each of these chunk sizes based on the power of the servers.
|
*/
'chunk' => [
'searchable' => 500,
'unsearchable' => 500,
],
/*
|--------------------------------------------------------------------------
| Soft Deletes
|--------------------------------------------------------------------------
|
| This option allows to control whether to keep soft deleted records in
| the search indexes. Maintaining soft deleted records can be useful
| if your application still needs to search for the records later.
|
*/
'soft_delete' => false,
/*
|--------------------------------------------------------------------------
| Algolia Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your Algolia settings. Algolia is a cloud hosted
| search engine which works great with Scout out of the box. Just plug
| in your application ID and admin API key to get started searching.
|
*/
'algolia' => [
'id' => env('ALGOLIA_APP_ID', ''),
'secret' => env('ALGOLIA_SECRET', ''),
],
];

View File

@ -7,6 +7,9 @@ use Illuminate\Database\Eloquent\Factory as EloquentFactory;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\Facades\Event;
use Webkul\Theme\ViewRenderEventManager;
use Webkul\Core\View\Compilers\BladeCompiler;
use Webkul\Core\Console\Commands\BookingCron;
use Webkul\Core\Core;
use Webkul\Core\Exceptions\Handler;
@ -43,6 +46,7 @@ class CoreServiceProvider extends ServiceProvider
$this->publishes([
dirname(__DIR__) . '/Config/concord.php' => config_path('concord.php'),
dirname(__DIR__) . '/Config/scout.php' => config_path('scout.php'),
]);
$this->app->bind(
@ -51,6 +55,16 @@ class CoreServiceProvider extends ServiceProvider
);
SliderProxy::observe(SliderObserver::class);
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'core');
Event::listen('bagisto.shop.layout.head', static function(ViewRenderEventManager $viewRenderEventManager) {
$viewRenderEventManager->addTemplate('core::blade.tracer.style');
});
Event::listen('bagisto.admin.layout.head', static function(ViewRenderEventManager $viewRenderEventManager) {
$viewRenderEventManager->addTemplate('core::blade.tracer.style');
});
}
/**
@ -63,6 +77,8 @@ class CoreServiceProvider extends ServiceProvider
$this->registerFacades();
$this->registerCommands();
$this->registerBladeCompiler();
}
/**
@ -109,4 +125,16 @@ class CoreServiceProvider extends ServiceProvider
{
$this->app->make(EloquentFactory::class)->load($path);
}
/**
* Register the Blade compiler implementation.
*
* @return void
*/
public function registerBladeCompiler()
{
$this->app->singleton('blade.compiler', function ($app) {
return new BladeCompiler($app['files'], $app['config']['view.compiled']);
});
}
}

View File

@ -0,0 +1,8 @@
<?php
return [
'path-hint' => [
'template' => 'Template',
'parents' => 'Parents'
]
];

View File

@ -0,0 +1,115 @@
<style>
.path-hint {
border: solid 1px transparent;
padding: 1px;
}
.path-hint:hover {
border: 1px solid red;
}
.path-hint-tooltip {
padding: 0px 10px;
position: absolute;
background: #000000;
z-index: 10000;
color: #fff;
font-size: 10px;
}
.path-hint-tooltip h4 {
margin-top: 5px;
margin-bottom: 3px;
color: #fff;
font-size: 12px;
}
.path-hint-tooltip ul li {
margin-bottom: 3px;
}
.main-container-wrapper .product-card .product-image img {
height: auto;
max-width: 100%;
}
</style>
<script>
window.addEventListener("load", function(event) {
$('.testing').each(function(index) {
if ($(this).siblings(':not(.path-hint)').length == 1
&& $(this).next().prop("tagName") != 'INPUT'
&& $(this).next().prop("tagName") != 'TEXTAREA'
&& $(this).next().prop("tagName") != 'SELECT'
) {
$(this).next().addClass('path-hint');
$(this).next().attr({
'data-toggle': 'tooltip',
'data-title': $(this).parent('.path-hint').attr('data-title'),
'data-id': $(this).parent('.path-hint').attr('data-id')
});
$(this).unwrap();
}
$(this).remove();
})
$('.path-hint').on('mouseover', function(e) {
e.stopPropagation();
var currentElement = $(e.currentTarget);
var tooltipContent = '<h4>{{ __("core::app.path-hint.template") }}</h4>' + currentElement.attr('data-title');
if ($(this).parents('.path-hint').length) {
tooltipContent += '<h4>{{ __("core::app.path-hint.parents") }}</h4>';
tooltipContent += '<ul>';
$(this).parents('.path-hint').each(function(index) {
tooltipContent += '<li>' + $(this).attr('data-title') + '</li>';
});
tooltipContent += '</ul>';
}
$('body').append("<span class='path-hint-tooltip' id='" + currentElement.attr('data-id') + "'>" + tooltipContent + "</span>")
var elementWidth = currentElement.outerWidth()
var tooltipWidth = $('.path-hint-tooltip').outerWidth()
var leftOffset = currentElement.offset().left;
minus = 0;
temp = leftOffset + (elementWidth / 2) + (tooltipWidth / 2)
if (temp > $(window).outerWidth()) {
minus = temp - $(window).outerWidth();
}
if (elementWidth > tooltipWidth) {
var left = leftOffset + ((elementWidth / 2) - (tooltipWidth / 2));
} else {
var left = leftOffset - ((tooltipWidth / 2) - (elementWidth / 2));
}
if (left <= 0) {
left = 10;
}
$('.path-hint-tooltip').css('left', left - minus)
$('.path-hint-tooltip').css('top', currentElement.offset().top + 20)
})
$('[data-toggle="tooltip"]').on('mouseout', function(e) {
var currentElement = $(e.currentTarget);
$("#" + currentElement.attr('data-id')).remove();
})
})
</script>

View File

@ -0,0 +1,35 @@
<?php
namespace Webkul\Core\View\Compilers;
use Illuminate\View\Compilers\BladeCompiler as BaseBladeCompiler;
class BladeCompiler extends BaseBladeCompiler
{
/**
* Append the file path to the compiled string.
*
* @param string $contents
* @return string
*/
protected function appendFilePath($contents)
{
$tokens = $this->getOpenAndClosingPhpTokens($contents);
if (config('view.tracer')
&& strpos($this->getPath(), 'tracer/style.blade.php') == false
&& strpos($this->getPath(), 'master.blade.php') == false
) {
$finalPath = str_replace('/Providers/..', '', str_replace(base_path(), '', $this->getPath()));
$contents = '<div class="path-hint" data-toggle="tooltip" data-title="' . $finalPath . '" data-id="' . uniqid() . '"><span class="testing"></span>' . $contents . '</div>';
}
if ($tokens->isNotEmpty() && $tokens->last() !== T_CLOSE_TAG) {
$contents .= ' ?>';
}
return $contents."<?php /**PATH {$this->getPath()} ENDPATH**/ ?>";
}
}

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

@ -539,6 +539,7 @@ abstract class AbstractType
if ($haveSpecialPrice) {
$this->product->special_price = min($this->product->special_price, $customerGroupPrice);
} else {
$haveSpecialPrice = true;
$this->product->special_price = $customerGroupPrice;
}

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;
@ -585,7 +585,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 +681,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

@ -62,6 +62,6 @@ class Virtual extends AbstractType
*/
public function haveSufficientQuantity($qty)
{
return true;
return $qty <= $this->totalQuantity() ? true : false;
}
}

View File

@ -65,7 +65,7 @@ class OrderRepository extends Repository
DB::beginTransaction();
try {
Event::dispatch('checkout.order.save.before', $data);
Event::dispatch('checkout.order.save.before', [$data]);
if (isset($data['customer']) && $data['customer']) {
$data['customer_id'] = $data['customer']->id;

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

@ -191,7 +191,7 @@ return [
'edit-profile' => [
'title' => 'Edit Profile',
'page-title' => 'Edit Profile Form'
'page-title' => 'Edit Profile'
]
],
@ -201,7 +201,7 @@ return [
'title' => 'Address',
'add' => 'Add Address',
'edit' => 'Edit',
'empty' => 'You do not have any saved addresses here, please try to create it by clicking the link below',
'empty' => 'You do not have any saved addresses here, please try to create it by clicking the add button.',
'create' => 'Create Address',
'delete' => 'Delete',
'make-default' => 'Make Default',
@ -213,7 +213,7 @@ return [
],
'create' => [
'page-title' => 'Add Address Form',
'page-title' => 'Add Address',
'company_name' => 'Company name',
'first_name' => 'First name',
'last_name' => 'Last name',

View File

@ -158,7 +158,11 @@
@if ($order->base_discount_amount > 0)
<tr>
<td>{{ __('shop::app.customer.account.order.view.discount') }}</td>
<td>{{ __('shop::app.customer.account.order.view.discount') }}
@if ($order->coupon_code)
({{ $order->coupon_code }})
@endif
</td>
<td>-</td>
<td>{{ core()->formatPrice($order->discount_amount, $order->order_currency_code) }}</td>
</tr>

View File

@ -87,7 +87,7 @@
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
<label for="password">{{ __('shop::app.customer.account.profile.password') }}</label>
<input type="password" id="password" class="control" name="password" data-vv-as="&quot;{{ __('shop::app.customer.account.profile.password') }}&quot;" v-validate="'min:6'">
<input type="password" id="password" class="control" name="password" ref="password" data-vv-as="&quot;{{ __('shop::app.customer.account.profile.password') }}&quot;" v-validate="'min:6'">
<span class="control-error" v-if="errors.has('password')">@{{ errors.first('password') }}</span>
</div>

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

@ -84,6 +84,19 @@ class ThemeViewFinder extends FileViewFinder
}
}
/**
* Get the string contents of the view.
*
* @param callable|null $callback
* @return array|string
*
* @throws \Throwable
*/
public function render(callable $callback = null)
{
dd(111);
}
/**
* Set the array of paths where the views are being searched.
*

View File

@ -26,6 +26,7 @@
"tooltip.js": "^1.3.1",
"url-polyfill": "^1.1.5",
"url-search-params-polyfill": "^6.0.0",
"v-tooltip": "^2.0.3",
"vue-multiselect": "^2.1.6",
"vue-swatches": "^1.0.3"
}

View File

@ -23,6 +23,13 @@ import TimeComponent from './components/time';
import SwatchPicker from './components/swatch-picker';
import Debounce from './directives/debounce';
import OverlayLoader from './components/overlay-loader';
import VTooltip from 'v-tooltip';
VTooltip.options.defaultDelay = 0;
Vue.directive('tooltip', VTooltip.VTooltip)
Vue.config.productionTip = false;
Vue.component('flash-wrapper', FlashWrapper);
Vue.component('flash', Flash);

View File

@ -1235,4 +1235,86 @@ modal {
left: 50%;
margin-top: -24px;
margin-left: -24px;
}
.tooltip {
display: block !important;
z-index: 10000;
.tooltip-inner {
background: black;
color: white;
border-radius: 4px;
padding: 5px 10px 4px;
}
.tooltip-arrow {
width: 0;
height: 0;
border-style: solid;
position: absolute;
margin: 5px;
border-color: black;
z-index: 1;
}
&[x-placement^="top"] {
margin-bottom: 5px;
.tooltip-arrow {
border-width: 5px 5px 0 5px;
border-left-color: transparent !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
bottom: -5px;
left: calc(50% - 5px);
margin-top: 0;
margin-bottom: 0;
}
}
&[x-placement^="bottom"] {
margin-top: 5px;
.tooltip-arrow {
border-width: 0 5px 5px 5px;
border-left-color: transparent !important;
border-right-color: transparent !important;
border-top-color: transparent !important;
top: -5px;
left: calc(50% - 5px);
margin-top: 0;
margin-bottom: 0;
}
}
&[x-placement^="right"] {
margin-left: 5px;
.tooltip-arrow {
border-width: 5px 5px 5px 0;
border-left-color: transparent !important;
border-top-color: transparent !important;
border-bottom-color: transparent !important;
left: -5px;
top: calc(50% - 5px);
margin-left: 0;
margin-right: 0;
}
}
&[x-placement^="left"] {
margin-right: 5px;
.tooltip-arrow {
border-width: 5px 0 5px 5px;
border-top-color: transparent !important;
border-right-color: transparent !important;
border-bottom-color: transparent !important;
right: -5px;
top: calc(50% - 5px);
margin-left: 0;
margin-right: 0;
}
}
}

View File

@ -1,3 +1,5 @@
<div class="pagination">
{{ $results->links() }}
</div>
@if (gettype($results) == 'object')
<div class="pagination">
{{ $results->links() }}
</div>
@endif

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=226121407d7f6a559c67",
"/js/velocity.js": "/js/velocity.js?id=ed145773873729794808",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=612d35e452446366eef7",
"/css/velocity.css": "/css/velocity.css?id=c8200b428c2a06a6d752"
"/css/velocity.css": "/css/velocity.css?id=02ba781fdeb5ad5b10eb"
}

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

@ -80,7 +80,7 @@ class ComparisonController extends Controller
$productFlatRepository = app('\Webkul\Product\Models\ProductFlat');
$productFlat = $productFlatRepository
->where('product_id', $productId)
->where('id', $productId)
->orWhere('parent_id', $productId)
->get()
->first();

View File

@ -31,6 +31,7 @@
> div {
&.row {
padding-bottom: 30px;
display: inline-block;
}
}
}

View File

@ -40,6 +40,28 @@ body {
float: right;
}
}
.mini-cart-container {
#mini-cart {
.badge {
top: -6px;
left: 90%;
}
.cart-text {
left: 24px;
vertical-align: top;
}
}
~ .wishlist-btn , ~ .compare-btn {
.badge-container {
.badge {
left: 20px;
}
}
}
}
}
.main-content-wrapper {
@ -168,6 +190,10 @@ body {
left: unset;
right: -10px;
}
.card-total-price {
float: left;
}
}
}

View File

@ -167,6 +167,9 @@
@if ($order->base_discount_amount > 0)
<tr>
<td>{{ __('shop::app.customer.account.order.view.discount') }}
@if ($order->coupon_code)
({{ $order->coupon_code }})
@endif
<span class="dash-icon">-</span>
</td>
<td>{{ core()->formatPrice($order->discount_amount, $order->order_currency_code) }}</td>

View File

@ -155,6 +155,7 @@
<input
value=""
name="password"
ref="password"
type="password"
v-validate="'min:6|max:18'" />