templates/bundles/SyliusShopBundle/Product/Show/_addToCart.html.twig line 1

Open in your IDE?
  1. {% set product = order_item.variant.product %}
  2. {% form_theme form '@SyliusShop/Form/theme.html.twig' %}
  3. <div class="ui segment" id="sylius-product-selecting-variant">
  4. {{ sonata_block_render_event('sylius.shop.product.show.before_add_to_cart', {'product': product, 'order_item': order_item}) }}
  5. {{ form_start(form, {'action': path('sylius_shop_ajax_cart_add_item', {'productId': product.id}), 'attr': {'id': 'sylius-product-adding-to-cart', 'class': 'ui loadable form', 'novalidate': 'novalidate', 'data-redirect': path(configuration.getRedirectRoute('summary'))}}) }}
  6. {{ form_errors(form) }}
  7. <div class="ui red label bottom pointing hidden sylius-validation-error" id="sylius-cart-validation-error"></div>
  8. {% if not product.simple %}
  9. {% if product.variantSelectionMethodChoice %}
  10. {% include '@SyliusShop/Product/Show/_variants.html.twig' %}
  11. {% else %}
  12. {% include '@SyliusShop/Product/Show/_options.html.twig' %}
  13. {% endif %}
  14. {% endif %}
  15. {# ADD TO BASKET #}
  16. {#
  17. {{ form_row(form.cartItem.quantity) }}
  18. {{ sonata_block_render_event('sylius.shop.product.show.add_to_cart_form', {'product': product, 'order_item': order_item}) }}
  19. <button type="submit" class="ui huge primary icon labeled button"><i class="cart icon"></i> {{ 'sylius.ui.add_to_cart'|trans }}</button>
  20. #}
  21. {{ form_row(form._token) }}
  22. {{ form_end(form, {'render_rest': false}) }}
  23. </div>