News:

Support the VirtueMart project and become a member

Main Menu

Backend Products Ordering Glitch

Started by kaiserdom, October 28, 2017, 13:38:21 PM

Previous topic - Next topic

p.barg

Removing that old stuff doesn't change the ordering behaviour.

The patch by Studio 42 fixes the issue for me!

Milbo

Do you open a product with child list tab?
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

I've tested a product with children (multivariant) and a product without children.
Or what do you mean?

Ventsi Genchev

Quote from: p.barg on November 28, 2017, 09:49:07 AM
Removing that old stuff doesn't change the ordering behaviour.

The patch by Studio 42 fixes the issue for me!

+1
It's the same way for me.
Audio Store:
https://vsystem.bg - Bulgarian language
https://vsystem.bg/en - English

Milbo

yeh, it fixes the problem here, but is just a quick and very dirty quick fix.

I found now the reason and Petra has already version to test for it. The reason was the list of "shoppers who bought the product" which has an own ordering, which overwrotes the ordering of normal product list. the product list got than an ordering for "email", which was recognised as wrong => use default.

The new core should now keep both orderings, the one of the standard product list and "customer who bought"
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

Max, in a task, the values have not to change, this is logic, so the code is not a durty fix, but the core code in this case is dirty(and do extra stuff for nothing with bad result).
If in some task, you need to set the ordering pagination in core, this should then be white listed and not simply set it in each case(and each time the product model is called, for a simple product this is set too and in a module...
At end perhaps using 2 model product + products is the best way to handel this case


Milbo

Patrick, the fixes in the core now include many different details. Your quickndirty fix pointed on the task, which gave me a good grab. The core was a only bit dirty there. It is the code, which I meant already, which can be deleted. The problem here is that we have a list for child products and a list for "shopper who bought", but with sorting.

The sortfilter of the "shopper who bought" overwrote the userState. Any user states were just stored by option and view, no task. So I had to add tasks here.

I had to extend the sort function by the task and also to add this task to the sort calls in the list, and more stuff like that.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

Add an extra value for ordering or other filters in case of other list then.It should solve the problem
Eg.
         $filter_order = strtolower ($app->getUserStateFromRequest ('com_virtuemart.' . $view . '.filter_order', 'filter_order', $this->_selectedOrdering, 'cmd'));
to
         $filter_order = strtolower ($app->getUserStateFromRequest ('com_virtuemart.' . $view .'.'.$task. '.filter_order', 'filter_order', $this->_selectedOrdering, 'cmd'));
Or better not use an instance but get a new model for your case. the constructor is not private and permit then to not destroy the value in the session