Author Topic: Backend Products Ordering Glitch  (Read 3523 times)

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 166
    • Barg IT
Re: Backend Products Ordering Glitch
« Reply #15 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!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10036
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Backend Products Ordering Glitch
« Reply #16 on: November 28, 2017, 10:38:29 am »
Do you open a product with child list tab?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

p.barg

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 166
    • Barg IT
Re: Backend Products Ordering Glitch
« Reply #17 on: November 28, 2017, 11:09:57 am »
I've tested a product with children (multivariant) and a product without children.
Or what do you mean?

Ventsi Genchev

  • Jr. Member
  • **
  • Posts: 303
    • Audio Store
Re: Backend Products Ordering Glitch
« Reply #18 on: November 29, 2017, 12:36:11 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10036
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Backend Products Ordering Glitch
« Reply #19 on: November 29, 2017, 18:20:02 pm »
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"
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4325
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Backend Products Ordering Glitch
« Reply #20 on: November 29, 2017, 18:58:15 pm »
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10036
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Backend Products Ordering Glitch
« Reply #21 on: November 29, 2017, 22:57:48 pm »
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.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4325
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Backend Products Ordering Glitch
« Reply #22 on: November 30, 2017, 00:16:52 am »
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