wc_get_cart_remove_url()WC 3.3.0

Gets the url to remove an item from the cart.

Hooks from the function

Return

String. url to page

Usage

wc_get_cart_remove_url( $cart_item_key );
$cart_item_key(string) (required)
contains the id of the cart item.

Changelog

Since 3.3.0 Introduced.

wc_get_cart_remove_url() code WC 8.7.0

function wc_get_cart_remove_url( $cart_item_key ) {
	$cart_page_url = wc_get_cart_url();
	return apply_filters( 'woocommerce_get_remove_url', $cart_page_url ? wp_nonce_url( add_query_arg( 'remove_item', $cart_item_key, $cart_page_url ), 'woocommerce-cart' ) : '' );
}