Sort Drop Down

Results 1 to 20 of 24
14 Mar 2011, 16:50
#1
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Sort Drop Down

Hi,

I have v 3.9h and am using Cherry Zen.

Currently, the sort drop down box shows up only on the All Products page.

I would like it to show up on the Sub-Category Pages, also (such as when the customer clicks on "Hearts").

Is there a way to do this?

Thank you,
Lynn
machineembroideryandmore.com/zencart
15 Mar 2011, 16:19
#2
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

I did not receive any answers and still would like to see if I can get this working. Currently, customers can only sort products when they are in the All Products Area on my website.

I would like them to be able to sort products when they are in other areas - such as the Categories and Sub-Categories Areas. This would be similar to having the search button showing up on all pages. Can the Sort Drop Down button show up on all pages?

Thank you,
Lynn
machineembroideryandmore.com/zencart
15 Mar 2011, 16:36
#3
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Sort Drop Down

Not sure if this is the dropdown but in

ADMIN > CONFIGURATION > PRODUCT LISTING

Include Product Listing Alpha Sorter Dropdown
also
Display Category/Manufacturer Filter (0=off; 1=on)


Hope this helps!
15 Mar 2011, 17:49
#4
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

Thanks for your response. I tried it and it did not work. The sort feature shows up on All Products and Featured Products, but not in the Categories.

If it can't show up on the page, can I get it to show up in the top banner next to the search button? Or as a side box?

Help!!
Lynn
machineembroideryandmore.com/zencart
13 Apr 2011, 20:54
#5
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

Re: Sort Drop Down

I Had the same problem, needed a sorter dropdown after scouring the forums got some good hints but no code, heres what i did, you will definatly have to change sort options and play with your settings, this is set to work on advanced search, manufacturers, and catagory listing.

add this code to the very top of product_listing.php under
// Column Layout Support (Grid Layout) upgraded for v1.3.0 compatibility DrByte 04/04/2006
//


?><?php

if ($current_page_base == 'advanced_search_result') {; ?>

<div style="font-size:11px">Sort by:
<form name="Jump" action="">
<select name="Menu" onchange="location=document.Jump.Menu.options[document.Jump.Menu.selectedIndex].value;" value="GO">
<option value="">Your Choices</option>
<option value=<?php echo '"index.php?main_page=advanced_search_result&search_in_description=0&keyword=' . $keywords . '">' ?>Product Name </option>
<option value=<?php echo '"index.php?main_page=advanced_search_result&search_in_description=1&keyword=' . $keywords . '">' ?>Product Name - Desc</option>
<option value=<?php echo '"index.php?main_page=advanced_search_result&search_in_description=1&keyword=' . $keywords . '&inc_subcat=0&page=1&sort=3a">' ?>Price - Low to High</option>
<option value=<?php echo '"index.php?main_page=advanced_search_result&search_in_description=1&keyword=' . $keywords . '&inc_subcat=0&page=1&sort=3d">' ?>Price - High to Low</option>
</select>
</form>
<div>



<?php } else if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) { ; ?>

<div style="font-size:11px">Sort by:
<form name="Jump" action="">
<select name="Menu" onchange="location=document.Jump.Menu.options[document.Jump.Menu.selectedIndex].value;" value="GO">
<option value="">Your Choices</option>
<option value=<?php echo '"index.php?main_page=index&manufacturers_id=' . $_GET['manufacturers_id'] . '&page=1&sort=2d&filter_id=' . $_GET['filter_id'] . '">' ?>Product Name </option>
<option value=<?php echo '"index.php?main_page=index&manufacturers_id=' . $_GET['manufacturers_id'] . '&page=1&sort=2a&filter_id=' . $_GET['filter_id'] . '">' ?>Product Name - Desc</option>
<option value=<?php echo '"index.php?main_page=index&manufacturers_id=' . $_GET['manufacturers_id'] . '&page=1&sort=3a&filter_id=' . $_GET['filter_id'] . '">' ?>Price - Low to High</option>
<option value=<?php echo '"index.php?main_page=index&manufacturers_id=' . $_GET['manufacturers_id'] . '&page=1&sort=3d&filter_id=' . $_GET['filter_id'] . '">' ?>Price - High to Low</option>
</select>
</form>
<div>

<? echo $_GET['manufacturers_id'];?>



<?

}else {; ?>

<div style="font-size:11px">Sort by:
<form name="Jump" action="">
<select name="Menu" onchange="location=document.Jump.Menu.options[document.Jump.Menu.selectedIndex].value;" value="GO">
<option value="">Your Choices</option>
<option value=<?php echo '"index.php?main_page=index&cPath=' . $cPath . '&page=1&sort=2d&filter_id=' . $_GET['filter_id'] . '">' ?>Product Name </option>
<option value=<?php echo '"index.php?main_page=index&cPath=' . $cPath . '&page=1&sort=2a&filter_id=' . $_GET['filter_id'] . '">' ?>Product Name - Desc</option>
<option value=<?php echo '"index.php?main_page=index&cPath=' . $cPath . '&page=1&sort=3a&filter_id=' . $_GET['filter_id'] . '">' ?>Price - Low to High</option>
<option value=<?php echo '"index.php?main_page=index&cPath=' . $cPath . '&page=1&sort=3d&filter_id=' . $_GET['filter_id'] . '">' ?>Price - High to Low</option>
</select>
</form>
<div>

<?
};

?>


14 Apr 2011, 01:34
#6
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

Thank you. I copied the code in the spot you directed me to but my Products disappeared. :oops: Am I doing something wrong? Can I just copy the code from this link and paste it into the php file? I'm really a novice at this. I used WordPad - is that OK?
14 Apr 2011, 01:57
#7
zskiman avatar

zskiman

New Zenner

Join Date:
Mar 2005
Posts:
69
Plugin Contributions:
0

Re: Sort Drop Down

If all your produts disappeared, then likely you missed one of the <?php or ?> tags, ran into it a few times while putting together, especially pay attention to the ?> at the very top
14 Apr 2011, 03:14
#8
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

The products did not disappear this time - that's good. However, I did not see a sort drop down box and when I tried to do a search, it gave me a bunch of code.
14 Apr 2011, 06:22
#9
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Sort Drop Down

Seems like allot of coding:

ADMIN > CONFIGURATION > PRODUCT LISTING
Display Category/Manufacturer Filter (0=off; 1=on) will display that categories manufacturers

This mod converts the alpha sorter

ADMIN > CONFIGURATION > PRODUCT LISTING
Include Product Listing Alpha Sorter Dropdown
to a drop-down that displays as:

Most Popular
Price: Low to High
Price: High to Low
Title
Manufacturer
Newest
Oldest

If the alpha sorter is not appearing you could check your /includes/templates/CUSTOM_TEMPLATE/template/tpl_index_product_list.php file to make sure it is calling it.

Would look something like:
<?php
  $check_for_alpha = $listing_sql;
  $check_for_alpha = $db->Execute($check_for_alpha);

  if ($do_filter_list || ($check_for_alpha->RecordCount() > 0 && PRODUCT_LIST_ALPHA_SORTER == 'true')) {
  $form = zen_draw_form('filter', zen_href_link(FILENAME_DEFAULT), 'get') . '<label class="inputLabel">' .TEXT_SHOW . '</label>';
?>


or you could copy that code from /includes/templates/template_default/template/tpl_index_product_list.php

If coding is the way you want to go I would look at this thread.

Hope this helps!
14 Apr 2011, 18:53
#10
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

That worked perfectly and it was easy! Thank you so much:D
14 Apr 2011, 19:06
#11
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

One more question - please.

How do I delete "Manufacturer" from the drop down list?
14 Apr 2011, 19:21
#12
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

OK - I responded before I looked at the drop down clearly. I am excited that it is there - but, I would like only these options to show:
Model
Product Name
Price Low to High
Price High to Low

Is there a way to add "Model"

and delete
Most Popular
Manufacturer
Newest
Oldest

Thanks again,
Lynn
14 Apr 2011, 21:11
#13
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Sort Drop Down

Glad it works and was easy!

Give me a few to play with code & I will post changes.

Ray
15 Apr 2011, 03:17
#14
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Sort Drop Down

For starters lets delete the options you don't want:

in the mod you downloaded find the following file:
\includes\modules\YOUR_TEMPLATE_NAME\product_listing_alpha_sorter.php

In that file find the lines:
$letters_list[] = array('id' => '1', 'text' => 'Most Popular');
$letters_list[] = array('id' => '2', 'text' => 'Price: Low to High');
$letters_list[] = array('id' => '3', 'text' => 'Price: High to Low');
$letters_list[] = array('id' => '4', 'text' => 'Title');
$letters_list[] = array('id' => '5', 'text' => 'Manufacturer');
$letters_list[] = array('id' => '6', 'text' => 'Newest');
$letters_list[] = array('id' => '7', 'text' => 'Oldest');


Rename
$letters_list[] = array('id' => '4', 'text' => 'Title'); 


to
$letters_list[] = array('id' => '4', 'text' => 'Products Name');

&

Delete
$letters_list[] = array('id' => '1', 'text' => 'Most Popular');
$letters_list[] = array('id' => '5', 'text' => 'Manufacturer');
$letters_list[] = array('id' => '6', 'text' => 'Newest');
$letters_list[] = array('id' => '7', 'text' => 'Oldest');

Part 1
16 Apr 2011, 16:08
#15
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

Sorry, I did not get to you sooner. I'm back now and ready to get this working. The Part 1 worked perfectly :smile:
16 Apr 2011, 17:35
#16
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Sort Drop Down

O.k. good

In ADMIN > CONFIGURATION > PRODUCT LISTING

Display Product Model: set the sort order to 9, looks like it is last on you site, just make sure it is not the same as #'s used above: 2,3,4

Now open:
\includes\index_filters\YOUR_TEMPLATE_NAME\default_filter.php file

find:
case 'PRODUCT_LIST_MODEL':
 //$listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;


change to:
case 'PRODUCT_LIST_MODEL':
$listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;


now in the:
\includes\modules\YOUR_TEMPLATE_NAME\product_listing_alpha_sorter.php file

ADD:
$letters_list[] = array('id' => '9', 'text' => 'Model');


change the 9 to the # you assigned to the sort order in ADMIN.

Should work, Hope this helped!

Part 2
17 Apr 2011, 04:07
#17
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

You are brilliant!

Thank you for all the help provided.

Lynn
17 Apr 2011, 04:19
#18
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Sort Drop Down

NP, Glad I could help!

BTW, if you want the drop-down to appear like you stated in post #12

Model
Product Name
Price Low to High
Price High to Low

in:\includes\modules\YOUR_TEMPLATE_NAME\product_listing_alpha_sorter.php

change this:
$letters_list[] = array('id' => '2', 'text' => 'Price: Low to High');
$letters_list[] = array('id' => '3', 'text' => 'Price: High to Low');
$letters_list[] = array('id' => '4', 'text' => 'Products Name');
$letters_list[] = array('id' => '9', 'text' => 'Model');


to this:
$letters_list[] = array('id' => '9', 'text' => 'Model');
$letters_list[] = array('id' => '4', 'text' => 'Products Name');
$letters_list[] = array('id' => '2', 'text' => 'Price: Low to High');
$letters_list[] = array('id' => '3', 'text' => 'Price: High to Low');
17 Apr 2011, 16:24
#19
sewingzfun avatar

sewingzfun

New Zenner

Join Date:
Mar 2011
Posts:
90
Plugin Contributions:
0

Re: Sort Drop Down

Yes, I did prefer to have it listed in that order.

Thank you! I feel like I have learned a lot from you :smartalec:
18 Apr 2011, 00:29
#20
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Sort Drop Down

Glad I could help with this!