WAIT: Problem with radio filter with WooCommerce source

Browser: Chrome 110
OS: Windows

Hello,

I have a query loop with the following settings that displays out of stock products at the end of the product list. The problem is that when I enable a radio filter with a WooCommerce source (like showing the cheapest products), the Outofstock products are no longer displayed at the bottom of the list. Is there any way to prevent this problem?

Best regards

Hey @Victor1999,

with what settings? :smiley:

Ideally, you can copy-paste the query loop element, so I can use it directly. :victory_hand:

Best regards,
Matej

Hi @Matej,

{"content":[{"id":"tmqycd","name":"section","parent":0,"children":["dhjpcw"],"settings":[]},{"id":"dhjpcw","name":"container","parent":"tmqycd","children":["aabxtc","xdmlho"],"settings":{"_rowGap":"20"}},{"id":"xdmlho","name":"block","parent":"dhjpcw","children":["oenrlx"],"settings":{"_display":"grid","_gridTemplateColumns":"1fr 1fr 1fr 1fr","_gridGap":"20"},"label":"Grid"},{"id":"oenrlx","name":"block","parent":"xdmlho","children":["uzqdqk","cukcns","cyynfa","axrezx"],"settings":{"hasLoop":true,"query":{"post_type":["product"],"orderby":["meta_value","date"],"meta_key":"_stock_status","order":["asc","desc"]},"_rowGap":"10"},"label":"Loop"},{"id":"uzqdqk","name":"image","parent":"oenrlx","children":[],"settings":{"image":{"useDynamicData":"{featured_image}","size":"large"}},"themeStyles":[]},{"id":"cukcns","name":"heading","parent":"oenrlx","children":[],"settings":{"text":"{post_title}"}},{"id":"cyynfa","name":"product-price","parent":"oenrlx","children":[],"settings":{"_conditions":[[{"id":"kmrkri","key":"woo_product_stock_status","compare":"==","value":"instock"}]]}},{"id":"axrezx","name":"button","parent":"oenrlx","children":[],"settings":{"text":"Out of stock","style":"primary","_background":{"color":{"hex":"#db0000"}},"_typography":{"color":{"hex":"#ffffff"}},"_padding":{"left":"10","right":"10"},"_conditions":[[{"id":"jxcxbc","key":"woo_product_stock_status","compare":"==","value":"outofstock"}]]}},{"id":"aabxtc","name":"filter-radio","parent":"dhjpcw","children":[],"settings":{"filterQueryId":"oenrlx","filterAction":"sort","sortOptions":[{"id":"fdsehi","optionLabel":"Low price","optionSource":"wcPrice"},{"id":"rosvkx","optionLabel":"High price","optionSource":"wcPrice","optionOrder":"DESC"},{"id":"fepkmc","optionLabel":"Top sales","optionSource":"meta_value_num","optionMetaKey":"total_sales","optionOrder":"DESC"},{"id":"zcqchm","optionLabel":"Newest","optionSource":"date","optionOrder":"DESC"}],"displayMode":"button","buttonBackgroundColor":{"hex":"#e0e0e0","id":"3ec65e","name":"Color #2"},"buttonActiveBackgroundColor":{"hex":"#212121","id":"8c8327","name":"Color #6"},"buttonActiveTypography":{"color":{"hex":"#f5f5f5","id":"d8614a","name":"Color #1"}}}}],"source":"bricksCopiedElements","sourceUrl":"https://try.bricksbuilder.io/t4ccb117","version":"2.1.4"}

By default, out of stock products are at the bottom of the list. However, after you enable the sort filter, this rule is ignored. It makes sense to follow this rule because, for example, when customers sort products by price, they want to see the prices of products that are available for purchase.

Hey @Victor1999,

I’ve moved this to the Feature Requests / Improvements category, because this is not a bug. Once you filter, then filters will change.
To achieve this, we would need to persist that one, but that’s not currently possible. I guess we would need some way to set which parameter should not change when filtering.

As for now, I’ll leave it here and wait for user ideas.

Best regards,
Matej