You are here

commerce-add-to-cart-link.html.twig in Commerce Add To Cart Link 8

Same filename and directory in other branches
  1. 2.x templates/commerce-add-to-cart-link.html.twig

Default template for add to cart link.

Available variables:

  • attributes: HTML attributes for the wrapper.
  • url: The URL to the add to cart route.
  • product_variation: The product variation entity.

File

templates/commerce-add-to-cart-link.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. *
  5. * Default template for add to cart link.
  6. *
  7. * Available variables:
  8. * - attributes: HTML attributes for the wrapper.
  9. * - url: The URL to the add to cart route.
  10. * - product_variation: The product variation entity.
  11. *
  12. * @ingroup themeable
  13. */
  14. #}
  15. <div{{ attributes }}>
  16. <a href="{{ url }}" class="add-to-cart-link" rel="nofollow" data-variation="{{ product_variation.id }}">{{ 'Add to cart'|t }}</a>
  17. </div>