Title: z00zer's Replies | WordPress.org

---

# z00zer

  [  ](https://wordpress.org/support/users/z00zer/)

 *   [Profile](https://wordpress.org/support/users/z00zer/)
 *   [Topics Started](https://wordpress.org/support/users/z00zer/topics/)
 *   [Replies Created](https://wordpress.org/support/users/z00zer/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/z00zer/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/z00zer/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/z00zer/engagements/)
 *   [Favorites](https://wordpress.org/support/users/z00zer/favorites/)

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434735)
 * Works nicely. Hope it gets added to WooCommerce 🙂
    (or some variation of this)
 *     ```
       add_filter('woocommerce_admin_stock_html', 'admin_product',10,2);
           function admin_product($stock_html,$product) {
                   if( $product->is_type( 'variable' ) ) {
                       $stock_html = $product->get_stock_quantity() . '<br>'  . '<mark class="instock">'. __('In stock', 'woocommerce' ) . '</mark>';
                   }
           return $stock_html;
       }
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434717)
 * Ok, thank you very much!
 * I’ll download 2.6 for my test server and test it out.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434706)
 * Yeah, I think admin products page gets the stock from simple product’s stock 
   request or something.
 * **woocommerce_get_stock_quantity -filter** is used in the admin page stock display.
   I can filter through my function to echo out the product’s quantity (the data
   is only int) and it will echo main product’s stock but it will still show the
   total stock quantity of main product and variation’s, because the way it’s coded.
   
   Weird, I thought it would echo the total amount, not just main product…
 * > [View post on imgur.com](https://imgur.com/8oE62rR)
 * ‘
    add_filter(‘woocommerce_get_stock_quantity’, ‘testings’,10,1); function testings(
   $product){ if(is_admin()){ echo “<b><font color=’#7ad03a’>Main product in stock:
   </font></b>”; echo $product; echo “<hr>”; } return $product; } ‘
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434676)
 * Is it possible that admin products page gets that information from some different
   way than using woocommerce_get_availability filter?
 * I tested it and it works in shop’s product page but not in admin page? The returning
   array has key availability => “QTY in stock” and in product page it is in form
   of “In stock x QTY”
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434658)
 * Well, customer only sees variations and their stock quantity – they’ll never 
   see main product’s quantity. Only place where user sees “wrong” stock quantity
   now is admin products page so basically admin is just the problem.
 * Wrapping it around is_admin() is very simply way, no idea why I didn’t thing 
   of that. Let see what I do (prolly crash the server few times…) 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434624)
 * Yeah that I was thinking about that. But adding filter to that would affect globally
   variation/product availability stock quantity, not just admin products page…?
 * There is no way to narrow my custom filter/function just to work in one page’s
   call?
 * Hope you understand what I mean 😉
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434619)
 * Yes I could add new field for the variation as “variation stock”, and take variation
   stock management off, so it doesn’t affect admin products page’s stock quantity,
   but I am assuming it will cause more problems when adding products to cart and
   in checkout page etc…?
 * Adding products to cart, alerts about trying to add more than there is stock,
   stock qty management after checkout etc. are working nicely with having variation’s
   stock management turned on.
 * _offtopic :
    (Expect that I need to find the best way to dynamically check/adjust
   stock so user can’t add more variations to cart than there are main product’s
   stock. User could buy 30x variation A (10) and 1x variation B (20), total of 
   320, when main product’s stock is 300)
 * I’ll check can I achieve this with that woocommerce_get_availability filter, 
   it is used by class-wc-product-variation.php and abstract-wc-product.php
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Admin Products page – Stock quantity](https://wordpress.org/support/topic/admin-products-page-stock-quantity/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/admin-products-page-stock-quantity/#post-7434613)
 * Thanks for fast reply! 🙂
 * Yes, 330 is correct total (main product + variations stock) but I made a plugin_(
   which we talked two weeks ago)_ adds option for product’s variation to reduce
   main product’s stock amount by certain value.
 * Also I manage variation’s stock amount by given them values based on this value.(
   Example. main product 300, variation A value 10, so variation A stock is 30) 
   so everything works beautifully in product’s page in the shop. Taking variation’s
   stock management off would cause other problems…
 * Because of this, I would need to have just main product’s stock showing on the
   products page.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Reduce main product stock with variation's amount](https://wordpress.org/support/topic/reduce-main-product-stock-with-variations-amount/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [10 years ago](https://wordpress.org/support/topic/reduce-main-product-stock-with-variations-amount/#post-7369849)
 * Yeah, but really would have loved some other option than coding plugin 🙂 Hope
   in some day this “feature” will find in to WooCommerce as default, because it’s
   like very common stuff in other ecommerces to have this kind of setup…
 * Thanks for the answer.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Reduce main product stock with variation's amount](https://wordpress.org/support/topic/reduce-main-product-stock-with-variations-amount/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [10 years ago](https://wordpress.org/support/topic/reduce-main-product-stock-with-variations-amount/#post-7369827)
 * Would it be hard to add feature in to product variation’s options “[ ] amount
   of stock removed when bought. Default 1.” ?
 * I’m thinking about stabbing abstract-wc-order.php reduce_order_stock to reduce
   stock according to the variation’s name/details, but user could buy 50, while
   real stock is 1, so should get that going on product page… fun times 🙂
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WooCommerce] Reduce main product stock with variation's amount](https://wordpress.org/support/topic/reduce-main-product-stock-with-variations-amount/)
 *  Thread Starter [z00zer](https://wordpress.org/support/users/z00zer/)
 * (@z00zer)
 * [10 years ago](https://wordpress.org/support/topic/reduce-main-product-stock-with-variations-amount/#post-7369825)
 * I tested “VarkTech Pricing Deals for WooCommerce”-plugin and it looked promising
   but didn’t do what I wanted. Yes it could make that kind of deals (one for 1€,
   5 for 4€ etc.) but it doesn’t show it in the product page, only in cart.
 * It might work with having product quantity field as dropdown menu (with pre determined
   quantity) but the price should update and show according to the selected value,
   or something 🙂

Viewing 11 replies - 1 through 11 (of 11 total)