JShop Extend cart output using cartOutputExtras.php
Never realised that you could extend the output of the cart for other variables by just adding a cartOutputExtra.php file to your /routines. Nice!
Simple add this to /routines as a new file. This instance gets the current URL so that it can be used as {location.url} in your template.
switch ($requiredVars[$z]) {
case "location":
if(!isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on'){
$http="http://";
}else{
$http="https://";
}
if(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == "81") {
$locationNow = $http . $_SERVER['SERVER_NAME'] .":" . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
} else {
$locationNow = $http . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
}
$tpl->addVariable("location",array("url"=>$locationNow));
break;
}
?>
This entry was posted on Monday, August 2nd, 2010 at 12:12 pm and is filed under jshop. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.