Developer forum

Forum » Ecommerce - Standard features » Sort by Price behavior in Rapido

Sort by Price behavior in Rapido

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a project that is based on Rapido 3.x. and I have inconsistent behavior of the Sort by Price functionality.

I get results like this:

 

Or like this:

The sorting loginc is the default one from Rapido, using this Querystring: /produse?SortBy=Price&SortOrder=ASC&pagesize=96

Some of my products have default Variants some are stand-alone products.

How do I make it work correctly?

Thank you,
Adrian


Replies

 
Nicolai Pedersen
Reply

Sortby price is using the default price field on the ecomproduct table. So whatever value is in that fields, is what is used. If prices are later calculated, personal, chaned from price matrix etc, sorting will be off.

The index also has other price fields in a combination of country and currency to control i.e. vat.

So you can change to use one of those price fields:

Also see this post: https://doc.dynamicweb.com/forum/ecommerce-standard-features/ecommerce-standard-features/guidance-on-a-price-filter-with-prices-in-the-pricematrix

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have investigated further and it seems that the inconsistency may be caused by the DefaultVariantComboID approach.
For products with a single variant, the price of the master product is changed in the back-end and in the front-end to the value of the variant (the first one in this case).

For products with more than one Variant, even if I select a Default Variant, the price of the MasterProducts is not updated.

Can somebody confirm my findings and maybe suggest a solution?

Thank you,
Adrian

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the response.

I have figured it out that the sorting will always be based on the Default price.

What I was wondering is how the system will/should behave when you set a Default variant on a product and set it to be displayed in the list instead of the master product.

The Product list will clearly display the variant but the sorting will still be based on the Master product price instead of the Default Variant price.

Maybe the value of the Price in the index should take into consideration this configuration. Or create another price field that would expose "Master or default variant price".

In my case, we've created a scheduled task that updates the value of the price on the master product but it does not feel right.

Thank you,
Adrian

 
Nicolai Pedersen
Reply
This post has been marked as an answer

No. There is a one to one of the data in the index and the database.

Instead of using that checkbox, you should change your query to return the default variant instead of the master. You mave fields that indicates if a produict is master, is variant, is master and has variant, and if a product is the first variant in a group - i.e. the first green (out of i.e. 3 green in sizes S, M and L).

BR Nicolai

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

I understand. That sounds like a good option.

I will try to set the query to list a mix of Master products (those without variants) and products with default Variant.

Thank you,

Adrian

 

You must be logged in to post in the forum