You can let the user edit the add-ons in products they’ve added to the cart:
- Go to WooCommerce > Settings > Product Add-Ons
- Check the ‘Enable editing’ option
When this option is enabled, a link to ‘Edit Options’ will appear after the product name in the cart. The user can click the link to return to the product page with their chosen options selected. If the user makes any changes to their options, they can click the ‘Update Product’ button.
You can filter the ‘Edit Options’ text using this snippet:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter 'Edit Options' text | |
*/ | |
function prefix_after_cart_item_edit_options_text( $text, $product_id ) { | |
$text = 'My new text here'; | |
return $text; | |
} | |
add_filter( 'pewc_after_cart_item_edit_options_text', 'prefix_after_cart_item_edit_options_text', 10, 2 ); |
Here’s how to add a snippet.