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

check box for "same as billing address"

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #91  
Old 08-20-2005, 08:29 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default

cherie,

Thank you for your reply.

The two imput lines are inside a form.
Form Name: name="registerform"
Verified the script blocks in home.tpl
Verified that the js files exist in skin1

This is what show up on the line in the source that is throwing the 1st error:

Code:
<input type="checkbox" name="copyn" onclick="javascript:copynames(this.form);">Use Customer Details in Billing Address

and here is the line that throws the 2nd error:

Code:
<input type="checkbox" name="copyb" onclick="javascript:copybilling(this.form);">Use Billing Address as Shipping Address

Unfortunatley, I'm a little too much of a noob to js to get what your referring to as "script blocks", but I hope the above information answers your post completely. Unfortunately, no resolution yet.

Thanks again.
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #92  
Old 08-20-2005, 08:39 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

Quote:
Originally Posted by HWT
Verified the script blocks in home.tpl

Unfortunatley, I'm a little too much of a noob to js to get what your referring to as "script blocks"
When you view the page source for the page that has the errors (using your browser's View Source option), do you see the following script blocks?
Code:
<script language=JavaScript1.3 src="{$SkinDir}/copybilling.js"></script> <script language=JavaScript1.3 src="{$SkinDir}/copynames.js"></script>
In place of $SkinDir you might see /xcart/skin1... Can you then load that path in your browser location and see the contents of the js file? Just trying to make sure the Javascript functions in those files are available.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #93  
Old 08-20-2005, 08:56 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default

Gottcha! OK, I think we're getting somewhere here. The script blocks are not showing up in the <HEAD> tags. Funny, because I have one other js that is showing up there. The js is accessible from /skin1/copybilling.js
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #94  
Old 08-20-2005, 09:08 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

Quote:
Originally Posted by HWT
Gottcha! OK, I think we're getting somewhere here. The script blocks are not showing up in the <HEAD> tags. Funny, because I have one other js that is showing up there. The js is accessible from www.heritagetoys.com/skin1/copybilling.js
That appears to be the problem. If you added those script blocks to home.tpl, maybe you aren't using home.tpl? You'll need to sort that part out yourself. The idea is that you want to put those script blocks in a main tpl so it can be referenced by your checkboxes. Are you really using your cart at the root level (/) and not a cart directory (i.e., /xcart)? It's fine to do that, just verifying since you mentioned /skin1 and not /xcart/skin1.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #95  
Old 08-20-2005, 09:15 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default

Those two script blocks do show up on pages that don't use them like the home page. I'm using easy checkout. So I'm sure that's the issue. This page is probably not using home.tpl.

Yes, I have the cart installed at the root level. A lot of posts I read suggested it. This is the most succinct: http://forum.x-cart.com/viewtopic.php?t=21581&highlight=root

{* edit *}
For anyone using Jon's Easy Checkout Mod, add the code below to customer/home_checkout.tpl instead of customer/home.tpl when using GriffithLea's mod:

right below
Code:
</TITLE> { include file="meta.tpl" } <LINK rel="stylesheet" href="{$SkinDir}/{#CSSFile#}">


add in
Code:
<script language=JavaScript1.3 src="{$SkinDir}/copybilling.js"></script> <script language=JavaScript1.3 src="{$SkinDir}/copynames.js"></script>

{* end edit *}

Thank you VERY much for your help in tracking this down. You may have just saved my sanity!
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #96  
Old 11-29-2005, 09:21 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

it seems that people would have got errors with this if they had this setting unchecked

Quote:
Use JavaScript version for state and country selector:

anyone come up with anything for this ?
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #97  
Old 11-29-2005, 09:47 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

just an idea for the checkbox if shipping address different - wouldnt it be a good idea that the checkbox and option to send to seperate shipping address be good if it could be controlled by country.

i.e i'd be happy to send to a different address in the UK but doing that to somewhere like singapore would be a big no no.

At least in the UK i could send the boys round if it was fraud.
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #98  
Old 12-03-2005, 05:22 AM
  HWT's Avatar 
HWT HWT is offline
 

eXpert
  
Join Date: Jan 2005
Location: Massachusetts, USA
Posts: 392
 

Default

Recently I've gotten a huge number of calls from customers using Macintosh computers who can't change the state dropdown menu, and can't change the expiration date dropdowns during checkout. I've tracked it down to this mod being the possible culprit. Has anyone else been having this issue?

I did modify copynames.js and copybilling.js very slightly to not use the title, as we don't use it in our store:

copynames.js
Code:
function InitSaveVariables_names(form) { b_firstname = form.b_firstname.value; b_lastname = form.b_lastname.value; } function copynames(form){ if (form.copyn.checked){ InitSaveVariables_names(form); form.b_firstname.value = form.firstname.value; form.b_lastname.value = form.lastname.value; } else { form.b_firstname.value = b_firstname; form.b_lastname.value = b_lastname; } }

copybilling.js
Code:
function InitSaveVariables_shipping(form) { s_firstname = form.s_firstname.value; s_lastname = form.s_lastname.value; s_address = form.s_address.value; s_address_2 = form.s_address_2.value; s_city = form.s_city.value; s_state = form.s_state.value; _s_state = document.getElementById('_s_state').value; s_country = form.s_country.value; s_zipcode = form.s_zipcode.value; } function copybilling(form) { if (form.copyb.checked){ InitSaveVariables_shipping(form); form.s_firstname.value = form.firstname.value; form.s_lastname.value = form.lastname.value; form.s_address.value = form.b_address.value; form.s_address_2.value = form.b_address_2.value; form.s_city.value = form.b_city.value; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = form.b_state.value; document.getElementById('_s_state').value = document.getElementById('_b_state').value; form.s_country.value = form.b_country.value; form.s_zipcode.value = form.b_zipcode.value; } else { form.s_firstname.value = s_firstname; form.s_lastname.value = s_lastname; form.s_address.value = s_address; form.s_address_2.value = s_address_2; form.s_city.value = s_city; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = s_state; document.getElementById('_s_state').value = _s_state; form.s_country.value = s_country; form.s_zipcode.value = s_zipcode; } }

I'm pretty sure that's not the issue, though. Anybody see anything in here that could cause a Mac to choke? I know nothing about Macs unfortunately, and have no way of testing either.

Any help would be appreciated. Thanks!!
__________________
x-cart 4.0.13 and 4.1.7 and 4.1.10
Reply With Quote
  #99  
Old 12-03-2005, 11:37 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default

Since x-cart uses different registration forms whether the customer is in the cart or not, copybilling.js needs to account for the differences.

This is what I ended up using for copybilling.js:
Code:
function InitSaveVariables_shippingC(form) { //s_title = form.s_title.value; s_title = form.s_title.selectedIndex s_firstname = form.s_firstname.value; s_lastname = form.s_lastname.value; s_address = form.s_address.value; s_address_2 = form.s_address_2.value; s_city = form.s_city.value; s_state = form.s_state.value; _s_state = document.getElementById('_s_state').value; s_country = form.s_country.value; s_zipcode = form.s_zipcode.value; } function InitSaveVariables_shipping(form) { s_address = form.s_address.value; s_address_2 = form.s_address_2.value; s_city = form.s_city.value; s_state = form.s_state.value; _s_state = document.getElementById('_s_state').value; s_country = form.s_country.value; s_zipcode = form.s_zipcode.value; } function copybillingC(form) { if (form.copyb.checked) { InitSaveVariables_shippingC(form); //form.s_title.value = form.b_title.value; form.s_title.selectedIndex = form.b_title.selectedIndex form.s_firstname.value = form.b_firstname.value; form.s_lastname.value = form.b_lastname.value; form.s_address.value = form.b_address.value; form.s_address_2.value = form.b_address_2.value; form.s_city.value = form.b_city.value; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = form.b_state.value; document.getElementById('_s_state').value = document.getElementById('_b_state').value; form.s_country.value = form.b_country.value; form.s_zipcode.value = form.b_zipcode.value; } else { //form.s_title.value = s_title; form.s_title.selectedIndex = s_title; form.s_firstname.value = s_firstname; form.s_lastname.value = s_lastname; form.s_address.value = s_address; form.s_address_2.value = s_address_2; form.s_city.value = s_city; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = s_state; document.getElementById('_s_state').value = _s_state; form.s_country.value = s_country; form.s_zipcode.value = s_zipcode; } } function copybilling(form) { if (form.copyb.checked) { InitSaveVariables_shipping(form); form.s_address.value = form.b_address.value; form.s_address_2.value = form.b_address_2.value; form.s_city.value = form.b_city.value; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = form.b_state.value; document.getElementById('_s_state').value = document.getElementById('_b_state').value; form.s_country.value = form.b_country.value; form.s_zipcode.value = form.b_zipcode.value; } else { form.s_address.value = s_address; form.s_address_2.value = s_address_2; form.s_city.value = s_city; change_states(document.getElementById('s_country'), 's_state', 'State/Province', '', '', '', ''); form.s_state.value = s_state; document.getElementById('_s_state').value = _s_state; form.s_country.value = s_country; form.s_zipcode.value = s_zipcode; } }

Then I used the following in main/register_shipping_address:
Code:
{* ======== COPY BILLING TO SHIPPING MOD ======= *} {if $js_enabled} <TR> <TD align="right"></TD> <TD></TD> <TD nowrap><input type="checkbox" name="copyb" onclick="copybilling(this.form);">Use {$lng.lbl_billing_address} as {$lng.lbl_shipping_address} </TD> </TR> {/if} {* ======== COPY BILLING TO SHIPPING MOD ======= *} {elseif $action eq "cart"} {* ======== COPY BILLING TO SHIPPING MOD ======= *} {if $js_enabled} <TR> <TD align="right"></TD> <TD></TD> <TD nowrap> <input type="checkbox" name="copyb" onclick="copybillingC(this.form);">Use {$lng.lbl_billing_address} as {$lng.lbl_shipping_address} </TD> </TR> {/if} {* ======== COPY BILLING TO SHIPPING MOD ======= *}

And I use the following in main/register_billing_address.tpl:
Code:
{* ======== COPY NAMES TO BILLING MOD ======= *} {if $js_enabled} <TR> <TD align="right"></TD> <TD></TD> <TD nowrap> <input type="checkbox" name="copyn" onclick="copynames(this.form);">Use {$lng.lbl_personal_information} in {$lng.lbl_billing_address} </TD> </TR> {/if} {* ======== COPY NAMES TO BILLING MOD ======= *}
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #100  
Old 12-07-2005, 06:28 AM
 
ortonceramic ortonceramic is offline
 

Member
  
Join Date: Nov 2005
Location: Columbus, Ohio
Posts: 28
 

Default hack disables email fields?

I'm not certain that this mod has changed this, but now my email registration notification only shows:

Quote:
Personal information
Username: test1
Password: ****
First Name: Test
Last Name: Tested!
Company: Test, Inc.


When it should also be showing address, contact info, etc. Did some inane variable get changed with this mod??

Thanks!
__________________
xcart gold v4.0.16 [unix]
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 03:45 PM.

   

 
X-Cart forums © 2001-2020