Skip to main content
Reference

view_cart.vm

info

Transcluded from Screen Interface Intro.

Form Legend
:tick: → form field
:green-star: → submit button

info

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

NameTypeFormal SyntaxForm Data?Required on Post?Comments/Sample Usage
affiliateIdstring$form.affiliateId
allowCustomerSelectableCurrencyboolean$form.allowCustomerSelectableCurrencysame as showChangeCurrency. Use showChangeCurrency instead.
allowPassingBrandingboolean$form.allowPassingBrandingdeprecated. and misspelled too.
amazonButtonUrlstring$form.amazonButtonUrl
amazonCheckoutstring$form.amazonCheckout:green-star:submit button. if non-null, this parameter signals the UltraCart engine that the payment method is Amazon Payments
amazonMerchantIdstring$form.amazonMerchantIdamazon merchant id
amazonOrderReferenceIdstring$form.amazonOrderReferenceIdthis is populated by the amazon payments and must be present and valid if amazonCheckout is non-null
amazonUseAddressBookboolean$form.amazonUseAddressBookif true, the amazon address book should load and display
amazonWidgetUrlstring$form.amazonWidgetUrlscript url for the "Pay with Amazon" button.
Example:
<script type='text/javascript'
src='${form.amazonWidgetUrl}?sellerId=${formatHelper.urlEncode($form.amazonMerchantId)}'>
</script>
applyAffiliateIdstring$form.applyAffiliateId:green-star:submit button. if non-null, instructs the engine to apply a supplied affiliate id
applyCouponstring$form.applyCoupon:green-star:submit button. if non-null, instructs the engine to apply a coupon
applyReferralCodestring$form.applyReferralCode:green-star:submit button. rarely used. If non-null, instructs the engine to apply a referral code
cartInNewWindowboolean$form.cartInNewWindowThis 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) <script type="text/javascript"> function closeWindow() { window.close(); return false; } </script> #end
&nbsp;
and later in the page:
#if($form.cartInNewWindow) <input type="image" &nbsp;name="continueShopping" &nbsp;src="/checkout/images/spacer.gif" &nbsp;border="0" &nbsp;class="ucContinueShoppingButton" id="ucContinueShoppingButtonId" &nbsp;onclick="return closeWindow()" /> #else &nbsp;<input type="image" &nbsp;name="continueShopping" &nbsp;src="/checkout/images/spacer.gif" &nbsp;border="0" &nbsp;class="ucContinueShoppingButton" id="ucContinueShoppingButtonId" /> #end
changeCurrencyCodestring$form.changeCurrencyCode:green-star:submit button. if non-null, the cart engine examines the currencyCode parameter and changes the cart currency to it.
checkoutInNewWindowboolean$form.checkoutInNewWindowif 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.
checkoutUrlstring$form.checkoutUrlthe url of the checkout, if a custom url is used.
containsPreorderedItemsboolean$form.containsPreorderedItemsif true, one or more items are pre-ordered items. this flag is used to display a pre-order message somewhere prominent on the screen.
continueShoppingstring$form.continueShopping:green-star:input submit button. if this is non-null, the shopping experience is redirected back to the catalog page.
couponCodestring$form.couponCodea coupon to be added to the cart
couponInputFieldStrstring$form.couponInputFieldStrThis 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"
couponPluralStrstring$form.couponPluralStrUsed 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.
couponSingularStrstring$form.couponSingularStrUsed 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.
couponsCoupon[ ]$form.coupons
currencyCodestring$form.currencyCodeThe currency or target currency code.
currencySuffixstring$form.currencySuffixexample: USD
currencySymbolstring$form.currencySymbolexample: $
emailstring$form.emailthe email address of the customer
errorsError[ ]$form.errorssee Error, see errors.vm
finalizeOrderstring$form.finalizeOrderIf true, the checkout is immedatiatly finalized.
formattedSubtotalstring$form.formattedSubtotalformatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas
formattedSubtotalBeforeDiscountstring$form.formattedSubtotalBeforeDiscountformatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas
formattedSubtotalDiscountstring$form.formattedSubtotalDiscountformatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas
formattedSubtotalFinalstring$form.formattedSubtotalFinalformatted values are a string representation of the decimal value, complete with currency symbol, periods, and commas
freePromotionboolean$form.freePromotionif true, the free promotional item is added to the cart.
freePromotionConfirmboolean$form.freePromotionConfirmconfirmation boolean
freePromotionHtmlstring$form.freePromotionHtmlSome merchants wish to include a free promotional item (configured on the back end). this html presents that offer to the customer.
hasSubtotalDiscountboolean$form.hasSubtotalDiscount
hideQuantityboolean$form.hideQuantityif true, do not show quantity
hideViewUrlsboolean$form.hideViewUrlsif true, do not link the item images to their view urls
highlightBlankQualifiersboolean$form.highlightBlankQualifiersif true, any options that do not yet have a selectedValue should be highlighted.
What are qualifiers? The original name of options. 20 years is a long, long time.
hostLinkHtmlstring$form.hostLinkHtml
infoMessagesstring[ ]$form.infoMessagessee Message, see info_messages.vm
itemsCartItem[ ]$form.items
lockQuantityboolean$form.lockQuantityif true, do not allow item quantities to be edited
lockedItemsboolean$form.lockedItemsif true, do not allow any edits on items (no deletions)
merchantIdstring$form.merchantId
passiveBrandingstring$form.passiveBrandingdeprecated.
payPalCheckoutstring$form.payPalCheckout:green-star:submit button. if true, the cart payment method is PayPal.
payPalExpressCheckoutboolean$form.payPalExpressCheckout
paypalCheckoutBmlstring$form.paypalCheckoutBml:green-star:submit button. if true, the cart payment method is PayPal Bill Me Later.
proactiveEmailCollectionboolean$form.proactiveEmailCollection
recalculatestring$form.recalculate:green-star:if true, the cart totals and shipping are recalculated
referralCodestring$form.referralCode
referralCodeDescriptionstring$form.referralCodeDescription
relatedItemsRelatedItem[]$form.relatedItemsItems related to the shopping cart items. These are displayed in a section usually titled "Customer who bought these products also bought these items", etc.
showAffiliateIdboolean$form.showAffiliateId
showAmazonboolean$form.showAmazon
showChangeCurrencyboolean$form.showChangeCurrencyThis 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 currencyCode (see that property above)
This setting is managed on the back end: Home → Configuration → Checkout → Multi-Currency.
showCouponEntryboolean$form.showCouponEntryIf true, coupon entry should be displayed. There are numerous settings and properties that could cause this to be false:
- A Merchant Property that turns off coupons completely.
- If the cart has a customer profile and that customer profile is set to "no coupons". (Home → Operations → Customer Profiles → Manage → edit a profile)
- If the cart has a customer profile and that customer profile belongs to a Pricing Tier that is set to "no coupons". (Home → Operations → Customer Profiles → Pricing Tiers)
showCouponsboolean$form.showCouponsif 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.
showOptionsboolean$form.showOptionsThis 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.
showPayPalboolean$form.showPayPalTrue if the cart can be paid for by PayPal. To qualify for PayPal, all of the following must be true.
1. The merchant has configured a valid PayPal account.
2. The cart has zero auto order items.
3. The cart has zero pre-order items.
4. The cart subtotal is greater than zero.
5. There is a Merchant Property to force PayPal to never show. That property must not be true.
showPayPalBmlboolean$form.showPayPalBmlThis is true if showPayPal is true, unless the merchant has a Merchant Property set to explictly turn this off.
showReferralCodeboolean$form.showReferralCodeThis is governed by a Merchant Property to collect referral code. Seldom used. If true, the referral code input field should display.
showShippingboolean$form.showShippingIf 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.
submitCartstring$form.submitCart:green-star:
subtotalBigDecimal$form.subtotal
subtotalBeforeDiscountBigDecimal$form.subtotalBeforeDiscount
subtotalDiscountBigDecimal$form.subtotalDiscount
subtotalFinalBigDecimal$form.subtotalFinal
useMultipartboolean$form.useMultipartif true, the form should have the following attribute: enctype='multipart/form-data' to ensure it can handle file uploads. This will be true if any of the cart item options are files. For example, if it stencil item has an option for a pattern pdf that the customer can upload.
viewUrlsToNewWindowboolean$form.viewUrlsToNewWindowif true, any hyperlinks to product pages should open in a new window.

Sample Code

tip

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.

Flow

flow_view_cart.vm.png

Was this page helpful?