You are here

commerce_variation_add_to_cart.module in Commerce Variation Add to Cart 8

Pass variables to Twig template.

File

commerce_variation_add_to_cart.module
View source
<?php

/**
 * @file
 * Pass variables to Twig template.
 */

/**
 * Implements hook_theme().
 */
function commerce_variation_add_to_cart_theme() {
  return [
    'variation_add_to_cart_formatter' => [
      'variables' => [
        'variation' => NULL,
        'product_id' => NULL,
        'variation_id' => NULL,
        'show_title' => NULL,
        'title' => NULL,
        'show_price' => NULL,
        'price_number' => NULL,
        'price_format' => NULL,
        'show_currency' => NULL,
        'price_currency' => NULL,
        'show_quantity' => NULL,
        'attributes' => [],
        'destination' => NULL,
      ],
    ],
  ];
}

Functions