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.

Need more subscription code examples please.

RustyDustyRustyDusty Member
Issue 1. How would the following code look is you set a different price for each frequency time frame?
For instance what if the 1d price is 00.50? 2w is $20.00 1m is $30.00, 3m is $35.00 and 1y is $50.00? How would that look in the code below?
<select name="sub_frequency">
<option value="">[ Select Frequency ]</option>
<option value="1d">Daily</option>
<option value="2w">Every 2 Weeks</option>
<option value="1m">Monthly</option>
<option value="3m">Quarterly</option>
<option value="1y">Yearly</option>
</select>
<input type="submit" value="Subscribe">
Issue 2. What would the sub_token and sub-cancel code look like and where do I put it?
At the moment I have 3 buttons for each of my subscription packages and each button has the price in the link example. But how would someone cancel that subscription?
<!-- link example -->
<a href="https://MYDOMAIN.foxycart.com/cart?name=Monthly%20Subscription&price=25&sub_frequency=1m&">Monthly Subscription</a>
<!-- form example -->
<form action="https://MYDOMAIN.foxycart.com/cart" method="post" accept-charset="utf-8">
<input type="hidden" name="name" value="Monthly Subscription" />
<input type="hidden" name="price" value="25" />
<input type="submit" value="Subscribe">
</form>
Thank you.
This newbie learns fast.
Comments
  • RustyDustyRustyDusty Member
    edited April 6
    Ok,

    I've been doing more reading and I realize that I do not need the form. So my subscription link looks like this now.

    <a href="https://MYDOMAIN.foxycart.com/cart?name=Monthly%20Subscription&price=25&sub_frequency=1m&sub_token=https://www.MYDOMAIN.com/tokenPage&sub_cancel=true

    I NEED clear step by step instructions for setting up subscriptions payments.

    Hope I'm on the right track here. After setting up this code on my site I'm now off to setup a Subscription XML Datafeed
  • brettbrett FoxyCart Team
    Hi @RustyDusty.

    A few things to cover here. First, pricing and forms:
    I know you've moved to links, but if you wanted to change the price, you'd use modifiers:
    https://wiki.foxycart.com/v/2.0/cheat_sheet#product_option_modifiers
    That said, unless you're doing donations, links probably make more sense.

    Cancels are handled via links from the receipt emails that are sent out. (We're working on a customer portal, but at this point, all subscription actions are included by default in the email receipts Foxy sends out.)

    I'm a little unclear on your 2nd post's link. If it's to purchase a new subscription, you don't include the sub_token or sub_cancel.

    Does that help?
  • Yes it does help. Thanks. I'll take the sub_token code out because I think it was giving me weird end dates listed as the next day.
  • brettbrett FoxyCart Team
    It's probably the sub_cancel that's causing the end date, actually. In any case, don't include the sub_token or the sub_cancel in your own links/forms and you should be fine :)
  • ok. Thanks.
Sign In or Register to comment.