How to get your website's store set up to work with FoxyCart.
For a nice and quick FoxyCart implementation, insert the loader.js
FoxyCart javascript file from “Step 1” of the sample code
section of your FoxyCart admin right above the closing </body>
tag of your webpage, after any other CSS or javascript tags you might have.
FoxyCart relies on jQuery to function, and we recommend jQuery version 1.11.1
with FoxyCart version 2.0
If you don't have any scripts that require jQuery on your page, you can simply include loader.js
on your page, and it will include the required version for you.
You may have other plugins or scripts that rely on jQuery as well. loader.js
will check to see if your page already has jQuery loaded, and if that version is 1.8
or newer. If it doesn't exist, or it's too old, loader.js
will include jQuery version 1.11.1
automatically, otherwise it will use your jQuery version. If you include your own version of jQuery, ensure it's 1.8
or newer, and that you include it before you include loader.js
If you've included loader.js
on your page and the cart isn't sliding in on the page when you click an add to cart link, there may be a conflict on your page with jQuery.
loader.js
has been included on your page.1.8
or newer, and that it's been included before loader.js
on your page.jquery
”. If you've included in yourself, you should see it included there. You may see it elsewhere also:validation.jquery.js
, jquery.accordion.js
, or anything similar, those are plugins and can remain.jquery.js
, jquery.js?m=1273512554g&ver=1.3.2
, jquery-1.4.2.min.js
, or anything similar, find out where those <script />
tags are being inserted, and remove them. Reload your page and view the source to ensure they're all gone.jquery.js
, make sure you move your <!– BEGIN FOXYCART CODE –>
block after any other jQuery calls, preferably right before the closing </head>
tag.
Products are added to your customer's cart using “add to cart links” that you create.
Create your FoxyCart links the same as you would create any HTML link (e.g.: <a href=“blah”>Link Text</a>)
To make this a FoxyCart link you'll need to create a link with an href
pointing to your FoxyCart domain:
https://YOURSUBDOMAIN.foxycart.com/cart?name=ITEMNAME&price=YOURPRICE
In this example, YOURSUBDOMAIN
is the value you entered as your store subdomain.
ITEMNAME
is, of course, the name you would like the cart to display for your item.
<a href="https://YOURSUBDOMAIN.foxycart.com/cart?name=ITEMNAME&price=YOURPRICE">Add to Cart</a>
To have a link to view the customers cart, you can do that with a simple links as well:
<a href="https://YOURSUBDOMAIN.foxycart.com/cart?cart=view">View the Cart</a>
To display the total items or price of the customers cart, take a look at the minicart functionality.