Email list checkbox checked by default at checkout...

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
crazyjoe
Commander (CMDR)
Commander (CMDR)
Posts: 172
Joined: Mon Apr 26, 2010 2:20 pm

Email list checkbox checked by default at checkout...

Post by crazyjoe » Fri Jul 05, 2013 11:15 am

I need to make it so my email list signup checkbox is checked by default on my OnePageCheckout. Can someone tell me how I should append this code so it is checked by default...

Code: Select all

                                    <asp:PlaceHolder ID="EmailListPanel" runat="server" EnableViewState="false">
                                        <asp:DataList ID="EmailLists" runat="server" EnableViewState="false">
                                            <ItemTemplate>
                                               <asp:CheckBox ID="Selected"  runat="server" Checked="<%#IsEmailListChecked(Container.DataItem)%>" EnableViewState="false" Enabled="true" />
                                                <%#Eval("Name")%><br />
                                                <%#Eval("Description")%><br />
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </asp:PlaceHolder>
Thanks in advance :-)
Crazy Joe Sadloski
Webmaster
Hot Leathers Inc.
http://www.hotleathers.com

crazyjoe
Commander (CMDR)
Commander (CMDR)
Posts: 172
Joined: Mon Apr 26, 2010 2:20 pm

Re: Email list checkbox checked by default at checkout...

Post by crazyjoe » Tue Jul 23, 2013 8:41 am

Can anybody help out with this?
Crazy Joe Sadloski
Webmaster
Hot Leathers Inc.
http://www.hotleathers.com

User avatar
deverill
Lieutenant (LT)
Lieutenant (LT)
Posts: 64
Joined: Tue Jan 06, 2009 11:58 am
Location: Key West, FL
Contact:

Re: Email list checkbox checked by default at checkout...

Post by deverill » Mon Aug 05, 2013 11:43 am

To make a checkbox checked you can say:

Code: Select all

<asp:CheckBox ID="Selected"  runat="server" Checked="true" EnableViewState="false" Enabled="true" />
but the part in the original that says:

Code: Select all

<%#IsEmailListChecked(Container.DataItem)%>
is calling a function in your OnePageCheckout.ascx.cs file named IsEmailListChecked() to see if it should be checked.

This mod may do what you want but there may be underlying settings this does not address. I've not really dug into what it's doing but I felt bad that your request was a month old without an answer so take it for what it's worth.

Jim

crazyjoe
Commander (CMDR)
Commander (CMDR)
Posts: 172
Joined: Mon Apr 26, 2010 2:20 pm

Re: Email list checkbox checked by default at checkout...

Post by crazyjoe » Mon Aug 12, 2013 2:15 pm

Thanks for the reply Jim. I caved and paid a professional to do it. Something needs to be added in the .cs I'm guessing. You can't just replace the code with "true" because that code is what actually tells the cart to add the address to my list. When I tested it, the check box was checked, but the address wasn't saved into my database. I appreciate your help, we need more guys like you wonderin' this board :-)
Crazy Joe Sadloski
Webmaster
Hot Leathers Inc.
http://www.hotleathers.com

Post Reply