Viewing 5 replies - 1 through 5 (of 5 total)
  • I’m also curious to hear how to hide both the +/- buttons and the quantity number (I only sell one of each product and having a quantity makes it look like it’s mass produced when it’s not).

    There are a couple of solutions here. Unfortunately neither are as simple as this ought to be. I think this is a good idea though, so I am going to submit it to Github ( where WC does its development )

    https://github.com/woothemes/woocommerce/issues

    The first option involves involves adding a meta field somewhere in the product date metabox and then using that value to toggle the woocommerce_is_sold_individually filter.

    The status of woocommerce_is_sold_individually is the condition that displays the quantity input on the single product page. True = hide that input and False = display the input. This is the development-side solution though, and I might even send them a pull request if I get a minute to fix it.

    In the mean time you can override every woo template in your own theme. In your theme’s folder create a folder called: woocommerce

    Then create a folder inside that called single-product

    Then inside that, add-to-cart

    Basically we’re going to mimic the folder structure inside the templates folder of the Woocommerce plugin files. Now go into the WooCommerce plugin files and find the file

    templates\single-product\add-to-cart\simple.php

    COPY it. and then paste it into the

    woocommerce\single-product\add-to-cart\

    folder we created earlier.

    Anything you do to the simple.php file nested in your theme folder will now be displayed in lieu of WooCommerce’s version. (this is called Template Hierarchy by the way)

    in your version (DO NOT HACK THE WOOCOMMERCE FILES!!) find the following:

    <?php
       if ( ! $product->is_sold_individually() )
    	 			woocommerce_quantity_input( array( 'min_value' => 1, 'max_value' => $product->backorders_allowed() ? '' : $product->get_stock_quantity() ) );
    ?>

    and delete it. The quantity input is now gone. The downside of this is that it is gone for every product you sell, which is why the development-side solution will be better.

    For your further information I have submitted the patch to WooCommerce: https://github.com/woothemes/woocommerce/pull/1602

    We shall see if it is merged into core. If not, then I have a already explained how to override the WC template file.

    -edited because I was reading github’s commit history incorrectly. I’m still hopeful that when the Woo Team is back from their Woo Trip, this will make it into version 1.7.

    HelgaTheViking

    (@helgatheviking)

    a heads up that my solution was merged into 1.7beta
    https://github.com/woothemes/woocommerce/pull/1673

    so in the next release you will be able to mark products in the backend as individual/unique and the quantity input will disappear automatically.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WooCommerce – excelling eCommerce] Hide 'plus' and 'minus' symbols for’ is closed to new replies.