Cart::get_cart_id()

Summary

Get the cart ID from the cookie


Return

(string)


Source

File: src/BigCommerce/Cart/Cart.php

	public function get_cart_id() {
		$cart_id = '';
		$cookie  = filter_input( INPUT_COOKIE, self::CART_COOKIE, FILTER_SANITIZE_STRING );
		if ( $cookie && get_option( Settings\Sections\Cart::OPTION_ENABLE_CART, true ) ) {
			$cart_id = $cookie;
		}

		/**
		 * Filter the cart ID to use for the current request
		 *
		 * @param string $cart_id
		 */
		return apply_filters( 'bigcommerce/cart/cart_id', $cart_id );
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.