News:

Support the VirtueMart project and become a member

Main Menu

Ordering of Product, is it fixed?

Started by GooRu, November 02, 2012, 19:27:11 PM

Previous topic - Next topic

GooRu

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?
Joomla Web Development, Hosting and site management

erandipiti

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.

erandipiti

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" />
                  

PRO

I do know milbo fixed this last week. I dont know when the next release will be.