News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to enable terms of service checkbox by default

Started by dylanphelan, August 16, 2012, 13:50:37 PM

Previous topic - Next topic

dylanphelan

How do i check the terms of service checkbox by default?

Dont see this anywhere in config.


bytelord

Hello,

I think the proper is the user checked by himself according that have already read the terms. But in case you want to do it you should add an attribute inside your custom template input method for terms check box. I think there  is no option from the backend to change the the attributes of the checkbox inside shopper fields.

The original should be like this:
<input class="terms-of-service" id="tosAccepted" type="checkbox" value="1" name="tosAccepted">


Change it to this by adding checked="checked" attribute.
<input class="terms-of-service" id="tosAccepted" type="checkbox" value="1" name="tosAccepted" checked="checked">


The above is an html example just add the attribute and please don't replace the whole line.

You have to add this attribute to your default cart template and in other layout template you want to change (billing address, registration, etc).

Hope it helps you out.

Regards,

Bytelord
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

dandez

In the file virtuemart-template/cart/default.php

I have a line like this that matches most acurately to the one You've mentioned:

'<input class="terms-of-service" type="checkbox" name="tosAccepted" value="1" ' . $this->cart->tosAccepted . '/>

I tried to change it to:

'<input class="terms-of-service" type="checkbox"  checkbox="checkbox"  name="tosAccepted" value="1" ' . $this->cart->tosAccepted . '/>

and it didn't work for me.
Warmest Regards
Dan

bytelord

#3
Hello,

it should be

'<input class="terms-of-service" checked="checked" type="checkbox" name="tosAccepted" value="1" ' . $this->cart->tosAccepted . '/>

the above is until version 2.0.8e
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

jmaracil

Hi:

In file com_virtuemart/helpers/cart.php

var $tosAccepted = true; intead of var $tosAccepted = null;

Regards

bytelord

Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!