Can you make a product have a subscription and a regular product at the same time?

jm987jm987 Member
Is it possible to have it so that a single buy button will let you set it so that the person will add a subscription and a regular item to their cart when the buy button is clicked?
Comments
  • fc_marijafc_marija FoxyCart Team
    Hi @jm987

    It sounds like you're looking for the "add multiple products to cart" type. If you're using a form, it'll look something like this:


    <form action="https://YOURSTORE.foxycart.com/cart" method="post" accept-charset="utf-8">
    <input type="hidden" name="name" value="Camera">
    <input type="hidden" name="price" value="100">
    <input type="hidden" name="2:name" value="Camera Bag">
    <input type="hidden" name="2:price" value="25">
    <input type="submit" value="Add Mulitple Products">
    </form>


    If you're using a link, it'll look like this:


    <a href="https://YOURSTORE.foxycart.com/cart?
    name=Camera&
    price=100&
    2:name=Camera Bag&
    2:price=25">
    Add Multiple Products</a>


    This will add multiple products to the cart with a single button or link. One distinction that should be made is that this will allow your customer to remove either individual product from their cart.

    If you don't want that to happen, then you'd want to use a parent/child product relationship, described in our docs here: https://wiki.foxycart.com/v/2.0/products?s[]=parent&s[]=child#adding_child_products

    Hope that helps. Let us know if you need anything else.
  • fc_marijafc_marija FoxyCart Team
    edited July 7
    @jm987 - I apologize, I didn't answer your question directly. Yes, you can combine a subscription product type with a regular product. Just note that if you're using a parent/child relationship where the parent product is either not a subscription or has different subscription settings (dates), when the subscription runs the second time the parent_code will be stripped from the product so that it can be added to the transaction without error.
  • jm987jm987 Member
    Awesome! Thanks.
Sign In or Register to comment.