Forums / Basic Configuration / Turn off random function in Featured Products

Turn off random function in Featured Products

Locked

Started by msport on 21 Nov 2006, 2:52 PM · Views: 5,598

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
21 Nov 2006, 2:52 PM
#1
msport avatar

msport

New Zenner

Join Date:
Nov 2006
Posts:
9
Plugin Contributions:
0

Turn off random function in Featured Products

Hello,

I need to stop the products from rotating in the Featured Products box. The site only has a handful of products to sell, and I'd like them to consistently display in their default sort order -- not randomly rotate!

Have searched through the Forum and found a very dated method of doing this - anyone have a new simple fix for accomplishing this?

Running Zen Cart version 1.3.6
DB Patch level 1.3.6

Thanks in advance!

21 Nov 2006, 2:54 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Turn off random function in Featured Products

You would need to re-write the code to not randomize the Featured Products ...

Copy the file:
/includes/modules/featured_products.php

To your template and overrides directoy, then change the way the selected products are handled to not do the randmization ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Nov 2006, 3:22 PM
#3
msport avatar

msport

New Zenner

Join Date:
Nov 2006
Posts:
9
Plugin Contributions:
0

Re: Turn off random function in Featured Products

Linda,

Thank you for the quick response! Unfortunately, I'm not versed well enough to re-write the code!

Anyone other suggestions would be appreciated!

Thanks again

14 Jan 2007, 8:50 PM
#4
deviation avatar

deviation

New Zenner

Join Date:
Nov 2006
Posts:
3
Plugin Contributions:
0

Re: Turn off random function in Featured Products

Hi,
simply do the following

change

[PHP]
$featured_products = $db->ExecuteRandomMulti($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);

to
[/PHP]

$featured_products = $db->Execute($featured_products_query, MAX_DISPLAY_SEARCH_RESULTS_FEATURED);

and

    $featured_products->MoveNextRandom();

to

    $featured_products->MoveNext();

cheers

18 Jan 2007, 3:51 PM
#5
msport avatar

msport

New Zenner

Join Date:
Nov 2006
Posts:
9
Plugin Contributions:
0

Re: Turn off random function in Featured Products

Deviation --

That worked perfectly! Exactly what I needed.

Thank you very much for the help!

30 Jul 2007, 3:26 PM
#6
blainbci avatar

blainbci

New Zenner

Join Date:
Dec 2006
Posts:
27
Plugin Contributions:
0

Re: Turn off random function in Featured Products

I wanted to stop the random feature for the new products on the main page. I used your code change and it worked perfectly. Thanks for your help. It took several hours to find this post which seems to always be the case with the forum. Does the new book or manual have answers like this in it?

Thanks
Blain

30 Jul 2007, 3:51 PM
#7
goodbuygail avatar

goodbuygail

New Zenner

Join Date:
Jul 2007
Posts:
77
Plugin Contributions:
0

Re: Turn off random function in Featured Products

Thanks for the help with this!

19 Sep 2007, 1:53 PM
#8
blarney avatar

blarney

New Zenner

Join Date:
Oct 2005
Location:
Connectiuct
Posts:
69
Plugin Contributions:
1

Re: Turn off random function in Featured Products

Thanks for the great instructions on "unrandomizing" the features. One follow-up... is there a simple way to instruct it how to sort those items? I can't figure out how they are currently sorted but doesn't seem to follow any ID/ title/ or such.

25 Sep 2007, 2:23 PM
#9
j_price avatar

j_price

New Zenner

Join Date:
Sep 2007
Posts:
9
Plugin Contributions:
0

Re: Turn off random function in Featured Products

I don't know if you already figured out the answer to this but if not or for anyone else viewing this thread- here is how I changed it.

Go to Configure, Featured Product
Change the Display Product Display - Default Sort Order
Choose the sort order that you want.

25 Sep 2007, 3:24 PM
#10
blarney avatar

blarney

New Zenner

Join Date:
Oct 2005
Location:
Connectiuct
Posts:
69
Plugin Contributions:
1

Re: Turn off random function in Featured Products

JPrice,
Thanks for your reply but the Configure/FeaturedProducts sorts the side box but not the center box for featured products.

I figured out how to fix that and just added a contribution called Featured Items Sorted in the "Other Modules" section of downloads with a fix I created for this.

I hope that helps others looking for a similar solution.