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

This is an old revision of the document!


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

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 change any and all references on your site that look like this:

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

Please check your FoxyCart Admin's "sample code" section for the new code to use.

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 necessarily 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.tld/cart?name=Test Product&price=9.99">Add To Cart</a>
<form action="https://example.foxycart.tld/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.

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 Unstlyed 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