| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Click "I agree" checkbox before allowing purchase. | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Click "I agree" checkbox before allowing purchase.
A client has asked me to implement some code whereby a customer must agree that they have read, and agree to, their Terms and conditions, otherwise they are not able to continue with a purchase. The customer has to tick the "I agree" checkbox etc.
Has anyone done a similar thing? If so, can you give me some guidance as to how to do this please? Note: FWIW, there is nothing dodgy about the client or the products they want to sell, they just want to be a little cautious is all! Many thanks.
__________________
:: WinXP : IIS5.0 :: X-Cart v4.0.13 Gold :: MySQL 4.1.9-nt :: Apache 2.0.53 :: PHP 4.3.10 :: ActivePerl 5.6 |
|||||||
#2
|
|||||||
|
|||||||
Any ideas or suggestions anyone
__________________
:: WinXP : IIS5.0 :: X-Cart v4.0.13 Gold :: MySQL 4.1.9-nt :: Apache 2.0.53 :: PHP 4.3.10 :: ActivePerl 5.6 |
|||||||
#3
|
|||||||||
|
|||||||||
...edited to reflect changes made later on in this post...
Here is a mod that will hide the submit button until they check the box that they agree. Step 1 Create the file /skin1/hide_block_script.tpl with this contents: Code:
Step 2 Open the file /skin1/customer/main/checkout.tpl for editing. At top of the file right before the first {capture} insert the line Code:
Next look for the line: Code:
Code:
Next find the section that looks like: Code:
and change it to read: Code:
|
|||||||||
#4
|
|||||||
|
|||||||
Superb idea TelaFirma. Thanks for taking the time to compile the solution, I'm sure this will be useful to others too.
Only 1 little problem with the final piece of code: Code:
It should read: Code:
The only difference is the button template called by the include code, it should be "button.tpl" and not "button2.tpl". Once I changed that your code work perfectly. Thank you!
__________________
:: WinXP : IIS5.0 :: X-Cart v4.0.13 Gold :: MySQL 4.1.9-nt :: Apache 2.0.53 :: PHP 4.3.10 :: ActivePerl 5.6 |
|||||||
#5
|
|||||||||
|
|||||||||
Oops... my fault! That is a secondary button template that I am using on one of my sites.. LOL
I will correct the post. |
|||||||||
#6
|
|||||||
|
|||||||
Cool.
I've noticed that if you tick the checkbox, everything is fine. But if you untick the checkbox, the submit order button is still displayed. I've done something similar with show/hide using DIVs, and I've been comparing code etc to find the solution for this, but no luck so far with my tests. Can you see why it doesn't toggle the order button? Thanks.
__________________
:: WinXP : IIS5.0 :: X-Cart v4.0.13 Gold :: MySQL 4.1.9-nt :: Apache 2.0.53 :: PHP 4.3.10 :: ActivePerl 5.6 |
|||||||
#7
|
|||||||||
|
|||||||||
I think that it will be best to use a radio button here rather than a checkbox. Since it is using the onclick method to call the function there is not a good way to check for a second click on the checkbox. Otherwise you would need to submit the form and check the state of the box and that would defeate the purpose of the script. So, lets use the radio buttons instead...
Change Code:
to be Code:
I will update the original post again to reflect this... |
|||||||||
#8
|
|||||||
|
|||||||
Thanks, that works really well. Whilst you were doing that, I had a go at using some other code I'd used in the past to show/hide layers and got it to work with the checkbox. I used your code in the end, but this also works:
Here is the code: hide_block_script.tpl Code:
Skin1\customer\main\checkout.tpl: Code:
Code:
Code:
__________________
:: WinXP : IIS5.0 :: X-Cart v4.0.13 Gold :: MySQL 4.1.9-nt :: Apache 2.0.53 :: PHP 4.3.10 :: ActivePerl 5.6 |
|||||||
#9
|
|||||||
|
|||||||
This is great, thanks. I am having a problem however. I used the code from TelaFirma --now I get the radio buttons and when the customer clicks the Yes radio button the submit button appears. My problem is that the radio button for No continues to be checked as well. It is confusing to have both the Yes and No buttons checked at the same time. Is there a way to turn off the No button when the Yes button is checked?
Thanks for your help. X-cart Pro 4.0.13 with lots of modifications |
|||||||
#10
|
|||||||
|
|||||||
After changing the code as suggested i now have this error message wich displays on site next to the бё signs?
Warning: Smarty error: unable to read resource: "customer/main/alter_currency_value.tpl" in /home/realsecu/public_html/Smarty-2.6.3/Smarty.class.php on line 1082 Any ideas!!!! the check boxes appear where they should!!!
__________________
SURECOM XCART V4.1.8 |
|||||||
|
|||
X-Cart forums © 2001-2020
|