The Dog Posted March 5, 2005 Posted March 5, 2005 I'm in the process of trying to convert Mason Miller's shopping cart for lasso 3.5/3.6 to lasso 7. I'm allmost there, but I'm having trouble getting the sessionid generated by the lasso page to work. I can add items to the database but they do not get any entry into the sessionid field.. And this is needed to use the data later. Would like any help... I'm going to make the files and databases public if I can get them to work.... At the start of the shoppingcart page is this code (I have changed the value of the variable SessionID from a random number to a fixed value - trying to minimize possible errors)..... [if: (Cookie:'SessionID')=''] [variable: 'SessionID'='abcdefg'] [cookie_set: 'SessionID'=(variable: 'SessionID')] [else] [variable: 'SessionID'=(cookie:'SessionID')] [/if] Later on the same page is the code to add an item to the shopping cart. This works fine but I don't get any value send to the database field SessionID [inline: -database='shoppingcart', -table='additem', 'SKU'=(Action_Param: 'SKU'), 'SessionID'=(variable: 'SessionID'), 'Item_Qty'='1', -add] [/inline] If I change the code (see below) so that SessionID is set to a fixed value this works and I get a value send to the database field SessionID [inline: -database='shoppingcart', -table='additem', 'SKU'=(Action_Param: 'SKU'), 'SessionID'='1234567', 'Item_Qty'='1', -add] [/inline] So it looks to me like the problem is in the code that sets the cookie and the variable SessionID or they way I'm getting the value when adding an item Any help would be great... It's driving me nutts.....
Steve T. Posted March 15, 2005 Posted March 15, 2005 Hi, Dog! I don't use Lasso but in CDML, INLINEs used to execute and resolve prior to any other code on your page. My guess is that you are calling on SessionID before it has been defined even though you have it higher in the page, it does not get read until the INLINE concludes if my assumption on the INLINE resolving first is correct. Can you set SessionID=(cookie:'SessionID') instead? Good luck! --ST
Steve T. Posted March 15, 2005 Posted March 15, 2005 Hi, Dog! I don't use Lasso but in CDML, INLINEs used to execute and resolve prior to any other code on your page. My guess is that you are calling on SessionID before it has been defined even though you have it higher in the page, it does not get read until the INLINE concludes if my assumption on the INLINE resolving first is correct. Can you set SessionID=(cookie:'SessionID') instead? Good luck! --ST
Steve T. Posted March 15, 2005 Posted March 15, 2005 Hi, Dog! I don't use Lasso but in CDML, INLINEs used to execute and resolve prior to any other code on your page. My guess is that you are calling on SessionID before it has been defined even though you have it higher in the page, it does not get read until the INLINE concludes if my assumption on the INLINE resolving first is correct. Can you set SessionID=(cookie:'SessionID') instead? Good luck! --ST
Steve T. Posted March 15, 2005 Posted March 15, 2005 Oh, BTW... I think in CDML INLINEs also had to resolve alone, i.e. without using any other data or variables. They were like little independent actions that started and resolved like separate pages but could display on the same page (no cross-over of data or variables, though). I could be wrong, but that's what I think I remember. Hope you get it! --ST
Steve T. Posted March 15, 2005 Posted March 15, 2005 Oh, BTW... I think in CDML INLINEs also had to resolve alone, i.e. without using any other data or variables. They were like little independent actions that started and resolved like separate pages but could display on the same page (no cross-over of data or variables, though). I could be wrong, but that's what I think I remember. Hope you get it! --ST
Steve T. Posted March 15, 2005 Posted March 15, 2005 Oh, BTW... I think in CDML INLINEs also had to resolve alone, i.e. without using any other data or variables. They were like little independent actions that started and resolved like separate pages but could display on the same page (no cross-over of data or variables, though). I could be wrong, but that's what I think I remember. Hope you get it! --ST
Recommended Posts
This topic is 7584 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now