• Resolved SKReimund

    (@skreimund)


    Hello James,

    I have installed your plugin and everything seems to be in order, except one little thing, and I was wondering if you can help me out a little.

    After I add the item to cart, my problem is that the stock for that item doesn’t “drop”. I have a stock availability thingie installed that shows under the product how many variables are still available for that product, and what I’m looking for, is for there incredibly awesome plugin to reduce the stock, and for example instead of 100 items left, while a product is in a cart (for the set duration – example 5 minutes-), to say 99 items left.

    The website I’m trying this on is https://www.thewinnitgame.com

    Can you please take a look and tell me what might be wrong?

    Thank you,
    SKReimund

    https://www.ads-software.com/plugins/woocommerce-cart-stock-reducer/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter SKReimund

    (@skreimund)

    P.S.

    I know the plugin itself isn’t meant to reduce the actual stock, but could it do that? And re-add it if the checkout is not complete?

    Thank you.

    Thread Starter SKReimund

    (@skreimund)

    P.P.S.

    I am quite slow today, I apologise. Your plugin works perfectly, I was looking at it from the wrong angle. On a more appropriate note, could you please tell me what code should I use in order for another line of text under “Items left” titled “Pending orders”: next to which it should specify how many items are currently pending? Could I do that with the appropriate coding? (don’t know how exactly you named and coded each aspect of what your plugin does and it would be quite difficult for me to know the variables by myself).

    Thank you, and sorry for changing the quetsion.

    Plugin Author James Golovich

    (@jamesgol)

    Glad you were able to figure it out.

    There is a function (quantity_in_carts)to return the number of items in a cart, though it was never really planned on being accessible to the end user.

    I suspect the easiest way would be to add code to create a shortcode that returns that information. If you end up doing this, please submit a pull request and I can integrate it in a future version.

    Thread Starter SKReimund

    (@skreimund)

    Well I am going to start looking into how to integrate it, and if I manage to do it I will post it. If you have any ideas, feel free to share with me, we might reach a nice end result.

    Thank you.

    Thread Starter SKReimund

    (@skreimund)

    add_action( ‘woocommerce_after_shop_loop_item_title’, ‘quantity_in_carts’, 15);
    function quantity_in_carts() {
    global $product;
    echo “Numbers pending: “.$product->quantity_in_carts;
    }

    it does not do anything sadly, because:
    1.I need the first function (basic one would be my_stock for a normal stock display), and at the end, after $product, i would need what would be the equivalent of total_stock, but the funciton that will display actualy quantity_in_carts

    any thoughts?

    EDIT:I have tried multiple variations from which I found in your .php on the plugin, including only $in_carts, $stock, etc. the base codeline should be that which I have just gave you, but the functions, aswell as $product might need to differ.

    Let me know what you find out.

    Plugin Author James Golovich

    (@jamesgol)

    I just added code to the github repository to add the count of items pending in carts. After further testing I will release a new version here.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Stock reduce – not quite’ is closed to new replies.