News:

Looking for documentation? Take a look on our wiki

Main Menu

2 TOS checkboxes on checkout

Started by KrisTianoVS, December 01, 2017, 15:07:18 PM

Previous topic - Next topic

KrisTianoVS

Hello, I read that a new law "GDPR" will contrain european websites to clearly give possibility for their users to check tos AND privacy policy when registring their data. Actualy, there is only one checkbox for TOS on Virtuemart checkout. Is there already a way to add a second checkbox?

jenkinhill

You can use Shopper Fields add another required checkbox to checkout .
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Milbo

It is also quite easy to create a clone of the tos.php
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

KrisTianoVS

Hi, thanks to all of you for your reply. I tried both solutions, but have some additional question about it.
I created a checkbox in shopper fields, but I would like to add "Click here to read privacy policy and check the box to accept them" with a link to a popup in the same way than the one from "Privacy policy", but I cannot solve this.

I also duplicate "tos.php" to "privacypolicy.php", replace "tos" to "privacypolicy", and add some line in "cart.php", but I cannot get it work neither. I presume I have to operate more changes than just those to files, but I am lost too.

Adwans

Quote from: Milbo on December 03, 2017, 10:23:23 AM
It is also quite easy to create a clone of the tos.php
Hello! Very interesting while Im looking for 2nd checkbox too... Could You be so good and explain how to CLONE TOS, please?  :)

asomaro

I too want to find out more about setting up a cloned checkbox for the privacy policy. The GDPR issue is looming and I'd like to try and get this sorted ASAP!

pkubik

#6
Hi,
I also need it.
1. I copied the file: components/com_virtuemart/views/vendors/tmpl/tos.php
2. tos.php renamed to policy.php
3. in the admin create new field: checkbox - agreed1 and field custom - policy
4. a checkbox appears in the shopping cart, but there is no link to privacy policy
5. how to add a check box to your order? to be as in the picture-  tos.png

Maybe I need to change something in the code, but I do not know what

defined('_JEXEC') or die('Restricted access');
$hiddenFields = '';
?>
<?php if(!empty($this->userFieldsCart['fields'])) : ?>
<?php foreach($this->userFieldsCart['fields'] as $field) : ?>
<?php if($field['hidden']) :
$hiddenFields .= $field['formcode'] . "\n";
else : ?>

<?php if($field['name'] == 'customer_note' || $field['type'] == 'textarea') : ?>
<div class="customer-comment-group">
<label for="<?php echo $field['name'?>_field" class="comment"><?php echo $field['title'?></label>
<?php $field['formcode'] = str_replace('rows="1"''rows="3"'$field['formcode']); ?>
<?php echo strpos($field['formcode'], 'class="') ? 
str_replace('class="''class="customer-comment proopc-customer-comment '$field['formcode']) : 
str_replace('<textarea''<textarea class="customer-comment proopc-customer-comment"'$field['formcode']); ?>

</div>
<?php elseif($field['name'] == 'tos') : ?>
<div class="cart-tos-group">
<?php
$this->cart->prepareVendor();
$tos = (is_array($this->cart->BT) && !empty($this->cart->BT['tos'])) ? $this->cart->BT['tos'] : 0;
?>

<?php if(VmConfig::get('oncheckout_show_legal_info'1)) : ?>
<?php if($this->params->get('tos_fancybox'0)) : ?>
<label for="tos" class="checkbox prooopc-tos-label proopc-row">
<?php echo VmHtml::checkbox ($field['name'], $tos10'class="terms-of-service"'); ?>
<div class="terms-of-service-cont">
<a href="#proopc-tos-fancy" class="terms-of-service" data-tos="fancybox"><?php echo vmText::('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED'); ?></a>
</div>
</label>
<div class="soft-hide">
<div id="proopc-tos-fancy" class="fancy-tos-container">
<div class="fancy-tos-head">
<button type="button" class="fancy-close"><span aria-hidden="true">&times;</span></button>
<h3 class="fancy-tos-title"><?php echo vmText::('COM_VIRTUEMART_CART_TOS'); ?></h3>
</div>
<div class="fancy-tos-body">
<p><?php echo $this->cart->vendor->vendor_terms_of_service?></p>
</div>
</div>
</div>
<?php else : ?>
<label for="tos" class="checkbox prooopc-tos-label proopc-row">
<?php echo VmHtml::checkbox ($field['name'], $tos10'class="terms-of-service"'); ?>
<div class="terms-of-service-cont">
<a href="#proopc-tos-fancy" class="terms-of-service" data-toggle="bootmodal"><?php echo JText::('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED'); ?></a>
</div>
</label>
<div class="bootmodal fade" id="proopc-tos-fancy" tabindex="-1" role="dialog" aria-labelledby="tosLabel" aria-hidden="true">
<div class="bootmodal-header">
<button type="button" class="close" data-dismiss="bootmodal" aria-hidden="true">&times;</button>
<h3 id="tosLabel"><?php echo JText::('COM_VIRTUEMART_CART_TOS'); ?></h3>
</div>
<div class="bootmodal-body">
<p><?php echo $this->cart->vendor->vendor_terms_of_service?></p>
</div>
</div>
<?php endif; ?>
<?php else : ?>
<label for="tos" class="checkbox prooopc-tos-label proopc-row">
<?php echo VmHtml::checkbox ($field['name'], $tos10'class="terms-of-service"'); ?> <?php echo $field['title'?>
</label>
<?php endif; ?>
</div>
<?php else : ?>
<fieldset class="vm-fieldset-<?php echo str_replace('_''-'$field['name']) ?>">
<div class="form-group">
<label for="<?php echo $field['name'?>_field"><?php echo $field['title'?></label>
<?php echo $field['formcode'?>
</div>
</fieldset>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>

<?php echo $hiddenFields?>


thanks for the solution. Petr

Milbo

There is no need todo this, because vm3.2 has already a second layout.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

pkubik

#8
Hi,
I have VirtueMart 3.2.12 and Joomla! 3.8.5 and I can not see this offer anywhere. You have somewhere preview of how to set it? It would be enough to make it look like the picture attached. Blue text is a link to a new, separate document. Thanks.

adrian12

hi guys,

is there a solution yet?

i would need this too....

thanks a lot

Jumbo!


AH

QuoteThere is no need todo this, because vm3.2 has already a second layout.

As Milbo said there is a second terms of service layout that can be used to support additional agreement checks
Regards
A

Joomla 3.10.11
php 8.0

thefbi


Jumbo!

Quote from: thefbi on May 20, 2018, 20:31:29 PM
Quote from: Jumbo! on May 17, 2018, 14:05:14 PM
You may use this plugin. Privacy Policy for VirtueMart - https://www.virtueplanet.com/extensions/privacy-policy-for-virtuemart

Yeah, I just bought it.
Simple, fast, no headache.

Thanks. I am glad that you like it.

panjarek

Have you found any other solution then the plugin? With a custom checkbox I cannot add the link to privacy policy, like it is done for tos.