I am installing Clicky code on a Magento website. I would like to use their HTTPS tracker only on HTTPS enabled pages of Magento. How can I do this?
I tried
<?php if($_SERVER['https'] == 'on') : ?>
but that doesn't work.
Any suggestions on identifying HTTPS pages will be of great help!
Thanks.
Magento actually provides a method for this for you.
Use this to check whether you are in secure mode:
// check to see if your store is in secure mode
$isSecure = Mage::app()->getStore()->isCurrentlySecure();
Hope that helps!
Thanks, Joe
Native Magento solution
$isSecure = Mage::app()->getFrontController()->getRequest()->isSecure();
($isSecure) ? 'https://' : 'http://';
This helps to check whether your store front is in https or http
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With