In WooCommerce, I have a custom cart.php
template where I need to check if a deleted product (item) is unique and then further code based on that information.
Is there a way to find this ONE Key id of a deleted item without using a hook, the one that notifies ' that "Item X" has been deleted. Undo? '
?
I can't find any solution anywhere.
You can get deleted shopping cart items in two ways:
Used from the WC_Cart object:
Used from the WC_Session object:
To locate a specific deleted product and get its key ID (and the revoke URL or delete URL from it) , use: