Comments 2Josh started the conversationNovember 13, 2024 at 12:38pmHi there,Is it possible to remove individual products that have been added to the cart as a composite product?e.g. if we add all products https://angliancompressors.com/product/atlas-copco-g5-ff-rm-air-compressor/, we get the photo in the attachment.I'd like to then give the option to remove certain items if they wish.I'm of course happy to pay for the pro version.Attached files: anglian compositre.png 1,281Dustin repliedNovember 13, 2024 at 4:25pmHi Josh, Please add the custom code below. (How to add custom code? ↗): add_filter( 'woocommerce_cart_item_remove_link', function ( $link, $cart_item_key ) { if ( isset( WC()->cart->cart_contents[ $cart_item_key ]['wooco_parent_key'] ) ) { $_product = WC()->cart->cart_contents[ $cart_item_key ]['data']; return sprintf( '<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">×</a>', esc_url( wc_get_cart_remove_url( $cart_item_key ) ), /* translators: %s is the product name */ esc_attr( sprintf( __( 'Remove %s from cart', 'woocommerce' ), wp_strip_all_tags( $_product->get_name() ) ) ), esc_attr( $_product->get_id() ), esc_attr( $_product->get_sku() ) ); } return $link; }, 99, 2 ); Then, you can remove the component product from the composite: Best regards,Dustin 2Josh repliedNovember 14, 2024 at 7:11amHi Dustin,That's amazing, thanks so much.1 Like 4Fernando Daniel Stal replied3 weeks ago on December 27, 2024 at 10:03pmExcellent and what about change the quantity of a component? Sign in to reply ...
Hi there,
Is it possible to remove individual products that have been added to the cart as a composite product?
e.g. if we add all products https://angliancompressors.com/product/atlas-copco-g5-ff-rm-air-compressor/, we get the photo in the attachment.
I'd like to then give the option to remove certain items if they wish.
I'm of course happy to pay for the pro version.
Attached files: anglian compositre.png
Hi Josh,
Please add the custom code below. (How to add custom code? ↗):
Then, you can remove the component product from the composite:
Best regards,
Dustin
Hi Dustin,
That's amazing, thanks so much.
Excellent and what about change the quantity of a component?