Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Ship to different address checkbox

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-13-2011, 02:48 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Ship to different address checkbox

Hi All,

I don't know if this question has been asked before, but having searched through the forums I can't seem to find it.

I was wondering how easy it would be to change the Ship2diff checkbox to make it a radio button group?

I would like to have 2 radio buttons

Same as Billing Address
Ship to different address

I have an idea that copying the code from the Address Book link should enable me to ship to a different address, but I can't see how Clicking on the "Same as billing address" option will remove the shipping address as it's already been entered.

I will consider it to be something like:

Code:
<div class="optional-label"> <label><input type="radio" name="ship2diff" value="N" id="ship2diff1" onclick="javascript: USE THE SAME AS THE BILLING ADDRESS"{if !$ship2diff} checked="checked"{/if}/>Same as Billing Address</label> <br /> <label><input type="radio" name="ship2diff" value="Y" id="ship2diff2" onclick="javascript: POPUP THE ADDRESS BOOK"{if $ship2diff} checked="checked"{/if} />Ship to Different Address</label> <br /> </div>
Any ideas?

Thanks,
FWM.
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote
  #2  
Old 09-13-2011, 04:46 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Re: Ship to different address checkbox

Hi All,

I have been searching high and low for this. I see that Altered cart has this functionality in the one page checkout, so it is definitely possible. I don't want to use altered cart, I prefer the x-cart OPC with a few tweaks.Does no-one know how to do it? Can you point me in the right direction?

Further to my last post I now have a radio button group and when I select the ship to different address it opens the address book and allows the user to choose a shipping address, however clicking on the same as billing option - I can't figure out how to get this to reset.

Anyone, please?
Thanks,
FWM.
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote
  #3  
Old 10-14-2011, 01:57 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Re: Ship to different address checkbox

Hi All,

I have been thinking about this and it seems to be very difficult. I have another option which is to use the checkbox as it currently exists. However instead of it saying Ship to a different address, I would like it to be checked by default and say Same as Billing address.

Then when a user unchecks the box, the shipping address fields should appear. This is the opposite to how it currently works. Does anyone know where the logic is that controls this?

Thanks,
FWM.
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote
  #4  
Old 10-14-2011, 06:50 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Ship to different address checkbox

Use webmaster mode to find the exact template(s), it's the shipping address template loaded from customer/main/register.tpl
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 10-19-2011, 04:59 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Re: Ship to different address checkbox

Hi Steve,

I have managed to change the checkbox so that it now displays "Same as Billing" - However it is setting the ship2diff separately. Do you know where this is set?

Thanks,
fwm
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote
  #6  
Old 10-19-2011, 06:20 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Ship to different address checkbox

It may be set in the php script that shows this page
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 10-19-2011, 07:05 AM
 
fwm fwm is offline
 

Advanced Member
  
Join Date: Apr 2011
Posts: 78
 

Default Re: Ship to different address checkbox

I don't think it is Steve. Is there a way to set a smarty variable within a tpl file. For instance it is checking if $ship2diff or if !$ship2diff

Can I set for arguments sake

Code:
{if !$ship2diff}onClick="Javascript popup"{assign $ship2diff|true}
__________________
X-Cart 4.1.9
X-Cart 4.4.1
X-Cart Platinum 4.6.1
Reply With Quote
  #8  
Old 10-19-2011, 07:53 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Ship to different address checkbox

You can assign smarty variable in template and use it

http://www.smarty.net/docs/en/language.function.assign.tpl
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:57 PM.

   

 
X-Cart forums © 2001-2020