We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22574
    • 181 Posts
    Hey Guys,

    I am working on a new site, with treasureChest again.

    I have 3 issues:

    #1 - How do I get treasureChest to my drop down option on the same selected item, as hitting update resets them.

    #2 - Has anyone figured out how to get paypal to pull in the option list values?
    EG: if you put-
    <select name="select" id="select">
    <option value="brown">brown</option>
    <option value="green">green</option>
    <option value="red">blue</option>
    <option value="red">red</option>
    </select>
    into option 1 then all paypal receives is the option name.

    #3 If the customer wants 2 of product A but wants one in green and the other in Red, how is this possible?
    I guess you would need to get treasureChest to add each product as a separate item and not increase the quantity, each time add to cart is clicked.
    I guess I could make each product and colour as a separate product, but thats a bit time consuming for the client.

    Thanks

      • 22574
      • 181 Posts
      I have almost figured out #1, just put
      <select class="os0_1" onchange="prepPaypal(this)" name="os0_1">
          <option value="brown">brown</option>
          <option value="green">green</option>
          <option value="blue">blue</option>
          <option value="red">red</option>
        </select>


      I want to try and get the same function for my extra shipping location drop down.
        • 22574
        • 181 Posts
        Does anyone know how to change this
        if ($_SESSION['TreasureChestOpt']['os0_'.$i])
                                        {
                                            $sval = $_SESSION['TreasureChestOpt']['os0_'.$i];
                                            $script = '<script type="text/javascript" charset="utf-8">jQuery(document).ready(function(){jQuery(".os0_'.$i.'").val("'.$sval.'");});</script>';
                                            $modx->regClientStartupScript($script);
                                        }
                                        $value = str_replace('[+cart.name+]', 'os0_'.$i.'" class="os0_'.$i.'" onchange="prepPaypal(this)', $value);
                                        $item_tpl = str_replace($ph, $value, $item_tpl);
                                    }


        so that it keeps my shipping code on the selected item after the shopping cart is refreshed?
        <select name="postage" id="postage" onchange="prepPaypal(this)">
          <option value="1- Choose a location -1">Choose a location</option>
          <option value="12.00">Metro VIC $12 per box</option>
          <option value="27.00">Country VIC $27 per box</option>
        
        </select>
          • 22574
          • 181 Posts
          Okay I figured out how to get my extra shipping drop down to keep the correct value.

          I used this.
          $Testpostage=$_REQUEST['postage'];
          						if($Testpostage!='1-Choose a location-1')
          						{
          						$_SESSION['savePostage']=$Testpostage;
          						}
          						$postage=$_SESSION['savePostage'];


          It kinda relates to my other post about adding extra shipping options, but all this does is checks if the first option (choose a location) is not picked, so say they picked the $12.00 option then it saves it in a session and so each time the update button is hit the value will still be saved and not reset each time to choose a location.

          Now I just need to figure out:


          #3 If the customer wants 2 of product A but wants one in green and the other in Red, how is this possible?
          I guess you would need to get treasureChest to add each product as a separate item and not increase the quantity, each time add to cart is clicked.
          I guess I could make each product and colour as a separate product, but that’s a bit time consuming for the client.


          Cheers
            • 12241
            • 80 Posts
            Quote from: pagalo at Jun 06, 2009, 08:44 AM

            I have almost figured out #1, just put
            <select class="os0_1" onchange="prepPaypal(this)" name="os0_1">
                <option value="brown">brown</option>
                <option value="green">green</option>
                <option value="blue">blue</option>
                <option value="red">red</option>
              </select>


            I want to try and get the same function for my extra shipping location drop down.

            When I put this code into the products option 1 value it works, however, when I have more than one product in the cart that has this code the value for one product over writes the value for the other. Did you ever find a way to have multiple products with different options for each in the same cart and have those values pass over to paypal on checkout???

            I found that I can use "os0_1","os0_2","os0_3" and "os0_4" as class & name values to get different values stored for different products in the same shopping cart. The problem is that those are the only names that work... say for instance I put os0_5 for the class & name attribute values then it won’t work. If I have two products that share the same code for the product options then the products can NOT have different options when they are in the cart at the same time. I’m not sure how to work around the issue.
              Environment:
              modx: rev 2.0.8-pl
              localhost: Apache/2.0.63 (Unix) PHP/5.2.11 DAV/2, MySQL client version: 5.1.37