Author Topic: Sort products by "in stock"  (Read 20372 times)

futuron

  • Beginner
  • *
  • Posts: 37
    • FuturOn.net
Sort products by "in stock"
« on: May 22, 2007, 16:24:16 pm »
Is it possible to add a option to sort/order the products by "in stock". I want to show products wich are out of stock on the website, but it is not very handy if these products stand at the top of the product list. 

Kind Regards
Rob van der Donk
Come and take a look at my Joomla! website (http://www.futuron.net) for Joomla! support, design and webhosting.

toivo

  • Beginner
  • *
  • Posts: 18
Re: Sort products by "in stock"
« Reply #1 on: June 05, 2007, 15:52:50 pm »
I happened to post a mod today to Inventory Listing in 1.0.9 which adds an option to display the products in the order of 'in stock' or stock on hand.  Only the child products which can have stock are listed, the parent products are excluded.
toivo
-------------------------
Suzhou, China

crackdaddy

  • Jr. Member
  • **
  • Posts: 263
Re: Sort products by "in stock"
« Reply #2 on: June 05, 2007, 16:42:46 pm »
um are you gonna share your work..or what? i dont need it... but if you hae done if and posted it..it helps to give the link...if you havnt posted it then do it, cause otherwise whats the point....

and yes sort by in stock in very simple to code...and can be done in 5 min prob.. i dont need this functionality but if you find the code that make the sort...you should be able to add what you need...

if toivo doesnt post his..i mihgt take a minute to show you where it is...

toivo

  • Beginner
  • *
  • Posts: 18
Re: Sort products by "in stock"
« Reply #3 on: June 08, 2007, 22:52:01 pm »
toivo
-------------------------
Suzhou, China

futuron

  • Beginner
  • *
  • Posts: 37
    • FuturOn.net
Re: Sort products by "in stock"
« Reply #4 on: November 26, 2007, 10:58:11 am »
Your hack is nice, but this is for the backend. What I'm looking for is a hack for the frontend. So the visitors of the webshop allways see the products in stock first!

Kind regards,
Rob van der Donk
Come and take a look at my Joomla! website (http://www.futuron.net) for Joomla! support, design and webhosting.

antivir

  • Beginner
  • *
  • Posts: 9
Re: Sort products by "in stock"
« Reply #5 on: May 13, 2008, 15:26:54 pm »
shop_browse_queries.php
old:
Quote
$q .= "\n ORDER BY $orderbyField $DescOrderBy";
new:
Quote
$q .= "\n ORDER BY product_in_stock DESC, $orderbyField $DescOrderBy";

vbarkouski

  • Beginner
  • *
  • Posts: 22
Re: Sort products by "in stock"
« Reply #6 on: May 26, 2010, 19:58:16 pm »
Is there a solution to sort by product name and in stock together?

shop_browse_queries.php
old:
Quote
$q .= "\n ORDER BY $orderbyField $DescOrderBy";
new:
Quote
$q .= "\n ORDER BY product_in_stock DESC, $orderbyField $DescOrderBy";

Template Designer

  • Beginner
  • *
  • Posts: 37
    • Virtuemart Templates
Re: Sort products by "in stock"
« Reply #7 on: May 29, 2010, 10:39:52 am »
I hope we can have these options in the backend. It's easy to make mistake if revising the code.
VirtueMart Templates gear up your sales...

killarney

  • Beginner
  • *
  • Posts: 2
  • Skype Name: nirmalthakur21
Re: Sort products by "in stock"
« Reply #8 on: August 25, 2015, 05:56:05 am »
Hi,
i am new to virtuemart and i want to show in stock  product first and not in stock after that at the Front End.
can anyone can help me with it,
thanks in advance

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 28585
  • Always on vacation
    • Jenkin Hill Internet
Re: Sort products by "in stock"
« Reply #9 on: August 25, 2015, 10:11:42 am »
And you are using VirtueMart 1?  See this section heading:  VirtueMart Dev/Coding Central: VM1 (old version)
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VirtueMart 4.0.22 10858  J 3.10.11 PHP 8.0.27