News:

Looking for documentation? Take a look on our wiki

Main Menu

Sorting by price is wrong

Started by Ventsi Genchev, May 13, 2019, 19:01:36 PM

Previous topic - Next topic

Ventsi Genchev

VirtueMart 3.4.5 10045

Sorting by price is wrong if there are 2 or more user groups.
When sorting for some products, it takes the price of one group, and for others the price of the other group.

Example:
Product_1: Price Available for All: 174 / Gold level: 160
Product_2: Price Available for All: 179 / Gold level: 165
Product_3: Price Available for All: 193 / Gold level: 170

Sort by price ASC: Product_1; Product_3 ; Product_2 (Price: 174 ; 193 ; 179)

If the user is in a Gold level group, sorting is again like this.
If the Gold level group is removed, the sorting is correct.

Tested with Protostar.

Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Ventsi Genchev

If it can help in finding the problem:

I noticed that if I make the following changes to the Product_3:

In Available for All group data:
Change the group Available for All to Gold level
Change the price from 193 to 170 (The normal price for the Gold group)

And respectively in the Gold level group:
Change the group Gold level to Available for All
Change the price from 170 to 193 (The normal price for the Available for All group)

Save changes and sorting works correctly.
Max, do you have an idea? This problem made me crazy.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Ventsi Genchev

I come to the conclusion that the topic of sorting by price is a taboo. I have written about this bug before, but absolutely no one is involved.
I want to pay special attention to the fact that it is not about the prices of the products according to the groups that are OK, but only for sorting by price and if you have prices for more than one user group.

The fact is that the VirtueMart does not take prices for the respective user group when sorting by price.
At the moment, if you lower the cost of a product for a "Available for All" group, then for the "Gold User" group, products are sorted by "Available for All" group. Which results in incorrect product ordering by price.

Even more:
I noticed that some products are not sorted correctly when they have a reduced price in the "Available for All" group.
Why? Because, for a vague reason, the price of the "Gold User" group is obtained by price sorting.

How did I fix it? On the product page I exchanged:
Group "Available for all" -> dropdown menu -> becomes a "Gold User".
Group "Gold User" -> dropdown menu -> becomes a "Gold User".
I accordingly changed the prices.

And then the sorting is correct. Which means that Virtuemart does not check the current user's group at price sorting, because such a change should not affect at all.
So far so good. But should any product be checked after upload? To test at a reduced price to see if it is sorted correctly? And if it is not, do the above described manipulation.
But if you have more user groups .... then I have no idea.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

AH

QuoteI come to the conclusion that the topic of sorting by price is a taboo.

Nothing is taboo - it is just that this topic might not be at the top of a list of stuff being looked at.

Once the final prices are "known" for display, sort by final-price - the shoppergroup is irrelevant

Regards
A

Joomla 3.10.11
php 8.0

Ventsi Genchev

Yes, and it would be great if the sorting was done at the "known" prices. But not.

Why is not anyone testing?
Reduce the price of a product to 1 euro. For "Available for all" group only.
Sort at a price.
If the product is sorted correctly, surely if you sign in with another account that is included in the "Gold User" group, it will again be the first one, although its price is for example 1000 Euros.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

AH

QuoteWhy is not anyone testing?

They are - I believe that this is due to items with patterns but I will look later on

If the people testing have available time to validate your particular user case, it will be noted.



Regards
A

Joomla 3.10.11
php 8.0