App Connect State Management Support Product Page

Answered

Session storage help needed...

Asked 14 Dec 2017 06:47:25
1
has this question
14 Dec 2017 06:47:25 Jesper Follin posted:
How do i keep forminput in form until form is submitted, even if leaving page and then come back?

Replies

Replied 14 Dec 2017 08:05:44
14 Dec 2017 08:05:44 Teodor Kuduschiev replied:
Hello Jesper,
Please check this tutorial: www.dmxzone.com/go/32875/working-with-sessions it explains how to use session storage.
Replied 21 Dec 2017 12:23:24
21 Dec 2017 12:23:24 Paul Conway replied:
How do I get this to work with an array. I have tried everything but cant get the values passed to the second page. On the first page I add a server action taking all records from a database table, then I ads a repeat children and then within that repeat I add a form with an input field and a submit button. I bind the input field to the item title. Then I define a session storage with an array and variable. Then as per the video I set up the form submit action and then the form action to go to the second page.

On the second page. I add the session storage and use that as the repeat source and the bind the value to the repeat. It works when I define an object with a value but not with an array. what am I doing wrong? Thanks

My aim is to build a shopping cart with your tools. Can this be done?
Replied 21 Dec 2017 12:40:44
21 Dec 2017 12:40:44 Teodor Kuduschiev replied:
Hi Paul,
What / how are you exactly trying to store in an array?
Replied 21 Dec 2017 12:43:38
21 Dec 2017 12:43:38 Paul Conway replied:
I'll email you the link Teodor
Replied 08 Jan 2018 12:43:34
08 Jan 2018 12:43:34 Tom Dupre replied:
I realise this question is marked as answered - I imagine it was finished with private emails. However, I would be very interested to know the answers to the issues raised, eg:

How do I get this to work with an array?
My aim is to build a shopping cart with your tools. Can this be done?

I am working on a shopping cart and had decided to do so from scratch, using PHP. I suspect it might be possible - and easier - using your extensions, but I simply don't know. Eg is there a way to create multidimensional arrays? Are there equivalents to array_push or array_splice? A little documention on how to manipulate arrays would be very useful. It would also be useful to know if it's not possible.
Replied 08 Jan 2018 12:46:51
08 Jan 2018 12:46:51 Teodor Kuduschiev replied:
Hi Tom,
This is not currently possible with arrays.
Replied 08 Jan 2018 13:25:00
08 Jan 2018 13:25:00 Tom Dupre replied:
Thanks Teodor.

Thanks for confirming that anyway.

Are there plans to incorporate such features? There are signs of them in the extension UI. Eg I can create a session variable and give it a type 'array'. Below this option is a 'Multiple' checkbox which looks like it might be do with creating a multidimensional array. What is this for?

Thanks,
Tom
Replied 08 Jan 2018 13:35:14
08 Jan 2018 13:35:14 Teodor Kuduschiev replied:
This option (multidimensional arrays) is not integrated with sessions.
For shopping cart i would do it using 2 tables.
1. Temp table (does not matter if user is logged or not). On page load you generate a random number and store it in a session, with a session cookie (really simple PHP code is required for this). Whenever user adds, removes or updates cart content, this random number (the session value) is used to reference the current user.
2. Purchases table - store there the purchases from the temp table.
Replied 08 Jan 2018 14:35:13
08 Jan 2018 14:35:13 Tom Dupre replied:
Thanks for this suggestion. When you say 'temp' table, I imagine you mean a normal table, but for temporary use (while the user uses the shopping cart), rather than an actual MySQL temporary table.

In relation to this, do you have any similar workarounds for the limitation with the mailer extension not managing arrays/repeat regions - eg to send an email with the shopping cart contents?

Thanks,
Tom
Replied 08 Jan 2018 14:38:10
08 Jan 2018 14:38:10 Teodor Kuduschiev replied:
Yes, just a normal mysql table, for temporary usage. On checkout/finishing orders you can delete everything related to that order (by the unique session id).
No, unfortunately in this version of the mailer it is not possible to render dynamic content inside it. This is already in our wish list for updates, but i have to check when is this planned for.
Replied 08 Jan 2018 14:55:46
08 Jan 2018 14:55:46 Tom Dupre replied:
Thanks for clarifying the temp table matter.

I haven't used the mail extension. I knew it had limitations but didn't realise it couldn't render dynamic content at all. It would be a very useful update.
Replied 08 Jan 2018 15:09:54
08 Jan 2018 15:09:54 Teodor Kuduschiev replied:
It can render dynamic bindings, it cannot render repeat regions.
Replied 08 Jan 2018 15:25:08
08 Jan 2018 15:25:08 Tom Dupre replied:
OK, thanks.
Replied 19 Jan 2018 16:53:14
19 Jan 2018 16:53:14 Dan Everton replied:
hi

I have a login form that sets a user id session value to next page

i want to show more user info that is shared accross pages but without seting more values in a form (which is pointless as part of a login) I cannot see how to do it. Certain its possible but don't know how.

Please help

So to eleborate further is it possible to set a record query based on a session variable so i can bind data from a table based on associated session variable?

Reply to this topic