X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Ship to different address checkbox (https://forum.x-cart.com/showthread.php?t=60872)

fwm 09-13-2011 02:48 AM

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.

fwm 09-13-2011 04:46 AM

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.

fwm 10-14-2011 01:57 AM

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.

cflsystems 10-14-2011 06:50 AM

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

fwm 10-19-2011 04:59 AM

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

cflsystems 10-19-2011 06:20 AM

Re: Ship to different address checkbox
 
It may be set in the php script that shows this page

fwm 10-19-2011 07:05 AM

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}

cflsystems 10-19-2011 07:53 AM

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


All times are GMT -8. The time now is 04:24 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.