Skip Navigation

[Resolved] Reorder product display on the unfiltered archive start pages

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 10 replies, has 2 voices.

Last updated by timv-3 4 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1661835

I filled my clients product database with their individual products and made an archive page that displays the first 12 products on the start page. I also added a filter section at the top.
Now if no filters are used (start) he wants to show the first 12 products in a specific order (different from what is showing now).

How can that be done?

#1662935

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please share information - In what order you want to display those 12 products when the page is loaded?

#1664345

My client wants the below products (in the order top to bottom) on the first page of this archive page
(hidden link)

CC240T
Scigrip SG300
DecCoat 2W
Scigrip SG5000
Net-CC200T-TP2
CC240 3D Style
CC101BX -45/45
AA170T
CC204BX -45/45
CC304UD
CC282P CF
CC404BX -45/45

Is this something i can do without coding?

Another issue is that my client wants the display of the search part less dominant on the top of the page. Is it possible to hide the search part behind a fold out kind of thing or move it to the left side bar (they want to products more dominant on the top of the page)

Thx for your fine help again

Gr, Peter

#1664349

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

To add such manual order, you should add a custom field that holds the order of the product and later we can use that custom field for your product ordering.

So, basically, you should add a new custom field and add it to any of your custom field group "Default order" and assign this custom field your required order. And later using hook we can set the order by this custom field.

Does that makes sense?

Regarding your additional query, I will create split ticket but lets resolve your original issue that you reported with this ticket first.

#1666017
Toolset custom fields.png

Hi Minesh,

You mean add a numeric custom field in the present "veldgroep voor producten" or a complete new "add custom field"?
In this numeric custom field give each sgl product a number (1 for the first product to show etc..)?
If so then give only the first 12 products a order number and the rest not (so they will be published randomly as present)?

#1666029

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

That is up to you, if you want to create a new custom field group that holds the numeric custom field that holds the order value or you want to add the new custom field to your existing custom field group.

In this numeric custom field give each sgl product a number (1 for the first product to show etc..)?
==>
Yes.

If so then give only the first 12 products a order number and the rest not (so they will be published randomly as present)?
==>
We will use the view's hook "wpv_filter_query" and add the orderby argument on fly using the custom field. So, it will display the products where you assigned the order.
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query

#1669425
Query filter.png

I made a custom field - products view order number - in my field group for products
After that i numbered the 12 most important of the 30 products

Now i think i can choose a query filter in the archive page view and choose the above custom field in the query list (see screenshot)

Am i right that this put these 12 numbered products on the first archive page view and the unnumbered randomly on the next pages?

#1669507

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I made a custom field - products view order number - in my field group for products
After that i numbered the 12 most important of the 30 products

Now i think i can choose a query filter in the archive page view and choose the above custom field in the query list (see screenshot)
==>
No, you should sort the product by your custom field from the ordering section and set number like 9999 to the remaining products you want to display at last.

#1670485

So better to number all products.
Is my assumption of using the query filter as mentioned above (screenshot) the proper way?
Looks quite simple if that is all or am i thinking to simple?

#1671963

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Is my assumption of using the query filter as mentioned above (screenshot) the proper way?
==>
No, as I already inform you in my previous reply that you should not use the "Query Filter" but you will require to use the "Ordering Settings" Section of your block view.

"Query Filter" section is used to add the query filers when you want to display the filtered posts.

In your case, you want to sort the results and for sorting, you need to go to "Ordering Settings" section and add the sorting custom field you created that holds the sort order.

You can see the "Ordering Settings" section above the "Query Filter" section as you can see with the screenshot you shared:
=> https://toolset.com/wp-content/uploads/2020/06/1669425-Query_filter.png

#1678745

My issue is resolved now. Thank you!