VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Urs on April 10, 2012, 10:18:18 AM

Title: Solved Sort order bug in 2.0.4...2.0.8
Post by: Urs on April 10, 2012, 10:18:18 AM
Hello

Everytime i open a product and save it, the sort-id is 1.

regards

Urs
Title: Re: Sort order bug in 2.0.4
Post by: Studio 42 on April 10, 2012, 15:20:39 PM
HI,
What you mean with the sort-id ?
the ordering number ?
Title: Re: Sort order bug in 2.0.4
Post by: Urs on April 10, 2012, 20:32:17 PM
I think so... in german: neu sortieren

regards
Title: Re: Sort order bug in 2.0.4
Post by: Urs on June 06, 2012, 11:02:55 AM
this is a big bug for me! Please solve it!

Everytime i edit an product, the sort-id of that product is 1! Still in newest version
Title: Re: Sort order bug in 2.0.4
Post by: Urs on June 21, 2012, 07:48:26 AM
Still not solved in 2.0.7f
Title: Re: Sort order bug in 2.0.4
Post by: papaavola on June 21, 2012, 08:15:17 AM
You want change your products sort order?

In version 2.0.7 f:
Go to products, select category you want modify from 'Filter: select product category'
After selecting category filter, reorder field comes visible. You can only order products in categories.

Select product order you want with arrows in reorder column and after that  press disk icon (Save order) next to reorder field label to save new sort order.
Saving product itself doesn't save sort orders, so always press disk icon after changing sort order to save it.

I hope this helps you.
Title: Re: Sort order bug in 2.0.4
Post by: Urs on June 21, 2012, 09:27:30 AM
Hi

This is not my problem.

My problem is that if all the products are sorted and i open a product and save it the ordering number is one!

regards


Urs
Title: Re: Sort order bug in 2.0.4
Post by: papaavola on June 21, 2012, 14:48:04 PM
Yes, you are right, order number really resets to 1 every time when product is saved.
My version is 2.0.7.h

Title: Re: Sort order bug in 2.0.4
Post by: Urs on June 25, 2012, 06:54:33 AM
Thanks papaavola. This error is since version 2.0 and still not fixed!

>:( >:( >:(
Title: Re: Sort order bug in 2.0.4
Post by: John2400 on June 25, 2012, 08:48:08 AM
Hi - the order -

You have a product that you would like the customers to see first ,
Use the SKU - and use numbers like 0001 , 0002 etc or aaaa1, aaaa2 on products - you may find that this will set a more stable order.

* ensue you leave space for products -  so the 1 might be 00001 and product 2 might be 00004  so that if you need it - you have room to reset orders -

* this is not the long term solution but it might help. If you are using 2.0.4 It might be best to update to 2.0.6 stable version.
Title: Re: Sort order bug in 2.0.4
Post by: DaggaTora on June 25, 2012, 18:33:44 PM
Plz, this is really important to fix! I can't tell my client that he can't order and promote the products he wants.

:'( :'( :'( :'(
Title: Re: Sort order bug in 2.0.4
Post by: BaidareW on June 25, 2012, 20:23:01 PM
Yes, sorting is very important. Please fix :)
Title: Re: Sort order bug in 2.0.4
Post by: Urs on June 28, 2012, 08:59:56 AM
No one from the 'team'??
Title: Re: Sort order bug in 2.0.4
Post by: Urs on June 30, 2012, 08:48:30 AM
Sill not fixed in 2.0.8!!!!!


>:( >:( >:( >:(
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: BaidareW on July 02, 2012, 18:58:10 PM
Sad :(
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: Milbo on July 03, 2012, 12:32:23 PM
Thanks for pushing, I take a look. Lets hope I find it fast and it is in the B version :-)
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: Milbo on July 03, 2012, 13:34:02 PM
I think I solved it. But again two files changed. We will upload the b version first to the forum. please check then.
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: BaidareW on July 03, 2012, 20:06:32 PM
Hi,

thanks for the effort as this bug is really annoying.

But.. in 2.0.8b still not working. If I change the product order by entering number and then click save icon, it resets to values that it was before, so nothing changes.  Manual sort with arrows is working fine.
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: Milbo on July 03, 2012, 22:40:16 PM
Okey, this is not working perfectly, but it is not changing the order anylonger when editing the product, which was for me the real bug.
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: DaggaTora on July 04, 2012, 09:23:12 AM
Yes, that is a nice step!
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: Milbo on July 04, 2012, 12:06:29 PM
Imho we can now work with it, before the habits you have to keep were to crazy.
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: BaidareW on July 04, 2012, 21:29:45 PM
Well it is still far from usable. I have category with more then 100 items, and I need them to sort. Now I need to click so many times to do this.. crazy..
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: Milbo on July 05, 2012, 00:07:43 AM
hmm, 100 items. interesting that you do them manually.

I am sorry, the c version is "already done" and I cant change it any longer. What we try to achieve next is that entered values are directly correctly stored. This is in fact a bug. Maybe it works worse since I fixed the other problem, that the ordering value is always set to 1.
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: Urs on July 05, 2012, 13:32:45 PM
Thanks Milbo! For me solved! Finally....
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: BaidareW on July 05, 2012, 22:03:44 PM
This is not solved 100%. One part of annoying bus is solved (not set to 1 after product edit and not set all to 1 after pressing save is solved) : manual sorting still not work if write sort order numbers by hand.
Title: Re: Sort order bug in 2.0.4...2.0.8
Post by: adamo on July 09, 2012, 14:46:06 PM
Quote from: Milbo on July 03, 2012, 13:34:02 PM
I think I solved it. But again two files changed. We will upload the b version first to the forum. please check then.
Which
Which two files have been modified?
I find change in file models/product.php in function saveorder() but what is second file? I can`t update all VM 8)
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: Milbo on July 09, 2012, 15:13:10 PM
from 2.0.8 to 2.0.8c is no problem
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: adamo on July 10, 2012, 09:39:26 AM
I find problem - wrong catogory id to ordering product. Must change function getProductSingle() in administrator/components/com_virtuemart/models/product.php

/* Load the categories the product is in */
$product->categories = $this->getProductCategories($this->_id);
$virtuemart_category_id2 = JRequest::getInt('virtuemart_category_id', 0);//add this line


if ( !empty($product->categories) and is_array($product->categories) and !empty($product->categories[0]) ){
$product->virtuemart_category_id = $product->categories[0];
$q = 'SELECT `ordering`,`id` FROM `#__virtuemart_product_categories`
WHERE `virtuemart_product_id` = "'.$this->_id.'" and `virtuemart_category_id`= "'.$virtuemart_category_id2.'" ';//change this line
$this->_db->setQuery($q);
// change for faster ordering
$ordering = $this->_db->loadObject();
if(!empty($ordering)){
$product->ordering = $ordering->ordering;
$product->id = $ordering->id;
}

}
$ordering = $this->_db->loadObject();
if(!empty($ordering)){
$product->ordering = $ordering->ordering;
$product->id = $ordering->id;
}

}
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: RosaMagma on August 01, 2012, 11:43:36 AM
Hello,
Milbo, could you, please, tell me the files changed? I have 2.0.8a version and I have some customisation, so I don't want to update each version because I must do a lot of changes.
Or if there is a file where specific the changes between the versions is enough for me.
Thanks in advance
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: stimpy on August 09, 2012, 10:29:00 AM
Please help me: This isn't fixed yet, is it?
I'm deperately trying to sort products by entering an ordering number in the backend, but as soon as I click "save", the products are ordered by who-knows-what.. ..There are ordering-numbers in the table, but not the ones, I've entered..
This is a real problem for me, 'cos it makes the product listings look quiet chaotic..

Should this problem be fixed yet? Can I fix it myself? Is someone working on it?
Can't really believe that a component as big and good as virtuemart has a huuuuge bug like this..? :/

Cheers,
  stimpy

PS: I'm on virtuemart v2.0.8e with Joomla v2.5.6...
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: NRE on August 27, 2012, 12:18:20 PM
Please fix this bug!
I've tryed with adamo fix with no luck and now I'm desperate ... my customer want kill me :)

UPDATE:
I've upgrated to latest version 2.0.10 and I've this situation (ex: 4 products):
1) by pressing "reorder" I get wrong order values for products (ex: 16, 35, 70, 76) and I  don't know where they came from, because in my DB order values are 1,2,3,4
2) if I edit the order number and then press save on the right of the label "reorder", no changes are saved and order values remain the same (and wrong)

I've tryed with Adamo fix and now I can see the correct values (1,2,3,4) but reordering arrows are inverted and save button still doesn't work except if I've a product set to 0 and want to save at position 1 (from 0 to 1, only in this case).

Thank you
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: rootfrequenz on September 08, 2012, 14:00:53 PM
Quote from: BaidareW on July 05, 2012, 22:03:44 PM
This is not solved 100%. One part of annoying bus is solved (not set to 1 after product edit and not set all to 1 after pressing save is solved) : manual sorting still not work if write sort order numbers by hand.

I have the problem, actually. We want order the items in category manually, but this still not work if write the numbers by hand in the fields (the save-sequence button )  This is very important.

What is the problem?

Thank you and kind regards
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: jthrongard on November 01, 2012, 17:35:54 PM
Quote from: adamo on July 10, 2012, 09:39:26 AM
I find problem - wrong catogory id to ordering product. Must change function getProductSingle() in administrator/components/com_virtuemart/models/product.php

/* Load the categories the product is in */
$product->categories = $this->getProductCategories($this->_id);
$virtuemart_category_id2 = JRequest::getInt('virtuemart_category_id', 0);//add this line


if ( !empty($product->categories) and is_array($product->categories) and !empty($product->categories[0]) ){
$product->virtuemart_category_id = $product->categories[0];
$q = 'SELECT `ordering`,`id` FROM `#__virtuemart_product_categories`
WHERE `virtuemart_product_id` = "'.$this->_id.'" and `virtuemart_category_id`= "'.$virtuemart_category_id2.'" ';//change this line
$this->_db->setQuery($q);
// change for faster ordering
$ordering = $this->_db->loadObject();
if(!empty($ordering)){
$product->ordering = $ordering->ordering;
$product->id = $ordering->id;
}

}
$ordering = $this->_db->loadObject();
if(!empty($ordering)){
$product->ordering = $ordering->ordering;
$product->id = $ordering->id;
}

}


Was this ever confirmed to work?  What code do we replace?
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: MvdO on January 10, 2013, 14:53:38 PM
Why is this marked "Solved". It's still not working. Like said earlier. This is very important for our customers
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: MvdO on January 10, 2013, 14:54:25 PM
I've updated my VM to the latest version... still nothing :(
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: nirit on March 19, 2013, 16:28:06 PM
Thanks Adamo, I tried your code and it works like a charm! now I can order the products in Virtuemart manually.
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: oremy on September 30, 2013, 09:39:10 AM
hi MILBO! :)

I have VM 2.0.6 and I need to fix this bug (at this moment I can't update VM)

I tray to fix with code of ADAMO... but nothing change.

Can you explain me wich fix I have to do exactly?

Thanks so much
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: Maxim Pishnyak on October 03, 2013, 17:48:56 PM
Quote from: oremy on September 30, 2013, 09:39:10 AM
at this moment I can't update VM
As a couple years before this moment too I guess.
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: oremy on October 03, 2013, 19:36:14 PM
Please...don't Askatasuna me tris :-)

Can You help me?
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: oremy on October 04, 2013, 09:36:13 AM
Hi!

I updated to the last versione of VM.... BUT....
now we have some problems with:

- addtocart button doesn't work
- lightbox doesnt work
- additional images in product haven't click for zoom (lightbox)

We try to fix this issue with JqueryEasy Plugin.
But nothing is changed


Can you solve this? :)

Thanks


Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: Maxim Pishnyak on October 06, 2013, 14:15:39 PM
URL?
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: oremy on October 07, 2013, 10:03:47 AM
it's in administrator...
Title: Re: Solved Sort order bug in 2.0.4...2.0.8
Post by: Maxim Pishnyak on October 12, 2013, 11:18:29 AM
Quote from: Maxim Pishnyak on October 06, 2013, 14:15:39 PM
URL?
... to your web site could help ..