Product sort order when Show products of subcategories is enabled

Started by sandomatyas, March 23, 2020, 13:11:56 PM

Previous topic - Next topic

sandomatyas

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?

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

lostmail

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...
VirtueMart VirtueMart 4.2.16 11030 | Joomla 4.x | PHP 8.3 | Vp_neoteric 1.6

GJC Web Design

I know further work has been done on this on the soon to be released VM3.8.8
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

lostmail

VirtueMart VirtueMart 4.2.16 11030 | Joomla 4.x | PHP 8.3 | Vp_neoteric 1.6