If this is your first visit, check our documentation. To post, register or login.
Forums / Zen Cart Code Suggestions / Update of session variables from editing account/primary address book details

Update of session variables from editing account/primary address book details

Started by torvista on 4 Nov 2013, 2:17 PM · Views: 94

Results 1 to 2 of 2
4 Nov 2013, 2:17 PM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Update of session variables from editing account/primary address book details

When editing either the main account details from the account edit page or the address book, some session variables are updated.

As I use the firstname + lastname in my title bar I noticed that they got out of sync while I was testing addresses.

In /pages/account_edit/header_php.php

// reset the session variables
$_SESSION['customer_first_name'] = $firstname;

And in/pages/address_book_process/header_php.php
There are two similar instances of

// register session variables
      if (isset($_POST['primary']) && ($_POST['primary'] == 'on')) {
        $_SESSION['customer_first_name'] = $firstname;
        $_SESSION['customer_country_id'] = $country;
        $_SESSION['customer_zone_id'] = (($zone_id > 0) ? (int)$zone_id : '0');
        //if (isset($_POST['primary']) && ($_POST['primary'] == 'on'))
        $_SESSION['customer_default_address_id'] = $new_address_book_id;

If all these variables are needed elsewhere why are they not all updated similarly (and why not lastname)?

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

28 Jun 2016, 6:01 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Update of session variables from editing account/primary address book details

While reviewing v160, this appears to be completed.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.