Merge pull request #4487 from rahulshukla-webkul/development

This commit is contained in:
Glenn Hermans 2021-01-15 13:29:10 +01:00 committed by GitHub
commit b168a3f0b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 65 additions and 5 deletions

View File

@ -166,6 +166,11 @@ return [
'type' => 'number',
'validation' => 'min:0',
],
[
'name' => 'out_of_stock_items',
'title' => 'admin::app.admin.system.allow-out-of-stock-items',
'type' => 'boolean',
],
],
], [
'key' => 'catalog.products.storefront',

View File

@ -1337,6 +1337,10 @@ return [
],
'system' => [
'catalog' => 'فهرس',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'منتجات',
'guest-checkout' => 'ضيف المحاسبة',
'allow-guest-checkout' => 'السماح للضيف بالخروج',

View File

@ -1345,6 +1345,10 @@ return [
'system' =>
[
'catalog' => 'Katalog',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Produkte',
'guest-checkout' => 'Gastbestellungen',
'allow-guest-checkout' => 'Gastbestellungen erlauben',

View File

@ -1348,6 +1348,7 @@ return [
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Products',
'guest-checkout' => 'Guest Checkout',
'allow-guest-checkout' => 'Allow Guest Checkout',

View File

@ -1326,6 +1326,10 @@ return [
],
'system' => [
'catalog' => 'Catálogo',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Productos',
'guest-checkout' => 'Compras como invitado',
'allow-guest-checkout' => 'Permitir compras como invitado',

View File

@ -1334,6 +1334,10 @@ return [
],
'system' => [
'catalog' => 'کاتالوگ',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'محصولات',
'guest-checkout' => 'وارسی میهمان',
'allow-guest-checkout' => 'مجاز به پرداخت مهمان',

View File

@ -1337,6 +1337,10 @@ return [
],
'system' => [
'catalog' => 'Catalogo',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Prodotti',
'guest-checkout' => 'Checkout come Ospite',
'allow-guest-checkout' => 'Consenti Checkout come Ospite',

View File

@ -1333,6 +1333,10 @@ return [
],
'system' => [
'catalog' => 'Catalogus',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Producten',
'guest-checkout' => 'Gast afrekenen',
'allow-guest-checkout' => 'Gast afrekenen toestaan',

View File

@ -1334,6 +1334,10 @@ return [
],
'system' => [
'catalog' => 'Katalog',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Produkty',
'guest-checkout' => 'Zamówienia gości',
'allow-guest-checkout' => 'Zezwalaj na zamówienia gości',

View File

@ -1333,6 +1333,10 @@ return [
],
'system' => [
'catalog' => 'Catálogo',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Produtos',
'guest-checkout' => 'Compras sem cadastro?',
'allow-guest-checkout' => 'Permitir compra para clientes sem cadastros?',

View File

@ -1321,6 +1321,10 @@ return [
],
'system' => [
'catalog' => 'Katalog',
'homepage' => 'Homepage configuration',
'allow-no-of-new-product-homepage' => 'Allowed No of New Product in Homepage',
'allow-no-of-featured-product-homepage' => 'Allowed No of Featured Product in Homepage',
'allow-out-of-stock-items' => 'Allow out of stock items',
'products' => 'Ürünler',
'guest-checkout' => 'Ziyaretçi Satışı',
'allow-guest-checkout' => 'Ziyaretçi Alımına İzin Ver',

View File

@ -189,9 +189,15 @@ class CartRuleController extends Controller
$cartRule = $this->cartRuleRepository->findOrFail($id);
if ($cartRule->coupon_type) {
$this->validate(request(), [
'coupon_code' => 'required_if:use_auto_generation,==,0|unique:cart_rule_coupons,code,' . $cartRule->cart_rule_coupon->id,
]);
if ($cartRule->cart_rule_coupon) {
$this->validate(request(), [
'coupon_code' => 'required_if:use_auto_generation,==,0|unique:cart_rule_coupons,code,' . $cartRule->cart_rule_coupon->id,
]);
} else {
$this->validate(request(), [
'coupon_code' => 'required_if:use_auto_generation,==,0|unique:cart_rule_coupons,code',
]);
}
}
Event::dispatch('promotions.cart_rule.update.before', $cartRule);

View File

@ -11,7 +11,13 @@
@foreach (app('Webkul\Product\Repositories\ProductRepository')->getFeaturedProducts() as $productFlat)
@include ('shop::products.list.card', ['product' => $productFlat])
@if (core()->getConfigData('catalog.products.homepage.out_of_stock_items'))
@include ('shop::products.list.card', ['product' => $productFlat])
@else
@if ($productFlat->isSaleable())
@include ('shop::products.list.card', ['product' => $productFlat])
@endif
@endif
@endforeach

View File

@ -11,7 +11,13 @@
@foreach (app('Webkul\Product\Repositories\ProductRepository')->getNewProducts() as $productFlat)
@include ('shop::products.list.card', ['product' => $productFlat])
@if (core()->getConfigData('catalog.products.homepage.out_of_stock_items'))
@include ('shop::products.list.card', ['product' => $productFlat])
@else
@if ($productFlat->isSaleable())
@include ('shop::products.list.card', ['product' => $productFlat])
@endif
@endif
@endforeach