[UX] Fix cart button on small screens

This commit is contained in:
Jan Goralski 2023-01-03 09:37:09 +01:00 committed by Grzegorz Sadowski
parent 50c9d31096
commit aa2d054810
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
2 changed files with 10 additions and 7 deletions

View file

@ -25,11 +25,14 @@ import './sylius-variants-prices';
$(document).ready(() => {
$('.popup-js').popup();
$('.cart.button')
.popup({
popup: $('.cart.popup'),
on: 'click',
});
$('.cart.button').popup({
popup: $('.cart.popup'),
on: 'click',
onUnplaceable() {
window.location.href = $('#sylius-go-to-cart').attr('href');
},
silent: true,
});
$('.star.rating').rating({
fireOnInit: true,
@ -85,6 +88,6 @@ $(document).ready(() => {
slidesToScroll: 1,
prevArrow: $('.carousel-left'),
nextArrow: $('.carousel-right'),
appendArrows: false
appendArrows: false,
});
});

View file

@ -9,7 +9,7 @@
{% endfor %}
<div class="item"><strong>{{ 'sylius.ui.subtotal'|trans }}</strong>: {{ money.convertAndFormat(cart.itemsTotal) }}</div>
</div>
<a href="{{ path('sylius_shop_cart_summary') }}" class="ui fluid basic text button">{{ 'sylius.ui.view_and_edit_cart'|trans }}</a>
<a href="{{ path('sylius_shop_cart_summary') }}" id="sylius-go-to-cart" class="ui fluid basic text button">{{ 'sylius.ui.view_and_edit_cart'|trans }}</a>
<div class="ui divider"></div>
<a href="{{ path('sylius_shop_checkout_start') }}" class="ui fluid primary button">{{ 'sylius.ui.checkout'|trans }}</a>
{% endif %}