-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working with variable products #59
Comments
Without knowing exactly how you have the items setup and plugin configured it's tough to know if you have it setup incorrectly. If you can provide some screen shots of the item setup and plugin configuration it would be a good start. |
Edit product ‹ Lake George Association — WordPress.pdf Hope these are helpful. It's a pretty simple setup. Just 1 product (a ticket) with 3 different variations in pricing (senior, adult, child). Everything else seems to be working with the plugin - countdown, etc. Just doesn't reduce the amount of stock listed above the button. |
It is set up as a virtual product if that makes any difference. |
It looks like you don't have 'Manage Stock' checked |
I have it checked on the product but not on the variations. I have 30 tickets to sell total, and they can be any combination of senior, adult, or child tickets. |
Ok that type of setup has definitely worked in the past. Do you have any sort of caching enabled? |
I think so, we have something called Comet Cache Pro in the menu. I didn't set up that portion of the site. I have to go pick up my kiddo from school but will be back in the office in the morning and possibly we can continue this thread then. |
I've never used that particular cache plugin but that is likely the source of the problem. I have plans to make this plugin slightly more cache friendly, but I'm not sure when that will fit in my schedule. It appears you can add a page URI to the cache exclusion list to ensure it will not be cached. |
I'll try that in the morning and will let you know. |
Ok - so I tried that, and that didn't fix the issue. |
You might need to clear your plugins cache and try again. A lot of the time those plugins work by saving a raw HTML file somewhere and then the webserver will check if the file exists to save the load of PHP actually running on the file. By accessing your file I can see it is still serving the cached version.
|
Unfortunately - still not working. I've cleared the Comet Cache Pro cache, cleared my browser cache, cleared the cache for the specific page ... |
It looks like you at least have comet cache not caching that page now, which is good.
I have not had a chance to test the lastest WooCommerce (3.4) which you appear to be using. Though I did not see anything in their release notes that seemed related. Let me duplicate your setup locally and see if I can reproduce the issue. Do you have any other WooCommerce related plugins installed? |
I'm using WooCommerce with WooCommerce Square and WooCommerce Table Rate Shipping - nothing else. |
I did just test it on other products (not variable, just simple products), and it worked perfectly. |
Sorry about this. I can confirm it's not working. Let me troubleshoot and see if this is due to a recent WooCommerce change or maybe it is something I have already fixed in the development version that has not been released yet. |
Not a problem! Thank you for all of your help, and patience! I'm golden if we can get this working, so I'm so grateful for your assistance! |
It does look like this is an issue I fixed in the dev version. If you would like to test it out you can download a zip from this GitHub repo. https://github.com/jamesgol/woocommerce-cart-stock-reducer/archive/master.zip I've been planning on releasing a new version soon for a while now but I have not been able to find the time to do the testing of all the possible setups yet. |
I'll give this one a shot and let you know. |
That worked!!! |
I'm going to go with it since it is far better than where I started from. But one fix for the future - the countdown isn't cumulative. So in my instance, I have Senior, Adult, and Child tickets. I have 30 available. If I add 2 senior tickets, the stock shown goes down to 28 (yay!). Then I add 3 Adult tickets, but the stock shown only goes down to 27 (as it seems to only be reading the last entry, not the cart total). Just an FYI. |
I can't reproduce that behavior on my test setup that I built just like yours. |
Hmm ... definitely not happening on mine like that. Also, it seems if I leave it sitting long enough, it takes all of my inventory out of stock and says that it is sold out (including on the back end). I added maybe 7 or 8 of the tickets to my cart and just left it, and going back in about 30 minutes later, it now has wiped out my entire stock. |
I see that on your site, also your cart isn't working so I can't go and remove items after adding them. |
My cart page was private because we hadn't made most of this live yet while testing. I've made it love now. |
Can you look at the WooCommerce status page wp-admin/admin.php?page=wc-status and see if it says there is 'External object cache:' enabled? |
I do not see that anywhere on that page. I also searched the page for "external" and nothing comes up. |
That's weird, on my almost completely default setup it shows that even if not enabled. It is inside the "WordPress environment" box. What theme are you using? |
It's a custom theme built by our developers |
Is it based on another theme as a child theme? I'm trying to think of any possible reasons your site is not behaving like a stock site. The object caching seems rather likely. |
It does not appear to be a child of another theme. When I go to Appearance, Themes, it just says the active theme is "lga" |
I'm going to install the free version of comet cache on my testbed to see if it helps me reproduce the behavior. I'm not sure if there are any differences between the pro vs free version that would cause any issues. |
Knock on wood, but it seems to be leaving my stock totals alone now (on the back end) - I've added several tickets and let them expire, and I know that you were adding some too, and my stock hasn't changed. Still not resolved is the displayed stock total after adding a ticket type... |
With the lite version of comet cache I can't reproduce the problem either. Looking at what they say the pro version provides I don't see anything that sounds like it would cause this problem. I did just add a commit to the development version to try to keep pages with dynamic quantities from being cached. I don't know if that will help here or not, it will definitely keep the dynamic html from being cached but I don't know if it will keep a PHP object cache in line. |
Alright - well our website just crashed (of course), so I'm stuck for now. |
I'm wondering why this doesn't seem to work with my variable products? It looked like you had added functionality for that, but it's not removing the stock on the page when I add an item to the cart (where it says 10 in stock right above the Add to Cart button). Am I setting it up incorrectly?
The text was updated successfully, but these errors were encountered: