<?php if($_SERVER['https'] == 'on') : ?> <?php // HTTPS tracking code goes here ?> <?php else : ?> <?php // HTTP tracking code goes here ?> <?php endif; ?>
You can write it using isCurrentlySecure like this:
<?php if (Mage::app()->getStore()->isCurrentlySecure()): ?> <?php // HTTPS tracking code goes here ?> <?php else : ?> <?php // HTTP tracking code goes here ?> <?php endif; ?>
I know that it is not a big issue but it would be nicer if you use magento methods as possible. The above code is also applicable when you are planning to put tracking scripts that have HTTPS and HTTP version.
0 comments:
Post a Comment