====== The JSON Cart Object ====== In an effort to make FoxyCart as flexible, customizable, and "Web 2.0" as possible, we've provided a JSON cart object for you to manipulate to your heart's content. If it exists, the function ''fc_PreProcess()'' is called before the FoxyBox (Thickbox) is //opened//. If it exists, the function ''fc_BuildFoxyCart()'' is called when the FoxyBox (Thickbox) is //closed//. ===== Example Code ===== The following code will render an ugly, table-based cart from the JSON object. var FoxyDomain = "YOURDOMAIN.foxycart.com/"; function fc_PreProcess() { // do something here before opening the cart... maybe some form error checking? // if you don't want the cart to open, say for example if there were some data validation problems you // want your customer to fix, then return false from this function instead of true. return true; } function fc_BuildFoxyCart() { fc_FoxyCart = ""; fc_FoxyCart += "
"; fc_FoxyCart += ""; fc_FoxyCart += ""; // fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; for (i=0;i 0) { $("#fc_cart").html(fc_FoxyCart); } else { $("#fc_cart").html(""); } } // This function is called by fc_BuildFoxyCart() for each product in your cart. // Feel free to edit this function as needed to display each row of your cart. function fc_BuildFoxyCartRow(fc_name,fc_code,fc_options,fc_quantity,fc_price_each,fc_price) { fc_FoxyCart += ""; fc_FoxyCart += ""; // fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; fc_FoxyCart += ""; }
NameOptionsCodeQuantityPrice EachPrice
" + fc_name + "" + fc_options + "" + fc_code + "" + fc_quantity + "" + fc_price_each + "" + fc_price + "