I have been using the WooCommerce Blocks plugin for the cart page and I am trying to use a code snippet to modify it slightly. https://developer.woocommerce.com/2020/05/27/available-for-testing-a-block-based-woocommerce-cart-and-checkout/
I found this snippet which works perfectly on the regular woo cart page, but I really would like for it to work for the woocommerce blocks cart page:
add_filter( 'woocommerce_quantity_input_args', 'hide_quantity_input_field', 20, 2 );
function hide_quantity_input_field( $args, $product ) {
// Here set your product IDs in the array
$product_ids = array(46);
// Handling product variation
$the_id = $product->is_type('variation') ? $product->get_parent_id() : $product->get_id();
// Only on cart page for a specific product category
if( is_cart() && in_array( $the_id, $product_ids ) ){
$input_value = $args['input_value'];
$args['min_value'] = $args['max_value'] = $input_value;
}
return $args;
}
I already tried changing the priority around.. Any suggestions?