custom/plugins/ChespackTheme/src/Resources/views/storefront/component/product/card/action.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/action.html.twig' %}
  2. {% block component_product_box_action_inner %}
  3.     {# Add to wishlist in listing as a button #}
  4.     {% if config('ChespackTheme.config.addToWishlistInListing') == 2 %}
  5.         {% block wishlist_listing_add_button %}
  6.             {% set isParent = product.childCount > 0 %}
  7.             {% if not isParent  %}
  8.                 {% block listing_wishlist_add_wishlist_modal_button %}
  9.                     <span data-uri="{{ path('frontend.PremsWishlist.add.modal', {'productId': id}) }}"
  10.                           rel="nofollow"
  11.                           data-toggle="modal"
  12.                           data-target="#prems-wishlist-modal-window"
  13.                           data-product-id="{{ id }}"
  14.                           class="btn btn-light wishlist-modal--button btn-block mt-3"
  15.                           title="{{ "prems-wishlist.modal.add_to_wishlist"|trans }}">
  16.                     {{ "prems-wishlist.modal.add_to_wishlist"|trans }}
  17.                 </span>
  18.                 {% endblock %}
  19.             {% endif %}
  20.         {% endblock %}
  21.     {% endif %}
  22.     {{ parent() }}
  23. {% endblock %}
  24. {# Added view button #}
  25. {% block component_product_box_action_buy %}
  26.     {# if this isnt a special order item, and the customer is logged in or show price field is set
  27.         then show the price
  28.     #}
  29.     {% if(
  30.         (not product.translated.customFields.special_order_item) and
  31.         ((context.customer) or
  32.          (product.translated.customFields.migration_attribute_4_show_price_154))
  33.         )
  34.     %}
  35.         {{ parent() }}
  36.     {% elseif (product.translated.customFields.special_order_item) %}
  37.         {% block login_for_price_action %} {# page_product_detail_product_buy_button #}
  38.             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  39.                title="{{ "listing.boxProductDetails"|trans|striptags }}">
  40.                 <button class="btn btn-block btn-buy"
  41.                         title="{{ "listing.boxProductDetails"|trans|striptags }}">
  42.                     {{ "chespackTheme.product.special.actionLabel"|trans|sw_sanitize }}
  43.                 </button>
  44.             </a>
  45.         {% endblock %}
  46.     {% else %}
  47.         {% block special_order_action %} {# page_product_detail_product_buy_button #}
  48.             <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  49.                title="{{ "listing.boxProductDetails"|trans|striptags }}">
  50.                 <button class="btn btn-block btn-buy"
  51.                         title="{{ "listing.boxProductDetails"|trans|striptags }}">
  52.                     {{ "chespackTheme.product.loginForPrice.actionLabel"|trans|sw_sanitize }}
  53.                 </button>
  54.             </a>
  55.         {% endblock %}
  56.     {% endif %}
  57.     {% block component_product_box_action_view %}
  58.         <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  59.            class="btn btn-block btn-light"
  60.            title="{{ "listing.boxProductDetails"|trans|striptags }}">
  61.             {{ "listing.boxProductDetails"|trans|sw_sanitize }} {% sw_icon 'arrow-head-right' %}
  62.         </a>
  63.     {% endblock %}
  64. {% endblock %}
  65. {# Adjusted button layout #}
  66. {% block component_product_box_action_detail %}
  67.     <a href="{{ seoUrl('frontend.detail.page', {'productId': id}) }}"
  68.        class="btn btn-block btn-light btn-view"
  69.        title="{{ "listing.boxProductDetails"|trans|striptags }}">
  70.         {{ "listing.boxProductDetails"|trans|sw_sanitize }} {% sw_icon 'arrow-head-right' %}
  71.     </a>
  72. {% endblock %}