Support » Plugin: WooCommerce » Remove quantity

  • Resolved panconjugo

    (@panconjugo)


    Hello,

    I am trying to remove the quantity everywhere but specifically in the checkout page, I pasted the file review-order.php from woocommerce into my theme directory themes/mytheme/woocommerce/checkout/review-order.php and tested just leaving echo $_product->get_name(); and removing the part <strong class="product-quantity">... but it’s still printing out the quantity.

    So, how can I remove the qty there? is it loading with AJAX but from where?

    This is the line I am checking

    https://github.com/woocommerce/woocommerce/blob/master/templates/checkout/review-order.php#L37

    Thanks,
    Daniel.

    • This topic was modified 1 month, 3 weeks ago by  panconjugo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @panconjugo!

    See if the following code works for you:

    function wc_remove_quantity_field_from_checkout( $return ) {
    	if ( is_checkout() ) return false;
    }
    add_filter( 'woocommerce_checkout_cart_item_quantity', 'wc_remove_quantity_field_from_checkout', 10, 2 );

    You can add that code to your site using the Code snippets plugin.

    Here’s some more information on how to add custom code to your site correctly:

    http://rynaldo.com/how-to-add-custom-code-to-your-woocommerce-wordpress-site-the-right-way/

    Cheers!

    • This reply was modified 1 month, 3 weeks ago by  Rynald0s.
    Plugin Support Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.