Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Help needed: Additional Alpha sorter based on quantity

Help needed: Additional Alpha sorter based on quantity

Views: 1,249

Results 1 to 4 of 4
16 Jan 2010, 4:00 PM
#1
juneloweelyn avatar

juneloweelyn

New Zenner

Join Date:
Jan 2009
Posts:
70
Plugin Contributions:
0

Help needed: Additional Alpha sorter based on quantity

Hello all,

I wanna have an additional filter for my website in which i can filter the items based on quantity.

Zen cart 1.3.8a only has
"from old to new"
"new to old"
"price high to low"
etc..

But i wish to add an additional filter that sort the products based on quantity. (product with highest quantity would appear first in the catalog, followed by sold out items) do u have any idea i can do it?

I will open a new thread for this once i have gotten the solution.

I have been asking for help for few times, it seems that noone could help.

Hope u can help me :)

Thank you SO SO MUCH!!!! i really glad that u replied :)

16 Jan 2010, 4:33 PM
#2
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

Re: Help needed: Additional Alpha sorter based on quantity

Hi,
tpl_modules_listing_display_order.php:
find

<option value="7" <?php echo ($disp_order == '7' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_DATE; ?></option>

add after

<?php // BOF disp_order by products_quantity ?>
<option value="6" <?php echo ($disp_order == '8' ? 'selected="selected"' : ''); ?>><?php echo TEXT_INFO_SORT_BY_PRODUCTS_QUANTITY; ?></option>
<?php // EOF disp_order by products_quantity ?>

listing_display_order.php
find

  case ($_GET['disp_order'] == 7):
  $order_by = " order by p.products_date_added, pd.products_name";
  break;

add after

// BOF disp_order by products_quantity
  case ($_GET['disp_order'] == 8):
  $order_by = " order by p.products_quantity DESC, pd.products_name";
  break;
// EOF disp_order by products_quantity

Also you must define text language constant TEXT_INFO_SORT_BY_PRODUCTS_QUANTITY

17 Jan 2010, 1:04 PM
#3
juneloweelyn avatar

juneloweelyn

New Zenner

Join Date:
Jan 2009
Posts:
70
Plugin Contributions:
0

Re: Help needed: Additional Alpha sorter based on quantity

Dear Andrew!!!

THANK YOU SO MUCH FOR UR HELP :)

I REALLY REALLY REALLY APPRECIATE IT :)

Take care!!!

11 Jun 2011, 12:19 PM
#4
juneloweelyn avatar

juneloweelyn

New Zenner

Join Date:
Jan 2009
Posts:
70
Plugin Contributions:
0

Re: Help needed: Additional Alpha sorter based on quantity

Hello Andrew,

May i know how can i put the product filter (like in new products, featured products) into each category?

Hope u can help too! Thank you!