6 Replies Latest reply on Oct 12, 2010 2:37 PM by WebolutionDesigns

    element at position 2 cannot be found

    WebolutionDesigns Level 1

      I have been beating my brains out trying to figure this out. If any of you have thoughts, I would love to hear them. I have a cflocation to redirect to PayPal as follows...

       

      <cflocation url="https://www.paypal.com/cgi-bin/websrc?tax_cart=#WA_eCart_FormatNumber(WA_eCart_GetTax(whit cart), false, 2)#&no_note=0&no_shipping=1&return=http://xxxxxxxx.com/paypalsuccess.cfm&cmd=_cart&upload=1&currency_code=USD&address_overrid e=0&firstname=#IIf(isDefined('session.firstname'),'session.firstname',DE(''))#&lastname=#I If(isDefined('session.lastname'),'session.lastname',DE(''))#&street1=#IIf(isDefined('sessi on.street1'),'session.street1',DE(''))#&street2=#IIf(isDefined('session.street2'),'session .street2',DE(''))#&city=#IIf(isDefined('session.city'),'session.city',DE(''))#&state_provi nce=#IIf(isDefined('session.state_province'),'session.state_province',DE(''))#&postcode=#I If(isDefined('session.postcode'),'session.postcode',DE(''))#&country=#IIf(isDefined('sessi on.country'),'session.country',DE(''))#&email=#IIf(isDefined('session.email'),'session.ema il',DE(''))#&phone=#IIf(isDefined('session.phone'),'session.phone',DE(''))#&ordernumber=#I If(isDefined('session.ordernumber'),'session.ordernumber',DE(''))#&handling_cart=#WA_eCart _FormatNumber(WA_eCart_GetShipping(whitcart)+WA_eCart_GetCharges(whitcart), false, 2)#&

       

      <cfoutput>

          <CFLOOP FROM='1' TO='#ArrayLen(session.whitcart_items)#' INDEX='i'>

              <CFLOOP COLLECTION='#session.whitcart_items[i]#' ITEM='y'>

                  <CFIF StructKeyExists(session.whitcart_items[i], y)>

                      #y#=#session.whitcart_items[i][y]#&

                  </CFIF>

              </CFLOOP>

          </CFLOOP>

      </cfoutput>

       

      business=xxxxxx@xxxxxxx.com" />

       

      When I run this, it comes back with element at position 2 cannot be found. The probem is that my array only has one item in it. I dumped it to the screen and see this...

       

      Price=0.01 TotalPrice=0.01 Name=The_Day_After_His_Birth.pdf Weight=0 Description=The Day After His Birth FullDetails=1 The_Day_After_His_Birth.pdf (2) ID=2 TotalWeight=0 Quantity=1

       

      So I am struggling as to what is occurring.

       

      Thoughts?