{% extends "shop/_layouts/main" %} {% block main %}

Here’s what’s in your cart

{% if cart.lineItems|length %} {{ redirectInput('shop/cart') }} {{ csrfInput() }} {% set lineItemHasErrors = false %} {% for item in cart.lineItems %} {% if item.hasErrors() %} {# if the line item has errors lets record it so we can hide totals later (since they wont make sense) #} {% set lineItemHasErrors = true %} {% endif %} {% if not lineItemHasErrors %} {% for adjustment in item.adjustments %} {% endfor %} {% endif %} {% endfor %} {% if not lineItemHasErrors %} {% for adjustment in cart.orderAdjustments %} {% endfor %} {% endif %}
Product Qty Price
{{ item.description }}
({{ item.sku }})
{{ item.options|json_encode }}
{% if item.options.giftWrapped is defined %} {% endif %} {% if item.options.donationAmount is defined %} {% endif %} {% if not lineItemHasErrors %} {% if item.onSale %} Price: {{ item.price|commerceCurrency(cart.currency) }}
Sale Off: {{ item.saleAmount|commerceCurrency(cart.currency) }}
Sale Price {{ item.salePrice|commerceCurrency(cart.currency) }}
Sale Price Subtotal: {{ item.subtotal|commerceCurrency(cart.currency) }}
{% else %} Price: {{ item.price|commerceCurrency(cart.currency) }}
Price Subtotal: {{ item.subtotal|commerceCurrency(cart.currency) }}
{% endif %} {% endif %} {% set itemSales = item.snapshot.sales ?? [] %} {% for sale in itemSales %} {% if loop.first %} Sales Applied: {% endif %} {{ sale.name }}
{% endfor %}
{{ adjustment.type }} {{ adjustment.type }} {{ adjustment.name }}{% if adjustment.isEstimated %}
{{ 'Estimated'|t('commerce') }}{% endif %}
({{ adjustment.description }} )
{{ adjustment.amount|commerceCurrency(cart.currency) }}
{{ adjustment.type }} {{ adjustment.name }}{% if adjustment.isEstimated %}
{{ 'Estimated'|t('commerce') }}{% endif %}
({{ adjustment.description }} )
{{ adjustment.amount|commerceCurrency(cart.currency) }}
{% if not cart.getShippingAddress() %}
{{ 'Shipping Estimate'|t('commerce') }}
{% set countries = craft.commerce.countries.allCountriesAsList %} {% set states = craft.commerce.states.allStatesAsList %}
{% set options = (cart.estimatedShippingAddress and states[cart.estimatedShippingAddress.countryId] is defined ? states[cart.estimatedShippingAddress.countryId] : []) %}
{{ 'Tax Estimate'|t('commerce') }}
{% set options = (cart.estimatedBillingAddress and states[cart.estimatedBillingAddress.countryId] is defined ? states[cart.estimatedBillingAddress.countryId] : []) %}
{# Shipping Methods #}
{% if cart.availableShippingMethods|length and cart.estimatedShippingAddressId %}
{% for handle, method in cart.availableShippingMethods %}
{% endfor %}
{% endif %}
{% endif %}
{% if not lineItemHasErrors %} Item Sub Total: {{ cart.itemSubTotal|commerceCurrency(cart.currency) }}

Adjustment Totals
Total Discount: {{ cart.getTotalDiscount()|commerceCurrency(cart.currency) }}
Total Shipping: {{ cart.getTotalShippingCost()|commerceCurrency(cart.currency) }}
Total Tax: {{ cart.getTotalTax()|commerceCurrency(cart.currency) }}
Total Tax (inc): {{ cart.getTotalTaxIncluded()|commerceCurrency(cart.currency) }}

Total Price: {{ cart.totalPrice|commerceCurrency(cart.currency) }}

{% endif %}
{# Update Coupon form uses the single update controller action: #} {% if cart.getFirstError('couponCode') %} {{ cart.getFirstError('couponCode') }} {% endif %}
{% if not lineItemHasErrors %} Checkout {% endif %}
{% endif %} {% if not cart.lineItems|length %}

You have no items in your cart, add some on the products page.

{% endif %} {% js %} var states = {{ craft.commerce.states.allStatesAsList|json_encode|raw }}; {% endjs %} {% js %} var $estimateShippingMethodsContainer = $('.estimate-shipping-methods'); var $estimateFieldsContainer = $('.estimate-fields'); var $estimateShowFieldsButton = $('.estimate-show-fields'); var $estimateBilling = $('.estimate-billing'); var $estimateBillingSameAsShipping = $('input[name="estimatedBillingAddressSameAsShipping"]'); var $estimateCountrySelects = $('select.estimate-country'); // Setup "same as" checkbox if ($estimateBillingSameAsShipping.prop('checked')) { $estimateBilling.addClass('hidden').find('input,select').attr('disabled', 'disabled').prop('disabled', 'disabled'); } // Handle the change event for the "same as" checkbox $estimateBillingSameAsShipping.change(function(ev) { var $this = $(this); if ($this.prop('checked')) { $estimateBilling.addClass('hidden').find('input,select').attr('disabled', 'disabled').prop('disabled', 'disabled'); } else { $estimateBilling.removeClass('hidden').find('input,select').attr('disabled', '').prop('disabled', ''); } }); // Setup initial state Showing/hiding of the shipping method selection if ($estimateShippingMethodsContainer.find('.shipping-select').length) { $estimateFieldsContainer.addClass('hidden'); $estimateFieldsContainer.find('input,select').attr('disabled', 'disabled').prop('disabled', 'disabled'); } else { $estimateShippingMethodsContainer.addClass('hidden'); $estimateShippingMethodsContainer.find('input,select').attr('disabled', 'disabled').prop('disabled', 'disabled');; } // Handle click event for returning to the estimate fields $estimateShowFieldsButton.click(function(ev) { ev.preventDefault(); if ($estimateFieldsContainer.hasClass('hidden')) { $estimateFieldsContainer.removeClass('hidden'); $estimateFieldsContainer.find('input,select').attr('disabled', '').prop('disabled', ''); $estimateShippingMethodsContainer.addClass('hidden'); $estimateShippingMethodsContainer.find('input,select').attr('disabled', 'disabled').prop('disabled', 'disabled'); } else { $estimateFieldsContainer.addClass('hidden'); $estimateFieldsContainer.find('input,select').attr('disabled', 'disabled').prop('disabled', 'disabled'); $estimateShippingMethodsContainer.removeClass('hidden'); $estimateShippingMethodsContainer.find('input,select').attr('disabled', '').prop('disabled', ''); } }); // Handle change event for country selection for both shipping and billing $estimateCountrySelects.change(function () { // get the value of the selected country. var cid = $(this).val(); var $box = $('.estimate-state-box[data-modelname="'+$(this).data('modelname')+'"]'); var $states = $box.find('select.address-stateId'); var $stateName = $box.find('input.address-stateName'); $states.find('option').remove(); if (states.hasOwnProperty(cid)) { // We have states for this country, show the states drop down. $states.removeClass('hidden'); $states.attr('name', $states.data('modelname')+'[stateValue]'); // We have states for this country, hide the stateName input. $stateName.removeAttr('name'); $stateName.addClass('hidden'); $stateName.val(''); // Add all states as options to drop down. for (var id in states[cid]) { var state = states[cid][id]; var $option = $('