Jump to content

How to make Add to Cart button SSL

Recommended Posts

Hi.  I've been busy trying to make my site fully SSL-friendly.  One of the last issues I'm having is that the Add to Cart button is not SSL, and I don't know how to change it.  

I believe the relevant code in the product_info.php file is this:

<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>

How do I make that generate an https:// url?   

Currently it's generating:  <form name="cart_quantity" action="http://www.mydomain.com/productname-2222.html?action=add_product" method="post">

I can't figure out hot to get an "s" in there...


Share this post

Link to post
Share on other sites

The easy way to do this is to use the HTML rewrite rules for your particular Web server and OS. This will redirect all http://.... requests into the equivalent https://.... request. The way to do this will vary for different software configurations, but it's often as easy as ticking a single option box in the server configuration area. In my case I also changed the URL's in the includes/configure.php file so that both paths to the site (ie, both HTTP_SERVER and HTTPS_SERVER) used the https: syntax rather than http:, and also set all of the rest of the links in that file to point to the same places for files and cookies. After doing all that I appear to have caught all of the major ways to get an internal reference to an http: URL on my site, and even if I've missed some they'll still get redirected to https.

All of this is now vastly easier than the bad old days when https was limited to protecting only one site per IP address.

Hope that helps.


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now