{{ block('customer_billing') }}
{% if not has_multiship %}
{{ block('customer_shipping') }}
{% else %}
{{ block('multiship_shipping') }}
{% endif %}
{# etc... #}
That might look complicated, but the basic idea is that each of the ''%%{{ block('foo') }}%%'' tags loads a ''block'' from the ''checkout_template.twig'' template, which is loaded via the ''use'' command. This view gives you the ability to move elements around pretty easily without needing to get //super// involved with giant chunks of HTML. It also allows you to override just specific portions of the HTML without needing to edit the entire massive template. (It's also really helpful for understanding the different elements and logic, even if you do end up using one of the full templates below.)
If, however, you do want more control, you don't have to use the ''block'' and ''use'' method, and you can instead just start with the underlying default template and customize from there. These links will show you the Twig templates from which you can start from:
* [[https://admin.foxycart.com/v/1.1.0/view/public/cart.inc.twig|Cart]]
* [[https://admin.foxycart.com/v/1.1.0/view/public/cart.inc.txt.twig|Cart Text]] for Text Emails
* [[https://admin.foxycart.com/v/1.1.0/view/public/checkout.inc.twig|Checkout]]
* [[https://admin.foxycart.com/v/1.1.0/view/public/checkout_error.inc.twig|Checkout Errors]]
* [[https://admin.foxycart.com/v/1.1.0/view/public/receipt.inc.twig|Receipt]]
* [[https://admin.foxycart.com/v/1.1.0/view/public/email_order_details.inc.twig|Email (HTML)]]
* [[https://admin.foxycart.com/v/1.1.0/view/public/email_order_details.inc.txt.twig|Email (Text)]]
* [[https://github.com/sparkweb/foxycart-twig-templates-1.1|See All Links at GitHub]]
If you use any of the above linked files as a starting point, you can insert that raw Twig+HTML directly into your FoxyCart template (either directly in the admin or in your own templates for use with AutoMagiCache).
=== Customizing the Cart ===
It's important to understand that there are two "cart" templates. There's the "full" cart template, which is what displays if you pull up ''your_store.foxycart.com/cart'', used for full-page cart displays as well as the iframe in the default Colorbox cart. But there's also the cart that's displayed on the checkout, the receipt, and the email receipts. The "full" cart uses the "partial" cart, just as the other templates do. So if you want to make a change to the cart system-wide (across the full cart, checkout, receipt, and email templates), you can edit the "include" cart. There's an extra checkbox on the "cart" template page in your FoxyCart admin now, and if you'd like to use that (in any of your other templates) you can access your customized cart via ''%%{{ custom_cart }}%%'' instead of the normal ''{% include 'cart_template.twig' %}'' syntax.
This would allow you to use the default cart HTML in some situations, and your custom cart in others (like on a minimalist email receipt, etc.).
=== Allowed Twig Tags and Functionality ===
At present, the only allowed functionality for Twig is as follows:
* Tags: ''if'', ''for'', ''include'', ''macro'', ''block'', ''set''
* Filters: ''escape'', ''raw'', ''length'', ''money_format'', ''pad'', ''replace'', ''upper'', ''lower'', ''title'', ''trim'', ''date'', ''date_modify''
* Functions: ''block'', ''date''
===== Default Template Styles =====
As of v1.1, there are two included themes.
**Standard**
{{:v:0.7.0:theme.standard.070.png?direct&300|The "standard" theme}}
The "standard" theme is designed to work in a variety of situations, but as such it is not well suited for advanced customizations.
**Text**
{{:v:0.7.0:theme.text.070.png?direct&300|The "text" theme}}
The "text" theme is built to be customized. If you're doing advanced customization we strongly recommend starting from this theme (and not the "standard").
===== AutoMagiCache Technical Details =====
==== What It Does ====
- Pulls in target URL.
- Strips any
tags.
- "Convenience replacements", currently converting "http" to "https" links for:
* Google Analytics
- Imports non-secure external CSS
* Rewrites all image paths (''*.jpg'', ''*.jpeg'', ''*.png'', ''*.gif'') to use FoxyCart image caching.
* Sticks it inline, inside CDATA comments.
- Imports non-secure external JS
* Replaces ''/ /'' with ''\/\/'' when not preceded by a space or line break.
* Replaces all '''' with ''<\/''.
* Sticks it inline, inside CDATA comments.
- Rewrites all ''
![]()
'' paths to use FoxyCart image caching.
- Rewrites all ''
'' paths to point to the correct locations.
- Rewrites all ''