Zen Cart Logo
Forums / General Questions / Can specials be sorted?

Can specials be sorted?

Views: 4,910

Results 21 to 36 of 36
20 Apr 2011, 2:52 PM
#21
britneycook avatar

britneycook

New Zenner

Join Date:
Oct 2010
Posts:
53
Plugin Contributions:
0

Can specials be sorted?

That worked BRILLIANTLY .. thank you sooooooo much for that!

Youre a magic legend!!!!

Ajeh:

Also, you have:
sort_order

in the WHERE ... if this is from the table:
products

that should be:
p.products_sort_order

NOTE: the p is not really needed as it is unique but it helps with clarity ...

NOTE: If you added a new field to the table:
specials

for sort order, make sure that you spelled it correctly ...

20 Apr 2011, 3:53 PM
#22
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can specials be sorted?

Thanks for the update that this is now working ... :smile:

What that suppose to be the products_sort_order or a new sort field in the specials table?

10 Mar 2013, 3:45 PM
#23
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Hi there, I would like to add a filter to the "new products" page to list by a specific model only, so basically what the filter "model" already does, but just to list a specific model type. Which files would I need to edit in order to achieve this?

Thanks for any help provided!

10 Mar 2013, 4:04 PM
#24
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can specials be sorted?

You can customize the file:
/includes/pages/products_new/header_php.php

and customize the $products_new_query_raw SELECT statement to include any filter that you are wanting ...

10 Mar 2013, 4:48 PM
#25
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Thanks Ajeh!

So I'd want to then add another statement such as:

p.products_model=product model inserted here

Or what should add in there to include the specific model?

10 Mar 2013, 5:02 PM
#26
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can specials be sorted?

That should filter it for a particular model ... test it and see if that does what you are looking for ...

10 Mar 2013, 5:09 PM
#27
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Okay, it accepts the code, however there is no extra menu item added, just the default ones are listed. Is there a file I should edit in order to add another menu item to the drop down?

10 Mar 2013, 5:31 PM
#28
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can specials be sorted?

You might try working your way through the template file tpl_products_new_default.php and see what all files are used for that page and for building the dropdown ...

It may take quite a bit of work to add on additional things, as the dropdown is shared by other files ...

What are you trying to add to the dropdown list?

10 Mar 2013, 6:34 PM
#29
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Well currently the default drop down menu has a few ways to filter the new products, I would like to add a custom filter a customer can click to filter all products with a specific model number, so basically add an extra filter statement to list products such as this (if it could work like this):

p.products_model='MODEL-01'
and
p.products_model='MODEL-02'

and so forth.
I have a lot of products added with the same model number and want those to be filtered and listed without a customer having to go through pages and pages of new products which is not of interest for them. I want them to be able to click on the drop down and be able to list all products with a model number of "model-01 or model-02 or model-03" and not have all the models of all the new products be listed together if you understand what I mean.

10 Mar 2013, 6:38 PM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can specials be sorted?

Does the Model list need to be a dropdown or can it just be an input field for the customer to type in the model that they want to filter for?

10 Mar 2013, 6:53 PM
#31
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Well a drop down list would make it fool proof for those customers which aren't the smartest lol, but I'm sure an input field for a client would work as well, or even a static link to the various models which would list all the new products for that certain model number.

10 Mar 2013, 6:58 PM
#32
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Or even if I can just get the code which does the following, I could then use that and link it to a static button:

In Zen-Cart, if you click on a category it will list all the products in that category, scroll down to the bottom of the list where you can click on the the page number to display, just be low that it lists a few of the New Products For March for that specific category, that's basically all I need, just a page which will list all the new products within that category.

11 Mar 2013, 9:58 AM
#33
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Hi there, I have gotten as far as adding a new value to the drop down menu, "option 8", I am now trying to edit the listing_display_order.php and would like to replace the following code with a static link, I have tried a few variations of code, but cannot get it to work:

case ($_GET['disp_order'] == 8):

$order_by = " order by p.products_model";

break;

Thanks for your help.

11 Mar 2013, 11:29 AM
#34
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

Got it working, thanks for the help, in case someone else wants to do the same thing, here's the code to replace:

$order_by = " and products_model='BKP-PCDVD' order by p.products_date_added DESC";

11 Mar 2013, 11:54 AM
#35
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

SoftCorpse:

Got it working, thanks for the help, in case someone else wants to do the same thing, here's the code to replace:

$order_by = " and products_model='BKP-PCDVD' order by p.products_date_added DESC";

It is also now dynamic and no need for any static links :D

11 Mar 2013, 12:21 PM
#36
softcorpse avatar

softcorpse

Zen Follower

Join Date:
Aug 2004
Posts:
96
Plugin Contributions:
0

Re: Can specials be sorted?

SoftCorpse:

It is also now dynamic and no need for any static links :D

obviously replace bkp-pcdvd with whatever model number you require ;)