Add “Quantity” Label in front of Add to Cart Button

Here’s another WooCommerce adjustment to improve your website’s user experience: just in front of the Add to Cart button, add a string that says “Quantity: “. Add the following Snippet to your functions.php.

add_action( 'woocommerce_before_add_to_cart_quantity', 'codeithub_echo_qty_front_add_cart' );
function codeithub_echo_qty_front_add_cart() {
 echo '<div class="qty">Quantity: </div>'; 

CSS Snippet:

div.qty {
    float: left;
    padding: 10px;
Add Quantity label
See also  Put Cart & Checkout on the Same Page

Leave a Reply

Your email address will not be published. Required fields are marked *