view_cart.vm
In addition to other standard variables like $cart
, StoreFront system screens (display and post form data, such as checkout screens) have a $form
variable that contains fields and data specific to that screen.
Listed below are the form fields specific to this screen template.
Form Legend
→ form field
→ submit button
Most of the boolean flags below are dictacted by Merchant Properties. These were seldom used flags created to allow merchants non-standard cart behavior during a time when they had limited control of the web design. With the introduction of the StoreFronts, these properties and flags aren't necessary. Now, if a merchant wishes non-standard cart behavior, he or she may edit the template as desired. The standard themes created by UltraCart will still contain references to these flags and properties to ensure they are backward compatible with long time customers who upgrade from a legacy cart to StoreFronts. If you are designing a new theme for personal use, you may wish to streamline and omit support for these conditionals all together. If you are designing a theme for general use, should you support these flags and merchant properties? Probably not worth the headache.
$form
variables for template view_cart.vm
Name | Type | Formal Syntax | Form Data? | Required on Post? | Comments/Sample Usage |
---|---|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
| same as showChangeCurrency. Use showChangeCurrency instead. |
|
|
|
|
| deprecated. and misspelled too.
|
|
|
|
|
|
|
|
|
|
| submit button. if non-null, this parameter signals the UltraCart engine that the payment method is Amazon Payments | |
|
|
|
|
| amazon merchant id |
|
|
|
|
| this is populated by the amazon payments and must be present and valid if |
|
|
|
|
| if true, the amazon address book should load and display |
|
|
|
|
| script url for the "Pay with Amazon" button. Example:
|
|
|
|
| submit button. if non-null, instructs the engine to apply a supplied affiliate id | |
|
|
|
| submit button. if non-null, instructs the engine to apply a coupon | |
|
|
|
| submit button. rarely used. If non-null, instructs the engine to apply a referral code | |
|
|
|
|
| if true, a buysafe bond is available and should be offered. |
|
|
|
| submit button. if non-null, notifies the engine that the customer has selected/de-selected a buysafe bond. | |
|
|
|
| the cost of the buysafe bond | |
|
|
|
|
| if true, the bond is being offered free by the merchant |
|
|
|
|
| if true, the customer has indicated that they want the bond. this should be set to true if the customer chooses to opt into a bond |
|
|
|
|
| deprecated. use example code provided by stock templates. this html creates the buysafe logo on the checkout, but it is non-responsive and unfit for mobile browsers. |
|
|
|
|
| deprecated. use example code provided by stock templates. |
|
|
|
|
| deprecated. use example code provided by stock templates. |
|
|
|
|
| deprecated. use example code provided by stock templates. |
|
|
|
|
| deprecated. use example code provided by stock templates. |
|
|
|
|
| This is a rarely used Merchant Property that, when present and true, should render out the ability to close the window. This flag means that the cart was opened in another window already. For example: #if($form.cartInNewWindow) and later in the page: #if($form.cartInNewWindow) |
|
|
|
| submit button. if non-null, the cart engine examines the currencyCode parameter and changes the cart currency to it. | |
|
|
|
|
| if present and true, open the checkout in a new window. This value, rarely used, is a Merchant Property to allow merchants to open the checkout in a new window. |
|
|
|
|
| the url of the checkout, if a custom url is used. |
|
|
|
|
| if true, one or more items are pre-ordered items. this flag is used to display a pre-order message somewhere prominent on the screen. |
|
|
|
| input submit button. if this is non-null, the shopping experience is redirected back to the catalog page. | |
|
|
|
|
| a coupon to be added to the cart |
|
|
|
|
| This is static text for creating the "Enter Coupons" label. Over the years, there seems to be a huge amount of customization over the years for coupons. "Enter Coupon" vs. "Enter Coupons" vs. "Enter Coupon Code". So, this field will contain the value from the constant "checkout.viewcart.couponCodeText", "coupon code" |
|
|
|
|
| Used to show the total number of coupons. For example, "5 Coupons" would need a plural version of the word 'coupon', whatever language that may be. |
|
|
|
|
| Used to show the total number of coupons. For example, "1 Coupon" would need a singular version of the word 'coupon', whatever language that may be. |
|
|
|
|
|
|
|
|
|
|
| The currency or target currency code. |
|
|
|
|
| example: USD |
|
|
|
|
| example: $ |
|
|
|
|
| the email address of the customer |
|
|
|
|
| |
|
|
|
|
| If true, the checkout is immedatiatly finalized. |
|
|
|
|
| formatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas |
|
|
|
|
| formatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas |
|
|
|
|
| formatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas |
|
|
|
|
| formatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas |
|
|
|
|
| formatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas |
|
|
|
|
| if true, the free promotional item is added to the cart. |
|
|
|
|
| confirmation boolean |
|
|
|
|
| Some merchants wish to include a free promotional item (configured on the back end). this html presents that offer to the customer. |
|
|
|
|
|
|
|
|
|
|
| if true, do not show quantity |
|
|
|
|
| if true, do not link the item images to their view urls |
|
|
|
|
| if true, any options that do not yet have a What are qualifiers? The original name of options. 20 years is a long, long time. |
|
|
|
|
|
|
|
|
|
|
| see Message, see info_messages.vm |
|
|
|
|
|
|
|
|
|
|
| if true, do not allow item quantities to be edited |
|
|
|
|
| if true, do not allow any edits on items (no deletions) |
|
|
|
|
|
|
|
|
|
|
| deprecated. |
|
|
|
| submit button. if true, the cart payment method is PayPal. | |
|
|
|
|
|
|
|
|
|
| submit button. if true, the cart payment method is PayPal Bill Me Later. | |
|
|
|
|
|
|
|
|
|
| if true, the cart totals and shipping are recalculated | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Items related to the shopping cart items. These are displayed in a section usually titled "Customer who bought these products also bought these items", etc. | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| This is a merchant property. If true, a drop down of currency codes may be displayed allowing the customer to select the checkout currency. The drop down should have the name This setting is managed on the back end: Home → Configuration → Checkout → Multi-Currency. |
|
|
|
|
| If true, coupon entry should be displayed. There are numerous settings and properties that could cause this to be false:
|
|
|
|
|
| if true, show the coupon section. this is true if there are coupons in the cart or if there is an affiliate id associated with the cart. the affiliate id is for legacy reasons. The original cart displayed the affiliate id below the coupon in the same section. So, technically, just because this is true does not mean there are coupons. You should still check to see if the coupons array is non empty. If it's false, then there are no coupons. |
|
|
|
|
| This is true if any of the items have options, false otherwise. It exists so that a header column or label can be generated for options before looping through the items. |
|
|
|
|
| True if the cart can be paid for by PayPal. To qualify for PayPal, all of the following must be true.
|
|
|
|
|
| This is true if showPayPal is true, unless the merchant has a Merchant Property set to explictly turn this off. |
|
|
|
|
| This is governed by a Merchant Property to collect referral code. Seldom used. If true, the referral code input field should display. |
|
|
|
|
| If true, the shipping estimate should display. This is true if the cart needs shipping (and a Merchant Property to turn it off is not true) A cart needs shipping if any of the items have a non-zero weight. |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| if true, the form should have the following attribute: |
|
|
|
|
| if true, any hyperlinks to product pages should open in a new window. |
Sample Code
This template is one of the most complex pages in the entire checkout and is constantly being updated in the stock themes. Rather than post stale code here, please see MrTeas, Craft, or Natural for examples.