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.

Upsell at Checkout

nicolesauknicolesauk Member
in Help edited January 2012
Hello all,

I'm trying to add upsell options to my checkout. I'm following this wiki example:

Here is my store:

In the wiki example, it was making it to only show the upsell if nothing was added in a specific category. So I created a warranty category, and thought I changed all the ids correctly, but the upsell still won't show up in my checkout. I know it's pretty advanced javascript, and I'm not incredibly comfortable with it, so it very well might be something very easy I'm just missing. Anyone have any idea what I'm doing wrong?

Thanks so much for the help!
  • Oops... forgot to show my code:
  • fc_adamfc_adam FoxyCart Team

    That's actually my fault - I had got the example code wrong on the snippet page. Instead of addUpSell it should be showUpSell.

    Sorry for the mixup
  • Ok, I got that fixed. But the upsell still isn't showing for me.
  • fc_adamfc_adam FoxyCart Team

    A couple things:
    * Firstly, I'd suggest removing the jquery-latest you've included in your checkout template. The cart, checkout and receipt templates automatically include jQuery for you, so you don't need that.
    * I'd also suggest ensuring that in your template all CSS style blocks are included before any javascript blocks or includes.
    * Lastly, you have a little error with your upsell logic, take away the else in the line else if (!hasMerch && total_upsell == 0) { - Sorry I didn't see that earlier.
  • nicolesauknicolesauk Member
    edited January 2012

    Ok, I removed the link to jquery-latest, put all my css before my javascript in the head tag, and removed the else. Still not coming up.

    All my code is attached on a pastie here:

    Thanks so much again for all your help.
  • fc_adamfc_adam FoxyCart Team

    I'm really sorry - another bug by my doing (I obviously didn't test this very well!), update your upsell code to this:
    var hasMerch = false;
    for (p in fc_json.products) {
    if (fc_json.products[p].category == "Warranty") {
    hasMerch = true;
    if (!hasMerch && total_upsell == 0) {
  • @fc_adam No worries, it just makes me feel less bad having to ask for help :)

    And that works, perfect. Thanks so much!
  • webmovementllcwebmovementllc Member, Integration Developer, FoxyPress
    If it helps anyone, I wrote an upsell/add ons tutorial for some ways to do it with FoxyPress.
Sign In or Register to comment.