The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Help! Error message on upgrade to 0.7.1

kscotbarrkscotbarr Member
in Bugs & Feature Requests edited June 2011
Upgrading from 0.7.1 and getting the following message when trying to complete a donation on our site:

Donation does not appear to be a valid category. Please login to your account manager and update your category list.

However, I've double-checked that this is a valid category and we're connected to the right store.

URL looks like this:

https://secure.abwe.org/cart?cart=checkout&category=Donation&name=[name]&price=[price]
Comments
  • lukeluke FoxyCart Team
    Did you get this worked out? Putting in examples values in the link above seems to be working for me now.
  • No, I haven't. It's working now because I reverted the store settings to 0.4.0. When I change it to 0.7.1 I still get the error message.
  • lukeluke FoxyCart Team
    The form I saw on your site shows "donations" all lower case, but the category code in the admin is actually "Donations". Could that be it? Otherwise you may be including the wrong javascript include files so it's not referencing the correct store (or the cdn hasn't triggered on the fact that your store has upgraded yet). Without it in the "broken" state, it's hard for us to debug what's going wrong. Do you have a test store you can work with first?
  • Yeah, I did experiment with the "Donations" in lowercase, but didn't seem to make a difference. Will create a test store and troubleshoot more next week.
  • Did a little more troubleshooting and still can't figure this out. I've set up a test store, which seems to work just fine:

    http://abwetest.foxycart.com/cart?name=testing&price=9.99&cart=checkout&category=Donation

    However, on the live store, when I switch it to version 0.5.1, I start getting the category error message:

    https://secure.abwe.org/cart?name=testing&price=9.99&cart=checkout&category=Donation

    (The above works right now since I have the store set to 0.5.0 - switching it to 0.5.1 triggers the error).

    Any ideas are appreciated.
  • OK, I think I figured out what's going on. I actually have 2 stores on 1 site. The one store is configured to process book sales, and the other to process donations. When I initially set these up they were part of the same store. Now the client wants to make 2 separate stores in order keep some separation.

    So, I've been testing out both systems. The first store (ABWE Books and More) is working great. The second (ABWE) is throwing the categories error. But I just realized that, when using 0.5.1, if I already have something in the Books and More cart, when I click on the link to add an ABWE donation, it goes to the Books and More cart. Hence the error.

    I suppose it would be rare for someone to run into this, and it is working if you simply try to process one or the other transaction. But is there a way to get around this?
  • brettbrett FoxyCart Team
    So, good news (hopefully): In v0.7.0+, the "2 stores on 1 domain" is way easier to deal with. BUT... you have to properly isolate the stores so the sessions don't bleed across and give you the problems you're seeing.

    Give this page a look first:
    http://wiki.foxycart.com/v/0.7.1/advanced/javascript#how_it_works_configuration

    So the key is this: Each store has to live at its own path or subdomain, and you need to set the sitedomain and/or cookiepath. I recommend opening up the cookies in Firefox and seeing when and where the "fcsid" cookies are set. They need to be set at their own subdomains or paths. If you get a cookie set at .abwe.org, that'll apply for the entire domain. You'd want cookies set at something like .abwe.org/store/ and .abwe.org/donations/, or at .store.abwe.org and .donations.abwe.org, or whatever makes sense. But they can't overlap.

    Make sense?
  • Thanks Brett. Looks like this is working the way we'd like it to now, with donations attached to "secure.abwe.org" and book sales to "abwe.foxycart.com".

    Thanks for your help!
  • Ok, looks like I need a little more explanation as to how to configure this. I assumed that simply because we have one store at "abwe.foxycart.com" (the bookstore) and the other at "secure.abwe.org" (donations) the cookie path would follow these. And that's what I thought I saw in Firebug, but now it looks like they're getting mixed up at .abwe.org.

    So there is the sitedomain and the cookie path. Do I need to set both? I'd like it so that the cart link would take them to the donations whenever they are anywhere on the site except for the abwe.org/books-and-more pages.

    I have it set now that the foxycart javascript includes are set up so that any page without the "books-and-more" path will include the donations store. What do I need to do now?

    I have read the documentation, but I'm just not getting it. Sorry for being slow.
  • fc_adamfc_adam FoxyCart Team
    @kscotbarr, I think you may need to also include the javascript to set the cookiepath for the other pages as well, so on all the other pages where your secure.abwe.org foxycart files are included, you need to set the cookiepath there to something like 'donations/'.
  • Hmmm. I did this but the carts are still colliding. What am I missing?

    http://www.abwe.org => secure.abwe.org (donations)
    http://www.abwe.org/books-and-more/ => abwe.foxycart.com (books-and-more)
  • brettbrett FoxyCart Team
    This probably requires a little explanation so you can see what's going on.

    First, it's important to understand how cookies work. Every time your browser makes a request, it sends to the server _all_ of the data in _all_ of the cookies it has for that domain (or subdomain or domain/path). So if you have a cookie set at .abwe.org, that cookie will be sent on _every_ request made to abwe.org. All subdomains, all paths, etc.

    If you have a cookie set at .example.abwe.org, it'll _only_ be included in the request to the server when that request is made to example.abwe.org. (In case you're wondering the . prefix is kind of a wildcard, so .example.abwe.org would be included to example.abwe.org and foo.example.abwe.org, whereas a cookie set at example.abwe.org would _only_ be included in requests to example.abwe.org but not to subdomains.)

    It's the same thing for the path restriction. So you have a cookie that's being set with a path of /books-and-more/. That's all well and good, but if you have a cookie set at /, that cookie will be included on abwe.org/ as well as abwe.org/books-and-more/.

    So that's the issue here. If you have one FoxyCart store setting cookies at .abwe.org/, that's pretty much set at the webroot, and will be included in all requests, everywhere to *.abwe.org/*. What you need to do is to isolate the FoxyCart store cookies completely from each other so there's no overlap. So you'd have to complete separate them to .abwe.org/donations/ and .abwe.org/books-and-more/ or to .www1.abwe.org/ and .www2.abwe.org/, or anything similar.

    As you currently have it, there's one that's isolated by the path, but it doesn't matter because the other is set at the webroot.

    The other option would be to kind of completely bypass the session stuff altogether and make your donation page cart=checkout (direct to checkout without loading the cart at all) with an empty=true as well (since otherwise there's no way to clear the cart), and making sure that you _don't_ have any foxycart.js on the donations page. (If you do, it'll attempt to set a cookie and such, which you don't want.)

    Does that help?
  • Thanks for the explanation, Brett.

    So our problem was simply that we weren't isolating the donations to another subdomain or path. I get it. Actually I think going the route of checkout without the cart and using the "empty=true" parameter is the way to go for us at the moment. I think we're set!

    Thanks again!
Sign In or Register to comment.