Both sides previous revisionPrevious revisionNext revision | Previous revision |
v:2.0:cheat_sheet [2020/04/02 00:29] – [Subscription Product Options] foxybrett | v:2.0:cheat_sheet [2024/02/02 14:02] (current) – [Cart] adam |
---|
; ''image'' | ; ''image'' |
: **Description:** An image for the product, displayed in the cart. | : **Description:** An image for the product, displayed in the cart. |
: **Accepts:** A full URI to an image, starting with ''http://'' or ''https://'', //or// a relative path to the image from the store's domain (as configured in the store settings). __Limited to 200 characters in length.__ | : **Accepts:** A full URI to an image, starting with ''http://'' or ''https://'', //or// a relative path to the image from the store's domain (as configured in the store settings). __Limited to 500 characters in length.__ |
: **Examples:** ''&image=http://example.com/path/to/image.jpg'', ''&image=local/path/to/image.png'', ''<input type="hidden" name="image" value="http://example.com/path/to/image.jpg">'' | : **Examples:** ''&image=http://example.com/path/to/image.jpg'', ''&image=local/path/to/image.png'', ''<input type="hidden" name="image" value="http://example.com/path/to/image.jpg">'' |
: **Notes:** Images will //not// be resized, but they will automatically be securely cached, so you don't need to worry about security warnings. | : **Notes:** Images will //not// be resized, but they will automatically be securely cached, so you don't need to worry about security warnings. |
; ''url'' | ; ''url'' |
: **Description:** A URL for the product, displayed in the cart. | : **Description:** A URL for the product, displayed in the cart. |
: **Accepts:** A full URL to the product page, starting with ''http://'' or ''https://'', //or// a relative path to the produt from the store's domain (as configured in the store settings). | : **Accepts:** A full URL to the product page, starting with ''http://'' or ''https://'', //or// a relative path to the produt from the store's domain (as configured in the store settings). __Limited to 200 characters in length.__ |
: **Example:** ''&url=http://example.com/path/to/product'', ''&url=local/path/to/product'' | : **Example:** ''&url=http://example.com/path/to/product'', ''&url=local/path/to/product'' |
: **Notes:** The URL will only be applied if the ''image'' parameter is also present, and will be wrapped around the image in the cart. | : **Notes:** The URL will only be applied if the ''image'' parameter is also present, and will be wrapped around the image in the cart. |
; ''weight'' | ; ''weight'' |
: **Description:** Product's per-product weight, used for shipping rate requests. | : **Description:** Product's per-product weight, used for shipping rate requests. |
: **Default:** If left blank, it will inherit this value from the product’s category. If no category selected, will default to the default category's specified weight. | : **Default:** If left blank, it will inherit this value from the product’s category. If no category selected, will default to the default category's specified weight. The default units for weight is lbs. This can be changes to kgs. in the category. |
: **Notes:** <wrap round important>Supports up to a maximum of three decimal places.</wrap> | : **Notes:** <wrap round important>Supports up to a maximum of three decimal places.</wrap> |
; ''length'', ''width'', ''height'' | ; ''length'', ''width'', ''height'' |
: **Notes:** | : **Notes:** |
* This is an optional field. Not indicating a "sub_startdate" would automatically assign it its default value. | * This is an optional field. Not indicating a "sub_startdate" would automatically assign it its default value. |
* Subscription start and end dates are not currently tied to a store's timezone settings. Test your start and end dates thoroughly or ask in the forum if you have questions about them. | * Subscription start and end dates are not currently tied to a store's timezone settings. Test your start and end dates thoroughly or [[https://foxy.io/contact|contact us]] if you have questions about them. |
* The day of the ''sub_startdate'' will generally be used for all subsequent billing attempts when used with a monthly frequency, but in cases where the date doesn't exist in a month, it will be moved //ahead// for that month. So if you have a subscription with a start date on Jan-31, it will run on the Feb-28, Mar-31, Apr-30, and etc. | * The day of the ''sub_startdate'' will generally be used for all subsequent billing attempts when used with a monthly frequency, but in cases where the date doesn't exist in a month, it will be moved //ahead// for that month. So if you have a subscription with a start date on Jan-31, it will run on the Feb-28, Mar-31, Apr-30, and etc. |
| |
* Normally if you load up a ''sub_token'' URL, it will allow modifying the subscription, but will //not// change the subscription's next date, //nor will it charge the customer immediately// for the products in the cart. (A past-due amount will still be payable "now", but the rest of the products will simply bill according to the subscription's next transaction date.) This flag makes the subscription charge "now". | * Normally if you load up a ''sub_token'' URL, it will allow modifying the subscription, but will //not// change the subscription's next date, //nor will it charge the customer immediately// for the products in the cart. (A past-due amount will still be payable "now", but the rest of the products will simply bill according to the subscription's next transaction date.) This flag makes the subscription charge "now". |
* This flag is almost always going to be preferable to customers paying the single lump sum past-due amount, as it ensure taxes, shipping, and product details are maintained. | * This flag is almost always going to be preferable to customers paying the single lump sum past-due amount, as it ensure taxes, shipping, and product details are maintained. |
| * If the "reset the next transaction date on payment (past due or restart)" option on the "advanced" setting page of the Foxy administration is checked, then the next date will be updated to be one frequency ahead of todays date. If unchecked, the next date will remain as it currently is. |
| |
| |
FoxyCart uses twig and twig.js as a template language so you can completely customize everything about your checkout experience. Listed below is all the data which is exposed to the templates and also available in JavaScript in the FC.json variable. | FoxyCart uses twig and twig.js as a template language so you can completely customize everything about your checkout experience. Listed below is all the data which is exposed to the templates and also available in JavaScript in the FC.json variable. |
| |
| When outputting in the template, you would utilise Twig, like ''%%{{%% variablename %%}}%%''. Note that if you're looking to access data that is within arrays (such as items, or item options), then you need to access those within a ''for'' loop in the Twig, like: |
| |
| <code> |
| {% for item in items %} |
| {{ item.name }} |
| {% endfor %} |
| </code> |
| |
| Note that the data is broken into different sections by the page scope it's available on. The cart is available on all pages (as it is present on all pages), but there are some strings that are specific to just other pages like the checkout and receipt. |
===== Cart ===== | ===== Cart ===== |
; ''cart_cancel_and_continue_link'' | ; ''cart_cancel_and_continue_link'' |
; ''future_subscription_totals_by_date''\\ ''future_subscription_totals_by_date.total''\\ ''future_subscription_totals_by_date.total_item_price''\\ ''future_subscription_totals_by_date.total_shipping''\\ ''future_subscription_totals_by_date.total_tax''\\ ''future_subscription_totals_by_date.total_weight'' | ; ''future_subscription_totals_by_date''\\ ''future_subscription_totals_by_date.total''\\ ''future_subscription_totals_by_date.total_item_price''\\ ''future_subscription_totals_by_date.total_shipping''\\ ''future_subscription_totals_by_date.total_tax''\\ ''future_subscription_totals_by_date.total_weight'' |
: **Description:** The totals for subscription products with a start date or next transaction date in the are grouped together here for the cart display. | : **Description:** The totals for subscription products with a start date or next transaction date in the are grouped together here for the cart display. |
| ; ''gift_cards''\\ ''gift_cards.{gift_card_code}''\\ ''gift_cards.{gift_card_code}.amount''\\ ''gift_cards.{gift_card_code}.id''\\ ''gift_cards.{gift_card_code}.code_id''\\ ''gift_cards.{gift_card_code}.is_applied''\\ ''gift_cards.{gift_card_code}.name''\\ ''gift_cards.{gift_card_code}.current_balance'' |
| : **Description:** Gift cards associated with this cart. The ''{gift_card_code}'' is the code value used by the customer to add the gift card. |
| : **Note:** The ''current_balance'' attribute will not factor in the discount that __could__ apply from the cart or checkout. On the web receipt, ''current_balance'' will take into account the discount from that transaction, and any other uses of the gift card since then (if the receipt is being revisited). The email receipt will be the current balance of the gift card at the time the transaction was completed. |
; ''has_eligible_coupons'' | ; ''has_eligible_coupons'' |
: **Description:** If the cart contains products which can have a coupon applied to them. | : **Description:** If the cart contains products which can have a coupon applied to them. |
; ''items[].width'' | ; ''items[].width'' |
: Reserved for future use. | : Reserved for future use. |
| ; ''language'' |
| : ** Description: ** The English name for the language of the cart as set by the template set (like ''english'', ''french'', ''german'' etc). Can be blank if using the default template set. |
| ; ''language_iso_code'' |
| : ** Description: ** The 2 character ISO code for the language of the cart as set by the template set (like ''en'', ''fr'', ''de'' etc). Can be blank if using the default template set. |
; ''loading_coupons''\\ ''loading_quantity''\\ ''loading_shipping_results''\\ ''loading_taxes''\\ | ; ''loading_coupons''\\ ''loading_quantity''\\ ''loading_shipping_results''\\ ''loading_taxes''\\ |
: **Description:** Used for determining if a loading animation should currently be displayed. | : **Description:** Used for determining if a loading animation should currently be displayed. |