Skip to content
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

Add out of stock class to radio buttons #22

Open
Garconis opened this issue Jan 23, 2017 · 8 comments
Open

Add out of stock class to radio buttons #22

Garconis opened this issue Jan 23, 2017 · 8 comments

Comments

@Garconis
Copy link

It seems hit or miss, but even with "Hide out of stock items from the catalog" checked, the "out of stock" variations still do not show. They are supposed to show, but as "disabled". However, this is not the case. They seem to work rarely, but most of the time they aren't showing at all.

Can you simply do this via a CSS class instead? It would be ideal to have all variations always show... but add a "disabled" class to each variation div, so that we can more easily control styling and/or visibility ourselves.

@Mantish
Copy link
Member

Mantish commented Jan 24, 2017

Do you have a link where to check this? I haven't been able to reproduce this problem

@Garconis
Copy link
Author

http://freshyjon.wpengine.com/product/product-name/

Size 2 and 10 are out of stock... but not showing.

@Mantish
Copy link
Member

Mantish commented Jan 25, 2017

Are you sure you have a variation for those sizes and those variations are enabled?
what happens when you disable the plugin? do you get those sizes in the select dropdown?

@Garconis
Copy link
Author

Yes, I have variations set up correctly. Here is the variations for the item:

Here is the WooCommerce setting enabled, that is necessary to show them as "disabled": https://gyazo.com/a2b7c5ee2c340c2d5cc7bcca1856ceb6

When I deactivate the plugin, those sizes do NOT show in the dropdown ... but I assume that's because I have it toggled for them to "Hide out of stock items from the catalog".

@Mantish
Copy link
Member

Mantish commented Jan 26, 2017

I wasn't able to reproduce this.
What versions of wp and wc are you using?
Also can you try deactivating all others plugins to discard any conflicts?

@Garconis
Copy link
Author

I'm using the latest versions of everything.

I also deactivated all other plugins (only WooCommerce and your plugin were activated). And I activated the 2017 theme. The problem was still there. The "out of stock" products did not show:

https://gyazo.com/5bafb0318ad593fbf30f9f369a7b1b6e

Regardless... if you are not experiencing this on your end... it may be a server/PHP/cache issue? I just toggled the "Hide out of stock items from the catalog" again and cleared my server cache (I use WPEngine). And it works again. http://freshyjon.wpengine.com/product/product-name/

But as mentioned originally, it seems hit-or-miss. Sometimes it works, sometimes it doesn't.

Either way, if you were able to add a "disabled" class to the div, I could then uncheck "Hide out of stock items from the catalog"... and then style the "disabled" radio button accordingly. However, at this time, there is no specific class to distinguish between disabled and in-stock options (when "Hide out of stock items from the catalog" is unchecked). https://gyazo.com/b5f7f68c5f5788121b0f4a8d18548244

@Mantish
Copy link
Member

Mantish commented Jan 27, 2017

From what you describe, the problem seems to be related with the cache of your site.
However it could be useful to add the class that you mention. Would you be able to implement it and submit a pull request?

@Mantish Mantish changed the title Disabled appearance not working Add out of stock class to radio buttons Jan 27, 2017
@Garconis
Copy link
Author

Unfortunately I'm not yet familiar enough with PHP to be able to implement such a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants