Zen Cart Logo
Forums / General Questions / Products_URL display on search engine results page

Products_URL display on search engine results page

Views: 663

Results 1 to 2 of 2
2 May 2014, 5:04 PM
#1
firstglimpse avatar

firstglimpse

New Zenner

Join Date:
May 2014
Location:
Oregon
Posts:
2
Plugin Contributions:
0

Products_URL display on search engine results page

I can see on the product_listing.php effects the layout on the search engine results page.

The website I'm working on is a directory not actually selling products.
All 'product'' results actually go to an external url, which is entered as the products URL in admin.

This is the code I have working successfully for the product listings page:

$lc_text = '<h3 class="itemTitle"><a href="http://'. $listing->fields['products_url'] . '" target="_blank">' . $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) . '<br />' . '<a href="http://'. $listing->fields['products_url'] . '" target="_blank"">' . $listing->fields['products_url'] . '</a></div><br />';

However in the search results page the products_url link only comes back as a forward slash. So if you click on the title it goes to http:///

Then it does not show the extra line of code I have added to display the products_url at the bottom of the description.

See images below.

Attachment 14017

vs.

Attachment 14018

Does anybody have any idea how to get the search results page to recognize the products_URL ?

Thanks!

15 May 2014, 5:03 PM
#2
firstglimpse avatar

firstglimpse

New Zenner

Join Date:
May 2014
Location:
Oregon
Posts:
2
Plugin Contributions:
0

Re: Products_URL display on search engine results page

Firstglimpse:

I can see on the product_listing.php effects the layout on the search engine results page.

The website I'm working on is a directory not actually selling products.
All 'product'' results actually go to an external url, which is entered as the products URL in admin.

This is the code I have working successfully for the product listings page:

$lc_text = '<h3 class="itemTitle"><a href="http://'. $listing->fields['products_url'] . '" target="_blank">' . $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) . '<br />' . '<a href="http://'. $listing->fields['products_url'] . '" target="_blank"">' . $listing->fields['products_url'] . '</a></div><br />';

However in the search results page the products_url link only comes back as a forward slash. So if you click on the title it goes to http:///

Then it does not show the extra line of code I have added to display the products_url at the bottom of the description.

See images below.

Attachment 14017

vs.

Attachment 14018

Does anybody have any idea how to get the search results page to recognize the products_URL ?

Thanks!


SOLUTION FOUND:

includes/modules/advanced_search_results/header_php.php

add the following: pd.products_url into this code, approximately line 205

$select_str = "SELECT DISTINCT " . $select_column_list .
" m.manufacturers_id, p.products_id, pd.products_name, pd.products_url, p.products_price, p.products_tax_class_id, p.products_price_sorter, p.products_qty_box_status, p.master_categories_id ";