jamesgol / woocommerce-cart-stock-reducer

Allow WooCommerce inventory stock to be reduced when adding items to cart
GNU General Public License v2.0
58 stars 19 forks source link

Show timer countdown on catalog page without refresh #84

Open NaturePinks opened 4 years ago

NaturePinks commented 4 years ago

Unless the user refreshes the shop page, the countdown timer does not show. Cart stocks are removed at the end of the timer without prior notice. This may be to do with Ajax carts, it would be a good enhancement to show the timer at the first add to cart click.

jamesgol commented 4 years ago

Yes this is definitely related to AJAX. You can disable the AJAX add to cart in the WooCommerce settings.

NaturePinks commented 4 years ago

Thanks jamesgol. It is catch 22, hard to not have ajax cart and hard to not have the cart stock reducer! I thinks this should be an enhancement if and when possible.

codeagencybe commented 3 years ago

@jamesgol

I have made some changes to your plugin to a timer to the catalog/archive loop. It's not ajaxed based yet, but it does handle the output in a location where this is very useful for certain use cases.

It's not perfect yet, but perhaps you can polish it and add some options to the settings screen to control it seperate or nicer.

How can I contribute my changes to your plugin?

image

codeagencybe commented 3 years ago

@jamesgol

After some more tweaking I got it to this (video recording): Two independant visitor sessions. The only part frustrating is that it only shows the timer after manual page refresh. Even if I disable AJAX, then I still need to manual refresh. Nevertheless, this is already a nice progress to get a timer output in the archive loop.

https://share.codeagency.be/s/LFoNoPqyERCHpqb

Ping me please so we can check how I can contribute this :)

jamesgol commented 3 years ago

You can create a pull request here on GitHub to submit your changes.