Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / More link on product listing page

More link on product listing page

Locked

Views: 2,336

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
1 Mar 2008, 11:49 PM
#1
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

More link on product listing page

Sorry to bother you with such a basic question...

Somewhere I think I turned off a switch that would create a link (to the product info page) on the product listing page when the product description was truncated. After the truncation it would say ...more and now it doesn't.

Am I right or am I remembering wrong? I've been hunting for a while now. Please set me straight! :smile:

29 Oct 2008, 5:48 PM
#2
itsjosh avatar

itsjosh

New Zenner

Join Date:
Oct 2008
Posts:
12
Plugin Contributions:
0

Re: More link on product listing page

I realize this post is old, but did you ever have any luck figuring this out? I'm in the same boat and can't seem to find any info on solving it.
thanks

29 Oct 2008, 6:13 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: More link on product listing page

You could customize the products_listing module and build a:
... more info

link with the following:

          $lc_more = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
29 Oct 2008, 6:51 PM
#4
itsjosh avatar

itsjosh

New Zenner

Join Date:
Oct 2008
Posts:
12
Plugin Contributions:
0

Re: More link on product listing page

Worked like a charm. Thanks Ajeh!

29 Oct 2008, 8:35 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: More link on product listing page

You are most welcome ... thanks for the update that this worked for you ... :smile:

7 Nov 2008, 11:04 PM
#6
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: More link on product listing page

Can you tell me where you put that code? Many thanks!

8 Nov 2008, 5:01 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: More link on product listing page

That code can go anywhere in the module for the products_listing that you would want to see the ... more info ...

12 Nov 2008, 3:08 AM
#8
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: More link on product listing page

I'm sorry Ajeh... I tried hard, but every time I try to add it the products won't display... I'm messing something up. Here's a link to my product listing page: http://www.threesistersfabric.com/fabric-2/fabric-by-collection-1/portobello-market-by-3-sisters-108/

The description is truncated by a "...". I'd like to add the "...more info" link, but I need a little more coaching. Thanks very much.

12 Nov 2008, 6:02 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: More link on product listing page

Did you add the new variable:
$lc_more

to where the current products_description is being displayed so that the new ... more info link shows?

12 Nov 2008, 6:21 PM
#10
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: More link on product listing page

I think so.... (I've only dabbled with PHP since I started using Zen Cart, so I'm still not clear in my head as to what a variable is exactly. I'm going through a course, but haven't made all the connections mentally, if you know what I mean!)

I copied the code you gave above and tried to add it to line 137... Does it not belong somewhere within this: > <div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;

I appreciate your patience. I really would like to learn this better!

12 Nov 2008, 7:33 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: More link on product listing page

$lc_more is now the link for the text ... more info ...

But, you have to add that to the code to display ...

This, excluding the HTML for clarity, is displaying the products_description on the page:

zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listi ng->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION)

You need to now add to that the $lc_more and decide whether to add a space or line break etc or just add it straight on to it ... example:

zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listi ng->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . $lc_more
3 Jun 2009, 9:32 AM
#12
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: More link on product listing page

Hi, I too am stuck with this, all I want is a link that reads 'More info' after the ... on all the products on product listing page. I'm quite new to php and can't work out which bits of code to put where. I know I have to put code into product_listing.php but if someone could explain in lamens terms exactly which bits of code to insert where in product_listing.php to achieve my desired result.

Many thanks.

3 Jun 2009, 10:42 AM
#13
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: More link on product listing page

Ignore me, I found another thread with the answer. Thanks

3 Jun 2009, 1:37 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: More link on product listing page

What thread was that? :smile:

3 Jun 2009, 11:00 PM
#15
three_sisters avatar

three_sisters

Zen Follower

Join Date:
Nov 2006
Location:
Indiana
Posts:
188
Plugin Contributions:
0

Re: More link on product listing page

Yeah, I'd love to know too! As you can see on my website, I still don't have it figured out and gave up to put out bigger fires. :smile:

9 Jun 2009, 4:29 PM
#16
sushigal avatar

sushigal

Zen Follower

Join Date:
Mar 2009
Posts:
435
Plugin Contributions:
0

Re: More link on product listing page

ah, sorry I've forgotten but I'll try find the link to the thread where I found my answer, watch this space...

9 Jun 2009, 4:57 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: More link on product listing page

Thanks for the udpate and posting where you found the solution ... that is really a great help for others! :smile: