Merge branch 'master' into issue-4283

This commit is contained in:
devansh bawari 2020-12-04 20:25:59 +05:30
commit d2bd499e46
22 changed files with 65 additions and 28 deletions

View File

@ -218,6 +218,10 @@ return [
],
],
'channel_based' => true,
], [
'name' => 'buy_now_button_display',
'title' => 'admin::app.admin.system.buy-now-button-display',
'type' => 'boolean',
]
],
], [

View File

@ -1379,7 +1379,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1353,7 +1353,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
],
],
];

View File

@ -1379,7 +1379,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1335,7 +1335,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1371,7 +1371,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1376,7 +1376,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1371,7 +1371,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1360,7 +1360,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1374,7 +1374,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -1357,7 +1357,8 @@ return [
'client-secret' => 'Client Secret',
'client-secret-info' => 'Add your secret key here',
'accepted-currencies' => 'Accepted currencies',
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...'
'accepted-currencies-info' => 'Add currency code comma seperated e.g. USD,INR,...',
'buy-now-button-display' => 'Allow customers to directly buy products'
]
]
];

View File

@ -69,8 +69,8 @@ class ChannelController extends Controller
'currencies' => 'required|array|min:1',
'base_currency_id' => 'required|in_array:currencies.*',
'root_category_id' => 'required',
'logo.*' => 'mimes:bmp,jpeg,jpg,png,webp',
'favicon.*' => 'mimes:bmp,jpeg,jpg,png,webp',
'logo.*' => 'nullable|mimes:bmp,jpeg,jpg,png,webp',
'favicon.*' => 'nullable|mimes:bmp,jpeg,jpg,png,webp',
'seo_title' => 'required|string',
'seo_description' => 'required|string',
'seo_keywords' => 'required|string',
@ -132,8 +132,8 @@ class ChannelController extends Controller
'currencies' => 'required|array|min:1',
'base_currency_id' => 'required|in_array:currencies.*',
'root_category_id' => 'required',
'logo.*' => 'mimes:bmp,jpeg,jpg,png,webp',
'favicon.*' => 'mimes:bmp,jpeg,jpg,png,webp',
'logo.*' => 'nullable|mimes:bmp,jpeg,jpg,png,webp',
'favicon.*' => 'nullable|mimes:bmp,jpeg,jpg,png,webp',
'hostname' => 'unique:channels,hostname,' . $id,
]);

View File

@ -102,11 +102,9 @@ class ProductFlatRepository extends Repository
foreach ($products as $key => $product) {
foreach ($filterAttributes as $attribute) {
if ($attribute->code <> 'price') {
if (isset($product[$attribute->code])) {
if (! in_array($product[$attribute->code], $allProductAttributeOptionsCode)) {
array_push($allProductAttributeOptionsCode, $product[$attribute->code]);
}
if ($attribute->code <> 'price' && isset($product[$attribute->code])) {
if (! in_array($product[$attribute->code], $allProductAttributeOptionsCode)) {
array_push($allProductAttributeOptionsCode, $product[$attribute->code]);
}
}
}

View File

@ -388,14 +388,14 @@ return [
],
'products' => [
'layered-nav-title' => 'Einkaufen bei',
'layered-nav-title' => 'Filtern nach',
'price-label' => 'Angebotspreis von',
'remove-filter-link-title' => 'Alles löschen',
'filter-to' => 'bis',
'sort-by' => 'Sortieren',
'from-a-z' => 'Von A-Z',
'from-z-a' => 'Von Z-A',
'newest-first' => 'Neuste zuerst',
'newest-first' => 'Neueste zuerst',
'oldest-first' => 'Älteste zuerst',
'cheapest-first' => 'Günstigste zuerst',
'expensive-first' => 'Teuerste zuerst',
@ -522,7 +522,7 @@ return [
'shipping-method' => 'Versandart wählen',
'payment-methods' => 'Zahlungsmethode wählen',
'payment-method' => 'Zahlungsmethode',
'summary' => 'Bestellübersichty',
'summary' => 'Bestellübersicht',
'price' => 'Preis',
'quantity' => 'Menge',
'billing-address' => 'Rechnungsadresse',

View File

@ -1,6 +1,11 @@
{!! view_render_event('bagisto.shop.products.add_to_cart.before', ['product' => $product]) !!}
<button type="submit" class="btn btn-lg btn-primary addtocart" {{ ! $product->isSaleable() ? 'disabled' : '' }}>
@php
$width = (core()->getConfigData('catalog.products.storefront.buy_now_button_display') == 1) ? '49' : '95';
@endphp
<button type="submit" class="btn btn-lg btn-primary addtocart" {{ ! $product->isSaleable() ? 'disabled' : '' }}
style="width: <?php echo $width.'%';?>;">
{{ ($product->type == 'booking') ? __('shop::app.products.book-now') : __('shop::app.products.add-to-cart') }}
</button>

View File

@ -3,7 +3,9 @@
<div class="add-to-buttons">
@include ('shop::products.add-to-cart', ['product' => $product])
@include ('shop::products.buy-now')
@if (core()->getConfigData('catalog.products.storefront.buy_now_button_display'))
@include ('shop::products.buy-now')
@endif
</div>
{!! view_render_event('bagisto.shop.products.view.product-add.after', ['product' => $product]) !!}

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=2d8252eb879bdc417224",
"/js/velocity.js": "/js/velocity.js?id=45f7f05ff7e9c16e73e5",
"/css/velocity-admin.css": "/css/velocity-admin.css?id=4322502d80a0e4a0affd",
"/css/velocity.css": "/css/velocity.css?id=e41e400c39a3cb5bc551"
"/css/velocity.css": "/css/velocity.css?id=735a971d8d35f29b420a"
}

View File

@ -349,6 +349,11 @@ body {
> h2, div {
padding-right: 0px;
}
.buynow {
float: left;
margin-right: 10px;
}
}
}

View File

@ -0,0 +1,7 @@
{!! view_render_event('bagisto.shop.products.buy_now.before', ['product' => $product]) !!}
<button type="submit" class="theme-btn text-center buynow" {{ ! $product->isSaleable(1) ? 'disabled' : '' }}>
{{ __('shop::app.products.buy-now') }}
</button>
{!! view_render_event('bagisto.shop.products.buy_now.after', ['product' => $product]) !!}

View File

@ -124,6 +124,12 @@
</div>
<div class="product-actions">
@if (core()->getConfigData('catalog.products.storefront.buy_now_button_display'))
@include ('shop::products.buy-now', [
'product' => $product,
])
@endif
@include ('shop::products.add-to-cart', [
'form' => false,
'product' => $product,