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.

2 products

itisnot_meitisnot_me Member
in Help edited November 2010
ok i might just be stupid but how do i do this.

there is going to be a 2 parter to a subscription that i need to make. One is the base price. Two is the additional seats that need to be added.

now what they are going to do is put in how many seats that they need and it would get added to the cart with the price. But what i need to do is also add the base price automatically with the seat and set that to quantity_max and quantity_min to 1 and add the price (And if could, disable it).

it might sound weird but that is how the software is going to be. base + extra seats.

btw seat = login

thanks in advance
Comments
  • brettbrett FoxyCart Team
    So I think the issue is more about how you actually want the products to appear in the cart. And what's actually the subscription. I'm thinking that each seat is a subscription, so you'd have a base price (recurring) as well as seats product with a variable quantity?

    Or are you looking for just a single product in the cart, where the # of seats could be a product option?

    There are a few options so let's try to get it as clear as possible before we dig in.
  • Correct the seats and the base are recurring. But they might not need extra seats but some will. I would need the seats and the base separate in case they need more or less in the future. If I figure this out then modifying the cart in the future would be easier.
  • brettbrett FoxyCart Team
    So...
    Adding multiple products to the cart at the same time is possible by prefixing with integers, so name=, 2:name=, 3:name=, etc. (Prefixes group product options, so each X: will need a name, price, and whatever else you want like sub details.)

    As far as the seats go, I think you'll want to just make a seat a product, then change the quantity as necessary. Does that make sense?

    If you need to ensure the base price isn't removed from the cart if seats are present you could take a look at the bundling forum post here: http://wiki.foxycart.com/docs:advanced:forum
    It's a little advanced, but I think @fc_adam made it not too bad.

    Thoughts?
  • itisnot_meitisnot_me Member
    edited November 2010
    ok so i was looking at the bundling code and trying to make it work but i wasnt getting it to work so some reason.

    form code
    <input name="name" type="hidden" value="xyz widget" />
    <input name="code" type="hidden" value="base" />	
    <input name="price" type="hidden" value="5.00" />
    <input name="quantity_min" type="hidden" value="1" />
    <input name="quantity_max" type="hidden" value="1" />
    <input name="sub_frequency" type="hidden" value="1m" />
    <input name="2:name" type="hidden" value="http" />
    <input name="2:code" type="hidden" value="seat" /
    <input name="2:quantity" type="text" value="0" />
    <input name="2:price" type="hidden" value="2.00" />
    <input name="2:sub_frequency" type="hidden" value="1m" />
    	<input type="submit" value="Buy It Now!" />
    

    and the code changed in the cart
    var productPairs = [
          [["seat"], ["base"]]
        ];
    

    also im lost at what exactly to do im lost.


    also on top of that issue i upgraded my store to 7.0 and added the color box scripts and it is not working either.

    the scripts i added
    <!-- BEGIN FOXYCART FILES -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"; type="text/javascript" charset="utf-8"></script>
    <script src="http://cdn.foxycart.com/tracadeal/foxycart.complete.js"; type="text/javascript" charset="utf-8"></script>
    <link rel="stylesheet" href="http://static.foxycart.com/scripts/colorbox/1.3.9/style1/colorbox.css"; type="text/css" media="screen" charset="utf-8" />
    <!-- END FOXYCART FILES -->
    
  • brettbrett FoxyCart Team
    Can you provide a URL (whisper it if it's private) for us to take a look? It sounds like there may be a javascript error or something else causing problems.

    Also, if the Colorbox isn't working please make sure you don't have jQuery called more than once on the page, as that's the most likely culprit.
  • itisnot_meitisnot_me Member
    edited November 2010
    ok so i see the problem is that i needed to add the jquery include.

    so the problem i face now is that it is making the base have the same quantity as the seat. also if i want to add just the base without and extra seats its kicking back the error saying that i have to add some seats.

    im not good at jquery/javascript. but maybe i could just get something that i could specify what item with a certain code i could just have disabled

    thanks in advance
  • any update on this?
  • fc_adamfc_adam FoxyCart Team
    itisnot_me, the script doesn't really allow for having a product have two states, one where it has to be there with some other product, but where it can also be there by itself. Can you sell the product as two different products? So basically the same details except it has different codes?
  • btw i know that your server has been busy and stuff but i wanted to let you know that i didn't get any emails saying you posted.

    i am willing to do anything to make this work. but i am not versed in javascript.

    they are two different products when i add them to the cart. the have an input to tell me how many more seats that they want. and as you know if that stays 0 then it doesn't get added to the cart but the base still does. but if there is 1+ then it gets added along with the base. the idea is to make the base product non removable if they add seats. so they don't pay for just the seats and not the base. but the base has a min and max quantity so they don't over buy or remove it completely.

    let me know if i dont make sense. my mind is kind of dieing since i have been out of a job for over a month
  • fc_adamfc_adam FoxyCart Team
    @itisnot_me,

    What you're trying to do is not currently how that script is setup. The script requires that both products be present and have a matching quantity.

    If I'm understanding you correctly, you want the base product to be able to be added by itself, but if the seats product is present, then the base product be required. You also don't care if the products match quantities. Is that correct?
  • yes. that is correct. sry the last post was not directed at the script. just more of what im trying to do.

    is that going to be possible. and if so how?

    thanks in advance.
  • fc_adamfc_adam FoxyCart Team
    The bundled products script could be modified to achieve that... I don't think it would be too hard, its basically just removing a bit of functionality. If you don't hear back from me in a couple days, bump this thread.

    Just to confirm though so I don't do something you don't actually want and waste our time, what I posted was correct?
    If I'm understanding you correctly, you want the base product to be able to be added by itself, but if the seats product is present, then the base product be required. You also don't care if the products match quantities.
  • Will do.

    And yes that is correct.
  • fc_adamfc_adam FoxyCart Team
    @itisnot_me, give this a try - http://pastie.org/private/75jwwnnsniiuxjn2pzuxpq

    I've altered it to do what you were after - non-matching quantities and only requiring base if seats are present.
  • thanks that works great. now on to the next problem.
  • the script works great but one thing i would like to know it how can i remove the remove button from the base product. I am running into the problem where if they accidentally remove the base within the software (from the sub_token) but wants to add more seats all the subscription says is to add back on the product with the code base.
  • fc_adamfc_adam FoxyCart Team
    Try this one - it hides the delete option for the base when there are also seats in the cart.

    http://pastie.org/private/lx7vmik2z7cumzdk3uwltg
  • thank you sir. Is there any plans in the future for this to be apart of foxy cart.
  • well i dont know jquery that well but i tried.
    if ($.url.param("sub_token") == "") {
            jQuery("input.parent-"+c).siblings("span").hide();
            jQuery("input.parent-"+c).val(0).attr("readonly", true).addClass("fc_readonly");
          }
          }
    

    I was trying to see if there was a sub_token and if there was i wanted to make sure that the base always has the remove button removed. and the quantity box disabled.
  • fc_adamfc_adam FoxyCart Team
    Ah ok, so to clarify, the base is a subscription, but the seats are not?
  • no they both are. its just that you cant have seats without the base.

    the idea with if the sub token exists then they are adding/removing seats. so there is now need to have the option to remove the base. there is a separate link all together to cancel there subscription.
  • fc_adamfc_adam FoxyCart Team
    Can you send me a link to see this in action?
  • fc_adamfc_adam FoxyCart Team
    @itisnot_me,

    Try this:
    if (fc_json.messages.warnings[0] == "You are currently modifying a subscription.") {
    jQuery("input.parent-"+c).siblings("span").hide();
    jQuery("input.parent-"+c).attr("readonly", true).addClass("fc_readonly");
    }
    
Sign In or Register to comment.