Skip to content
Docs
Get RestroPress

Action

rpress_cart_contents_loaded_from_session

Updated
On this page

Fires after the cart contents have been read from the session.

Runs at the end of RPRESS_Cart::get_contents_from_session(), once the session value has been assigned to the cart. This happens during cart setup and the first time the contents are requested. The stored value is not validated at this point.

Parameters#

ParameterTypeDescription
$thisRPRESS_CartThe cart instance.

Example#

function my_cart_session_loaded( $cart ) {
	RPRESS()->session->set( 'my_cart_loaded_at', time() );
}
add_action( 'rpress_cart_contents_loaded_from_session', 'my_cart_session_loaded', 10, 1 );

Source#

Fired from:

  • includes/cart/class-rpress-cart.php (line 142), in RPRESS_Cart::get_contents_from_session()

See also#

Was this page helpful?