Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

flat rate script not working after upgrade to 0.7

kanjigirlkanjigirl Member
in Bugs & Feature Requests edited April 2011
I upgraded my client from 0.6 to 0.7 - now the flat rate script we've been using is no longer working. This is what we have in the <head> section (working fine for months):
<script type="text/javascript">
		FC.checkout.config.orderFlatRateShipping = 5;

What needs changing?

Our default category (all cats) is set to flat rate shipping at 0.00. I tried changing that to 5.00 on a whim, it didn't have any effect.
  • Help?
  • I'm sorry to bug, but my client's having to manually tell her customers that shipping is not working on her site. Can someone please help me with this problem?
  • a9ka9k Member
    Can you get away with setting the shipping on a cart category instead of using js? At least until they can give you a better answer?
    Good luck.
  • I'll try that - right now I'm integrating Google Analytics :)
  • Unfortunately that's not working either.
  • brettbrett FoxyCart Team
    @kanjigirl, is there a reason you need to use the script instead of just setting it per category? Is the issue that you could have products from multiple categories in the cart?

    We don't have great visibility from the forum (yet) into which store you might be asking about, so we'd need to get links in order to see what's going on on your site.
  • Hi Brett,

    I don't remember the exact reason we used the script, it was something that was set up before I came in but you guys helped me get the JS working well. It worked fine until I upgraded to 0.7.

    The site is here:

    Last night I tried adding flat rate shipping to the default category (the client does not have a category set up for every product), that had no effect on the shipping, it stayed at zero. If there isn't a category set up, shouldn't the default flat rate be applying to everything *not* in a specific category?

    If that's not right, does the client need to create and assign a category to every product (hundreds of products) just to get shipping working again?
  • I just tried removing the flat rate script from checkout.html and changing the default flat rate to $5.00, that also had no effect on the cart.
  • My client's site:

    Flat rate shipping is not working either through our script or by adding a flat rate fee to a category. Please provide some guidance for us.
  • lancelance Member, Community Support Member
    @kanjigirl -

    Is the idea that everything needs to be shipped at a $5 flat-rate?

    Are you using categories on the site? If so, what are the categories being used for?

  • lancelance Member, Community Support Member
    @kanjigirl -

    It also seems that you are including the FoxyCart files in the header of your checkout template. You should remove these. You only need to use the <!-- BEGIN FOXYCART FILES --> block on your site pages, not in the cart or on the checkout. In fact, loading them in the cart or on the checkout could cause things not to work in an expected manner.

  • Hi everyone. I'm the client. The $5 minimum shipping I believe initially came from me thinking that was the way things were going to be set up, then we planned the categories and such around that functionality. We then discovered that no, that wasn't the way it worked default, but since we had worked everything out that way, we went ahead with it.

    Background: Most everything except for the ships themselves (we sell fiberglass model warships that can get up to over six feet long, and hit dimensional weight) get sent via USPS flat rate. My husband and I basically sat down and looked at what we sold, and eyeballed how things would fit together in flat rate boxes. You order one turret for example, I think it's a $1 charge on top of the $5 flat charge, and covers our cost for the flat rate box. Order four turrets, it's $4 charge, and enough to cover the bigger size box it'll take to ship those in. We have about six different categories set up this. It's a bit of a kludge, but it's worked well enough for now until the ability to support dimensional weight shipping and a more robust shipping program comes along.
  • @lance - Thanks - I'll remove the FC code from checkout (our custom page) and cart (the default), but it's been working *with* that code just fine until upgrading to 0.7.

    What about the receipt page, if anything FoxyCart-related is in the head section it needs to be removed?
  • brettbrett FoxyCart Team
    So just to confirm: The way it was is the way you want to keep it, right?
  • Yes - flat rate of $5.00 for each order.
  • lukeluke FoxyCart Team
    hey kanjigirl. It looks like your checkout page is having a lot of trouble right now... I'm seeing raw code outputted at the top of the page and a LOT of javascript errors. Can you try removing all of the css and javascript files from the checkout template you're trying to cache and see which one is causing all of the problems? Until we get the basic checkout page functioning again, we won't be able to address the $5 shipping issue.
  • fc_adamfc_adam FoxyCart Team
    edited April 2011
    {response to whispers}

    @kanjigirl - you were right to remove the colorbox stuff, what you need to add in though is the styling you want for the checkout. If its just the default FoxyCart styling that you're after, you need to add in the following to the head section of your template:
    <link rel="stylesheet" href="https://^^store_domain^^/themes/standard/styles.css"; type="text/css" media="screen" charset="utf-8" />
    That will give your template a default styling. You'll also want to add back in your foxycart_override.css file for your customisations.

    Now that you've got the checkout js errors cleared, you can add back in the stuff that you actually need for the checkout - custom javascript, custom css etc and we'll see if anything crops up then.
  • HI Adam,

    I added in the styles and override.css and the custom JS, ignoring the Google Analytics stuff for now. The two bits of JS are a country restriction (they can't type anything in the Country box and it's populated with United States), which is working fine, and our flat rate script which is not.

    Also, my override.css is not working, my styling isn't showing (see the custom fields at the bottom for terms and comments, there should be vertical space between those elements).

    What next to get the flat rate script working - or how to get it set up correctly as the default for all categories?
  • brettbrett FoxyCart Team
    So... at this point, I see:
    * Custom CSS seems to be working? I'm not sure what it should look like, but give the 2nd and 3rd screencasts a go for help in diagnosing that:

    * Forcing the country to US seems to work fine.

    * I don't see the flat-rate code at all. Can you put that back in?
  • Flat rate's in there now:
    <script type="text/javascript">
    		FC.checkout.config.orderFlatRateShipping = 5;

    The CSS issue is minor and I'll fix later.
  • brettbrett FoxyCart Team
    edited April 2011
    Ok, so I actually made a slight tweak to your checkout template and I think it's working. (We don't usually do that, but I wanted to make sure.) The latest versions of FoxyCart will insert all the necessary javascript (like calling jQuery) until _after_ the last CSS is loaded. You had the <script> above a <style>, so you were calling jQuery before jQuery was loaded.

    Also, you should lose the quotes around "document" in your js.

    So just move that <script> after your last <style> and and you should be good to go. (I think. I tested and it looks like it's adding $5 to whatever handling fee is set, which I think is correct.) Make sure you update your own checkout template and re-cache so you don't lose the changes on your next template cache.

    As far as the Google Analytics goes, we just updated the docs here:
    We added a "simplified version" that might be a little easier. Let us know if you have problems with that and we'll try to get you helped before you take your time off.
  • Hi Brett,

    I removed the quotes around "document" and moved the script as directed.

    I put one product into my cart from the Hardware products page and my shipping fee is $6.00, not $5.00. I checked the script and it does have '5' in it. The default product category has 0.00 as the flat rate - so I'm not sure why it's $6.00? The default handling fee for all categories is 'no handling fee.'

    I tried clearing cookies and removing the product, and adding a different product from another product page, same thing - $6.00 shipping. Every time I add another product it adds $1.00 to shipping. I don't get that, is that a handling fee it's adding even though it should not be?

    What does this line do:
  • Client confirms this is now working, there were some category fees I wasn't aware of. So thank you for your help, I'll start redoing the Google Analytics integration with your new instructions.
  • brettbrett FoxyCart Team
    Great. Making progress. If you have issues with the Google Analytics just start a new thread and we'll handle it there.
  • Dead thread arise! It's two years later, and we've discovered that if you order something and pay via paypal express checkout, the $5 base price isn't added, yet it is added if click checkout.

    We just discovered this, but really don't know how long it has been happening. I upgraded to 1.0 on my own (without the help of Kanjigirl), and perhaps it broke then?

    To replicate, go to and select an item, then try to pay with each of the methods and the cost is different.

    I'd love a hint of where to go to start troubleshooting this.

    Thanks so much!

  • fc_adamfc_adam FoxyCart Team

    Are you seeing this on any of your completed transactions - or just when you go to PayPal from the cart?

    With custom shipping, if the customer proceeds to PayPal from the cart, they won't see your custom shipping rates until they confirm their PayPal login and jump over to the FoxyCart checkout page to confirm their order. It's only there that they'll see your custom shipping rates.
Sign In or Register to comment.