====== FAQs ====== This page is for an unsupported version of Foxy ― chances are you're on a different version and these instructions won't apply. You can go to the [[:start|start page]] and select your version or if you're in doubt, [[https://www.foxy.io/contact|get in touch with us]]. ==== Non-technical FAQs ==== This FAQ page is primarily technical in nature, with common (but specific) questions and answers about customizing FoxyCart. Frequently asked questions about FoxyCart in general may be found [[http://www.foxycart.com/faqs.html|here]]. ==== How do I hide specific cart options from the cart display? ==== Some values can be hidden purely with CSS using display:none on the these class names: fc_cart_item_weight, fc_cart_category_code, fc_cart_item_code. Other custom supplied product options will have to be hidden via javascript by adding this code to your cart template. This example hides a product option called "Color": Please note that depending on your FoxyCart version you may need to use ''$()'', ''$j()'', or ''jQuery()'' for all your jQuery calls above. ==== How do I change the "continue shopping" or "continue" receipt link? ==== Add this code to your checkout template: OR this code to your receipt template (change http://MYDOMAIN.com/MYURL to the link you want): **NOTE**: Depending on your FoxyCart version you may need to manually include jQuery (or ''foxycart_includes.js'') in your receipt template. If you'd like to make the "cancel and continue shopping" link empty the cart, try something like this: ==== I'd like a donation select box and the option to enter a custom value... where do I start? ==== We've had various requests for this so here's a quick and dirty example using the FoxyCart included JQuery. It's not a "paste this in your site and run with it" bit of code, but it should point you in the right direction. The field names are prefixed with "x:" so they won't be sent to FoxyCart as product options and the "\\" is needed to help unconfuse the JQuery selector. Basic concept involves stuffing a hidden input named price with the value you want to send to FoxyCart. To make this a working example, you'd need to fully setup the form as you need it. Please post any questions in the forum. Note: this example starts with a $10 initial price point, so the "price" hidden field was set to "10". You'll want to adjust that accordingly as needed since that value only changes when the select box is changed. FoxyCart V 0.5.1: For this script to correctly work with 051, please read this [[http://forum.foxycart.com/comments.php?DiscussionID=414&page=2#Item_3|Forum note]].
==== Can I hide the quantity field in the cart? ==== Add &quantity_max=1 to your cart add links or a hidden input named "quantity_max" with a value of 1 if you're using a form. Then add some css to color the text in the table header to match your header background and hide all the stuff you don't need anymore: Note, you may also just want to use the cart=checkout option to go directly to the checkout page if you're only selling a single product. ==== My checkout page is narrow. Can I make the "standard" checkout theme thinner? ==== Yes, you can start by overriding one declaration: You can stick that override in your own CSS file if you want, rather than inline. Just make sure it comes //after// the ''/themes/standard/styles.css'' call. ==== Can I remove the CVV field entirely? ==== Yes. Using the built-in jQuery, it'd look like this: Put that down by your closing '''' ==== Can I move the custom field div? ==== Yes, with just a bit of jQuery: Put that down by your closing ''''. If you want to move it to a different place in the code, just change the target of the ''insertAfter()'' function. ==== Can I make customer_phone a required field? ==== Sure. Just get a little creative with your checkout template. By adding this code (//after you call the checkout placeholders//), your customer_phone will now be required: **v0.6.0+** **v0.5.1** **v0.4.x** **v0.3.x** **v0.2.9 and earlier:** ==== Can I hide the Purchase Order field (I want to invoice them later and don't need a PO#)? ==== Sure. Just add some love like this: v060+: v051 and below: ==== Can I make the "Save your credit card" checkbox checked by default? ==== Yes. Add this in the head section of your page. ==== It says my cached images are "corrupt". What gives? ==== Try clearing your image cache. Log into your admin panel, click Templates -> Image Cache -> Clear all cached images. If that doesn't fix the problem, let us know. ==== XML: How do I get epoch time from yyyy-mm-dd hh:mm:ss ? ==== Example to convert from ''yyyy-mm-dd hh:mm:ss'' to ''mm/dd/yyyy'': $format = '%m/%d/%Y'; // New desired format $time = '2007-05-04 20:53:57'; // The timestring (which you'd get from the XML, but it's hardcoded here just as an examle) $time = strtotime($time); // Convert the original to epoch time $time_new = strftime($format,$time); // Convert from epoch time to the new format Reference: http://us2.php.net/strftime ==== Redirect to a Custom "JavaScript Required" Page ==== If you'd like to alert your customers that javascript is required, here's one method. - Change all your "add-to-cart" links, forms, and image maps to point to your own custom "JavaScript Required" page. - After you include your ''foxycart_includes.js'' file, add the following: If you have image maps or other methods of adding products to your cart, like image maps or dynamically generated links or forms, you'll have to modify that code as necessary to make sure you get everything. - Test to make sure it's working as expected. If JavaScript is enabled things should be fine. If js is disabled, the user should be sent to your custom page on an add-to-cart attempt. - You might want to make your "JavaScript Required" page link to some instructions (like [[http://www.google.com/support/bin/answer.py?answer=23852|Google's]]), and provide a BIG PROMINENT PHONE NUMBER for the customer to call in their order if they want to. ==== Set a Maximum or Minimum Quantity on the Cart or Order ==== If you need to limit the quantity of your entire order (and not just per product, which you could use ''quantity_min'' and ''quantity_max'' for), you can use the JSON cart object. The basic idea is: * load up the cart, * check the JSON for the parameter you want, and * disable/enable the "checkout" link. Here's an example of disallowing checkout if the order quantity is less than 12: Stick that code somewhere beneath your ^^cart^^