Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Primary Mailing Address in addition to a Primary Shipping Address

    I am trying to create an add-on which allows customers to identify their primary "mailing address" in addition to their primary "shipping address".

    I think I am getting the hang of things, I have added an extra field in the customers table called customers_default_postal_id. It has a number which collates to the address I want in the address book just the same as customer_default_address_id (ie. an Address ID of the corresponding address related to the customer in the address_book table)

    When identifying this in the address_book.php, I just can't seem to work out how the command
    PHP Code:
    <?php echo zen_address_label($_SESSION['customer_id'], $_SESSION['customer_default_address_id'], true' ''<br />'); ?>
    uses the data from the field "customers_default_address_id" in the customers table, to display on the page (address_book.php)

    I know that the field in the customer table is called customers_default_address_id but in the command line above it uses customer_default_address_id (ie with no "s" after customers]).

    Please excuse me if this sounds ignorant but how does this work? How does the page recognize that the session 'customer_default_address_id' uses the data from the field customers_default_address_id in the customers table.

    Thank you in advance for any help or ideas.

  2. #2
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Re: Primary Mailing Address in addition to a Primary Shipping Address

    I figured it out an addition needs to be made in ../pages/login/header_php.php
    around line 87.

    I added:
    PHP Code:
    $_SESSION['customer_default_postal_id'] = $check_customer->fields['customers_default_postal_id']; 
    I now have an additional issue I can't seem to add a tick box next to address_book_details.php

    I noticed that primary shipping address uses:

    PHP Code:
    <?php
      
    if ((isset($_GET['edit']) && ($_SESSION['customer_default_address_id'] != $_GET['edit'])) || (isset($_GET['edit']) == false) ) {
    ?>
    <?php 
    echo zen_draw_checkbox_field('primary''on'false'id="primary"') . ' <label class="checkboxLabel" for="primary">' SET_AS_PRIMARY '</label>'?>
    <?php
      
    }
    ?>
    so I tried:

    PHP Code:
    <?php
      
    if ((isset($_GET['edit']) && ($_SESSION['customer_default_postal_id'] != $_GET['edit'])) || (isset($_GET['edit']) == false) ) {
    ?>
    <?php 
    echo zen_draw_checkbox_field('primary''on'false'id="primary"') . ' <label class="checkboxLabel" for="primary">' SET_AS_PRIMARY '</label>'?>
    <?php
      
    }
    ?>
    but it didn't seem to work. Does anyone have any suggestions?

    Thanks again.

  3. #3
    Join Date
    Feb 2009
    Location
    Sydney, Australia
    Posts
    43
    Plugin Contributions
    0

    Default Re: Primary Mailing Address in addition to a Primary Shipping Address

    Does anyone have any suggestions?

    Thanks

 

 

Similar Threads

  1. Remove Customer primary address from Invoice when shipping/billing are displayed?
    By barendfaber in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 26 Oct 2013, 01:48 AM
  2. v150 PayPal Canada won't accept Chinese address as customer's primary address
    By skyguard2000 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 11 May 2012, 03:13 AM
  3. v138a Address Line 2, non-primary address
    By d0ugparker in forum General Questions
    Replies: 1
    Last Post: 20 Jan 2012, 01:37 PM
  4. Replies: 8
    Last Post: 1 Apr 2009, 05:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR