You are here

public static function Utility::removeFromCart in Basic cart 8.0

Same name and namespace in other branches
  1. 8.6 src/Utility.php \Drupal\basic_cart\Utility::removeFromCart()
  2. 8 src/Utility.php \Drupal\basic_cart\Utility::removeFromCart()
  3. 8.2 src/Utility.php \Drupal\basic_cart\Utility::removeFromCart()
  4. 8.3 src/Utility.php \Drupal\basic_cart\Utility::removeFromCart()
  5. 8.4 src/Utility.php \Drupal\basic_cart\Utility::removeFromCart()
  6. 8.5 src/Utility.php \Drupal\basic_cart\Utility::removeFromCart()

Callback function for cart/remove/.

Parameters

int $nid: We are using the node id to remove the node in the shopping cart

1 call to Utility::removeFromCart()
CartController::removeFromCart in src/Controller/CartController.php

File

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

Class

Utility

Namespace

Drupal\basic_cart

Code

public static function removeFromCart($nid = NULL) {
  $nid = (int) $nid;
  $storage = static::getStorage();
  $storage
    ->removeFromCart($nid);
}