Forums › Forums › Search & Filter Pro › Wrong attribute order
Tagged: attribute order, woocommerce
- This topic has 3 replies, 2 voices, and was last updated 4 years, 1 month ago by Trevor.
-
Anonymous(Private) November 26, 2020 at 1:25 am #267873
Hi
https://www.thejar.sitiosatumedida.com/menu/?_sft_pa_porcion=1kg,porcion
In Attirbute “Elige tu Porción”
I would like the order to be:
1. 250g
2. 500g
3. 1kg
4. PorciónI’ve tried to order it in Product Attributes and re-do the cache but it didn’t work
Please let me know what I should do.Thanks!
Trevor(Private) November 26, 2020 at 10:09 am #267895There is not an easy way to do this. You would need use this filter in some code that you would insert in your child theme functions.php file:
https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments
As there are only four values, the easiest code would be to create a new array for that field and return that array to the form. This forum search should yield some code snippets:
https://support.searchandfilter.com/forums/search/function+sf_edit_query_args/
Anonymous(Private) November 26, 2020 at 2:45 pm #267946Hi
I think I wasn’t clear enough in my request.
As you can see on this video:
https://www.loom.com/share/798d2c5f6206480e9c057de8f8c2b305
I have a “Elige tu Porción” filter that already has those four terms (it’s a woocommerce product attribute called “porcion”).
However, they are showing up in the incorrect order. I’ve tried ordering them inside the Terms view on Woocommerce Attribute page but that didn’t work.Thanks!
Trevor(Private) November 27, 2020 at 9:15 am #268016I did understand what you asked, and, with a taxonomy (an attribute is a taxonomy), it is not possible to alter the order as you want, and our plugin does not order according to the order on the page you showed.
The only way to order them is to use PHP as I said.
IF this was a Custom Field instead (such as can be made with Advanced Custom Fields), then in our Form UI the field object would be a Post Meta, and in the definitions for that you can manually drag and drop the order.
-
AuthorPosts