Answers for "remove product from cart by id woocommerce"

PHP
1

remove product from cart by id woocommerce

foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
     if ( $cart_item['product_id'] == $your_product_id_here ) {
          WC()->cart->remove_cart_item( $cart_item_key );
     }
}
Posted by: Guest on January-18-2022
0

woocommerce remove category from product page

remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
Posted by: Guest on September-08-2021

Code answers related to "remove product from cart by id woocommerce"

Browse Popular Code Answers by Language