0

how to remove the square of Quanity for woocommerce cart page? Have try different themes, but seem like the css/layout is tie to woocommerce. The current themes is twentytwentytwo

enter image description here

have trying many elements and disable some css. still can't make it work. please help.

At the same time, use code from
Remove Woocommerce cart quantity selector from cart page

add_filter( 'woocommerce_cart_item_quantity', 'wc_cart_item_quantity', 10, 3 );
function wc_cart_item_quantity( $product_quantity, $cart_item_key, $cart_item ){
    if( is_cart() ){
        $product_quantity = sprintf( '%2$s <input type="hidden" name="cart[%1$s][qty]" value="%2$s" />', $cart_item_key, $cart_item['quantity'] );
    }
    return $product_quantity;
}

will also remove the function of increase/decrease quality. (while just would like to remove the box, not the entire feature.

added: remove the quantity box border in black("input"/stepper without boarder), but keep the increase and decrease quantity function.

added again: with testing url: https://s-qb6as3jh4rw8.eu1.wpsandbox.org/

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
  • Do you just want to remove the quantity box border in black? or an entire quantity box with input so user can not enter qty. – Bhautik Jul 19 '23 at 12:41
  • remove the quantity box border in black, something like input box without border, reading something like from the web, (not sure if correct terms) – user294265 Jul 19 '23 at 12:51

1 Answers1

0

Add below code to your active theme style.css file.

.quantity .qty {
    border: none !important;
}

Or

Add below code to your active theme functions.php file.

function add_custom_css{
    ?>
    <style type="text/css">
        .quantity .qty {
            border: none !important;
        }
    </style>
    <?php
}

add_action( 'wp_head', 'add_custom_css', 10, 1 );

enter image description here

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Bhautik
  • 11,125
  • 3
  • 16
  • 38