Closed jrmain closed 1 year ago
Hi @jrmain thanks for posting this. I've moved this issue to the WooCommerce Blocks repository.
Thanks for opening this issue, @jrmain! I'm able to reproduce, other filter blocks are affected as well. Ie, I tried inserting these blocks in a post:
<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"width":"33.33%"} -->
<div class="wp-block-column" style="flex-basis:33.33%"><!-- wp:woocommerce/price-filter -->
<div class="wp-block-woocommerce-price-filter is-loading" data-showinputfields="true" data-showfilterbutton="false" data-heading="Filter by price" data-heading-level="3"><span aria-hidden="true" class="wc-block-product-categories__placeholder"></span></div>
<!-- /wp:woocommerce/price-filter -->
<!-- wp:woocommerce/attribute-filter {"attributeId":1,"displayStyle":"dropdown","heading":"Filter by Color"} -->
<div class="wp-block-woocommerce-attribute-filter is-loading" data-attribute-id="1" data-show-counts="true" data-query-type="or" data-heading="Filter by Color" data-heading-level="3" data-display-style="dropdown"><span aria-hidden="true" class="wc-block-product-attribute-filter__placeholder"></span></div>
<!-- /wp:woocommerce/attribute-filter -->
<!-- wp:woocommerce/attribute-filter {"attributeId":2,"heading":"Filter by Size"} -->
<div class="wp-block-woocommerce-attribute-filter is-loading" data-attribute-id="2" data-show-counts="true" data-query-type="or" data-heading="Filter by Size" data-heading-level="3"><span aria-hidden="true" class="wc-block-product-attribute-filter__placeholder"></span></div>
<!-- /wp:woocommerce/attribute-filter -->
<!-- wp:woocommerce/active-filters -->
<div class="wp-block-woocommerce-active-filters is-loading" data-display-style="list" data-heading="Active filters" data-heading-level="3"><span aria-hidden="true" class="wc-block-active-product-filters__placeholder"></span></div>
<!-- /wp:woocommerce/active-filters --></div>
<!-- /wp:column -->
<!-- wp:column {"width":"66.66%"} -->
<div class="wp-block-column" style="flex-basis:66.66%"><!-- wp:woocommerce/all-products {"columns":3,"rows":3,"alignButtons":false,"contentVisibility":{"orderBy":true},"orderby":"date","layoutConfig":[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]]} -->
<div class="wp-block-woocommerce-all-products wc-block-all-products" data-attributes="{"alignButtons":false,"columns":3,"contentVisibility":{"orderBy":true},"isPreview":false,"layoutConfig":[["woocommerce/product-image"],["woocommerce/product-title"],["woocommerce/product-price"],["woocommerce/product-rating"],["woocommerce/product-button"]],"orderby":"date","rows":3}"></div>
<!-- /wp:woocommerce/all-products --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->
Filter blocks are visible in WC Blocks 10.2.1 but not in WC Blocks 10.2.2. This issue might be related to #9870.
Hi again, @jrmain. We are working on deploying a fix for this bug (you can follow the progress in https://github.com/woocommerce/woocommerce-blocks/pull/9954). In the meanwhile, and in order to fix it in your store, you can remove and add the Filter Products by Stock block again. This will add an updated version that renders properly.
And thanks again for reporting this issue, reports like this are super valuable in order to improve WooCommerce.
in order to fix it in your store, you can remove and add the Filter Products by Stock block again. This will add an updated version that renders properly.
That won't work for the site in question, because we're using the classic editor and classic widgets. As reported, the Stock Status filter was added as a Block widget in the classic widget editor. I did try removing and re-adding the Block widget, but alas it didn't help.
As to why we're not using the block editor and block widgets, they just seem to have too many issues. The classic editors are much more straightforward and, in my opinion, easier to use.
Given that the fix proposed here didn't work for us, are you sure that the change in #9954 will?
I can't speak with 100% certainty for your specific store, but I expect that the fix will work. I did test adding the Filter Products by Stock block via a Classic Widget and the fix worked as expected.
If you want to test it by yourself, there is a testing ZIP attached to the PR: https://github.com/woocommerce/woocommerce-blocks/pull/9954#issuecomment-1602445878. But it's a ZIP for testing purposes, so please don't use it in a production site. :pray:
~If getting the fix is really urgent, I would suggest installing the WC Blocks plugin, as the fix will be available there faster than in WC core.~ Update: it might be released in WC core first.
Hope that heps! :slightly_smiling_face:
I can confirm that WooCommerce 7.8.1 fixes this problem.
Awesome, thanks for confirming, @jrmain!
Prerequisites
Describe the bug
After upgrading WooCommerce from version 7.7.2 to version 7.8.0, WooCommerce 'Filter Products by Stock' in Block widget stopped working.
Nothing appears at all where previously 'In stock' and 'Out of stock' checkboxes appeared.
It was working perfectly before the update to 7.8.0. Switching to one of the canned themes didn't help. Disabling all but the WooCommerce plugin didn't help. Tried updating to 7.8.0 on a development site and the same thing happened. Reverted to WooCommerce 7.7.2 and 'Filter Products by Stock' reappeared.
Expected behavior
The 'Filter Products by Stock' filter should appear in the WooCommerce sidebar.
Actual behavior
The 'Filter Products by Stock' filter DOES NOT appear in the WooCommerce sidebar.
Steps to reproduce