Support Forums

Changing Billing Address checkbox default to Unchecked?

This is a discussion on Changing Billing Address checkbox default to Unchecked? within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Hello Everyone, Thanks in advance for any help. At registration I only require Name & Email address as I want ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 05-13-2009, 10:07 PM   #1
Junior Member
 
Join Date: Apr 2009
Posts: 20
Rep Power: 10
Offshoreboat is on a distinguished road
Default Changing Billing Address checkbox default to Unchecked?

Hello Everyone,

Thanks in advance for any help.

At registration I only require Name & Email address as I want as many people as possible to register but at checkout on step6.tpl I want to make the billing address "Unchecked" by default so that all of the fields show at that moment vs. current setting of checked.

I know it's in template: step6.tpl and believe the change is here:

<input type="checkbox" name="b_same" value="Y" onclick="javascript: displayID('billing',this.unchecked);"{if $b_same=="Y"} checked{/if} />{$smarty.const.LANG_BILLING_SAME}</label>
</div>
<div id="billing"{if $b_same=="Y"}style="display:none;"{/if}>

I've tried changing value=Y to value=N and also changed "this.checked" to "this.unchecked" with no success.

Thanks in advance for helping!
Jessie

v4.1 developer, seo mod
__________________
Running Developer 4.1 | SEO mod
Offshoreboat is offline   Reply With Quote
Old 05-13-2009, 10:18 PM   #2
Junior Member
 
Join Date: Apr 2009
Posts: 20
Rep Power: 10
Offshoreboat is on a distinguished road
Default

Never mind.... after more digging figured it out... in case anyone doing the same:

Changed:

<div id="billing"{if $b_same=="Y"}style="display:none;"{/if}>

To:

<div id="billing"{if $b_same=="Y"}style="display:block;"{/if}>

Thanks
Jessie
__________________
Running Developer 4.1 | SEO mod
Offshoreboat is offline   Reply With Quote
Old 05-13-2009, 10:37 PM   #3
Junior Member
 
Join Date: Apr 2009
Posts: 20
Rep Power: 10
Offshoreboat is on a distinguished road
Default

Actually... scratch previous reply... that displayed box by default but did not uncheck the checkbox... still stuck...

Maybe different logic... a test to see if all fields are complete, leave checked if complete, if blank then display block?
__________________
Running Developer 4.1 | SEO mod
Offshoreboat is offline   Reply With Quote
Old 05-14-2009, 08:28 AM   #4
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by Offshoreboat
Actually... scratch previous reply... that displayed box by default but did not uncheck the checkbox... still stuck...

Maybe different logic... a test to see if all fields are complete, leave checked if complete, if blank then display block?
I think you are totally misinterpreting the smarty logic you quoted above.

For starters, the following smarty logic....

<div id="billing"{if $b_same=="Y"}style="display:none;"{/if}>

simply states if the value of the smarty variable $b_same is Y then set a style. You can change the Y to an N and it may change the outcome of the evaluation but it DOES NOT change the value of the variable $b_same.

The contents, or value of, $b_same is stored in the database so even if you present the user the form to fill out, if the value of $b_same is Y in the database I am not sure the values in the form would be used anyway.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 05-16-2009, 03:20 PM   #5
Junior Member
 
Join Date: Apr 2009
Posts: 20
Rep Power: 10
Offshoreboat is on a distinguished road
Default

Hello Larry,

Thanks for the feedback on this. I studied it some more and getting closer to the desired solution. Once I get it, will post code here.

Thanks
Jessie
__________________
Running Developer 4.1 | SEO mod
Offshoreboat is offline   Reply With Quote
Old 05-16-2009, 05:09 PM   #6
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,311
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

I think you need to step back a little further...

If you are only requiring the few fields that you are in registration, then regardless of whether the $b_same variable is Y or N in the checkout template file, the address fields are going to be blank. However when you look at the initial set up of the database and the users table in the database you will see that b_same field is set to "Y" by default. As far as I can tell, there is nowhere other than the checkout step or in modifying the user in admin that this field will ever change.

When in the checkout step, the field only gets changed when the user actually clicks the checkbox for business address the same and then it is the javascript that actually then makes the change in the database. Otherwise, the only other place this field can be changed is in the usermodify in administration.

Given the above information, in your particular case I think the key first lies in changing the actual default within the database field itself. You need to change the default from "Y" to "N". Then in addition, make the change that you are talking about in the checkout step. Since all of your users already have the b_same filled in the database set to "Y" by default, nothing will change regardless of what you do in the template or the php file.
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Reply

Tags
billing , checkout , step6.tpl

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing default regional setup sunshinemike Technical Support 3 04-21-2009 05:17 PM
Getting rid or Changing Default Fields thorscore Templates, HTML, CSS, and Design Help 1 02-05-2009 04:19 PM
Billing Address on Userjoin marketingsolutions Technical Support 7 02-04-2009 04:51 PM
Changing Default picture scott17b Technical Support 2 07-28-2008 06:17 PM
Changing colors on Default template.. YourPalAl Technical Support 5 06-22-2008 11:30 PM


All times are GMT -4. The time now is 01:48 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0