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='shipping' & versions='0.6.0'

NameLinkSupported versions
Automatically selecting returned shipping rateautomatically_selecting_returned_shipping_rate0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Breaking shipments over the maximum weight into smaller packagesbreaking_shipments_over_maximum_weight_into_smaller_packages0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0
Conditional free shipping with live ratesconditional_free_shipping_with_live_rates0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0
Dimensional weightsdimensional_weights0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0
Flat Rate Markup of Live Ratesflat_rate_markup_of_live_rates0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Flat rate shipping calculated by product shipping attributes via add to cartshipping_calculated_by_product_shipping_attibutes_in_add_to_cart0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Free shipping using a couponfree_shipping_using_a_coupon0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Handling fee on orders under $100, free if over, live rates included.handling_fee_on_orders_under_100_dollar0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0
Live Rate Shipping Modificationlive_rate_shipping_modification0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Live shipping rates with a fixed rate fall back for heavy shipmentslive_shipping_rates_with_fixed_rate_fall_back_for_heavy_shipments0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0
Multiple Flat Ratemultiple_flat_rates0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Remove days timeframe from USPS ratesremove_day_timeframe_from_usps_rates0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Restricting Countries and States on the Checkout (0.7.2 and older)restricting_countries_and_states_on_the_checkout_old0.6.0, 0.7.0, 0.7.1, 0.7.2
Setting a single flat rate shipping amount no matter which categories are includedsetting_single_flat_rate_shipping_amount0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1
Tiered Flat Rate Shippingtiered_flat_rate_shipping0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1

"Add to Cart" Form Snippets

Filtered by category='shipping' & versions='0.6.0'

NameLinkSupported versions
Nothing found

Tax Tips and Tricks

Filtered by category='shipping' & versions='0.6.0'

NameLinkSupported versions
Nothing found

Miscellaneous Cart and Checkout

Filtered by category='shipping' & versions='0.6.0'

NameLinkSupported versions
Nothing found

Checkout

Filtered by category='shipping' & versions='0.6.0'

NameLinkSupported versions
Nothing found

Receipt

Filtered by category='shipping' & versions='0.6.0'

NameLinkSupported versions
Nothing found

Multiple Store / Session / Cookie Tweaks

Site Tools