{% sw_extends '@Storefront/storefront/component/product/card/action.html.twig' %}
{% block component_product_box_action_inner %}
{# Add to wishlist in listing as a button #}
{% if config('ChespackTheme.config.addToWishlistInListing') == 2 %}
{% block wishlist_listing_add_button %}
{% set isParent = product.childCount > 0 %}
{% if not isParent %}
{% block listing_wishlist_add_wishlist_modal_button %}
<span data-uri="{{ path('frontend.PremsWishlist.add.modal', {'productId': id}) }}"
rel="nofollow"
data-toggle="modal"
data-target="#prems-wishlist-modal-window"
data-product-id="{{ id }}"
class="btn btn-light wishlist-modal--button btn-block mt-3"
title="{{ "prems-wishlist.modal.add_to_wishlist"|trans }}">
{{ "prems-wishlist.modal.add_to_wishlist"|trans }}
</span>
{% endblock %}
{% endif %}
{% endblock %}
{% endif %}
{{ parent() }}
{% endblock %}
{# Added view button #}
{% block component_product_box_action_buy %}
{# if this isnt a special order item, and the customer is logged in or show price field is set
then show the price
#}
{% if(
(not product.translated.customFields.special_order_item) and
((context.customer) or
(product.translated.customFields.migration_attribute_4_show_price_154))
)
%}
{{ parent() }}
{% elseif (product.translated.customFields.special_order_item) %}
{% block login_for_price_action %} {# page_product_detail_product_buy_button #}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
<button class="btn btn-block btn-buy"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
{{ "chespackTheme.product.special.actionLabel"|trans|sw_sanitize }}
</button>
</a>
{% endblock %}
{% else %}
{% block special_order_action %} {# page_product_detail_product_buy_button #}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
<button class="btn btn-block btn-buy"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
{{ "chespackTheme.product.loginForPrice.actionLabel"|trans|sw_sanitize }}
</button>
</a>
{% endblock %}
{% endif %}
{% block component_product_box_action_view %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
class="btn btn-block btn-light"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
{{ "listing.boxProductDetails"|trans|sw_sanitize }} {% sw_icon 'arrow-head-right' %}
</a>
{% endblock %}
{% endblock %}
{# Adjusted button layout #}
{% block component_product_box_action_detail %}
<a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
class="btn btn-block btn-light btn-view"
title="{{ "listing.boxProductDetails"|trans|striptags }}">
{{ "listing.boxProductDetails"|trans|sw_sanitize }} {% sw_icon 'arrow-head-right' %}
</a>
{% endblock %}