VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: sandomatyas on March 23, 2020, 13:11:56 PM

Title: Product sort order when Show products of subcategories is enabled
Post by: sandomatyas on March 23, 2020, 13:11:56 PM
There is a shop where the categories and the products also use manual sort order. It works well until I enable 'Show products of subcategories' and open a parent category.
In this case I get wrong sort order
Like there is a structure like this
Cat1
--Prod1-1
--Prod1-2
--Prod1-3
Cat2
--Prod2-1
--Prod2-2
Cat3
--Prod3-1

I get this
Prod1-1
Prod2-1
Prod3-1
Prod1-2
Prod2-2
Prod1-3

It makes sense because in this case the query uses #__virtuemart_product_categories.ordering but this field shows the product's position inside of a specific category so I get all of the first products from the categories, the second products from the categories etc.

But I need this:
Prod1-1
Prod1-2
Prod1-3
Prod2-1
Prod2-2
Prod3-1

So if I'm right when I enable Show products of subcategories there should be an extra join to #__virtuemart_product_categories ( or #__virtuemart_category_categories??) and use the category order first and the pc.ordering  after that. I modified my VirtueMartModelProduct a bit according to this and seems okay but I used some hardcoded stuff so it is not universal at all.

Could you please consider handling this?
Title: Re: Product sort order when Show products of subcategories is enabled
Post by: GJC Web Design on March 23, 2020, 16:03:51 PM
I know Max is currently working in this area..  can u test again when the latest  com_virtuemart.3.6.11.10291  appears in http://dev.virtuemart.net/projects/virtuemart/files
Title: Re: Product sort order when Show products of subcategories is enabled
Post by: lostmail on January 28, 2021, 14:31:56 PM
Have a similiar problem.
When i sort Subcategories in backend for "category name" and "Save order" - it is not updated in frontend.

My main categories were also mixed after (the last  ?) updae. I gave them new numbers and they were sorted well.
But the subcategories are completely mixed....and it would be a lot of work to sort them by hand...
Title: Re: Product sort order when Show products of subcategories is enabled
Post by: GJC Web Design on January 28, 2021, 14:58:23 PM
I know further work has been done on this on the soon to be released VM3.8.8
Title: Re: Product sort order when Show products of subcategories is enabled
Post by: lostmail on January 29, 2021, 08:12:08 AM
OK - THANX ;-)