Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Widget Filters by Attribute: Term order #8608

Closed
5 tasks done
cam4rgo opened this issue Sep 30, 2022 · 14 comments
Closed
5 tasks done

Widget Filters by Attribute: Term order #8608

cam4rgo opened this issue Sep 30, 2022 · 14 comments
Labels
block: filter by attribute Issues related to the Filter by Attribute block. type: bug The issue/PR concerns a confirmed bug. type: enhancement The issue is a request for an enhancement.

Comments

@cam4rgo
Copy link

cam4rgo commented Sep 30, 2022

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

Widget filter by attribute does not stay in the correct order of terms.

Hello, I created a topic in the plugin forum and was asked to open a topic here regarding a bug in the Filter By Attribute Widget.

Expected behavior

The bug is the following:
In the settings of the terms the order is like this and it is the way I want it to appear: P, M, G, GG, XG.

Captura de tela 2022-09-23 112100
Captura de tela 2022-09-23 112232

Actual behavior

However, in the Filter By Attribute Widget the order is different, apparently in alphabetical order, as in the image:
kBXx8zO

I noticed that this happens only with the new filter by attribute model, in the legacy widget the order works, but when filtering an item some size options are missing, and in the new one some options are not missing (which is the correct way.)
Captura de tela 2022-09-28 231303

By using the YITH WooCommerce Ajax Product Filter Premium plugin I was able to reorder the terms the correct way, as in the image:
zmB7xd

If you want to take a look at the topic I opened in the forum regarding this bug, here is the link.

I have tested with the Storefront theme, I have disabled the plugins, I have checked the logs, and the problem persists. Other people have also tested and the problem is the same.

Steps to reproduce

  1. Create an attribute with custom sorting.

  2. Put the terms P, M, G, GG, XG.

  3. Products>Attibutes>Configure terms - Place them in the above order in the terms' settings.

  4. Go to the widgets menu. (Appearance>Widgets)

  5. Put the filter by WooCommerce attribute with the created attribute.
    image

  6. See the error.

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2022

We are adding the status: needs reproduction label to this issue to try reproduce it on the current released version of WooCommerce.

Thank you for your patience.

@swatipawarGS
Copy link

Hi @cam4rgo,
Thank you for taking the time to report this bug, we really appreciate your help. We are able to reproduce the issue on our end using the WooCommerce 6.9.4 version, and WordPress 6.0.2 version.

Please find below the screenshots for reference :

#34910(backend)

#34910(frontend)

Priority of this issue will be assigned shortly after we’d go through a round of prioritization. Please note it may take a couple of days.

@clambug
Copy link

clambug commented Dec 6, 2022

Hi, facing exact same issue, has this been addressed yet?

@cam4rgo
Copy link
Author

cam4rgo commented Dec 11, 2022

@clambug Not yet. I'm waiting for that as well.

@Stefan-Ioan
Copy link

any news?

@Stefan-Ioan
Copy link

Stefan-Ioan commented Dec 13, 2022

@clambug Not yet. I'm waiting for that as well.

i find an workaround,
since is alphabetical sort u can add   in front of the name

ex for ur issue:
   P
 M
G
GG
XG

if u want to remove   from front page u can use jquery

jQuery(".wp-block-woocommerce-attribute-filter span").html(function (i, html) {
return html.replace(/ /g, '');
});

another workaround is with letter and css
ex:

aP
bM
cG
dGG
eXG

and css

.wc-block-components-checkbox__label:first-letter {
font-size: 0;
}

@cam4rgo
Copy link
Author

cam4rgo commented Dec 15, 2022

@swatipawarGS Any news on the prioritization of the problem?

@lsinger lsinger added the type: bug The issue/PR concerns a confirmed bug. label Feb 21, 2023
@github-actions
Copy link
Contributor

Hi @cam4rgo,

Thank you for opening the issue! It requires further feedback from the WooCommerce Core team.

We are adding the needs developer feedback label to this issue so that the Core team could take a look.

Please note it may take a few days for them to get to this issue. Thank you for your patience.

@peterfabian peterfabian transferred this issue from woocommerce/woocommerce Mar 2, 2023
@peterfabian
Copy link

Thanks for letting us know about the issue. I've transferred the issue to the Blocks repository since the old widget works, but the Block widget displays the wrong order, I assume the issue comes from the Block.

@kmanijak kmanijak added block: filter by attribute Issues related to the Filter by Attribute block. type: enhancement The issue is a request for an enhancement. labels Mar 15, 2023
@kmanijak
Copy link
Contributor

Hi, thanks for taking the time and letting us know about the issue! 🙌

I can reproduce it, however, at this moment Filter by Attribute block supports only the alphabetical ordering of attributes. But I agree that's a good idea for an enhancement!

Please bear in mind, we have limited time to work on various projects and at this moment this issue doesn’t fit in with our current priorities for the project. At some point, we may revisit our priorities and look through the list of suggestions like this one to see if it warrants a second look. Meanwhile, don’t be alarmed if you don’t see any activity on this issue for a while. 🙏


Technical notes:

@cam4rgo
Copy link
Author

cam4rgo commented Mar 15, 2023

@kmanijak This worked before Blocks, so I believe it is more a bug than an improvement. In Brazil at least, this bug affects a lot of online stores that use WooCommerce. If you can review the priority of the problem, it would be interesting.

Sorry for any grammatical errors, I'm using a translator to write.

@kmanijak
Copy link
Contributor

Sorry for any grammatical errors, I'm using a translator to write.

First of all - no need to apologize, it's all good! 👍

This worked before Blocks, so I believe it is more a bug than an improvement.

I totally understand that perspective and we'd love to be able to make a full replacement of every feature existing in the block's equivalents. However, we work in an iterative approach and we try to release blocks as quickly as they are functional and can bring value to the users. But that doesn't mean they will cover 100% of previous functionalities straight away. Then we're iteratively adding other features and functionalities.

However, we keep in mind some of the missing features may be more demanded by the community and issues like this one help us prioritize the work, so thank you for your input, especially since there are more voices in this thread!


Last but not least, I'd like to encourage the contribution. It's not an easy task to achieve for sure, but even a draft contribution may be a good trigger for further conversations 🙌

@DanielDM325
Copy link

Is there any progress regarding this problem? I'm suffering from it too.

@dinhtungdu
Copy link
Member

Hey there, we fixed this issue in #11232 so I'm closing this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: filter by attribute Issues related to the Filter by Attribute block. type: bug The issue/PR concerns a confirmed bug. type: enhancement The issue is a request for an enhancement.
Projects
None yet
Development

No branches or pull requests

10 participants