Merge pull request #4337 from rahulshukla-webkul/development
enhancement #4321 done with all required changes
This commit is contained in:
commit
963191b3fc
|
|
@ -218,6 +218,10 @@ return [
|
|||
],
|
||||
],
|
||||
'channel_based' => true,
|
||||
], [
|
||||
'name' => 'buy_now_button_display',
|
||||
'title' => 'admin::app.admin.system.buy-now-button-display',
|
||||
'type' => 'boolean',
|
||||
]
|
||||
],
|
||||
], [
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
]
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"/js/velocity.js": "/js/velocity.js?id=7667f0ec09b600fb38fc",
|
||||
"/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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -349,6 +349,11 @@ body {
|
|||
> h2, div {
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
.buynow {
|
||||
float: left;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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]) !!}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue