Documentation You are here: start ยป snippets

This is an old revision of the document!


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.

Shipping Snippets

NameLinkSupported versionsDescription
Multiple Flat Ratemultiple_flat_rates0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=3132&page=1
Flat rates by country and product categoryflat_rates_by_country_and_product_categoryhttp://forum.foxycart.com/comments.php?DiscussionID=4559
Dimensional weightsdimensional_weights0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0http://forum.foxycart.com/comments.php?DiscussionID=1988&page=1
Australia TNT Rate Requests.australia_tnt_rate_requestshttp://forum.foxycart.com/comments.php?DiscussionID=1983&page=1
Shipping calculation on cartshipping_calculation_on_cart1.0, 1.1
Tiered Flat Rate Shippingtiered_flat_rate_shipping0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=2880&page=1
Free shipping using a couponfree_shipping_using_a_coupon0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1https://forum.foxycart.com/discussion/4487
Adding handling fees for each shipment with multiship.adding_handling_fees_for_each_shipment_with_multishiphttp://forum.foxycart.com/comments.php?DiscussionID=4111&page=2
Shipping Rate Requests on the Cartshipping_rate_requests_on_the_carthttp://webmovementllc.com/index.php/tag/foxycart-api/
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.0http://forum.foxycart.com/comments.php?DiscussionID=1789&page=2#Item_17
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.0http://forum.foxycart.com/comments.php?DiscussionID=2898&page=1
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.1http://forum.foxycart.com/comments.php?DiscussionID=4389&page=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.0https://forum.foxycart.com/discussion/4365/
Conditional free shipping with live ratesconditional_free_shipping_with_live_rates0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0http://forum.foxycart.com/comments.php?DiscussionID=1531
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.1http://forum.foxycart.com/discussion/5385/fedex-rates-incorrect
Automatically selecting returned shipping rateautomatically_selecting_returned_shipping_rate0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/discussion/5498/set-default-shipping-method
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
Live Rate Shipping Modificationlive_rate_shipping_modification0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=3132&page=1
Restricting Countries and States on the Checkoutrestricting_countries_and_states_on_the_checkout1.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.2http://forum.foxycart.com/comments.php?DiscussionID=1642&page=1, http://forum.foxycart.com/comments.php?DiscussionID=2834&page=1, http://forum.foxycart.com/comments.php?DiscussionID=3482&page=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
 

"Add to Cart" Form Snippets

NameLinkSupported versionsDescription
Very, very large form with lots of datavery_large_form_with_lots_of_data0.6.0http://forum.foxycart.com/comments.php?DiscussionID=761
Automatically adding a coupon codeautomatically_adding_coupon_code0.6.0, 0.7.2, 1.0, 1.1https://forum.foxycart.com/discussion/1993
Using a calendar date-picker to add dates to products.using_calendar_date_picker0.6.0http://forum.foxycart.com/comments.php?DiscussionID=3343&page=1
Updating a total element to reflect selected price modifiers in your pageupdating_total_element_to_reflect_selected_price_modifiers_in_page0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=3655&page=1
Form with radio options for price with an option for user to enter any amount they wantform_with_radio_options_for_price_with_an_option_to_enter_any_amount0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=4417&page=1#Item_1
Set the sub_startdate to the next closest date from a group of datesset_sub_startdate_to_closest_shipment_date0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=4669&page=1
Add products to the cart without Colorboxadd_products_without_colorbox0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=4675&page=1
Add To Cart Form Field Validationform_field_validation0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/comments.php?DiscussionID=5246&page=1
Set the sub start/end date to a relative future dateset_sub_start_end_date_to_future_date0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0, 1.1http://forum.foxycart.com/discussion/6264/subscriptions-how-to-limit-the-renewals
Restore a Cart, Persistent Cartpersistent_cart_restore_cart1.0, 1.1http://wiki.foxycart.com/integration/foxycart/saved_cart
 

Filter by Category Filter by Versions

Site Tools