Forums / Templates, Stylesheets, Page Layout / modifying the featured product listing on the main page

modifying the featured product listing on the main page

Locked

Views: 2,567

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
19 Jul 2008, 8:01 PM
#1
klagreca avatar

klagreca

New Zenner

Join Date:
Jul 2008
Posts:
7
Plugin Contributions:
0

modifying the featured product listing on the main page

Hi folks!

I'm trying to modify the main page's "Featured Products" center box. Instead of showing an image of a product, I want to display a complete product listing, such as you'd see in a complete "Featured Product" listing.

I tried to cut the table from tpl_modules_products_featured_listing.php into the tpl_modules_featued_products.php file, but the main page will show "No featured" products.

Also, I'd want it to radomize the product, like the "monthly specials" listing on the home page does, but for now, just getting the listing to work with just one would be a great step.

I'm probably missing a variable to pass via PHP, but I'm not sure. Can anyone give me any tips with this?

Thanks!
Kris

19 Jul 2008, 10:36 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: modifying the featured product listing on the main page

There is a thread about this and yellow1912 posted how to do this...
You will have to search for it

Zen-Venom Get Bitten

20 Jul 2008, 7:11 PM
#3
klagreca avatar

klagreca

New Zenner

Join Date:
Jul 2008
Posts:
7
Plugin Contributions:
0

Re: modifying the featured product listing on the main page

Thanks Kobra. I did check out his posts but they didn't seem to fit the bill. However in my search I did fine this:
http://www.zen-cart.com/forum/showthread.php?p=586609#post586609
That looked like it. And I added the code following directions...

I'm almost there. I just can't seem to get the description to show. Any ideas? I think the error is here, but I'm not sure exactly where the error lies:

$products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($featured_products->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION); $info_link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '"> more info...</a>';  

Thanks for any help.
K

20 Jul 2008, 7:27 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: modifying the featured product listing on the main page

Link to this page on your site?

Zen-Venom Get Bitten

22 Jul 2008, 12:12 AM
#5
chuck avatar

chuck

Totally Zenned

Join Date:
Jul 2005
Posts:
255
Plugin Contributions:
0

Re: modifying the featured product listing on the main page

I like kobra's suggestion
I think he's referring to this: http://www.zen-cart.com/forum/showthread.php?t=84174

31 Jul 2008, 12:20 AM
#6
klagreca avatar

klagreca

New Zenner

Join Date:
Jul 2008
Posts:
7
Plugin Contributions:
0

Re: modifying the featured product listing on the main page

Honestly, the singular template suggestion looks tempting, but I'm only a few steps away from my goal. I'd rather not pull everything apart, especially since I barely understand the single template solution.

From my debugging, it looks like there's an error with calling the variable "$featured_products". It might have existed in 1.3.7, but the site is on 1.3.8.

I have a "work in progress" up.

I should be able to find the right variable. I'll keep you posted.

Thanks!
Kris

12 Aug 2008, 9:57 PM
#7
klagreca avatar

klagreca

New Zenner

Join Date:
Jul 2008
Posts:
7
Plugin Contributions:
0

Re: modifying the featured product listing on the main page

Okay, so far, I swapped in the the $display_products_description call and variable from tpl_modules_products_featured_listing.php, and that doesn't work as well.

Julie, in the "more info..." link, does the link have the product_id? I discovered that doesn't work either. I cannot, for the life of me, tell what's wrong. Here's the function:

$info_link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . 'more info...</a>';

But, I put this code into the function, instead of using the variable, and it works. I don't know enough of PHP to understand why.

At this point, I'm still trying to get the description to show. I'll keep you posted!

Kris

13 Aug 2008, 10:47 PM
#8
askjv avatar

askjv

New Zenner

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

Re: modifying the featured product listing on the main page

Hi, the "more info" link does not show the product ID and results in a "product not found" page, while the product image does have the correct id in the link and works. Will let you know if I figure anything out but I think I know less php. Julie