Merge branch 'master' into validation-message-added
This commit is contained in:
commit
0af35cae62
|
|
@ -102,7 +102,7 @@ class Shipping
|
|||
if (! isset($rates[$rate->carrier])) {
|
||||
$rates[$rate->carrier] = [
|
||||
'carrier_title' => $rate->carrier_title,
|
||||
'rates' => []
|
||||
'rates' => [],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ class Shipping
|
|||
'code' => $object->getCode(),
|
||||
'method' => $object->getMethod(),
|
||||
'method_title' => $object->getTitle(),
|
||||
'description' => $object->getDescription()
|
||||
'description' => $object->getDescription(),
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -147,8 +147,20 @@ class Shipping
|
|||
*/
|
||||
public function isMethodCodeExists($shippingMethodCode)
|
||||
{
|
||||
$activeShippingMethods = collect($this->getShippingMethods());
|
||||
$shippingMethods = $this->collectRates()['shippingMethods'] ?? [];
|
||||
|
||||
return $activeShippingMethods->contains('method', $shippingMethodCode);
|
||||
if (empty($shippingMethods) || ! $shippingMethods) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($shippingMethods as $shippingMethod) {
|
||||
foreach ($shippingMethod['rates'] as $rate) {
|
||||
if ($rate->method === $shippingMethodCode) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"/js/shop.js": "/js/shop.js?id=34684ef2b5b3c24817b4",
|
||||
"/css/shop.css": "/css/shop.css?id=9afe3747b802b3fd1aa9"
|
||||
"/css/shop.css": "/css/shop.css?id=018e0f910649f28ef1f0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1959,22 +1959,23 @@ section.product-detail {
|
|||
}
|
||||
|
||||
.add-to-buttons {
|
||||
display: none;
|
||||
flex-direction: row;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 10px;
|
||||
width: 79.5%;
|
||||
float: right;
|
||||
justify-content: space-between;
|
||||
|
||||
.addtocart {
|
||||
width: 49%;
|
||||
margin: 2px;
|
||||
width: 100%;
|
||||
background: black;
|
||||
white-space: normal;
|
||||
white-space: nowrap;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.buynow {
|
||||
width: 49%;
|
||||
margin: 2px;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
{!! view_render_event('bagisto.shop.products.add_to_cart.before', ['product' => $product]) !!}
|
||||
|
||||
@php
|
||||
$width = (core()->getConfigData('catalog.products.storefront.buy_now_button_display') == 1) ? '49' : '100';
|
||||
@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
|
||||
type="submit"
|
||||
class="btn btn-lg btn-primary addtocart"
|
||||
{{ ! $product->isSaleable() ? 'disabled' : '' }}
|
||||
>
|
||||
{{ $product->type == 'booking' ? __('shop::app.products.book-now') : __('shop::app.products.add-to-cart') }}
|
||||
</button>
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.add_to_cart.after', ['product' => $product]) !!}
|
||||
{!! view_render_event('bagisto.shop.products.add_to_cart.after', ['product' => $product]) !!}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
{!! view_render_event('bagisto.shop.products.buy_now.before', ['product' => $product]) !!}
|
||||
|
||||
<button type="submit" class="btn btn-lg btn-primary buynow" {{ ! $product->isSaleable(1) ? 'disabled' : '' }}>
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-lg btn-primary buynow"
|
||||
{{ ! $product->isSaleable(1) ? 'disabled' : '' }}
|
||||
>
|
||||
{{ __('shop::app.products.buy-now') }}
|
||||
</button>
|
||||
|
||||
{!! view_render_event('bagisto.shop.products.buy_now.after', ['product' => $product]) !!}
|
||||
{!! view_render_event('bagisto.shop.products.buy_now.after', ['product' => $product]) !!}
|
||||
|
|
|
|||
|
|
@ -277,12 +277,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
var addTOButton = document.getElementsByClassName('add-to-buttons')[0];
|
||||
document.getElementById('loader').style.display="none";
|
||||
addTOButton.style.display="flex";
|
||||
});
|
||||
|
||||
window.onload = function() {
|
||||
var thumbList = document.getElementsByClassName('thumb-list')[0];
|
||||
var thumbFrame = document.getElementsByClassName('thumb-frame');
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@
|
|||
},
|
||||
|
||||
fetchCountries: function () {
|
||||
let countriesEndPoint = `${this.$root.baseUrl}/api/countries?pagination=0`;
|
||||
let countriesEndPoint = `${this.$root.baseUrl}/api/countries?pagination=0&sort=id&order=asc`;
|
||||
|
||||
this.$http.get(countriesEndPoint)
|
||||
.then(response => {
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@
|
|||
data-vv-as=""{{ __('shop::app.checkout.onepage.country') }}""
|
||||
@change="validateForm('address-form')">
|
||||
|
||||
<option value=""></option>
|
||||
<option value="" disabled>{{ __('ui::form.select-attribute', ['attribute' => __('shop::app.checkout.onepage.country')]) }}</option>
|
||||
|
||||
<option v-for='(country, index) in countries' :value="country.code">
|
||||
@{{ country.name }}
|
||||
|
|
@ -431,7 +431,7 @@
|
|||
data-vv-as=""{{ __('shop::app.checkout.onepage.country') }}""
|
||||
@change="validateForm('address-form')">
|
||||
|
||||
<option value=""></option>
|
||||
<option value="" disabled>{{ __('ui::form.select-attribute', ['attribute' => __('shop::app.checkout.onepage.country')]) }}</option>
|
||||
|
||||
<option v-for='(country, index) in countries' :value="country.code" v-text="country.name"></option>
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in New Issue