To upgrade page cache Chemo contribution 1.5:
STEP 6 - Edit includes/functions/html_output.php
Find this code in tep_href_link():
global $request_type, $session_started;
And REPLACE it with this code:
global $request_type, $session_started, $SID;
Find this code in tep_href_link():
if (isset($_sid)) {
$link .= $separator . $_sid;
}
And REPLACE it with this code:
if (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache')) {
$link .= $separator . '<osCsid>';
} elseif (isset($_sid)) {
$link .= $separator . $_sid;
}
to upgrade seo url Chemo contribution to latest (still in includes/functions/html_output.php) :
////
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $request_type, $session_started, $SID;
$seo = ( defined('SEO_URLS') ? SEO_URLS : false );
$seo_rewrite_type = ( defined('SEO_URLS_TYPE') ? SEO_URLS_TYPE : false );
$seo_pages = array('index.php', 'product_info.php');
if ( !in_array($page, $seo_pages) ) $seo = false;
if (!tep_not_null($page)) {
die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine the page link!<br><br>');
}
if ($page == '/') $page = '';
if ($connection == 'NONSSL') {
$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
$seo_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
$seo_rewrite_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
} elseif ($connection == 'SSL') {
if (ENABLE_SSL == true) {
$link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
$seo_link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
$seo_rewrite_link = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
} else {
$link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
$seo_link = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
$seo_rewrite_link = HTTP_SERVER . DIR_WS_HTTP_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</b><br><br>');
}
if (tep_not_null($parameters)) {
$link .= $page . '?' . tep_output_string($parameters);
$separator = '&';
# Start exploding the parameters to extract the values
# Also, we could use parse_str($parameters) and would probably be more clean
if ($seo == 'true'){
$p = explode('&', $parameters);
krsort($p);
$params = array();
if ( $seo_rewrite_type == 'Rewrite' ){
foreach ($p as $index => $valuepair) {
$p2 = explode('=', $valuepair);
switch ($p2[0]){
case 'products_id':
$rewrite_product = true;
if ( defined('PRODUCT_NAME_'.$p2[1]) ){
$rewrite_page_product = short_name(constant('PRODUCT_NAME_'.$p2[1])) . '-p-' . $p2[1] . '.html';
} else { $seo = false; }
break;
case 'cPath':
$rewrite_category = true;
if ( defined('CATEGORY_NAME_'.$p2[1]) ){
$rewrite_page_category = short_name(constant('CATEGORY_NAME_'.$p2[1])) . '-c-' . $p2[1] . '.html';
} else { $seo = false; }
break;
// manufacturer addition by WebPixie
case 'manufacturers_id':
$rewrite_manufacturer = true;
if ( defined('MANUFACTURER_NAME_'.$p2[1]) ){
$rewrite_page_manufacturer = short_name(constant('MANUFACTURER_NAME_'.$p2[1])) . '-m-' . $p2[1] . '.html';
} else { $seo = false; }
break;
// end manufacturer addition by WebPixie
default:
$params[$p2[0]] = $p2[1];
break;
} # switch
} # end foreach
$params_stripped = implode_assoc($params);
switch (true){
case ( $rewrite_product && $rewrite_category ):
case ( $rewrite_product ):
$rewrite_page = $rewrite_page_product;
$rewrite_category = false;
break;
case ( $rewrite_category ):
$rewrite_page = $rewrite_page_category;
break;
// manufacturer addition by WebPixie
case ( $rewrite_manufacturer ):
$rewrite_page = $rewrite_page_manufacturer;
break;
// end manufacturer addition by WebPixie
default:
$seo = false;
break;
} #end switch true
$seo_rewrite_link .= $rewrite_page . ( tep_not_null($params_stripped) ? '?'.tep_output_string($params_stripped) : '' );
$separator = ( tep_not_null($params_stripped) ? '&' : '?' );
} else {
foreach ($p as $index => $valuepair) {
$p2 = explode('=', $valuepair);
switch ($p2[0]){
case 'products_id':
if ( defined('PRODUCT_NAME_'.$p2[1]) ){
$params['pName'] = constant('PRODUCT_NAME_'.$p2[1]);
} else { $seo = false; }
break;
case 'cPath':
if ( defined('CATEGORY_NAME_'.$p2[1]) ){
$params['cName'] = constant('CATEGORY_NAME_'.$p2[1]);
} else { $seo = false; }
break;
// manufacturer addition by WebPixie
case 'manufacturers_id':
if ( defined('MANUFACTURER_NAME_'.$p2[1]) ){
$params['mName'] = constant('MANUFACTURER_NAME_'.$p2[1]);
} else { $seo = false; }
break;
// end manufacturer addition by WebPixie
default:
$params[$p2[0]] = $p2[1];
break;
} # switch
} # end foreach
$params_stripped = implode_assoc($params);
$seo_link .= $page . '?'.tep_output_string($params_stripped);
$separator = '&';
} # end if/else
} # end if $seo
} else {
$link .= $page;
$separator = '?';
$seo = false;
} # end if(tep_not_null($parameters)
while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);
// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
if (tep_not_null($SID)) {
$_sid = $SID;
} elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
$_sid = tep_session_name() . '=' . tep_session_id();
}
}
}
if ( (SEARCH_ENGINE_FRIENDLY_URLS == 'true') && ($search_engine_safe == true) ) {
while (strstr($link, '&&')) $link = str_replace('&&', '&', $link);
while (strstr($seo_link, '&&')) $seo_link = str_replace('&&', '&', $seo_link);
$link = str_replace('?', '/', $link);
$link = str_replace('&', '/', $link);
$link = str_replace('=', '/', $link);
$seo_link = str_replace('?', '/', $seo_link);
$seo_link = str_replace('&', '/', $seo_link);
$seo_link = str_replace('=', '/', $seo_link);
$seo_rewrite_link = str_replace('?', '/', $seo_rewrite_link);
$seo_rewrite_link = str_replace('&', '/', $seo_rewrite_link);
$seo_rewrite_link = str_replace('=', '/', $seo_rewrite_link);
$separator = '?';
}
if (isset($_sid)) {
$link .= $separator . $_sid;
$seo_link .= $separator . $_sid;
$seo_rewrite_link .= $separator . $_sid;
}
if ($seo == 'true') {
return ($seo_rewrite_type == 'Rewrite' ? $seo_rewrite_link : $seo_link);
} else {
return $link;
}
}
and replace with
////
// Ultimate SEO URLs v2.1
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
global $seo_urls;
return $seo_urls->href_link($page, $parameters, $connection, $add_session_id);
}
Question:
global $request_type, $session_started, $SID;
, I must delete, I must change, or other else?
when I visit page by manufacturer or category, the is session change, and cart is empty