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

Open in your IDE?
  1. {% sw_extends '@parent/storefront/component/product/card/action.html.twig' %}
  2. {% block component_product_box_action_buy %}
  3.     {% set nb_is_por = product.extensions.nimbits_por.is_por %}
  4.     {% set nb_is_purchaseable = product.extensions.nimbits_por.is_purchaseable %}
  5.     {% set nb_show_price = product.extensions.nimbits_por.show_price %}
  6.     {% set customizedProductsTemplate = product.extensions.swagCustomizedProductsTemplate %}
  7.     {% set por_btn_visible = product.extensions.nimbits_por_product_ruleset.por_btn_visible %}
  8.     {% set por_dont_show_price = product.extensions.nimbits_por_product_ruleset.por_dont_show_price %}
  9.     {% set por_add_to_cart_not_visible = product.extensions.nimbits_por_product_ruleset.por_add_to_cart_not_visible %}
  10.     {% set por_product_not_purchasable = product.extensions.nimbits_por_product_ruleset.por_product_not_purchasable %}
  11.     {% if por_btn_visible or por_dont_show_price or por_add_to_cart_not_visible or por_product_not_purchasable %}
  12.         {% if por_product_not_purchasable %}
  13.             {# {% do page.extensions.payPalEcsButtonData.assign({'listingEnabled': false }) %}  #}
  14.             {# todo paypal settings #}
  15.         {% endif %}
  16.         {% if por_dont_show_price %}
  17.             {# {% do page.extensions.payPalEcsButtonData.assign({'listingEnabled': false }) %}  #}
  18.             {# todo paypal settings #}
  19.         {% endif %}
  20.         {% if not por_add_to_cart_not_visible %}
  21.             {{ parent() }}
  22.         {% endif %}
  23.         {% block nimbits_por_product_box_action_buy_visible %}
  24.             {% if por_btn_visible %}
  25.                 {% set nbPriceRequestItems = [] %}
  26.                 {% set nbPriceRequestItems = nbPriceRequestItems|merge([{ quantity: 1, number: product.productNumber, name: product.translated.name }]) %}
  27.                 <input type="hidden" name="redirectParameters" data-redirect-parameters="true"
  28.                        value='{"productId": "{{ product.id }}"}'>
  29.                 <input type="hidden" name="lineItems[{{ id }}][id]" value="{{ id }}">
  30.                 <input type="hidden" name="lineItems[{{ id }}][referencedId]" value="{{ id }}">
  31.                 <input type="hidden" name="lineItems[{{ id }}][type]" value="product">
  32.                 <input type="hidden" name="lineItems[{{ id }}][stackable]" value="1">
  33.                 <input type="hidden" name="lineItems[{{ id }}][removable]" value="1">
  34.                 <input type="hidden" name="lineItems[{{ id }}][quantity]" value="1">
  35.                 <input type="hidden" name="product-name" value="{{ product.translated.name }}">
  36.                 <button
  37.                         class="btn btn-block btn-buy btn-nb-pricerequest-listing"
  38.                         title="{{ 'nimbits-pricerequests.listing.button.openrequestform'|trans }}"
  39.                         data-toggle="modal"
  40.                         data-ajax-modal
  41.                         data-url="{{ path('frontend.action.nimbits.price-request-modal') }}">
  42.                     {{ 'nimbits-pricerequests.listing.button.openrequestform'|trans }}
  43.                     <input name="nb_pricerequest_lineitems" type="hidden"
  44.                            value="{{ nbPriceRequestItems|json_encode() }}"/>
  45.                 </button>
  46.             {% endif %}
  47.         {% endblock %}
  48.     {% else %}
  49.         {{ parent() }}
  50.     {% endif %}
  51. {% endblock %}