Same Images on Secure and Non-Secure Pages

When customers enter their credit card and payment information, they need to know that the website is secure and their information will not be stolen. This gives peace of mind to both customers and merchants. When setting up secure pages, like the shopping cart, it is important that all information meets the correct format. Everything on the checkout, confirmation and thank you pages must be secure.

ShopSite has a special URL for secure images, and on the Checkout, Confirmation, and Thank You pages you’ll want to use this specific image URL for your images which appear on those pages. On the other pages (the shopping cart, search results, and general store pages) you’ll want to use the regular image directory.

The instructions below show you how you can use the same include file, such as a header include or footer include, on both secure and non-secure pages. In order to use the sample code listed here, you’ll need to create a new variable in your custom template. On the page, product, advanced templates, and shopping cart page, include the following code. Make sure the code is inside the define tags:

    [-- VAR.Secure "no" --]

Inside the shopping cart template for Checkout (billing/shipping), Confirmation, and Thank You pages, include this code. Note that you do not include this code on the Shopping Cart page itself. You’ll set the shopping cart to “no.”

    [-- VAR.Secure "yes" --]

When including an image, you’ll then supply the code below. This code will call the correct image, adjusting the media directory and image name accordingly:

    [-- IF VAR.Secure "yes" --]
    [-- IF SC_USE_SECURITY --]
    <img src="[-- STORE.SC_Secure_Image_URL --]/media/image.jpg">
    [-- ELSE --]
    <img src="[-- STORE.Output_URL --]/media/image.jpg">
    [-- END_IF --]
    [-- ELSE --]
    <img src="[-- STORE.Output_URL --]/media/image.jpg">
    [-- END_IF --]

If your shopping cart has a secure URL set up, it will use that URL and all the images will be secure. Otherwise it will use the standard URL.This prevents the common error that occurs with custom templates---customers get a warning that there are elements on the page that are not secure. Using this code will ensure that your images are being called correctly.