You are here

public static function Utility::addToCart in Basic cart 8

Same name and namespace in other branches
  1. 8.6 src/Utility.php \Drupal\basic_cart\Utility::addToCart()
  2. 8.0 src/Utility.php \Drupal\basic_cart\Utility::addToCart()
  3. 8.2 src/Utility.php \Drupal\basic_cart\Utility::addToCart()
  4. 8.3 src/Utility.php \Drupal\basic_cart\Utility::addToCart()
  5. 8.4 src/Utility.php \Drupal\basic_cart\Utility::addToCart()
  6. 8.5 src/Utility.php \Drupal\basic_cart\Utility::addToCart()
4 calls to Utility::addToCart()
AddToCart::submitForm in src/Form/AddToCart.php
Form submission handler.
AddToCartWithQuantity::submitForm in src/Form/AddToCartWithQuantity.php
Form submission handler.
CartController::addToCart in src/Controller/CartController.php
CartController::addToCartNoRedirect in src/Controller/CartController.php

File

src/Utility.php, line 81
Contains \Drupal\basic_cart\Utility

Class

Utility

Namespace

Drupal\basic_cart

Code

public static function addToCart($id, $params = array()) {
  $storage = static::getStorage();
  $storage
    ->addToCart($id, $params);
}