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 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, {
  6.         'action': path('sylius_shop_ajax_cart_add_item', {'productId': product.id}),
  7.         'attr': {
  8.             'id': 'sylius-product-adding-to-cart',
  9.             'class': 'ui loadable form',
  10.             'novalidate': 'novalidate',
  11.             'data-redirect': path(configuration.getRedirectRoute('summary'))
  12.         }
  13.     }) }}
  14.     {{ form_errors(form) }}
  15.     <div class="ui red label bottom pointing hidden sylius-validation-error" id="sylius-cart-validation-error"></div>
  16.     {% if not product.simple %}
  17.         {% if product.variantSelectionMethodChoice %}
  18.             {% include '@SyliusShop/Product/Show/_variants.html.twig' %}
  19.         {% else %}
  20.             {% include '@SyliusShop/Product/Show/_options.html.twig' %}
  21.         {% endif %}
  22.     {% endif %}
  23. {#    {{ form_row(form.cartItem.quantity) }}#}
  24.     {{ sonata_block_render_event('sylius.shop.product.show.add_to_cart_form', {
  25.         'product': product,
  26.         'order_item': order_item
  27.     }) }}
  28. {#    {{ form_widget(form.wishlists) }}#}
  29.     <br />
  30.     {% if product.getVendor() is null or product.getVendor().isEnabled() %}
  31.         <button type="submit" class="ui large right floated primary icon labeled button" id="buy-product">
  32.             Acheter
  33.         </button>
  34.     {% endif %}
  35. {#    <button#}
  36. {#            id="{{ form.addToWishlist.vars.id }}"#}
  37. {#            name="{{ form.addToWishlist.vars.full_name }}"#}
  38. {#            class="{{ form.addToWishlist.vars.attr.class }}"#}
  39. {#            data-bb-toggle="wishlist-variant"#}
  40. {#            {{ sylius_test_html_attribute('wishlist-add-variant') }}#}
  41. {#    >#}
  42. {#        <i class="heart icon"></i>#}
  43. {#        {{ form.addToWishlist.vars.label|trans }}#}
  44. {#    </button>#}
  45.     {{ form_row(form._token) }}
  46.     {{ form_end(form, {'render_rest': false}) }}
  47.     <a href="" class="ui large button" id="send-message">
  48.         Message
  49.     </a>
  50. </div>
  51. <style>
  52.     /*#sylius-product-selecting-variant{*/
  53.     /*    display: flex;*/
  54.     /*    flex-direction: row;*/
  55.     /*    align-items: center;*/
  56.     /*    justify-content: flex-end;*/
  57.     /*    gap: 2rem;*/
  58.     /*}*/
  59.     /*#send-message, #buy-product{*/
  60.     /*    width: fit-content;*/
  61.     /*    padding: 1.25rem 2rem !important;*/
  62.     /*    color: white;*/
  63.     /*    height: fit-content;*/
  64.     /*    font-weight: bold;*/
  65.     /*    border-radius: 0 !important;*/
  66.     /*}*/
  67.     /*#buy-product{*/
  68.     /*    background-color: black;*/
  69.     /*}*/
  70.     /*#send-message{*/
  71.     /*    background-color: #E35E31;;*/
  72.     /*}*/
  73.     /*#sylius-product-adding-to-cart{*/
  74.     /*    display: flex;*/
  75.     /*    height: fit-content;*/
  76.     /*}*/
  77. </style>