wc_get_cart_undo_url( string $cart_item_key )

Gets the url to re-add an item into the cart.


Description Description


Parameters Parameters

$cart_item_key

(Required) Cart item key to undo.


Top ↑

Return Return

(string) url to page


Top ↑

Source Source

File: includes/wc-template-functions.php

function wc_get_cart_undo_url( $cart_item_key ) {
	$cart_page_url = wc_get_cart_url();

	$query_args = array(
		'undo_item' => $cart_item_key,
	);

	return apply_filters( 'woocommerce_get_undo_url', $cart_page_url ? wp_nonce_url( add_query_arg( $query_args, $cart_page_url ), 'woocommerce-cart' ) : '', $cart_item_key );
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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