Announcement

Collapse
No announcement yet.

How to change separate delivery address option without returning to checkout page 1

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

    How to change separate delivery address option without returning to checkout page 1

    It seems a bit odd to return the shopper from checkout page 2 to checkout page 1 in order to change the separate delivery option.
    Also, if your store is setup for UK only zones, and you want to drop the separate shipping checkbox from page 1, or if you have modified OrderScript.pl to skip checkout page 1 entirely (refer to KB article http://community.actinic.com/showthread.php?t=45290), then it makes sense to allow shopper to be able to change the separate delivery address option on page 2.

    My solution is to modify how the 'Change' button works. Instead of returning shopper to checkout page 1, checkout page 2 is reloaded with the separate shipping option toggled.

    To do this you need to modify OrderScript.pl.
    Go to line: 811

    Code:
    if($sAction =~ m/$sChangeLocationButton/i)
    		{
    		$::g_nCurrentSequenceNumber = $::STARTSEQUENCE;
    		$eDirection = $::FORWARD;
    		}
    and change to:

    Code:
    if($sAction =~ m/$sChangeLocationButton/i)
    		{
    		$::g_nCurrentSequenceNumber = 0; # __AI__ Set sequence to page 0, causes reload sequence page 1 (was $::STARTSEQUENCE)
    		$::g_LocationInfo{SEPARATESHIP} = !$::g_LocationInfo{SEPARATESHIP}; # __AI__ Toggle separate shipping
    		$::g_BillContact{'SEPARATE'} = ($::g_LocationInfo{SEPARATESHIP} ne ''); # __AI__ Set separate delivery address flag
    		$eDirection = $::FORWARD;
    		}
    Save, then do Refresh website (so os00000n.pl is rebuilt).
    NOTE: The solution has been tested on v9.01 (IDWA). Needless to say, test fully on a dev server first, unless you're mad as a hat.

    BTW, I've also been working on a solution to move delivery address from checkout page 3 to page 2, so it is shown directly below the invoice address.
    My client does not want this right now, but if anyone's interested in a solution, let me know, I could be persuaded .

    Jon.
    Last edited by KB2; 22-Mar-2010, 12:14 PM. Reason: Updating kb links

    #2
    jon, that looks like a very nice solution. I haven't had a chance to try it but it looks very clean and logical.

    Mike
    -----------------------------------------

    First Tackle - Fly Fishing and Game Angling

    -----------------------------------------

    Comment

    Working...
    X