Subscribe Option in Checkout

alanalan Member
in Help
Hi,

We do not utilize the cart in our store, rather the purchase page posts straight to our checkout page (secure.carpelotion.com). On the checkout page, we have the editable cart displayed on the side. We would like to add an option to this cart which allows customer to change their one-time purchase to a recurring subscription. Can you please advise on the easiest way to do this? Would we edit the cart template to include these fields?

We also want to give the customers discounted products when they subscribe. What would be the easiest way to do this? Would we want to create a different product category for products that a purchased through subscriptions?

We are using V2.0.

Any help would be much appreciated!

Thanks,

Alan
Comments
  • fc_adamfc_adam FoxyCart Team
    edited May 2
    @alan,

    Good question. Currently it's only possible to alter the quantity of products in the cart - it's not possible to alter other details about products in the cart. To do that you would need to first remove the product and then add it back in it's updated form.

    That is possible to achieve from the checkout - you would handle it using javascript, submitting a request which removes the one-time product and adds it back as a recurring subscription. As a quick example of what that could look like:
    var product_id = 0; // Get product ID from FC.json.items

    FC.client.request("https://" + FC.settings.storedomain + "/cart?cart=update&quantity=0&id=" + product_id).done(function(dataJSON) {
    FC.client.request("https://" + FC.settings.storedomain + "/cart?name=My+Product&price=5&category=abc&sub_frequency=1m").done(function(dataJSON) {
    FC.checkout.render();
    });
    });
    That is triggering two requests. First it removes the existing product from the cart (you'll need to get the ID of the product from the cart JSON object), and then when that's done it adds in the new product (defined in the URL) before rendering the checkout.
    We also want to give the customers discounted products when they subscribe. What would be the easiest way to do this? Would we want to create a different product category for products that a purchased through subscriptions?
    Would it be an ongoing discount for subscriptions? If so - creating a unique category for your subscriptions would be your best bet, giving the category a discount in it's configuration and then assigning the product to that category.

    If you only want to offer a limited discount, for example just the first renewal, or the first few renewals, you could do that using a coupon instead. It would still be worth adding the product to it's own category, but then restrict the coupon to only apply to that category. If you want to limit the coupon to only applying for a specific number of renewals, you can set the uses per customer to that number for the coupon. It will then stop applying once that specific customer (by email address) has used it that many times.
  • alanalan Member
    Of course! Thanks!
Sign In or Register to comment.