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.

Subscriptions with Variable Price

charlie_mezakcharlie_mezak Member
in Bugs & Feature Requests edited February 2012
Hello,

I'm having a great time using FoxyCart so far. I'm coming from the world of rails and building my first storefront. I've been surprised at how simple it is with FoxyCart.

Anyway, I'm using 0.7.2, and my client has a somewhat non-standard requirement, and I'm not sure how to make it fit in with what FoxyCart can do.

The client wants to allow customers to join a club, which among other things means that they will receive two assorted product shipments per year. The obvious way to handle this is to have the customer purchase a biannual subscription. However, the total price of each product shipment varies. For example, a customer signs up for the club, and, when the first shipment date rolls around, my client ships them a set of products that cost $120. The next shipment, six months later, might be $150.

I understand how to set up subscriptions in general, but I don't know what the best way would be to handle this requirement. I see that you can modify individual subscriptions, so perhaps my client will have to change the subscription price before each shipment. But is it possible to do that (and to do it for a large set of subscribers at once)?

Is there some other way to handle this requirement instead of using subscriptions? All I need to do is:

1 Get the customer's payment info into the system and mark them as a club member (I can do the latter in my CMS)
2 Periodically (not necessarily automatically) complete a purchase for a (potentially large) set of customers

I suppose I could have the customer purchase some kind of initial Club Membership product (for $0, but still requiring them to enter their payment info). My CMS would get the club member's email address via the XML data feed, so the unified form could later be used to conduct the purchase associated with each shipment. But can those purchases be done all at once for a set of customers?

Thanks for you advice! I hope to add FoxyCart to my toolkit for many other projects!

- Charlie
Tagged:
Comments
  • fc_adamfc_adam FoxyCart Team
    @charlie_mezak,

    I'd suggest taking a look at the API (http://wiki.foxycart.com/static/redirect/api), which would allow you to modify a large number of subscriptions at once based on some filtering rules.
  • charlie_mezakcharlie_mezak Member
    edited February 2012
    @fc_adam

    Thanks for your reply! I see that the API can be used to modify subscriptions, but it doesn't look like I can use it to modify the price. It makes sense not to allow price changes in general, but it seems necessary in my case, at least if I'm going to use subscriptions.

    So my problem isn't quite solved. Maybe I will have to convince my client to have a consistent price for these periodic shipments.
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    You can modify the price - you'll want to look at http://wiki.foxycart.com/v/0.7.2/api#subscriptions and the subscription_modify / transaction_template XML.
  • Ah, I see in the provided XSD file for the transaction_template XML that I can set the price. OK then. I'll use subscriptions and set up a mechanism on my CMS for them to periodically change the price of the subscription. Thank you!
  • lukeluke FoxyCart Team
    To be clear, the transaction details are what determine the price. So if you add or remove a line item, the price updates. That was probably obvious, but I just wanted to say it out loud just in case. :)
  • @luke

    I don't know what "line item" is referring to, but I see in the advanced edit section of the "edit subscription" page that the xml includes:
    <transaction_details>
        <transaction_detail>
          <product_price><![CDATA[120]]></product_price>
    

    I'm assuming that I can use the API to replace this xml with a different price. Right? I can do that on the "edit subscription" page manually, but my client is going to have to do it for all subscribers at en masse. I'm hoping that between my rails app and the FC API this can be done.
  • fc_adamfc_adam FoxyCart Team
    @charlie_mezak,

    Yeah, using the API you'll be able to setup bulk modifications.

    The 'line item' Luke is referring to is a product that is a part of the cart. So if you add three items to a cart, you'd have three line items. Make sense?
  • @fc_adam,

    Sure, that makes sense, but I guess I don't see the relationship between a cart of products and a subscription. A subscription is a product, right? So it is a line item itself, isn't it? When I'm interacting with it via the API, where does a cart come into play?

    I'm sure it'll all make sense in time. I'm going to start implementing all of this.
  • lukeluke FoxyCart Team
    A subscription is better thought of as a recurring transaction. The entire transaction is replayed (which includes coupons, transaction details (or order "line items"), etc. This is important because some subscriptions really need to have multiple products as part of the overall "subscription." We think of subscriptions as a transaction template that can be modified as needed. When interacting with the API, the subscription_modify method has a transaction_template which, in a sense, is your "cart" that will be replayed in the recurring transaction. It follows the XSD pattern defined here: http://wiki.foxycart.com/v/0.7.2/api#subscriptions

    I hope that helps.
Sign In or Register to comment.