Hi Guys,
I have for some unavoidable reason - duplicate products and duplicate categories in my website. I need to modify the canonical function so that the search engine indexes only one url.
I found the canonical function code - but for some reason whenever I try to modify - the website goes down.
The actual zen cart code is:
1)
Here - I need to check if the product id is greater than 2000 then the canonical url to should point to the URL of the product id minus 1000. So if the current product id is 2646 - the rel canonical tag should point to 1646.
If product id is lesser than 2000 then the function is unchanged.
/**
* for products (esp those linked to multiple categories):
*/
case (strstr($current_page, '_info') && isset($_GET['products_id'])):
$canonicalLink = zen_href_link($current_page, ($includeCPath ? 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($_GET['products_id'])) . '&' : '') . 'products_id=' . $_GET['products_id'], 'NONSSL', false);
break;
/**
2)
Here - I need to check if the product id is greater than 200 then the canonical url to should point to the URL of the cateogory id minus 100. So if the current category id is 264 - the rel canonical tag should point to 164.
If product id is lesser than 2000 then the function is unchanged.
* for product listings:
*/
case ($current_page == 'index' && isset($_GET['cPath'])):
$canonicalLink = zen_href_link($current_page, zen_get_all_get_params($excludeParams), 'NONSSL', false);
break;
/**
I know this sounds simple - I cant figure out what wrong I am attempting to do :)



Reply With Quote



Bookmarks