with my current theme, the quantity selector for each woocommere product sits to the left of the add to cart button area. When it's sized down in mobile, the add to cart button moves below the quantity selector. Is there a way to move the .quantity div so that it's under the add to cart button? I've tried css margins, padding etc. but it does not work correctly.

  • Using css or php? – vikrant zilpe Dec 5 at 8:29
  • please try this code – vikrant zilpe Dec 5 at 8:33
  • add_action( 'woocommerce_before_add_to_cart_quantity', 'bbloomer_echo_qty_front_add_cart' ); function bbloomer_echo_qty_front_add_cart() { echo '<div class="qty">Quantity: </div>'; } And a couple of CSS lines as well: div.qty { float: left; padding: 10px; } – vikrant zilpe Dec 5 at 8:33
  • I had only tried with css. I tried your code in my child theme's functions.php file, but all it did was add the word "quantity" above the selector; it did not move the location of the quantity selector. – wooq123 Dec 6 at 9:23
  • please share your site url – vikrant zilpe Dec 6 at 11:08

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.