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.

FoxyCart Checkout Only, with single Product added

ahsodesignsahsodesigns Member
in Help edited September 2013
here's the store's domain :

we're working on a site where they're just selling one product, an online quiz,
we'd like to use just the foxycart checkout template, and bypass the shopping cart process,
and we're wondering if there's a way to have the shopping cart set with just one product in it by default.

They're only selling one product, so we'd like to skip the add-to-cart & shopping cart phase and just proceed to the cached foxycart checkout template with the single product in it all ready to go.
How would we go about this ?
tyty again,

  • fc_adamfc_adam FoxyCart Team

    You'd simply set up the add to cart link or form and make it go straight to the checkout. For example:

    That would add a $20 product called Widget to the cart, but the customer would be sent straight to the checkout. So using that approach, you could set up a link or form on your page for the customer to purchase the quiz, and it would send them straight to the checkout with the product added to their cart.
  • brilliant fc underscore adam! thanx!

    we're having another issue now, the foxycart admin won't keep the templates we're cacheing.
    we'll cache the template URL and it will say "success"
    then we click 'update template'
    more success,
    but when we come back to the template cacheing page for the cart, checkout and receipt,
    the fields are all empty again.

    we've configured a default product category,
    but the URL to the checkout : Assessment&price=20&cart=checkout
    tells us the templates aren't cached and / or there's no default category.
    ty again,
  • lukeluke FoxyCart Team
    @ahsodesigns Looking through the data, it looks like your templates may have been removed. I went ahead and cleaned it up, though our backup data showed empty template records as well. If you re-save the templates now, it should work. Please let us know.
  • no worries. tyty.

    It's working now. all is well.

    p.s. my daughter RLY hearts those unicorn rainbow stickers btw...
  • it's going really well,
    you can check our progress here :

    we've modified the cart on the checkout page to be an input field, so if, for whatever reason they quit the cart and try to get back in, they can adjust the quantity in the form field.
    we're then making a getJSON call to out cart, and it's returning , and updating the info as it should,
    we're verifying this in the console.

    we're having trouble finding the function to run to update / recalculate the information on the checkout template tho, based on the new cart data. could you pls point us in the right direction?
    tyty & have a good one.

    p.s. here's our code, let us know if you see any room for improvement.
        //#todo - if there's ever more than one product, this will have to be scoped tighter $(this)
        // get product id, it's the id of the element prefixed w/ "product_" and the actual number is all we need, so it gets stripped.
        var productID = $("[id^=product_]").attr("id").replace(/[^\d\.]/g, '');
        // get values from existing cart
        var itemQuantity = $(".fc_cart_item_quantity").text().replace(/ /g,'');
        $(".fc_cart_item_quantity").empty(); // dump what's there.
        console.log("itemQuantity : " + itemQuantity);
        var itemQuantitiyInput = '<input class="ahso_fc_cart_item_qty" type="text" name="fc_cart_item_quantity" value="'+itemQuantity+'" maxlength="1" size="1"><a href="" class="fc_cart_item_delete_quantity">  X</a><a href="" class="fc_cart_item_update_quantity">  update quantity  </a>';
        // swap in input field prepopulated w/ value from existing cart
        console.log("itemQuantitiyInput : " + itemQuantitiyInput);
        // attach listeners to input field and 'x' next to field
            var currentQtyValue = $(".ahso_fc_cart_item_qty").val();
            if ( currentQtyValue !== '0') $(".ahso_fc_cart_item_qty").val( currentQtyValue - 1 );
        // update cart when changes are made
            var currentQtyValue = $(".ahso_fc_cart_item_qty").val();
            console.log("currentQtyValue : " + currentQtyValue);
            // #todo - you left off here, trying to get the cart to update.
            jQuery.getJSON(''+FC.session_id+'&cart=update&quantity='+currentQtyValue+'&id='+productID+'&output=json&callback=?', function(cart) {
                console.log("i'm back");
                console.log("time to update the cart...");
    //        jQuery.getJSON(''+fcc.session_get()+'&output=json&callback=?', function(cart) {
    //  ;
    //  ;
    //  ;
    //            var total_price = cart.total_price - cart.total_discount;
    //            console.log('You have '+cart.product_count+' products in your cart, totalling $'+total_price+' (which is after a $'+cart.total_discount+' discount).');
    //        });
  • fc_adamfc_adam FoxyCart Team

    I believe you should be able to just do this:
Sign In or Register to comment.