1

As far as I know the function checks whether HTTPS is activated over the backend. Why would you pass the function to go without it then?

Example:

$this->getUrl('checkout/cart');

Returns http://localhost/checkout/cart/ whilst

 $this->getUrl('checkout/cart', array("_secure"=>true));

returns https://localhost/checkout/cart/, but only when its active in the backend. You could call app() and check for the value as well, but its just burning calculating time on the server as the function will only return https when it is enabled anyhow.

1

Can't answer the "why" ... but maybe it's still useful:

If you use http for your unsecure base URL and want to force using secure url on particular pages you can also do this in you config.xml

<frontend>
    <secure_url>
        <cms_newsletter>/newsletter</cms_newsletter>
        <sendfriend_product>/sendfriend/product</sendfriend_product>
    </secure_url>
</frontend>
| improve this answer | |
  • 1
    I belive that this "sometimes https, sometimes http" is a relict from earlier times of securing websites where you especially only secured specific pages. SSL has nowadays another standing. – Max Jul 16 '17 at 13:37
  • 1
    Yep. This is why i can't answer the "why" question ... all sites i'm involved use SSL everywhere. – sv3n Jul 16 '17 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.