Skip to content

Commit 28e3172

Browse files
committed
refactored template file
1 parent dd2a959 commit 28e3172

File tree

1 file changed

+16
-16
lines changed
  • app/design/frontend/base/default/template/piwikanalytics

1 file changed

+16
-16
lines changed

app/design/frontend/base/default/template/piwikanalytics/piwik.phtml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@
1919

2020
if ($siteId) {
2121

22-
/*path for noscript should take unadultered path*/
22+
/*path for noscript should take unaltered path*/
2323
$bugPath = $installPath;
2424

25-
if (strpos($installPath, "https://") !== false) {
26-
$secureinstallPath = $installPath;
27-
$installPath = str_replace("https://", "http://", $installPath);
25+
if (strpos($installPath, 'https://') !== false) {
26+
$secureInstallPath = $installPath;
27+
$installPath = str_replace('https://', 'http://', $installPath);
28+
}
29+
if (strpos($installPath, 'http://') === false) {
30+
$installPath = 'http://' . $installPath;
31+
$secureInstallPath = str_replace('http://', 'https://', $installPath);
2832
}
29-
if (strpos($installPath, "http://") === false)
30-
$installPath = "http://" . $installPath;
31-
32-
$secureinstallPath = str_replace("http://", "https://", $installPath);
3333

34-
$last = $installPath[strlen($installPath)-1];
34+
$last = $installPath[strlen($installPath) - 1];
3535

36-
if ($last != "/") {
37-
$installPath .= "/";
38-
$secureinstallPath .= "/";
36+
if ($last != '/') {
37+
$installPath .= '/';
38+
$secureInstallPath .= '/';
3939
}
4040

4141
// 0 Search Results
4242
if($this->getRequest()->getControllerName()=='result') {
43-
$nores = Mage::helper('catalogsearch')->getEngine()
43+
$noRes = Mage::helper('catalogsearch')->getEngine()
4444
->getResultCollection()
4545
->addSearchFilter(Mage::helper('catalogsearch')
4646
->getQuery()
@@ -53,16 +53,16 @@
5353
<script type="text/javascript">
5454
//<![CDATA[
5555
var _paq = _paq || [];
56-
(function(){ var u=(("https:" == document.location.protocol) ? "<?php echo $secureinstallPath ?>" : "<?php echo $installPath ?>");
56+
(function(){ var u=(("https:" == document.location.protocol) ? "<?php echo $secureInstallPath ?>" : "<?php echo $installPath ?>");
5757
_paq.push(['setSiteId', <?php echo $siteId ?>]);
5858
_paq.push(['setTrackerUrl', u+'piwik.php']);
5959
<?php echo $this->_getEcommerceCartUpdate()?>
6060
<?php echo $this->_getOrdersTrackingCode()?>
6161
<?php echo $this->_getProductPageview()?>
6262
<?php echo $this->_getCategoryPageview()?>
6363

64-
<?php if (isset($nores)): ?>
65-
_paq.push(['setCustomUrl', '' + document.URL + '&search_count=<?php echo $nores ?>']);
64+
<?php if (isset($noRes)): ?>
65+
_paq.push(['setCustomUrl', '' + document.URL + '&search_count=<?php echo $noRes ?>']);
6666
<?php endif ?>
6767

6868
<?php

0 commit comments

Comments
 (0)