Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    bug Selected Billing Address not highlighted

    Hi,

    this is not a bug so much as a usability issue.

    When you're checking out, and you select a different shipping address for example, and then proceed to the Checkout Payment page:

    1. Click change address.

    You'll notice that the selected radio box shows the new address you chose for your Shipping Address, rather then having the default address, or even a newly selected Bill To address selected.

    To resolve this,

    open includes/template/YOUR_TEMPLATE/template/tpl_modules_checkout_address_book.php

    Change this:

    PHP Code:
    <?php
          
    while (!$addresses->EOF) {
            if (
    $addresses->fields['address_book_id'] == $_SESSION['sendto']) {
              echo 
    '      <div id="defaultSelected" class="moduleRowSelected">' "\n";
            } else {
              echo 
    '      <div class="moduleRow">' "\n";
            }
    ?>
            <div class="back"><?php echo zen_draw_radio_field('address'$addresses->fields['address_book_id'], ($addresses->fields['address_book_id'] == $_SESSION['sendto']), 'id="name-' $addresses->fields['address_book_id'] . '"'); ?></div>
    to this:

    PHP Code:
    <?php
          
    while (!$addresses->EOF) {

    if (
    $current_page_base == 'checkout_shipping_address') {
            if (
    $addresses->fields['address_book_id'] == $_SESSION['sendto']) {
              echo 
    '      <div id="defaultSelected" class="moduleRowSelected">' "\n";
            } else {
              echo 
    '      <div class="moduleRow">' "\n";
            }
    }

    if (
    $current_page_base == 'checkout_payment_address') {
            if (
    $addresses->fields['address_book_id'] == $_SESSION['billto']) {
              echo 
    '      <div id="defaultSelected" class="moduleRowSelected">' "\n";
            } else {
              echo 
    '      <div class="moduleRow">' "\n";
            }
    }


    if (
    $current_page_base == 'checkout_shipping_address') {
    ?>
            <div class="back"><?php echo zen_draw_radio_field('address'$addresses->fields['address_book_id'], ($addresses->fields['address_book_id'] == $_SESSION['sendto']), 'id="name-' $addresses->fields['address_book_id'] . '"'); ?></div>

    <?php }
    if (
    $current_page_base == 'checkout_payment_address') {
    ?>
            <div class="back"><?php echo zen_draw_radio_field('address'$addresses->fields['address_book_id'], ($addresses->fields['address_book_id'] == $_SESSION['billto']), 'id="name-' $addresses->fields['address_book_id'] . '"'); ?></div> 
    <?php ?>

    This issue also affects 1.5.5d.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Selected Billing Address not highlighted

    A similar/related issue is seen in ZC 1.5.5. If at checkout_shipping and select an address by changing the current address, then as one steps to the checkout_payment, the default address which was used on checkout_shipping is shown on checkout_payment, but if one goes to change the payment address, then the selection that was made for checkout_shipping_address is shown as selected on the checkout_payment_address page and no "cancel" button (there is a back button that works like a cancel operation, but its not clear that is the case. The address information that was displayed on the previous page is shown at the top of the screen with an option to enter a different address or to select an existing address ("current" selection being the value that was selected in the checkout_shipping_address page).

    Haven't dug into the "fix" yet, but seems like a related fix would/could apply.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Selected Billing Address not highlighted

    @mc12345678, this issue is a bit different than the one you referenced.

    @yaseent, I'd suggest an slight update to your proposal:
    Code:
     <?php
          $current_address_book_id = ($current_page_base == FILENAME_CHECKOUT_SHIPPING_ADDRESS) ? $_SESSION['sendto'] : $_SESSION['billto'];
          while (!$addresses->EOF) {
    
            if ($addresses->fields['address_book_id'] == $current_address_book_id) {
              echo '      <div id="defaultSelected" class="moduleRowSelected">' . "\n";
            } else {
              echo '      <div class="moduleRow">' . "\n";
            }
    
            <div class="back"><?php echo zen_draw_radio_field('address', $addresses->fields['address_book_id'], ($addresses->fields['address_book_id'] == $current_address_book_id), 'id="name-' . $addresses->fields['address_book_id'] . '"'); ?></div>

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Selected Billing Address not highlighted

    Quote Originally Posted by lat9 View Post
    @mc12345678, this issue is a bit different than the one you referenced.
    Wow, really? Under the hood, significantly different, but the observation is/was the same as described: Address option chosen at shipping is what is presented as selected when selecting to change the billing address option... Feel free to debate the difference...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Selected Billing Address not highlighted

    The previous issue (that I reported) has to do with the fact that a customer with a single address in their address book, upon clicking the "Change Address" button, has no way to say "never mind".

  6. #6
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Selected Billing Address not highlighted

    Actually, we are/were both describing the same condition/situation, so there was no "bit different" issue.

    My incorrect understanding of the situation was that it was reported as occurring at the end of the checkout process as in when trying to modify addresses while on the checkout_confirmation page. As such, wanted to point out that the issue occurred along the checkout process also (condition/situation was seen when working on payment module implementations and modifications and at least for paypal in sandbox mode had to use an address that "really existed"). That said, I should/could have known better that selecting Edit on the Payment information from the checkout_confirmation page takes one back to the checkout_payment page and not just to say the change address for payment at least that's what I observe in ZC 1.5.5. Big picture it allows modifying the address, just takes a step more than I expected to get there.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Selected Billing Address not highlighted

    @lat9 Awesome. I've since shortened my code, but yours is still much better hehe.

    @mc12345678 That sounds like a much worse problem than the one I'm talking about. The one I'm talking about only confuses a customer at a point where they want to change their BillTo address, and as the default selection it gives them their session['sendto'] address.

    Bear in mind here, at this point, it has not altered their BillTo address, it still remains the default, or updated address during the Checkout Payment stage. It just defaults to the Shipping Address address when you opt to change the address during the session.

    The issue you're referring to seems to be mixing SENDTO and BILLTO variables from what I can understand?

  8. #8
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Selected Billing Address not highlighted

    Unfortunately includes/modules/pages/checkout_shipping/header_php.php and the associated modules file: includes/modules/checkout_new_address.php use or expect $addressType of 'shipto' instead of the session equivalent 'sendto'. Otherwise, it seems that the whole thing could be "shortened" to:

    Code:
     <?php
          while (!$addresses->EOF) {
    
            if ($addresses->fields['address_book_id'] == $_SESSION[$addressType]) {
              echo '      <div id="defaultSelected" class="moduleRowSelected">' . "\n";
            } else {
              echo '      <div class="moduleRow">' . "\n";
            }
    
            <div class="back"><?php echo  zen_draw_radio_field('address',  $addresses->fields['address_book_id'],  ($addresses->fields['address_book_id'] == $_SESSION[$addressType]), 'id="name-' . $addresses->fields['address_book_id'] . '"'); ?></div>
    No further evaluation of which page one is on is necessary nor be "limited" to two options (though why would there need to be more addresses per se unless one can think of a way to use this snippet to support say multiple destinations or other expansion).

    @yaseent See, as perhaps posted before you had a chance to read it, looks like we both were discussing the same thing, just from two different ways of describing it. I misunderstood the initial report, but seemed like we were both seeing the same thing/result/action. I then went on (as this was being reported in the bug section, which tends to mean that solution would/could be applied in the future and therefore wanted to further address the overall "issue".)

    I.e., okay, so a button was displayed as selected different from what was presented in the top corner or perhaps the same... Intentionally made it into the change address area... But upon further review/thought/what have you, I don't want to change it... How do I do that "best"?

    - One way is to cancel (no cancel button, but the back button works the same way),
    - I can choose the same address as was already "assigned" compare top address with "list" of bottom addresses and be sure to select the same,
    - I could I guess hit the back button on the browser (no harm no foul there possibly other than perhaps "timeout" issues if a refresh to the server is not made),
    - I could "merrily" accept from the bottom screen whatever was selected (which on the checkout_payment page would always show up as whatever was selected on the checkout_shipping page without some modification as described above), etc... etc...

    I mean, if the concept of selecting to change the address is to pre-select an alternate address, then great, if it is just an option to add new and then possibly divert away from the previously selected (above solutions lead to this), then also great, if it is to follow the path of the shipping/sendto address (current "default" method), also also great. Whatever the case, if the thought is that when opting to change the payment/billing address information is such that it not attempt to default to the same as the shipping/receiving information then some change is necessary which actually would also mean that the "customer_default_address_id" should also be changed after obtaining the shipping address... Again, another "indicator" that something was not fully coded as "desired". Don't get me wrong, it works, and like said nothing about this is broken.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Mar 2009
    Posts
    169
    Plugin Contributions
    2

    Default Re: Selected Billing Address not highlighted

    Yep,

    as I mentioned in my report, it's not so much a bug, but a usability issue.

    The concern is customers. Who...well...what can I say...customers :) Always always design things to be idiot proof. They will build better idiots...but that's the cat and mouse of it.

  10. #10
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,492
    Plugin Contributions
    88

    Default Re: Selected Billing Address not highlighted

    Quote Originally Posted by mc12345678 View Post
    Unfortunately includes/modules/pages/checkout_shipping/header_php.php and the associated modules file: includes/modules/checkout_new_address.php use or expect $addressType of 'shipto' instead of the session equivalent 'sendto'. Otherwise, it seems that the whole thing could be "shortened" to:

    Code:
     <?php
          while (!$addresses->EOF) {
    
            if ($addresses->fields['address_book_id'] == $_SESSION[$addressType]) {
              echo '      <div id="defaultSelected" class="moduleRowSelected">' . "\n";
            } else {
              echo '      <div class="moduleRow">' . "\n";
            }
    
            <div class="back"><?php echo  zen_draw_radio_field('address',  $addresses->fields['address_book_id'],  ($addresses->fields['address_book_id'] == $_SESSION[$addressType]), 'id="name-' . $addresses->fields['address_book_id'] . '"'); ?></div>
    I'm not sure why that's "unfortunate", but thanks for pointing out that there was a variable set to customize the checkout-address display ... and now it will actually be used!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 6
    Last Post: 8 Mar 2012, 06:36 PM
  2. Linkpoint To Decline Order If CC Address Does Not Match With Billing Address
    By smythmikey in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 11 Dec 2009, 03:29 PM
  3. Billing address not match problem?
    By gsmsalers in forum PayPal Website Payments Pro support
    Replies: 1
    Last Post: 10 May 2009, 06:32 PM
  4. Confirmed billing address and not confirmed shipping address
    By stagebrace in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 30 Nov 2008, 12:32 AM
  5. Billing address not showing in orders
    By dbrewster in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 30 Apr 2007, 09:18 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