Tribe__Tickets_Plus__Meta::clear_storage_on_remove_cart_item( $cart_item_key = '', $cart = null )
Clear the storage allocated by a product if the product is removed from the cart.
Contents
Parameters
- $cart_item_key
-
(Optional)
Default value: ''
- $cart
-
(Optional)
Default value: null
Source
File: src/Tribe/Meta.php
public function clear_storage_on_remove_cart_item( $cart_item_key = '', $cart = null ) {
$product_id = null;
if ( $cart instanceof WC_Cart ) {
$product = $cart->cart_contents[ $cart_item_key ];
$product_id = empty( $product['product_id'] ) ? null : $product['product_id'];
}
if ( ! is_null( $product_id ) ) {
$this->storage->clear_meta_data_for( $product_id );
}
}
Changelog
| Version | Description |
|---|---|
| 4.7.1 | Introduced. |