Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / clickable links in main product listing page, possible?

clickable links in main product listing page, possible?

Locked

Views: 2,034

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
12 Jul 2008, 11:43 PM
#1
modchipfitters_co_uk avatar

modchipfitters_co_uk

Zen Follower

Join Date:
Sep 2006
Location:
United Kingdom
Posts:
190
Plugin Contributions:
0

clickable links in main product listing page, possible?

i want to remove the product info page but in the product listing page i need to make either some or all of the product description text or image into a link that would link to an external site

what i am doing is building an affiliate site for a customer using zen cart as the base of the site
take a look here http://www.the-highstreet.org/

so i dont need most of the ecommerce features
im using the products features to list the companies that he is advertising on his site so a product is really an advertiser
but what my client insists on is for his customers to be able to just click on the product description on the product listing page and a new window open with the advertisers own website there

does that make any sense?
if not ask questions and i will try to clarify

13 Jul 2008, 12:10 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: clickable links in main product listing page, possible?

Makes sense, but you don't want to do it (although I have to admit I'm not sure I understand why you want to use Zencart in the first place if you 'don't need the ecommerce features').

Zencart isn't meant to be a backend cart script, and moving back and forth between Zencart and another site causes all manner of sessions problems.

13 Jul 2008, 11:33 AM
#3
modchipfitters_co_uk avatar

modchipfitters_co_uk

Zen Follower

Join Date:
Sep 2006
Location:
United Kingdom
Posts:
190
Plugin Contributions:
0

Re: clickable links in main product listing page, possible?

i do want to do it otherwise i wouldnt have asked lol

session wont be a problem as the new site will open in a new window

zencart made it easy to add and remove advertisers and the banner manager is perfect to easily administer the main page banners

all i want to know is:
1, is it possible
2, how do i do it

please bare in mind im not a good php coder but i can modify php fioles if there are clear enough instructions

13 Jul 2008, 2:43 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: clickable links in main product listing page, possible?

The whole point of this site is apparently for finding advertisers, so the question is reasonable in that context.

You can use HTML in product descriptions, so with a tiny tweak to /includes/modules/your_template/product_listing.php the listing description can have the external link. Find this section```php
if (isset($_GET['manufacturers_id'])) {
$lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>' ;
} else {
$lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>';
}

/*zen_clean_html*/
in two places to get```php
        if (isset($_GET['manufacturers_id'])) {
          $lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>' ;
        } else {
          $lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>';
        }
13 Jul 2008, 7:33 PM
#5
modchipfitters_co_uk avatar

modchipfitters_co_uk

Zen Follower

Join Date:
Sep 2006
Location:
United Kingdom
Posts:
190
Plugin Contributions:
0

Re: clickable links in main product listing page, possible?

gjh42:

The whole point of this site is apparently for finding advertisers, so the question is reasonable in that context.

You can use HTML in product descriptions, so with a tiny tweak to /includes/modules/your_template/product_listing.php the listing description can have the external link. Find this section```php
if (isset($_GET['manufacturers_id'])) {
$lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>' ;
} else {
$lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>';
}

> /*zen_clean_html*/
> in two places to get```php
        if (isset($_GET['manufacturers_id'])) {
          $lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>' ;
        } else {
          $lc_text .= '<h3 class="itemTitle"><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 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $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>';
        }

your an absolute star this is exactly what i wanted :clap:
thank you very much :cheers: