Glossary Item Box

Squirrelcart v6.1.0

Checkout

Overview

There are several different templates involved in generating your checkout pages, depending on the step you are on during checkout.

Main Checkout Template - checkout.tpl.php

Overview

Every portion of the checkout process has the overall apperance controlled by the checkout.tpl.php template file. This template is used for every checkout step.

Code Explanation

The default code for the checkout.tpl.php template file is as follows: 

 1: <?php /* This line prevents direct access to template. Don't remove it. */ if (!defined('SC_INCLUDE_OK')) die; ?>
 2: <!-- Template: <?php print basename(__FILE__) ?>
-->
 3:
 4: <
div class="checkout"
>
 5:      <div class="checkout_progress"
>
 6:           <div class="step1 <?php print $Step_1_State ?>">
 7:                <?php if ($Step_1_URL):
?>
 8:                     <a href="<?php print $Step_1_URL ?>"
>
 9:                          <?php print $Step_1_Label ?><br
/>
10:                          <?php print $Step_1_Text
?>
11:                     </a
>
12:                <?php else:
?>
13:                     <?php print $Step_1_Label ?><br
/>
14:                     <?php print $Step_1_Text
?>
15:                <?php endif;
?>
16:           </div
>
17:           <div class="step2 <?php print $Step_2_State ?>">
18:                <?php if ($Step_2_URL):
?>
19:                     <a href="<?php print $Step_2_URL ?>"
>
20:                          <?php print $Step_2_Label ?><br
/>
21:                          <?php print $Step_2_Text
?>
22:                     </a>
23:                <?php else:
?>
24:                     <?php print $Step_2_Label ?><br
/>
25:                     <?php print $Step_2_Text
?>
26:                <?php endif;
?>
27:           </div
>
28:           <div class="step3 <?php print $Step_3_State ?>">
29:                <?php if ($Step_3_URL):
?>
30:                     <a href="<?php print $Step_3_URL ?>"
>
31:                          <?php print $Step_3_Label ?><br
/>
32:                          <?php print $Step_3_Text
?>
33:                     </a
>
34:                <?php else:
?>
35:                     <?php print $Step_3_Label ?><br
/>
36:                     <?php print $Step_3_Text
?>
37:                <?php endif;
?>
38:           </div
>
39:           <div class="step4 <?php print $Step_4_State ?>">
40:                <?php print $Step_4_Label ?><br
/>
41:                <?php print $Step_4_Text
?>
42:           </div
>
43:      </div
>
44:
45:      <?php
print sc_msg($Success_Message,'success')
?>
46:      <?php print sc_msg($Alert_Message,'alert')
?>
47:      <?php print sc_msg($Error_Message,'error')
?>
48:      <?php print sc_msg($Info_Message)
?>
49:
50:      <!-- content varies based on step we are on in the checkout progress -->
51:      <?php print $Checkout_HTML
?>
52: </div>

 

Line #1:

This ensures that this file is only included by Squirrelcart, and is a security precaution. It appears at the top of all template files.

 

Line #2:

This line appears in all templates. It outputs an HTML comment to make it easiery to locate the template file by viewing the source code.

Example:

<!-- Template: store_main -->

 

Line #4:

This surrounds the entire checkout content

 

Lines #5 - 43:

This section of code outputs the checkout progress steps. The labels for the steps can be controlled on the Visual Settings page in your control panel.

 

Lines #45 - 48:

Each line outputs a different type of message if one is available. The message.tpl.php template file controls the overall appearance of these messages.

 

Line #51:

This line outputs HTML that varies based on the step we are on in the checkout process. See the section below for details on templates used for specific checkout steps.

Viewing Cart Templates

checkout_view.tpl.php - controls most of the HTML when viewing your cart

 

checkout_view_buttons.tpl.php - this template is used to display the buttons used to checkout - Continue Shopping, Empty Cart, Update Cart, and Checkout

 

checkout_view_buttons_amazon.tpl.php -  this is an alternate template used in place of checkout_view_buttons.tpl.php. It is only used when Checkout By Amazon is enabled.

 

checkout_view_buttons_google.tpl.php -  this is an alternate template used in place of checkout_view_buttons.tpl.php. It is only used when Google Checkout is enabled.

Empty Cart Template

checkout_empty_cart.tpl.php - When the customer clicks Empty Cart, this template is used to display the confirmation form.

Account Choice Template

The account choice form may appear during checkout if enabled. This form is used for other operations as well, and is discussed in the Account Choice topic in this section.

Account Form Template

The account form may appear during checkout if your customer chooses to create an account during the checkout process. This form is used for other operations as well, and is discussed in the Account Form topic in this section.

Address Form Template

Overview

The address form is seen when the customer clicks Skip Account on the Account Choice page, OR if they click Edit in one of the address blocks at the top of the Viewing Cart page. The fields shown on the form are controlled by the Address Form Settings page.

address form

Templates

checkout_address_form.tpl.php - controls the entire address form, with the exception of the template listed below

 

checkout_address_paypal_express.tpl.php - if PayPal Express Checkout (part of PayPal Website Payments Pro) is enabled, this template is used to show the button to checkout via Express Checkout.

Shipping Rate Form Template

shipping rate selection

checkout_ship.tpl.php - This template controls the shipping rate selection form.

Payment Templates

payment form

checkout_pay.tpl.php - this is the main template that controls the payment portion of the checkout process

 

checkout_pay_cvv2_help.tpl.php - this template controls the page that is shown when you click the "help" link to the right of the Security Code field

 

checkout_pay_final.tpl.php - some payment gateways require a separate page after the one shown above, to send/confirm payment. This template controls that page.

 

checkout_pay_order_summary.tpl.php - this template controls the order summary at the top of the payment page

 

checkout_pay_redirect.tpl.php - for payment systems that require sending the customer to their site for payment, this template controls the page shown while that redirect is occurring

 

checkout_pay_redirect_iframe.tpl.php - this template is used in conjunction with the one listed directly above

 

checkout_pay_stratapay*.tpl.php - templates used in conjunction with the Stratapay payment method. 

Checkout Done Template

When an order is completed, a thank you page is shown that includes a record of what the customer ordered. The HTML for that section of the checkout is controlled by the checkout_done.tpl.php template file. The "Thanks for your order..." message at the top of the page is controlled by the Thank You Message field on your Visual Settings control panel page.

 

 


© 2001-2017 Lighthouse Development. All Rights Reserved.