Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 3
bug in Account (logged in) - billing /shipping addresses
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

This probably should go to the bug report however I wanted to attached screen shots to better explain it.

I think the Change Billing Address and Change Shipping Address all go to the same form, because whether I change either of the address, the result in the Address Book is the same.

There are ‘Default Billing Address’ and ‘Default Shipping Address’, from the code of ‘customer/address/edit.phtml’ file, it looks to me there should have checkbox option available

<li>
                
<?php if($this->isDefaultShipping()): ?>
                    
<strong><?php echo $this->__('Default Shipping Address'?></strong>
                
<?php elseif($this->canSetAsDefaultShipping()): ?>
                    
<input type="checkbox" id="primary_shipping" name="default_shipping" value="1" />&nbsp;
                    <
label for="primary_shipping"><?php echo $this->__('Use as my default shipping address'?></label>
                
<?php else: ?>
                    
<input type="hidden" name="default_shipping" value="1" />
                
<?php endif; ?>
            
</li>

First I thought it must be me messing up the code by changing class or id name and div tags, but a visit to your demo store I am seeing the same thing . Please see attached screen shoots:
1) I had the addres: 555 peace lane, alameda, ca 94501
2) I changed the shipping address to 888 freedom ave, san francisco, ca 94107.
3) when I go back to address book, both the shipping and address are showing the #2.

22 minutes later…
I did a checkout test from your demo store, added a new address (#1) for shipping, went back to my account, the billing/shipping address info are still showing #2

1 hour+ many minutes later…
Sorry, got some more finding, and now I am not sure if it’s a bug, but it’s absolutely confusing (if a customer doesn’t do multi-address shipping).

So I was testing my shop, did a ‘ceate a new address’ with multi-address shipping, I see it pulled the ‘edit.phtml’ from the customer/address; now I can see the checkboxes for “Use as my default billing address” (Default Billing Address) and “Use as my default shipping address” (Default Shipping Address). I entered a new address, checked the “Use as my default shipping address”, went back to My Account, and I can see the new address is reflected in the ‘default shipping address’, in addition, I can also see my old shipping address is placed in the ‘Additional Address Entries’; on top of that, a ‘Add new Address’ button has surfaced, I clicked it, now I can see the checkboxes option for “Use as my default billing address” and “Use as my default shipping address”

Now, it all make sense, still, somewhere, it’s missing a piece of something, because,
1) A customer who has not done a multi-address shipping and added a new address for billing or shipping will never ever figure this out because whether she clicks on ‘Manage Addresses’ or ‘Edit Address’ in ‘PRIMARY BILLING ADDRESS’ or ‘PRIMARY SHIPPING ADDRESS’ in the Account Dashboard or ‘Address Book’ (clicking on ‘Manage Addresses’ brings her to ‘Address Book’) , she will never see the ‘use as my default’ checkboxes option.

2) If this is how it’s supposed to work, shouldn’t there an indication in the Address Book somewhere?

3) Should it allows customer who has not done multi-address shipping to be able to have separate address for Shipping and Billing?

Image Attachments
default_shipping_address.jpgedit_address.pngsaved_address.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
dilbert4life
Jr. Member
 
Total Posts:  27
Joined:  2008-11-21
 

This issue is still present almost a year later. Does anyone have an answer?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ScottSt
Member
 
Total Posts:  52
Joined:  2009-02-06
 

I have this EXACT issue. Thanks for the clear documentation, I’ll have to start thinking about a fix.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

I already forgotten this post of mine smile

Yes, just checked a site (v1.3.1) I was working, it’s still not fixed!!!!!! Maybe this is intentional? That if you don’t use multi-address shipping you don’t get to use separate address for billing and shipping?! Does make a bit of sense with the Credit Card Fraud issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Goetz
Jr. Member
 
Total Posts:  6
Joined:  2009-02-05
 

Hi Tankgirl,

I do not see a checkbox on the bottom of the page only:

Standard Rechnungsadresse
Standard Versandadresse

(German translation for standard billing address standard shipping address).

When this basic part has an error can I trust the rest of magento?

Is there a bugfix or workaround ?

I working with Safari but the same in FireFox

 
Magento Community Magento Community
Magento Community
Magento Community
 
eight32
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-02-24
 

Designer’s answer :: this is by design, and is not a bug

The absence of check-boxes found in ‘Customer Login’ -> ‘Address Book’ -> ‘Add New Address’ (ie frontend):

Use as my default billing address
Use as my default shipping address

is a statement and not an option, implying that

the (first and) only address that you’ve provided will be used as your default billing address and default shipping address

This may be intuitively ambiguous for non-developers; functionality being present but not functional… in a wait-state if you may. If you add another address you’ll see that the check boxes are rendered functional in the ‘Add New Address’ block, giving you the option to choose which is *default billing* and which is *default shipping*.

This is yet another subtle example of Magento’s design genius. Functionality /degrades/ to a secure state, and doesn’t introduce any vulnerablities by allowing you to choose an option for which there isn’t actually an option (yet).

cool smile

Developer’s answer :: interpreting the logic

In {web_root}/app/design/frontend/default/default/template/customer/address/edit.phtml you’ll find:

...
            <
li>
                
<?php if($this->isDefaultBilling()): ?>
                    
<strong><?php echo $this->__('Default Billing Address'?></strong>
                
<?php elseif($this->canSetAsDefaultBilling()): ?>
                    
<input type="checkbox" id="primary_billing" name="default_billing" value="1" />&nbsp;
                    ...
            </
li>
            <
li>
                
<?php if($this->isDefaultShipping()): ?>
                    
<strong><?php echo $this->__('Default Shipping Address'?></strong>
                
<?php elseif($this->canSetAsDefaultShipping()): ?>
                    
<input type="checkbox" id="primary_shipping" name="default_shipping" value="1" />&nbsp;
                    ...
            </
li>
        ...

which essentially determines whether the check box(es) should be rendered or not. And if so, how to do so.

The isDefaultBilling(), canSetAsDefaultBilling(), isDefaultShipping() and canSetAsDefaultShipping() methods are called from:

{web_root}/app/code/core/Mage/Customer/Block/Address/Edit.php

public function canSetAsDefaultBilling()
    
{
        
if (!$this->getAddress()->getId()) {
            
return $this->getCustomerAddressCount();
        
}
        
return !$this->isDefaultBilling();
    
}

    
public function canSetAsDefaultShipping()
    
{
        
if (!$this->getAddress()->getId()) {
            
return $this->getCustomerAddressCount();
        
}
        
return !$this->isDefaultShipping();;
    
}

    
public function isDefaultBilling()
    
{
        
return $this->getAddress()->getId() && $this->getAddress()->getId()==Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
    
}

    
public function isDefaultShipping()
    
{
        
return $this->getAddress()->getId() && $this->getAddress()->getId()==Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping();
    
}

which in turn calls the getCustomerAddressCount() method to count how many addresses already exist:

public function getCustomerAddressCount()
    
{
        
return count(Mage::getSingleton('customer/session')->getCustomer()->getAddresses());
    
}

Interestingly, the Customer (frontend) input type is ‘checkbox’, while the AdminHTML (backend) is a JS of type ‘radio’

{web_root}/app/design/adminhtml/default/default/template/customer/tab/addresses.phtml

setAddressAsDefault : function(){
                
...
                    if(
inputs[j].type=='radio' && inputs[j].checked && this.itemList.length 1){
                
...

HTH, and have a great day!

Stuart

 
Magento Community Magento Community
Magento Community
Magento Community
 
Eydamos
Jr. Member
 
Total Posts:  25
Joined:  2009-06-29
 

It’s nice to know where these files are and what they do. But I can’t figure out how to solve the problem.

I tried to edit the edit.phtml and comment out the if statements and the html text from the if and the second elseif. After reloading the page I had the checkboxes but whatever I clicked he changes both addresses.

I tried to edit the php code but I realy don’t know what to change to force him to accept the checkboxes.

Has anyone figured out what to change to get this featurebug work as from us expected?

 
Magento Community Magento Community
Magento Community
Magento Community
 
loeffel
Guru
 
Avatar
Total Posts:  427
Joined:  2009-02-03
 

More than 1 year has passed again and this problem still exists!
And I dont think this is ‘clever designing’ - it’s lazy designing to a point where it’s starting to become ridiculous.
No explanation or reason justifies employing a system that makes no sense at all and will confuse everybody and force them into a stupid trial and error procedure to find out, how to edit one address without changing the other.
If I were a customer and was to change my invoice address only to find out that my shipping address was just changed aswell, I wouldn’t even try a second time. I would leave immediately because I have better things to do than coping with stupid non-sense webpage anomalies!

Why do you even include two links which each denotes that using this link would actually change this particular address only, when it will always change both? What made magento decide to put in an option that simply doesn’t do, what it promises to do and not include any note of it at all as if it were better to let the user stumble through the dark than admitting, that the system the user is about to use, works differently than he will expect?

Yes, genius design indeed magento!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sillyzero
Jr. Member
 
Total Posts:  3
Joined:  2010-05-26
 

Hi all,

i´m not really fixed the \"bug\".
But i post a message to the customer. So when he try to change the billing or shipping address in the first time he´s registered he get the message:\"Add a new address to handle different billing and shipping address\”.

If you want do the same, copy the following code to your edit.phtml file (.../app/design/frontend/default/default/template/noregion/customer/address/) after the last closing list tag </li> and bevor the ul-tag closed.

<li class=\"addressCount\">
<?php $count=$this->getCustomerAddressCount() ?>
<?php $value = $this->canSetAsDefaultBilling() ?>
<?php if(($count==1)&&($value!=1)){
echo $this->__(\'Add new address to handle different billing and shipping address.\');
$count+=1;
}
?>
</li>

If you want, that the message disappear in a different language edit the Mage_Customer.csv file
and styles.css for another layout.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rhonda_Rondeau
Enthusiast
 
Total Posts:  924
Joined:  2010-08-03
Culver City
 
loeffel - 03 September 2010 04:37 AM

More than 1 year has passed again and this problem still exists!
And I dont think this is ‘clever designing’ - it’s lazy designing to a point where it’s starting to become ridiculous.
No explanation or reason justifies employing a system that makes no sense at all and will confuse everybody and force them into a stupid trial and error procedure to find out, how to edit one address without changing the other.
If I were a customer and was to change my invoice address only to find out that my shipping address was just changed aswell, I wouldn’t even try a second time. I would leave immediately because I have better things to do than coping with stupid non-sense webpage anomalies!

Why do you even include two links which each denotes that using this link would actually change this particular address only, when it will always change both? What made magento decide to put in an option that simply doesn’t do, what it promises to do and not include any note of it at all as if it were better to let the user stumble through the dark than admitting, that the system the user is about to use, works differently than he will expect?

Yes, genius design indeed magento!

Does this exists in all the versions or just a particular version?

Rhonda

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mosses Akizian
Sr. Member
 
Avatar
Total Posts:  176
Joined:  2009-04-28
Los Angeles, CA
 

Thanks for bringing this back to our attention guys. I have escalated this issue with our core team.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mosses Akizian
Sr. Member
 
Avatar
Total Posts:  176
Joined:  2009-04-28
Los Angeles, CA
 

Quick update. Core team has acknowledged the issue but I don’t have an ETA yet on a patch. Will update their feedback once available.

Quick workaround to this issue is to add a new address and apply each default accordingly. I know it’s an extra step but will work just fine without needing to hack the code.

 
Magento Community Magento Community
Magento Community
Magento Community
 
loeffel
Guru
 
Avatar
Total Posts:  427
Joined:  2009-02-03
 

rondata, sorry for the late reply.Tested in 1.4.0.1 and 1.4.1.1.
monocat, thank you for forwarding this. I have included a note in the customer addressbook page that explains how to add a new address that doesn’t replace both, so the issue is not that urgent imho - would be nice to see it fixed some time though. Thanks guys!

 
Magento Community Magento Community
Magento Community
Magento Community
 
moens
Jr. Member
 
Total Posts:  13
Joined:  2010-09-19
 

Yeah… the problem is the stupid ui… wow, its really bad… but its an easy template fix:

app/design/frontend/YOUR-THEME-PACKAGE/default/template/customer/address/book.html

..find this part of the code that looks for a default shipping address near line 58 (code is from 1.4.1.1):

<?php if($_pAddsses Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping()): ?>
            
<li class="item">
                <
h3 class="clearfix"><?php echo $this->__('Default Shipping Address'?><a href="<?php echo $this->getAddressEditUrl(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>"><?php echo $this->__('Change Shipping Address'?></a></h3>
                <
address>
                    
<?php echo $this->getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>
                
</address>

            </
li>

...and replace it with this bit that checks first to see whether the default shipping and the default billing are the same address object in the model. If so, it says as much and offers a link to create a new address (update your language files on multi-lang sites!)…

<?php if($_pAddsses Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping()): ?>
            
<li class="item">
                
<?php if($_pAddsses == Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling()): ?>
                
<h3 class="clearfix"><?php echo $this->__('Default Shipping Address will use the Billing Address'?></h3>
                        <
p><a href="<?php echo $this->getAddAddressUrl(); ?>"><?php echo $this->__('Add a new address to my address book'?></a></p>
                
<?php else: ?>
                
<h3 class="clearfix"><?php echo $this->__('Default Shipping Address'?><a href="<?php echo $this->getAddressEditUrl(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>"><?php echo $this->__('Change Shipping Address'?></a></h3>
                <
address>
                    
<?php echo $this->getAddressHtml(Mage::getSingleton('customer/session')->getCustomer()->getAddressById($_pAddsses)) ?>
                
</address>
                
<?php endif ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
lurebeauty
Sr. Member
 
Avatar
Total Posts:  229
Joined:  2009-07-06
 

Thanks ... unfortunately, Im unsure if this last fix also works on 1.4.2, i tried it and it gives the link to change, but it still changes both everytime.

 
Magento Community Magento Community
Magento Community
Magento Community
 
BLACKBULL_316
Member
 
Total Posts:  35
Joined:  2010-04-20
India
 

Magento team hast to do something urgent in this issue for it makes the developers and end users confusing.

THNX MOENS
great hook.

Please also add this in
app\design\frontend\base(or your theme)\default\template\customer\account\dashboard\address.phtml

Find this code near line 41

<div class="col-2">
                <
h4><?php echo $this->__('Default Shipping Address'?></h4>
                <
address>
                    
<?php echo $this->getPrimaryShippingAddressHtml() ?><br />
                    <
a href="<?php echo $this->getPrimaryShippingAddressEditUrl() ?>"><?php echo $this->__('Edit Address'?></a>
                </
address>
            </
div>

and replace with

<div class="col-2">            
<?php if($_pAddsses Mage::getSingleton('customer/session')->getCustomer()->getDefaultShipping()): ?>            
                <?php 
if($_pAddsses == Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling()): ?>
                
<h4><?php echo $this->__('Default Shipping Address will use the Billing Address'?></h4><br clear="all"/>
                     <
a href="<?php echo $this->getAddAddressUrl(); ?>"><?php echo $this->__('Add a new address to my address book'?></a>
                
<?php else: ?>
                
<h4 class="clearfix"><?php echo $this->__('Default Shipping Address'?></h4><a href="<?php echo $this->getPrimaryShippingAddressEditUrl() ?>"><?php echo $this->__('Edit'?></a><br clear="all"/>
                <
address>
                     
<?php echo $this->getPrimaryShippingAddressHtml() ?> 
                
</address>                 
                
<?php endif ?> 
        <?php 
else: ?>            
                
<h4><?php echo $this->__('Default Shipping Address'?></h4><br clear="all" />
               
<?php echo $this->__('You have no default shipping address in your address book.'?>           
        <?php 
endif ?>
</div>

The above code is style customised. so plz change the css according to your needs

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3