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 5
Makiing ‘Ship to this address’ the default. 
 
Mootrealm
Sr. Member
 
Avatar
Total Posts:  150
Joined:  2007-09-14
San Francisco, CA
 

When placing an order, ‘Ship to another address’ is the default. I would like to make ‘Ship to this address’ the default.

I really can’t see the logic in this decision. The majority of the time, people are going to be shipping to their own address.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Gabriiiel
Guru
 
Avatar
Total Posts:  563
Joined:  2008-04-29
France - Paris
 

Hi,

In template/checkout/onepage/billing.phtml

Line 97, change the code :

<input type="radio" name="billing[pickup_or_use_for_shipping]" id="billing:pickup_or_use_for_shipping_yes" value="1"<?php  if(($this->getPickupOrUseForShipping() === 1) || ($this->getPickupOrUseForShipping() === false)): ?> checked="checked"<?php  endif ?> onclick="billing.setPickupOrUseForShipping(1);" />&nbsp;<label for="billing:pickup_or_use_for_shipping_yes"><?php echo  $this->__('Ship to this address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;
       
        <
input type="radio" name="billing[pickup_or_use_for_shipping]" id="billing:pickup_or_use_for_shipping_no" value="0"<?php if($this->getPickupOrUseForShipping() === 0): ?> checked="checked"<?php endif ?> onclick="billing.setPickupOrUseForShipping(0);" />&nbsp;<label for="billing:pickup_or_use_for_shipping_no"><?php echo $this->__('Ship to different address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;

By

<input type="radio" name="billing[pickup_or_use_for_shipping]" id="billing:pickup_or_use_for_shipping_yes" value="1" checked="checked"<?php  if(($this->getPickupOrUseForShipping() === 1) || ($this->getPickupOrUseForShipping() === false)): ?> checked="checked"<?php  endif ?> onclick="billing.setPickupOrUseForShipping(1);" />&nbsp;<label for="billing:pickup_or_use_for_shipping_yes"><?php echo  $this->__('Ship to this address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;
      
        <
input type="radio" name="billing[pickup_or_use_for_shipping]" id="billing:pickup_or_use_for_shipping_no" value="0"<?php if($this->getPickupOrUseForShipping() === 0): ?> <?php endif ?> onclick="billing.setPickupOrUseForShipping(0);" />&nbsp;<label for="billing:pickup_or_use_for_shipping_no"><?php echo $this->__('Ship to different address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;

Seems to work…

 
Magento Community Magento Community
Magento Community
Magento Community
 
srinigenie
Guru
 
Avatar
Total Posts:  539
Joined:  2008-02-04
 

I would prefer to set the radio button based on whether customer has logged in or not - code as listed below

<input type="radio" name="billing[pickup_or_use_for_shipping]" id="billing:pickup_or_use_for_shipping_yes" value="1" <?php  if(($this->getPickupOrUseForShipping() === 1) || ($this->getPickupOrUseForShipping() === false) || !$this->isCustomerLoggedIn()): ?>checked="checked" <?php  endif ?>onclick="billing.setPickupOrUseForShipping(1);" />&nbsp;<label for="billing:pickup_or_use_for_shipping_yes"><?php echo  $this->__('Ship to this address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;
        <
input type="radio" name="billing[pickup_or_use_for_shipping]" id="billing:pickup_or_use_for_shipping_no" value="0" <?php  if($this->getPickupOrUseForShipping() === && $this->isCustomerLoggedIn()): ?>checked="checked" <?php  endif ?>onclick="billing.setPickupOrUseForShipping(0);" />&nbsp;<label for="billing:pickup_or_use_for_shipping_no"><?php echo  $this->__('Ship to different address'?></label>&nbsp;&nbsp;&nbsp;&nbsp;
 
Magento Community Magento Community
Magento Community
Magento Community
 
Jamaicamama
Jr. Member
 
Total Posts:  19
Joined:  2008-01-10
 

Hi Gabriiiel,

Could you modify this to also auto select the shipping method selected on the car page?

Thanks,
j

 
Magento Community Magento Community
Magento Community
Magento Community
 
lu@qu
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-02-23
Bremen/Hamburg, DE
 
Gabriiiel - 09 June 2008 12:53 PM

Hi,

In template/checkout/onepage/billing.phtml [...]

Hi Gagriiel,

thanks for your code suggestion. I have tried it.
The radio button is set correct but the next step is not correct.
The next step after submit should be Payment Information (workflow as equal as you set Use Billing Address manually).
With your code the radio button is set but the next step is Shipping Method.
(I have tried it with Version Magento 1.1.1, as guest).

What is to do that Magento steps from Billing Information to Shipping Method?
Any hints / suggestions?

Thanks and many greeting.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lu@qu
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2008-02-23
Bremen/Hamburg, DE
 

Answer to my question. grin

The only thing to do is change one code line (tested in Magento V.1.1.1).

public function isUseBillingAddressForShipping()
    
{
        
if (($this->getQuote()->getIsVirtual())
            || !
$this->getQuote()->getShippingAddress()->getSameAsBilling()) {
            
return false;
        
}
        
return true;
    
}

to

public function isUseBillingAddressForShipping()
    
{
        
if (!$this->getQuote()->getShippingAddress()->getSameAsBilling()) {
            
return false;
        
}
        
return true;
 
Magento Community Magento Community
Magento Community
Magento Community
 
cyfer
Jr. Member
 
Total Posts:  24
Joined:  2008-07-14
 

That’s good stuff lu@qu, but could you please tell in which file you are editing this? :\

 
Magento Community Magento Community
Magento Community
Magento Community
 
ukdazza
Guru
 
Total Posts:  308
Joined:  2008-04-16
 

I believe this editing is in the file mentioned at the top:  template/checkout/onepage/billing.phtml

Does this work yeh? Quite a useful thing really...silly that it was set the other way around originally, most customers are going to ship to their own address lol.

 
Magento Community Magento Community
Magento Community
Magento Community
 
caos989
Sr. Member
 
Total Posts:  96
Joined:  2008-07-25
Linz, Austria
 
lu@qu - 02 August 2008 10:29 PM

Answer to my question. grin

The only thing to do is change one code line (tested in Magento V.1.1.1).

public function isUseBillingAddressForShipping()
    
{
        
if (($this->getQuote()->getIsVirtual())
            || !
$this->getQuote()->getShippingAddress()->getSameAsBilling()) {
            
return false;
        
}
        
return true;
    
}

to

public function isUseBillingAddressForShipping()
    
{
        
if (!$this->getQuote()->getShippingAddress()->getSameAsBilling()) {
            
return false;
        
}
        
return true;

where can I edit this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
cyfer
Jr. Member
 
Total Posts:  24
Joined:  2008-07-14
 

Exactly my question as well… There is definitely no “public function” in the billing.phtml file :\

 
Magento Community Magento Community
Magento Community
Magento Community
 
Michal_s
Sr. Member
 
Total Posts:  111
Joined:  2008-05-15
The Netherlands
 

why dont you guys just make a search trough all the files for:
function isUseBillingAddressForShipping()

??????

a hint, it is a php file NOT phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
cyfer
Jr. Member
 
Total Posts:  24
Joined:  2008-07-14
 

Greatmedia: Wow that was a pretty shitty comment. Why not just help out and write which file needs to be edited instead of being a wise guy?
Other users will inevitable also be looking up this thread and finding your answer as the solution is pretty insufficient and ruins the entire flow of this thread.

Also it would be interesting which search tool you use to search an entire library for the content of it’s files.

 
Magento Community Magento Community
Magento Community
Magento Community
 
WebShopApps
Guru
 
Avatar
Total Posts:  460
Joined:  2008-05-30
London, UK
 

Hi, I havent tried this, but I presume the file referenced is app/code/core/Mage/Checkout/Block/Onepage/Billing.php.

I use Textpad to search & edit files - works well for me. Also has syntax highlighting capabilities.

Rgds

Karen

 
Magento Community Magento Community
Magento Community
Magento Community
 
Christian_Norway
Sr. Member
 
Total Posts:  135
Joined:  2008-06-18
 

I would like this for:

- To be able to set a default shipping type in backend, which is then selected by default for the customer
- To be able to set a default payment type in backend, which is then selected by default for the customer

 
Magento Community Magento Community
Magento Community
Magento Community
 
Lol
Member
 
Avatar
Total Posts:  68
Joined:  2008-06-26
Plymouth, UK
 

Yup. I agree with Christian.  If there is only one shipping type required and one payment type being used they shouldn’t have to be selected by the customer. In my case, I have set up free shipping for a client’s store. There is no need for the shipping to be a required step at all. The checkout should just jump straight from Shipping Info to the Payment Info part of the one-page checkout process. If any one knows how I could go about trying to get this to work I will give it a go and report back if I get it to work.

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
team_in_medias
Sr. Member
 
Avatar
Total Posts:  113
Joined:  2008-05-06
Aachen, Germany
 

See http://www.magentocommerce.com/boards/viewthread/4152/ for another solution.

Andreas

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