Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2010
    Posts
    263
    Plugin Contributions
    0

    Default Remove Customer primary address from Invoice when shipping/billing are displayed?

    Hi,

    I wonder if someone can help me. I am using version 1.3.9 h. At present, when a customer purchases from us, we can auto generate the invoice. If the shipping and billing address matches, it shows on the invoice two addresses next to each other, Sold To: and Ship To:. However, in instances where the customer Billing and Shipping addresses are different, the format changes on my invoices. I will first have CUSTOMER: displaying the customer address, underneath that Sold To: and address, and next to it Ship To: and the address. How can I remove this CUSTOMER: address where the shipping and billing don't match, so all my invoices display in the same layout?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    Quote Originally Posted by barendfaber View Post
    when a customer purchases from us, we can auto generate the invoice.
    Please explain what you mean by "auto generate the invoice". Is this something you've added from a plugin?
    .

    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.

  3. #3
    Join Date
    Apr 2010
    Posts
    263
    Plugin Contributions
    0

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    Hi DrByte,

    Thank you for the reply. I just mean that when you look in Admin for Customer - Orders, there is a button (Invoice) that you can click and it opens the invoice. I have looked at my Admin folder on FTP, I have found invoice.php, there is a bit of code there a bit of code like this:

    <tr>
    <td class="main"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
    </tr>
    <tr>
    <td class="main"><?php echo zen_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
    </tr>
    <?php } ?>

    I can assume that this is to display the details for CUSTOMER?

    Just underneath that there is two more, one for "php echo ENTRY_SOLD_TO" and "php echo ENTRY_SHIP_TO". I am no wizard, and just need help to know what I can remove to never display CUSTOMER if shipping and billing addresses do not match?

  4. #4
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    You'll need to write some custom code to handle those conditions, and wrap your if/else code around that part of the output to prevent it from displaying when you don't want it.
    .

    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.

  5. #5
    Join Date
    Apr 2010
    Posts
    263
    Plugin Contributions
    0

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    Hi DrByte,

    Hmm, this will be above my experience level, so I will need to let go of this change. Thanks for your help though.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    I finally had a chance to look at the code.

    The code specifically checks to see if the billing and delivery address are different, and in that case it specifically displays the customer's primary address, intentionally.

    If you want to bypass that safety so that you never see the customer's primary address for validation purposes, you can add a new line into the code as shown here, a couple lines above the stuff you quoted earlier:
    Code:
        $show_customer = 'true';
      }
    // ADDED HERE TO SKIP SHOWING CUSTOMER'S PRIMARY ADDRESS SO WE DON'T HAVE IT FOR VERIFICATION PURPOSES:
    $show_customer = 'false';
      if ($show_customer == 'true') {
    ?>
          <tr>
            <td class="main"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
    .

    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.

  7. #7
    Join Date
    Apr 2010
    Posts
    263
    Plugin Contributions
    0

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    Hi DrByte,

    Sorry for the very late reply! I took a chance just after our last correspondence and deleted this code:

    <tr>
    <td class="main"><b><?php echo ENTRY_CUSTOMER; ?></b></td>
    </tr>
    <tr>
    <td class="main"><?php echo zen_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td>
    </tr>

    This seem to have removed the extra address, and the invoice looks good. So far no issues, let's hope it stays that way!

    Kind regards

    B

  8. #8
    Join Date
    Apr 2013
    Location
    Lincolnshire
    Posts
    3
    Plugin Contributions
    0

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    Would it be possible to use this to move swap the addresses round or put them in a certain place. I would like to use some paper with built in labels to make despatching orders quicker but at the moment if the shipping is different it moves the shipping address about. I need it to stay in one place so I know it will end up on the address label.
    Is this possible?
    Thank you Amy

  9. #9
    Join Date
    Jan 2004
    Posts
    66,350
    Blog Entries
    7
    Plugin Contributions
    271

    Default Re: Remove Customer primary address from Invoice when shipping/billing are displayed?

    Yes, you could edit the corresponding files to set a fixed output, however needed. And if "conditional" stuff like shipping address needs to "always" display, remove the IF, or add an ELSE to it so it creates an empty placeholder.
    .

    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.

 

 

Similar Threads

  1. Replies: 9
    Last Post: 7 May 2016, 06:39 PM
  2. Remove Billing Address from Step 2 of checkout
    By rc2008 in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 31 Dec 2012, 11:05 AM
  3. need to remove billing address from checkout
    By carlos.cardenas in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Jan 2011, 06:05 AM
  4. Primary Mailing Address in addition to a Primary Shipping Address
    By southpacific in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 3 Mar 2009, 11:11 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