I use the UIkit framework. The component card suppose a "uk-card" class.
I override the commerce-product.html.twig to encapsulate products infos inside a card.
(I have a custom event subscriber to redirect user to checkout just after adding a product)
Everything worked fine from years with previous release of commerce core module, but it's now broken with the 8.x-2.33.
{% set main_classes = [
'uk-card',
'uk-card-default',
'uk-flex',
'uk-flex-column'
]
%}
<article{{ attributes.addClass(main_classes).setAttribute('data-uk-scrollspy-class', 'uk-animation-slide-left-small') }}>
<div class="uk-card-header uk-text-center">
<h4 class="uk-text-bold">{{ product.title.0 }}</h4>
</div>
<div class="uk-card-body">
<div class="uk-text-center">
{{ product.variation_price }}
{{- product.body -}}
</div>
</div>
<div class="uk-card-footer">
{{- product|without('variation_attributes', 'title', 'variation_price', 'body') -}}
</div>
</article>
Not working. The user is redirect to current_page_urlundefined !
{% set main_classes = [
'uk-card-default',
'uk-flex',
'uk-flex-column'
]
%}
<article{{ attributes.addClass(main_classes).setAttribute('data-uk-scrollspy-class', 'uk-animation-slide-left-small') }}>
<div class="uk-card-header uk-text-center">
<h4 class="uk-text-bold">{{ product.title.0 }}</h4>
</div>
<div class="uk-card-body">
<div class="uk-text-center">
{{ product.variation_price }}
{{- product.body -}}
</div>
</div>
<div class="uk-card-footer">
{{- product|without('variation_attributes', 'title', 'variation_price', 'body') -}}
</div>
</article>
Working !
It's really surprising !!! Maybe the class name which close to "cart" plays...
Closed: works as designed
2.33
Product