Table of Contents
Upgrading to v0.4.0
Note: This page is geared towards upgrading from v0.3.2. Please make sure you view all the version notes for versions you may be skipping (ie. from 0.3.1 → 0.3.2 → 0.4.0).
Please make sure you review the 0.4.0 changelog before upgrading.
Possible Action Required: Checkout JavaScript Redesigned
The javascript on the checkout page was completely redesigned to be contained in the “FC” namespace. If you've done any custom javascript on your checkout page that ties into FoxyCart javascript methods that start with “fc_” then you'll need to reference “FC.checkout.” as the prefix instead.
Possible Action Required: JSON Changed
The JSON has been changed dramatically. You can view the new structure at the JSON documentation page. Because any JSON implementation will be somewhat custom, we cannot provide easy instructions to upgrade, but it should now be easier to access values within the JSON.
Possible Action Required: CART HTML Changed, IDs changed and removed
We have removed many of the ID
s that were in the cart HTML
in order to make the code more consistent and easier to understand. If you're using one of the FoxyCart provided themes (either the “standard” or the “text” themes) you won't have to worry about these changes, as the CSS will change automatically when you apply the new version to your store.
If you've customized the CSS on the cart, however, you will likely need to update your CSS. Yes, we know this is lame, but we feel that it is an improvement that needs to be made in order to keep the underlying HTML clean and understandable. You should be able to quickly go through your CSS and do a find & replace for all the elements listed below.
MAKE SURE you don't replace partial matches. For example, if you're searching for #fc_cart_foot_subtotal
, that string also occurs in #fc_cart_foot_subtotal_row
, so make sure you add a space after the string so you don't match substrings in your find and replace. If that doesn't make sense, just make sure you don't replace partial matches. The replacements outlined below should work well, but obviously do a reality check to make sure you're not creating invalid CSS.
Also, now would probably be a good time to review the screencasts on customizing your checkout and cart. Trust us, they're worth the 10 minutes it'll take to watch them, and if you do run into any issues it'll help you resolve them in no time at all.
The following ID
s were removed:
- #fc_cart_update_top → #fc_cart_controls_top a.fc_cart_update
- #fc_cart_update_bottom → #fc_cart_controls_bottom a.fc_cart_update
- #fc_cart_checkout_top → #fc_cart_controls_top a.fc_cart_checkout
- #fc_cart_checkout_bottom → #fc_cart_controls_bottom a.fc_cart_checkout
- #fc_cart_notice_top → #fc_cart_controls_top span.fc_cart_notice
- #fc_cart_notice_bottom → #fc_cart_controls_bottom span.fc_cart_notice
- #fc_cart_foot_subtotal → tr#fc_cart_foot_subtotal td.fc_col2
- #fc_cart_foot_subtotal_label → tr#fc_cart_foot_subtotal td.fc_col1
- #fc_cart_foot_subscriptions → tr#fc_cart_foot_subscriptions td.fc_col2
- #fc_cart_foot_subscriptions_label → tr#fc_cart_foot_subscriptions td.fc_col1
- #fc_cart_foot_shipping → tr#fc_cart_foot_shipping td.fc_col2
- #fc_cart_foot_shipping_label → tr#fc_cart_foot_shipping td.fc_col1
- #fc_cart_foot_tax → tr#fc_cart_foot_tax td.fc_col2
- #fc_cart_foot_tax_label → tr#fc_cart_foot_tax td.fc_col1
- #fc_cart_foot_total → tr#fc_cart_foot_total td.fc_col2
- #fc_cart_foot_total_label → tr#fc_cart_foot_total td.fc_col1
The following ID
s were changed:
- #fc_cart_foot_subtotal_row → #fc_cart_foot_subtotal
- #fc_cart_foot_subscriptions_row → #fc_cart_foot_subscriptions
- #fc_cart_foot_shipping_row → #fc_cart_foot_shipping
- #fc_cart_foot_tax_row → #fc_cart_foot_tax
- #fc_cart_foot_total_row → #fc_cart_foot_total_row
You may then want to do a find and replace for:
- tr# → #
The following HTML was added, for COUPON CODES. This HTML is added if your store has valid/current coupon codes. If you plan on using coupon codes you should probably create a quick test code, then play around with it a little. Some example HTML is copied here so you know what to expect.
<tr class="fc_cart_foot_discount"> <td class="fc_col1" colspan="2"> $5 off all orders over $5!: </td> <td class="fc_col2"> <span class="fc_discount">-$5.00</span> <span class="fc_cart_coupon_remove"> <a href="/path/to/link" class="fc_cart_remove_link" title="Remove this item">[x]</a> </span> </td> </tr> <tr id="fc_cart_foot_discount_new"> <td class="fc_col1" colspan="2"> <a href="#" onclick="fc_addCoupon()">Add a coupon</a> </td> <td class="fc_col2"> <input type="text" name="coupon" id="fc_coupon" class="fc_text_short" value="" style="display:none;" onchange="fc_HideCheckout()"/> </td> </tr>
Note: We don't like to change things like this, but it's necessary as we move towards more flexible and extensible system.
Possible Action Required: CHECKOUT HTML Changed, IDs changed and removed
Many of the <li>
elements on the checkout have had their ID
s removed. If you were styling <li>
elements on the checkout or receipt using their ID
s you should change the CSS declarations to select the elements by the container's ID and the <li>
element's class.
We are not aware of any stores doing this type of customization, but if you are and you require a detailed list of IDs that have been removed please let us know in the forum.
CART Error Notification HTML
The HTML that is output when an invalid product is added has been changed to be consistent with the HTML on the checkout. It looks something like this:
<div id="fc_error_container"> <div class="fc_error"> <ul class="fc_error_list"> <li><b>2007</b> is in the past. Please set a sub_startdate with a correct year.</li> </ul> </div> </div>