VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: GooRu on November 02, 2012, 19:27:11 PM

Title: Ordering of Product, is it fixed?
Post by: GooRu on November 02, 2012, 19:27:11 PM
Hi...

Serious problem that I have not been able to solve, and have spent lots of time here reading the same lament but no answers!

What is the solution to order my products?
Title: Re: Ordering of Product, is it fixed?
Post by: erandipiti on January 31, 2013, 19:21:29 PM
I have this problem with products in different categories, the original query is not filtering the products right so you end up changing the order for the same products in other categories.
I made a change in: administrator/components/com_virtuemart/models/product.php
THIS:
   $this->_db->setQuery ('UPDATE `#__virtuemart_product_categories`
               SET `ordering` = ' . $i . '
               WHERE `id` = ' . (int)$key . ' ');
FOR:
         $this->_db->setQuery ('UPDATE `#__virtuemart_product_categories`
               SET `ordering` = ' . $i . '
               WHERE `virtuemart_category_id` = ' . $virtuemart_category_id . ' AND `virtuemart_product_id` = ' . (int)$key . ' ');

Now if I write the values in the ordering box and save them, the order actually changes, although you can't see the real order in the backend, you can see it's right in the frontend.

I'll be checking the original query to see if I can fix it, but as a temporary solution this worked for me.
Title: Re: Ordering of Product, is it fixed?
Post by: erandipiti on January 31, 2013, 19:24:08 PM
ups sorry, you also have to change /administrator/components/com_virtuemart/views/product/tmpl/default.php so the ordering input looks like this:

<input class="ordering" type="text" name="order[<?php echo $product->virtuemart_product_id?>]" id="order[<?php echo $i?>]" size="5" value="<?php echo $product->ordering; ?>" style="text-align: center" />
                  
Title: Re: Ordering of Product, is it fixed?
Post by: PRO on January 31, 2013, 20:03:18 PM
I do know milbo fixed this last week. I dont know when the next release will be.