Jeepstone

The home of Pete Jones

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.

One Response to “JShop Extend cart output using cartOutputExtras.php”

  1. Articles » Blog Archive » Getting Your Car Audio System Components to Work Together Says:

    August 4th, 2010 at 2:55 pm

    [...] JShop Extend cart output using cartOutputExtras.phpToshiba SD-5980 Progressive Scan DVD Player with HDMI Output … [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Jeepstone is proudly powered by WordPress 3.1 | Entries (RSS) | Comments (RSS).