Documentation You are here: start » v » 0.7.0 » upgrading

Upgrading to v0.7.0

Note: This page is geared towards upgrading from v0.6.0. Please make sure you view all the version notes for versions you may be skipping (ie. from 0.5.1 → 0.6.0 → 0.7.0).

Please make sure you review the 0.7.0 changelog (available in your FoxyCart admin's Store Settings page) before upgrading. Also please ensure you've read the v070 known issues

ACTION REQUIRED

Change of "Include" File Paths

Read this section carefully This one is a biggie. If you don't make this change, FoxyCart won't work as expected on your site.

The “includes” files necessary for FoxyCart to function on your site have been moved to our CDN (Content Delivery Network). This provides a 2-5x speed increase around the world, but in order to make it happen the paths for the “includes” CSS and JavaScript files have been changed. You will need to replace any and all references on your site that look like the below code with new code.

This is the what the old includes look like:

<!-- BEGIN FOXYCART FILES -->
<script src="http://YOUR_FOXYCART_DOMAIN/files/foxycart_includes.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="http://YOUR_FOXYCART_DOMAIN/files/foxybox.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="http://YOUR_FOXYCART_DOMAIN/themes/standard/theme.foxybox.css" type="text/css" media="screen" charset="utf-8" />
<!-- END FOXYCART FILES -->

That code needs to be removed and replaced with the new code available in your FoxyCart Admin's "sample code" section, which will look like this:

<!-- BEGIN FOXYCART FILES -->
<link rel="stylesheet" href="http://static.foxycart.com/scripts/colorbox/1.3.16/style1_fc/colorbox.css" type="text/css" media="screen" charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://cdn.foxycart.com/YOUR_FOXYCART_DOMAIN/foxycart.complete.3.js" type="text/javascript" charset="utf-8"></script>
<!-- END FOXYCART FILES -->

Please copy the new code to use from your FoxyCart admin and not this wiki page. Also note that YOUR_FOXYCART_DOMAIN needs to be either the *.foxycart.com subdomain or the full checkout domain if you're using a custom subdomain. So if your checkout is at example.foxycart.com, YOUR_FOXYCART_DOMAIN should be example. If you're using a custom subdomain like secure.example.com, then YOUR_FOXYCART_DOMAIN should be the entire secure.example.com.

Also, ensure that your cart, checkout, and receipt templates do not contain any of this code. It is unnecessary on the cart/checkout/receipt, and can cause problems in the template caching.

Confirm You Have the Right Includes

STOP! Check your site's template. If you have any references to foxycart_includes.js, you have not properly completed the step above.

Your site should now be calling code that looks like this:

<!-- BEGIN FOXYCART FILES -->
<link rel="stylesheet" href="http://static.foxycart.com/scripts/colorbox/1.3.16/style1_fc/colorbox.css" type="text/css" media="screen" charset="utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="http://cdn.foxycart.com/YOUR_FOXYCART_DOMAIN/foxycart.complete.3.js" type="text/javascript" charset="utf-8"></script>
<!-- END FOXYCART FILES -->

If you have code in your site referencing foxycart_includes.js and foxybox.css your site will not work. Please go to the upgrade step above and follow the steps there to ensure you have the right code.

PayPal Express Checkout and Subscriptions

If you use PayPal Express Checkout (ie. if your cart has a “PayPal” button on it), you should set up your IPN and API access for your PayPal account to allow FoxyCart to make requests on your behalf. This step is recommended for all FoxyCart stores using PayPal Express Checkout, but if you are doing subscriptions through FoxyCart this step is required, as your subscriptions will fail through PayPal if the proper API permissions are not granted.

"Offline Processing" is no longer available

If your store is using “Offline Processing” as a payment method, that is no longer available as of v0.7.0. Please contact us for details. We will be phasing out Offline Processing over the next 6-12 months, and will give all merchants using Offline Processing plenty of time to move to a real gateway. The security and liability risks are simply too great for us to continue to offer Offline Processing as we continue to provide secure and innovative solutions to our users.

If you're currently using Offline Processing we recommend moving to a supported gateway. If your desired gateway isn't available, let us know and we can look into adding support.

Complete Rewrite of the FoxyCart Javascript (foxycart_includes.js, foxycart.js)

If your site is using any of the following, you'll need to rewrite some of your javascript to take advantage of the new functionality and maintain compatibility with FoxyCart's javascript.

  • fc_PreProcess()
  • fc_BuildFoxyCart()
  • fc_json
  • fc_tb_init()
  • Any custom cart display using a non-default modal window or JSONP functionality
  • Hack or override to get the fcsid cookie set at a subdomain or third-level domain (like example.co.uk)
  • Self-hosted foxycart_includes.js
  • Anything else that's using any code from foxycart_includes.js

Please review the documentation for the new ''foxycart.js'' and make the necessary changes. Since the javascript has been mostly rewritten it isn't possible to include a step-by-step upgrading guide, but if you have any questions feel free to ask in our forums.

Thickbox replaced by Colorbox

If you're just using the default foxycart_includes.js without custom styling on the “FoxyBox” (based on Thickbox and you upgrade straight to the foxycart.complete.js as mentioned above, this won't impact you too much. If, however, you have made customizations to the FoxyBox you'll need to re-create them using Colorbox (the new default modal window), re-implement them using your own Thickbox setup, or use another modal window as desired.

You can tell if you have custom FoxyBox styling if it doesn't look more or less like the image on the right (with your cart displaying inside the big white area). You can also check if you have any #fc_tb_ declarations in your CSS.

Note that this doesn't affect the cart itself, which is displayed in an iframe inside the modal window, and set in your “Cart” template in your FoxyCart admin. That page is entirely unrelated to the modal window script with holds it.

The new foxycart.js no longer relies on a class of .foxycart, instead attaching the necessary functionality based on the href or action of your links or forms actually pointing at your FoxyCart domain, like example.foxycart.com. This change shouldn't impact the vast majority of stores, but it is sufficiently large that you should double-check to ensure that your add-to-cart links and forms continue to work as expected.

If you're relying on the .foxycart class to actually set the href or action attributes of your links and forms, you'll need to either override a function in foxycart.js or ensure that your links and forms point to your FoxyCart domain. For example:

<!-- The following WILL NOT work -->
<a class="foxycart" href="path/to/something/else?name=Test Product&price=9.99">Add To Cart</a>
<form class="foxycart" action="" method="get">
	<input type="hidden" name="name" value="Test Product" />
	<input type="hidden" name="price" value="9.99" />
	<input type="submit" value="Add to Cart" />
</form>
 
<!-- The following WILL work -->
<a href="https://example.foxycart.com/cart?name=Test Product&price=9.99">Add To Cart</a>
<form action="https://example.foxycart.com/cart" method="get">
	<input type="hidden" name="name" value="Test Product" />
	<input type="hidden" name="price" value="9.99" />
	<input type="submit" value="Add to Cart" />
</form>

fc_PreProcess(), fc_BuildFoxyCart() are replaced

If you're using fc_PreProcess() or fc_BuildFoxyCart() at all you'll have to migrate those to the new preprocess() and postprocess() methods. Please review the documentation for the new ''foxycart.js'' and make the necessary changes. Since the javascript has been mostly rewritten it isn't possible to include a step-by-step upgrading guide, but if you have any questions feel free to ask in our forums.

jQuery 1.4.2

The jQuery required for foxycart.js, the cart, checkout, and receipt is now 1.4.2 (previously 1.3.2). This shouldn't cause any problems, but take a look at the jQuery upgrade notes to make sure there are no backwards-incompatible changes that impact your site.

Coupon Code & Quantity Discount Changes

If you're using coupon codes you should check to ensure that the discounts are applying as expected. Coupon code discount behavior has been tightened up a little and now defaults to the newly created ''single'' discount type. This single discount type is actually what may be in effect for coupon codes prior to v0.6.0, but the behavior was undocumented, and the allunits discount type wasn't available previously.

If you use coupon codes please test them out after upgrading to ensure they are applying the correct discount.

Email Templates

FoxyCart v0.7.0 now allows for sections to be shown or hidden depending on the type of transaction the customer made. If you have customized your email template we recommend:

  1. Copying your existing email templates out of FoxyCart.
  2. Selecting the default email templates in FoxyCart.
  3. Comparing the new defaults with your old custom templates, and modifying your old templates accordingly.
  4. Pasting your newly updated custom templates back into your FoxyCart admin and saving.
  5. Test. Then test some more.

If you haven't customized your email templates just reset them to the defaults and test to ensure they're acceptable.

You can now lock down your add-to-cart links and forms using HMAC validation, which sounds scary but you may be able to do it automatically. It is highly recommended you at least read through the documentation so you know what options you have to secure your add-to-cart links and forms.

Store-Specific Timezone Settings

Your store settings page in your FoxyCart admin now allows for selecting the timezone of your store, which will change the transaction time displayed in your admin and on your store's email receipts sent to customers.

Cart and Checkout Javascript Insertion point have changed

To prevent the FOUC (Flash Of Unstyled Content), we have changed where we insert the FoxyCart-required javascript in the cart and checkout templates. Previously it was inserted immediately after the closing </title> tag. Because the FOUC occurs if JavaScript that modifies the DOM is loaded before CSS is loaded, the FoxyCart javascript is now inserted after the last <link> tag in your template's <head> section.

This shouldn't cause any problems, but if you notice any strangeness with your CSS or javascript not behaving as expected please let us know.

Subscription Improvements, Past Due Amounts

  • Past due amounts now will be automatically charged on subsequent billing attempts. This is a change to previous functionality, where the past due amount would be stored but not automatically attempted. If this impacts your billing models please make any appropriate adjustments.
  • There are new subscription-specific language fields for both the checkout and emails. ^^subscription_cancel_begin^^ and ^^subscription_cancel_end^^ are available for placement in your receipt email templates. More info.
  • The XML in the Transaction XML Datafeed and the Subscription XML Datafeed has some fields removed, and some other fields added. Please review the

Email Placeholders for Improved Communication

New placeholders are available to only include blocks if the email is for an order, an update_info request, or a subscription receipt. More info.

New Button ''ID''s for "Checkout" Button

If you have CSS image replacement on the main “checkout” button you may want to add new images or styles for updating a customer's info or canceling a subscription.

  • Added class fc_updatinfo to #fc_complete_order_button for when the customer is updating their billing information.
  • Added class fc_subscription_cancel to #fc_complete_order_button for when the customer is cancelling a subscription.

Language Customizations and New Language Fields

If you've customized the language on your FoxyCart store you should check the changelog for a list of new language fields. If your store is not using the default English language translation this should be considered a mandatory upgrade step.

Other Notes for Advanced Users or Implementations

  • If you've done crazy hacks to get categories changed depending on a product option, you can now use the y modifier. More info.

Site Tools