Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / hyperlink from product list

hyperlink from product list

Locked

Views: 1,032

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
27 Aug 2008, 5:08 AM
#1
jeff_g avatar

jeff_g

Zen Follower

Join Date:
Oct 2007
Posts:
132
Plugin Contributions:
0

hyperlink from product list

Hi,

I have a main site that lists various restaurants. Each restaurant is created as a product within a category. Each restaurant has its' own site (a subdomain of the main site.)

I put the site URL in "Product URL" in the product description and of course it works if I click there.

How can I have the URL active on the Product Listing Screen and eliminate the need to go to the product detail page?

The test site is here:
http://werdna.catplaques.com/index.php?main_page=index&cPath=2
Each of these 2 restaurants has a link to a new ZC site.

I don't think it matters, but this is set up using the multisite module.

Thanks,
Jeff

27 Aug 2008, 5:31 AM
#2
kobra avatar

kobra

Black Belt

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

Re: hyperlink from product list

You will have to copy the product info code for productInfoLink and work it into the "array" for the product listing. Arrays are for me difficult to manage but that is where it needs to be

28 Aug 2008, 4:24 AM
#3
jeff_g avatar

jeff_g

Zen Follower

Join Date:
Oct 2007
Posts:
132
Plugin Contributions:
0

Re: hyperlink from product list

Thanks Kobra,

You put me in the right direction.

I don't know php so I am doing by example. I've got it partially working.

I took the link code from tpl_product_info_display.php

<p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link (FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>

I then changed (hacked) the line in product_listing.php and ended up with this:

$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link ( FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false) . '">' . $listing->fields['products_name'] . '</a></h3><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>';

When I hover over the Description, the link shows up to the url&goto=, but the url is missing.

Any suggestions why or how to properly define the $products_url? I think that missing definition is the problem.

Thanks again,
Jeff

30 Aug 2008, 4:33 AM
#4
jeff_g avatar

jeff_g

Zen Follower

Join Date:
Oct 2007
Posts:
132
Plugin Contributions:
0

Re: hyperlink from product list

With Kobra's suggestion, and after much searching of the forums, I believe what I said in my last post to be correct.

As I suspected the $products_url is not valid/defined in product_listing.php.

A very old post suggests (for a similar problem) to "add a function to do this look up", but offers no example on how to write the function.

Any help here would be greatly appreciated!

Thanks again,
Jeff