Documentation You are here: start ยป snippets

Snippets

Advanced Code Snippets with Reference to Forum Posts

Please note that advanced manipulation of the cart or checkout via javascript is not supported by FoxyCart, and you can break things causing lost orders, errors, and global catastrophe. The links here are provided for reference, and they very likely will not work without tinkering requiring at least intermediate javascript knowledge.

Are you using FoxyCart version 2.0? Due to a complete revamp of the javascript in version 2.0, none of the below snippets will work in the new version. See this page for snippets for 2.0.

Shipping Snippets

Versions 0.7.1 and older: Note that applying javascript shipping modifications using either live or flat rates where you are setting custom values has been found to not work as expected for subscription based products where you need the shipping to apply to each subscription renewal. A fix is in place for versions 0.7.2 and newer.

Custom shipping snippets do not work for subscriptions. The reason for this is because the snippets are done as Javascript modifications and run in the browser, while subscriptions run completely on the server side and never touch the browser. Subscriptions will always calculate shipping on the server side based on how the category is configured.

Filtered by category='checkout'

NameLinkSupported versions
Nothing found

"Add to Cart" Form Snippets

Filtered by category='checkout'

NameLinkSupported versions
Nothing found

Tax Tips and Tricks

Filtered by category='checkout'

NameLinkSupported versions
Nothing found

Miscellaneous Cart and Checkout

Filtered by category='checkout'

NameLinkSupported versions
Nothing found

Checkout

Filtered by category='checkout'

NameLinkSupported versions
Adding a "Consent to safe data transfer" checkbox to the checkoutadding_a_consent_to_data_transfer_checkbox0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Adding a coupon code field to the checkoutadding_a_coupon_code_field
Adding a gift-wrapping checkbox to the checkout.adding_gift_wrapping_checkbox
Adding an email confirmation boxadding_an_email_confirmation_box
Adding an email confirmation field to the checkoutadding_email_confirmation_field_to_the_checkout
Age Validation For Alcohol Purchaseage-validation-for-alcohol-purchase1.0, 1.1
Displaying PO payment optiondisplaying_po_payment_option
Hiding the Purchase Order payment optionhiding_po_payment_option0.7.0, 0.7.1, 0.7.2, 1.0
Making checkout fields requiredmaking_checkout_fields_required0.6.0, 0.7.1, 0.7.2, 1.0
Making shipping address fields mirror billing fieldsmaking_shipping_address_fields_mirror_billing_fields070
Making the the shipping and payment fields hidden until a valid selection is made for guest/login step of checkoutmaking_shipping_and_payment_fields_hidden0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0
Override Sales Tax During Checkoutoverride-sales-tax-during-checkout0.7.2
Performing actions when customer has logged in on the checkoutperforming_actions_when_customer_logged_in_on_checkout0.7.0, 0.7.1, 0.7.2, 1.0
Pre-populating checkout values, without invoking "single-use customers"pre_populating_checkout_values
Smarty Streets Address Validationsmarty-streets-address-validation0.7.2, 1.0
 

Receipt

Filtered by category='checkout'

NameLinkSupported versions
Nothing found

Multiple Store / Session / Cookie Tweaks

Site Tools