<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.foxycart.com/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>Foxy Wiki - snippets:add_to_cart_form</title>
        <description></description>
        <link>https://wiki.foxycart.com/</link>
        <lastBuildDate>Tue, 28 Jul 2026 09:04:19 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://wiki.foxycart.com/_media/wiki/dokuwiki.svg</url>
            <title>Foxy Wiki</title>
            <link>https://wiki.foxycart.com/</link>
        </image>
        <item>
            <title>add_products_without_colorbox</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/add_products_without_colorbox?rev=1493190150&amp;do=diff</link>
            <description>Add products to the cart without Colorbox

This script allows you to either add products to the cart silently through the JSON, or use a different javascript modal library instead of the default Colorbox modal. If you are adding products to the cart silently, we</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>automatically_adding_coupon_code</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/automatically_adding_coupon_code?rev=1493190150&amp;do=diff</link>
            <description>Automatically adding a coupon code

The code below is for automatically adding a coupon code in the background, on pageload. 

v0.7.2+


fcc.events.cart.ready.add(function(){
    // check for coupon
    $.getJSON('https://' + storedomain + '/cart?output=json' + fcc.session_get() +'&amp;cart=view&amp;callback=?', function(data){
        if (!data.coupons) {
            $.getJSON('https://' + storedomain + '/cart?cart=update&amp;output=json' + fcc.session_get() +'&amp;coupon=free-special-product-shipping&amp;callback…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>form_with_radio_options_for_price_with_an_option_to_enter_any_amount</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/form_with_radio_options_for_price_with_an_option_to_enter_any_amount?rev=1493190150&amp;do=diff</link>
            <description>Form with radio options for price with an option for user to enter any amount they want - perfect for donations

Sometimes you need a form that presents some common basic options to your customers, but also gives the freedom for your customers to enter a completely different amount. This type of approach is especially useful when taking donations. This approach allows you to have as many selectable options as you want as radio inputs, with an additional radio input which when selected shows a te…</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>persistent_cart_restore_cart</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/persistent_cart_restore_cart?rev=1493190150&amp;do=diff</link>
            <description>Restore a Cart, Persistent Cart

More info here. (Adding to the snippets section for visibility.)</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>set_field_to_allow_only_whole_numbers</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/set_field_to_allow_only_whole_numbers?rev=1493190150&amp;do=diff</link>
            <description>Set fields to only allow whole numbers

When constructing add to cart forms, it can be nice to only allow customers to enter whole numbers into a quantity field. To do this, simply paste the following script right before the closing &lt;/head&gt; tag of your page templates, adding a class of</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>set_sub_start_end_date_to_future_date</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/set_sub_start_end_date_to_future_date?rev=1493190150&amp;do=diff</link>
            <description>Set a subscription to start or finish a certain time after today

When you know the exact date that a subscription starts/ends, it's easy to provide the dates - but if you want to have a subscription start 7 days after the day it is purchased, or for it to end 2 months after it's started, that requires a little bit of extra work - that's where this library can help.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>set_sub_startdate_to_closest_shipment_date</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/set_sub_startdate_to_closest_shipment_date?rev=1493190150&amp;do=diff</link>
            <description>Set the sub_startdate to the next closest date from a group of dates

This script is great for situations where you have a subscription that is only run at regular intervals during the year, quarterly for example, and you need all of the subscriptions to run on the same day.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>updating_total_element_to_reflect_selected_price_modifiers_in_page</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/updating_total_element_to_reflect_selected_price_modifiers_in_page?rev=1493190150&amp;do=diff</link>
            <description>Updating a total element to reflect selected price modifiers in your page.

	*  Paste the following just before the &lt;/head&gt; of any page that requires FoxyCart attribute modifiers calculations. 

 This is *not* required on the cart or checkout pages, so should not be place in those templates.</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
        <item>
            <title>using_calendar_date_picker</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/using_calendar_date_picker?rev=1542592028&amp;do=diff</link>
            <description>Using a calendar date-picker to add dates to products.

This calendar setup requires having a link and an input with coinciding id's. An input an link should be setup like this:


&lt;input type=&quot;text&quot; name=&quot;date&quot; id=&quot;date2&quot; class=&quot;datepicker&quot;&gt;
&lt;a href=&quot;https://yourstore.foxycart.com/cart?name=Large%20Box&amp;amp;price=15&quot; id=&quot;link_date2&quot; class=&quot;foxycart&quot;&gt;Add to basket&lt;/a&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 19 Nov 2018 01:47:08 +0000</pubDate>
        </item>
        <item>
            <title>very_large_form_with_lots_of_data</title>
            <link>https://wiki.foxycart.com/snippets/add_to_cart_form/very_large_form_with_lots_of_data?rev=1493190150&amp;do=diff</link>
            <description>Very Large Form with Lots of Data

The current foxycart implementation cannot handle more than about 25 items in a single form before IE balks at the GET submission. For its solution you can try the following steps: &lt;http://forum.foxycart.com/comments.php?DiscussionID=761&gt;

Related Forum Discussions

	*  &lt;http://forum.foxycart.com/comments.php?DiscussionID=761&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Wed, 26 Apr 2017 07:02:30 +0000</pubDate>
        </item>
    </channel>
</rss>
