custom/plugins/AmMacTradeCustomPlugins/src/Resources/views/storefront/page/product-detail/buy-widget-form.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/buy-widget-form.html.twig' %}
  2. {% set sppproduct = page.extensions['spp_product'].all()['spp'] %}
  3. {% block page_product_detail_buy_form_inner_csrf %}
  4.     {% if config('AmMacTradeCustomPlugins.config.sppProduct') %}
  5. {#        {{ parent() }}#}
  6.         {% if sppproduct and page.extensions['insurance_warranty'] is not null %}
  7.             {{ sw_csrf('frontend.checkoutspp.line-item.add') }}
  8.         {% else %}
  9.             {{ sw_csrf('frontend.checkout.line-item.add') }}
  10.         {% endif %}
  11.     {% else %}
  12.         {{ parent() }}
  13.     {% endif %}
  14. {% endblock %}
  15. {% block page_product_detail_buy_form_action %}
  16.     {% if config('AmMacTradeCustomPlugins.config.sppProduct') %}
  17. {#        {{ parent() }}#}
  18.         {% if sppproduct and page.extensions['insurance_warranty'] is not null %}
  19.             {{ path('frontend.checkoutspp.line-item.add') }}
  20.         {% else %}
  21.             {{ path('frontend.checkout.line-item.add') }}
  22.         {% endif %}
  23.     {% else %}
  24.         {{ parent() }}
  25.     {% endif %}
  26. {% endblock %}
  27. {% block page_product_detail_product_buy_meta %}
  28.     {% if config('AmMacTradeCustomPlugins.config.amMacTradeInsuranceWarranty') %}
  29.         {{ parent() }}
  30.         {% if page.extensions['insurance_warranty'] is not null %}
  31.             {% set insurance_prod_id = page.extensions['insurance_warranty'].all()['insurance_prod_id'] %}
  32.             <input type="hidden"
  33.                    name="product-insurance"
  34.                    class="product-insurance"
  35.                    value="0">
  36.             <input type="hidden"
  37.                    name="product_insurance_exist"
  38.                    class="product-insurance-exist"
  39.                    value="{{ insurance_prod_id }}">
  40.         {% endif %}
  41.     {% else %}
  42.         {{ parent() }}
  43.     {% endif %}
  44.     {% if config('AmMacTradeCustomPlugins.config.sppProduct') %}
  45.         {% if sppproduct and page.extensions['insurance_warranty'] is not null %}
  46. {#            <input type="hidden"#}
  47. {#                   name="spp_product_id"#}
  48. {#                   value="{{ sppproduct }}">#}
  49.             <input type="hidden"
  50.                    name="lineItems[{{ sppproduct }}][id]"
  51.                    value="{{ sppproduct }}">
  52.             <input type="hidden"
  53.                    name="lineItems[{{ sppproduct }}][type]"
  54.                    value="product">
  55.             <input type="hidden"
  56.                    name="lineItems[{{ sppproduct }}][referencedId]"
  57.                    value="{{ sppproduct }}">
  58.             <input type="hidden"
  59.                    name="lineItems[{{ sppproduct }}][stackable]"
  60.                    value="1">
  61.             <input type="hidden"
  62.                    name="lineItems[{{ sppproduct }}][removable]"
  63.                    value="1">
  64.             <input type="hidden"
  65.                    name="lineItems[{{ sppproduct }}][spp]"
  66.                    value="1">
  67.             <input type="hidden"
  68.                    name="lineItems[{{ sppproduct }}][sppMain]"
  69.                    value="{{ page.product.id }}">
  70.         {% endif %}
  71.     {% else %}
  72.         {{ parent() }}
  73.     {% endif %}
  74. {% endblock %}