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

Makiing ‘Ship to this address’ the default. 
 
nileco
Sr. Member
 
Avatar
Total Posts:  79
Joined:  2008-10-29
Virginia
 

Cool, glad you figured it out.

 
Magento Community Magento Community
Magento Community
Magento Community
 
PJU751
Jr. Member
 
Total Posts:  10
Joined:  2008-07-12
 

Yeah, but what about your fix when Varien adds an admin setting that lets us select the default value for shipping address? The checked=checked will override anything coming from backend, no?

 
Magento Community Magento Community
Magento Community
Magento Community
 
erenaud
Sr. Member
 
Total Posts:  221
Joined:  2009-01-05
Minden, Germany
 

Hi all,

this is what I did (I use Magento 1.3.1):

nileco - 03 April 2009 04:23 AM


hacking the core ! not if i can help it, whats wrong with just adjusting the template onepage/billing.phtml ?

billing.phtml line 113 change from:

-snip-

to this:

-snip-

Seems to work just fine and no core changes.

of course I backed up the file before I did any changes. My problem is, that it wasn’t working. the radio button “ship to different address” was still pre-selected. so I restored the file from backup.

If I am ordering in Guest mode now, I can enter my address, and when I click on next, nothing happens but that I see the “next step is loaded” animation and the header “shipping information” becoming light blue.

the invoice address is not closing and the shipping address or shipping method is not popping up. see screenshot for details.

what did I do wrong, does anyone have an idea how I can fix it?

Image Attachments
problemcheckout.gif
 
Magento Community Magento Community
Magento Community
Magento Community
 
erenaud
Sr. Member
 
Total Posts:  221
Joined:  2009-01-05
Minden, Germany
 

If I am ordering in Guest mode now, I can enter my address, and when I click on next, nothing happens but that I see the “next step is loaded” animation and the header “shipping information” becoming light blue.

the invoice address is not closing and the shipping address or shipping method is not popping up

I just noted that this is also happening when I make a purchase with registering a customer account at the same time.

It’s the same with both browsers IE and firefox

this is what my line 113 of billing.phtml looks like:

<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" <?php if ($this->isUseBillingAddressForShipping()) {?>checked="checked" <?php }?>onclick="$('shipping:same_as_billing').checked = true;" />&nbsp;<label for="billing:use_for_shipping_yes"><?php echo  $this->__('Ship to this address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0" <?php if (!$this->isUseBillingAddressForShipping()) {?>checked="checked" <?php }?>onclick="$('shipping:same_as_billing').checked = false;" />&nbsp;<label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address'?></label>
anyone has a solution ?
 
Magento Community Magento Community
Magento Community
Magento Community
 
erenaud
Sr. Member
 
Total Posts:  221
Joined:  2009-01-05
Minden, Germany
 

I just applied nileco’s fix again on line 113 of billing.phtml.

the default is now on “ship to this address” but my problem with the next step not opening up still persists.

can anyone tell me which file (javascript) is responsible for switching to the next step ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
erenaud
Sr. Member
 
Total Posts:  221
Joined:  2009-01-05
Minden, Germany
 

... okay, false alarm.

I also checked the other changes that I have made and after disabling adjustware’s module to remove the dropdown list of states during registration, it worked fine again. I will post at this other thread to see wether there is a solution or not, as I definitely would like to have the state dropdown list removed.

http://www.magentocommerce.com/boards/viewthread/34487/

 
Magento Community Magento Community
Magento Community
Magento Community
 
relentless1
Member
 
Total Posts:  67
Joined:  2009-04-02
 

the solution given by laqua worked for me. (ver. 1.3.2.3) The other solutions didn’t work

 
Magento Community Magento Community
Magento Community
Magento Community
 
caricell
Jr. Member
 
Total Posts:  17
Joined:  2009-08-13
 

Laqua’s quick fix worked for me too. Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Discovery
Enthusiast
 
Total Posts:  767
Joined:  2007-12-29
 

Laqua’s fix did not do it for me, Mageparts solution worked very nicely though - thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Midimarcus
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2007-12-03
Perugia
 

nileco solution on billing.phtml worked for me on Magento 1.3.2.3

 
Magento Community Magento Community
Magento Community
Magento Community
 
freshshop
Sr. Member
 
Avatar
Total Posts:  88
Joined:  2009-03-07
 

Thanks Nileco, worked like a charm!

 
Magento Community Magento Community
Magento Community
Magento Community
 
invision-studios
Jr. Member
 
Total Posts:  20
Joined:  2009-06-17
 

I found a better solution to this question that doesn’t change any core code and will survive upgrades: changing the default value in the database. Thanks to Shaun’s blog:

Here are the simple instructions to update your Magento Commerce website to default the shipping address to match the billing address:

1. Log into your database. This may involve using an interface such as Navicat or PHPMyAdmin.
2. Open the table: “sales_flat_quote_address”
3. Locate the column: “same_as_billing” and modify the structure of this field
4. Change the “same_as_billing” default value to 1. (It should have been set to 0 upon installation.)

Here’s the SQL code generated by PHPMyAdmin:

ALTER TABLE `sales_flat_quote_addressCHANGE `same_as_billing` `same_as_billingTINYINT(1UNSIGNED NOT NULL DEFAULT '1'

Be sure to follow these directions carefully. This table appears to contain existing customer info, so it will only work for new accounts. Best to do it before you go live with your store.

Sherm Stevens
iNvision Studios

 
Magento Community Magento Community
Magento Community
Magento Community
 
jazkat
Sr. Member
 
Total Posts:  154
Joined:  2009-07-09
 

Actually I do want it to have <b>Ship to different address</b> checked by default.
What I did at the end is delete/add one “!” exclamation mark.

in file:
billing.phtml

find code

$this->isUseBillingAddressForShipping()

For “Ship to this address” add ! just infront of it
and remove it for “Ship to different address”.
like:

<input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_yes" value="1" <?php if (!$this->isUseBillingAddressForShipping()) {?>checked="checked" <?php }?>onclick="$('shipping:same_as_billing').checked = true;" />&nbsp;<label for="billing:use_for_shipping_yes"><?php echo  $this->__('Ship to this address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<
input type="radio" name="billing[use_for_shipping]" id="billing:use_for_shipping_no" value="0" <?php if ($this->isUseBillingAddressForShipping()) {?>checked="checked" <?php }?>onclick="$('shipping:same_as_billing').checked = false;" />&nbsp;<label for="billing:use_for_shipping_no"><?php echo $this->__('Ship to different address'?></label>

That’s it.

--------------------------------------
Magento v 1.3.2.4

 
Magento Community Magento Community
Magento Community
Magento Community
 
winta
Member
 
Total Posts:  38
Joined:  2009-09-28
 

Is is also possible to completly remove the radio button shipto another address?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MikeyBoy
Jr. Member
 
Total Posts:  9
Joined:  2010-03-10
 
invision-studios - 08 March 2010 06:21 AM

I found a better solution to this question that doesn’t change any core code and will survive upgrades: changing the default value in the database. Thanks to Shaun’s blog:

Here are the simple instructions to update your Magento Commerce website to default the shipping address to match the billing address:

1. Log into your database. This may involve using an interface such as Navicat or PHPMyAdmin.
2. Open the table: “sales_flat_quote_address”
3. Locate the column: “same_as_billing” and modify the structure of this field
4. Change the “same_as_billing” default value to 1. (It should have been set to 0 upon installation.)

Here’s the SQL code generated by PHPMyAdmin:

ALTER TABLE `sales_flat_quote_addressCHANGE `same_as_billing` `same_as_billingTINYINT(1UNSIGNED NOT NULL DEFAULT '1'

Be sure to follow these directions carefully. This table appears to contain existing customer info, so it will only work for new accounts. Best to do it before you go live with your store.

Sherm Stevens
iNvision Studios

This works perfect and is the best way! Simple and appears to be a permanent fix. Many thank you’s!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top