Announcement

Collapse
No announcement yet.

Write and Read from $::Session

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Write and Read from $::Session

    Dear developers,

    I'm not really great developer IN Perl, 'cause just helping to my friend , my knowledge is in .NET environment.

    How can I write and read from session, the thing is I need to store custom variables values , and after redirecting back to be able to read them again.

    I'm using :

    $::Session->{TEST} = "test";
    $::Session->SaveSession();

    after redirection trying to read the value
    print "example: ".$::Session->{TEST};

    but it is always empty, I suggest I have to manage the code in Cart.pm for SaveXml file method, could someone advise me how to do this properly, or there are any other methods?

    Thank you very much.

    #2
    You probably have to do this in several places.

    1) In ShoppingCart.pl look for the line:

    $Values{"SID"} = $::g_InputHash{"SID"};

    and add a line after that to store your value. E.g. (untested):

    $Values{'TEST'} = $$pProduct{CUSTOMVARS}{TEST};

    2) You need to add 2 routines to Cart.pm to store and retrieve your data. Look for:

    Compose the QDQualify child node

    and

    Process the QDQualify child node

    for sample bits of code that you can duplicate / edit replacing all QDQualify with e.g. TEST to store your own values.

    3) Then look in ActinicOrder.pm for the line:

    $hLineData{'INFO'} = $CurrentItem{'INFOINPUT'};

    And add a line after that that retrieves your variable and stores it for the Cart scripts to use. E.g. (untested)

    $hLineData{'TEST'} = $$pProduct{CUSTOMVARS}{TEST};

    Again in ActinicOrder.pm if you want to display something in the Cart, retrieve the value via something like

    my $Test = $CurrentItem{'TEST'};

    This http://community.actinic.com/showthread.php?t=28914 post or searching the forum for variables in cart may help.

    As this is all a bit experimental, I'd suggest doing (2) first and storing a hard coded value. See if it turns up in the Session file. If so, restore the TEST value, do (1) and see if your Customvar now shows up. After that do (3) to display things in the Cart.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Complex objects

      Thank you, anywa it seems to be I'll have to do this in different way, 'cause for instance I need to write elements not on the event of when I'm making order, but when processing payment, I'm going to authorization section, where PSP_Processing Script is fired, and I need to do several requests and getting several responses, thus need to store information, 'cause I'm implementing 3d security payment Verified By VISA and MASTERCARD, so I need to store all the payment information in session, it is only the way to make it work.. the only thing is, could you provide how to store serialized objects in XML? like complex one....

      With regards,

      S.O.U.

      Comment


        #4
        Don't know how to do that.

        Unless someone else does, you'll have to look at the 60,000 lines of Perl, split over 30'ish files and work it out yourself.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          I think to make it maximum easier, not trying to ammend the code in the existing files, it is to write to your own xml file and then retrieve the values back, like Actinic does, using standart XMLParser and writer... I'll post up what I managed to do...

          Comment


            #6
            Take changes...

            How to reupload to your website with new changes, which I made in Cart.pm?

            Comment


              #7
              Click the Publish to Web button! If any scripts have changed, Actinic will upload them.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                It is weirdd

                Well actually I added some strings in Cart.pm which is located under Original actinic folder, I do republish and publish, still nothing happens, I found the code which relates to Cart.pm it is cm000001.pm in cgi-bin on the website, and it is unchanged....

                Comment


                  #9
                  Change the copy in the Site1 folder.

                  Comment


                    #10
                    Thanks alot draunding, I just forgot, that the local copy of each site is stored in the documents of actinic now everythin works, I'll post up the whole solution to work with session and writing into xml, no need to go into Cart.pm and other files, only Session.pm

                    Comment


                      #11
                      Made the generic solution

                      I found the solution how to write and read from $::Session, which retries values from the xml session file.... if someone requires let me know, I'll post it up...

                      Comment


                        #12
                        Yes please. It will be of use to others.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment


                          #13
                          Another yes from me! Very interested to see this working....
                          Fergus Weir - teclan ltd
                          Ecommerce Digital Marketing

                          SellerDeck Responsive Web Design

                          SellerDeck Hosting
                          SellerDeck Digital Marketing

                          Comment


                            #14
                            That'll make three of us then...

                            Comment


                              #15
                              make that four
                              Elysium:Online - Official Accredited SellerDeck Partner
                              SellerDeck Design, Build, Hosting & Promotion
                              Based in rural Northants

                              Comment

                              Working...
                              X