You are here

public function CartTable::emptyCart in Basic cart 8

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

* Shopping cart reset.

Overrides CartInterface::emptyCart

File

src/CartTable.php, line 72

Class

CartTable
Class CartTable.

Namespace

Drupal\basic_cart

Code

public function emptyCart() {
  $param['uid'] = $this->user_id;
  $this->cart_storage
    ->delete($param);
  unset($_SESSION['basic_cart']['cart']);
  unset($_SESSION['basic_cart']['cart_quantity']);
}