Site icon Experience Wordpress Developer Online – Design Develop and Maintenance Support

Hide quantity column on WooCommerce cart page

Some Reason want to Hide quantity column on WooCommerce cart page ?
go with current article How to Hide quantity column on cart page in WooCommerce ?
add following code in your active theme functions.php file and see magic 🙂

# add code in functions.php 
function wdo_remove_quantity_column_from_cart( $return, $product ) {
	if ( is_cart() ) return true;
}
add_filter( 'woocommerce_is_sold_individually', 'wdo_remove_quantity_column_from_cart', 10, 2 );

Explanation :
With use of woocommerce_is_sold_individually woocommerce filter hook we calling our custom function wdo_remove_quantity_column_from_cart in which conditionally check if current page is Cart page than return true to set Item added in Cart is sold individually instead of in Quantity.

Sold Product in Single Quantity Only

to sale Product in single unit and dont show Quantity Box on Single Product Page use following code snippet in theme functions.php file

function wdo_remove_all_quantity_fields( $return, $product ) {
    return true;
}
add_filter( 'woocommerce_is_sold_individually', 'wdo_remove_all_quantity_fields', 10, 2 );
Exit mobile version