It appears I have found a bug in the current fileset, relating to the creating of urls from the admin side.
I find that very hard to believe but since Conor is not here to enlighten me, I'll describe in detail so someone else can corroborate it.
Catalog Side
On a page, links to other pages are created using the Catalog function zen_href_link
This builds the link in two chunks:
a) The server bit that is the same per site, eg: www.mysite.com/myshop/
I'll call this the link stub to simplify things.
b) The page bit: index.php?main_page=product_info&cPath=2_1273&products_id=819
The CEON URI code is inserted between a) and b) and when enabled, makes a nice friendly url like this:
manufacturers/rg-racing/general-accessories/rg-dhb0001bk-deluxe-helmet-bag
And it returns the two bits concatenated to make the link:
www.mysite.com/myshop/manufacturers/rg-racing/general-accessories/rg-dhb0001bk-deluxe-helmet-bag
All well and good.
Admin Side
URI mapping is used on the admin side to generate friendly urls such as emails sent to customers such as Back in Stock notifications, or Abandoned Shopping Cart reminders, Order Status updates, Sitemapxml.
In this case the Admin function zen_catalog_href_link is used.
In the CEON fileset, I find two things that stop this from building the link correctly.
1) the CEON code is inserted BEFORE the a) above, so only the page link is returned from the function:
manufacturers/rg-racing/general-accessories/rg-dhb0001bk-deluxe-helmet-bag
2) The CEON method/function call is this:
buildHREFLink(NULL, $page, $parameters, $connection, false))
The first parameter is the link stub that has to be prefixed to the friendly url.
As it is set to null it still will not work. It should be "$link".
Once these two changes are made, the email links are generated correctly.
So, for those who want to test, the complete Admin function zen_catalog_href_link as I currently have it is
PHP Code:
function zen_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
global $zco_notifier;
$link = null;
$zco_notifier->notify('NOTIFY_SEFU_INTERCEPT_ADMCATHREF', array(), $link, $page, $parameters, $connection);
if($link !== null) return $link;
if ($connection == 'NONSSL') {
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL_CATALOG == 'true') {
$link = HTTPS_CATALOG_SERVER . DIR_WS_HTTPS_CATALOG;
} else {
$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;
}
} else {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>zen_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
// BEGIN CEON URI MAPPING 1 of 1 - placed AFTER the web server address is built as per the catalog side but NOT as per the file in the CEON URI installation pack!! This issue is highlighted by BISN that uses this function.
if (defined('CEON_URI_MAPPING_ENABLED') && CEON_URI_MAPPING_ENABLED == 1) {
if (!isset($ceon_uri_mapping_href_link_builder)) {
static $ceon_uri_mapping_href_link_builder;
require_once(DIR_FS_CATALOG . DIR_WS_CLASSES . 'class.CeonURIMappingHREFLinkBuilder.php');
$ceon_uri_mapping_href_link_builder = new CeonURIMappingHREFLinkBuilder();
}
if ($ceon_uri_mapping_href_link_builder->buildHREFLink($link, $page, $parameters, $connection, false)) {//steve changed first parameter from null to link or it loses the base server address
return $ceon_uri_mapping_href_link_builder->getHREFLink();
}
}
// END CEON URI MAPPING 1 of 1
if ($parameters == '') {
$link .= 'index.php?main_page='. $page;
} else {
$link .= 'index.php?main_page='. $page . "&" . zen_output_string($parameters);
}
while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
return $link;
}
But then again, I might be missing something...!!
Bookmarks