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?
You can use Shopper Fields add another required checkbox to checkout .
It is also quite easy to create a clone of the tos.php
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.
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? :)
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!
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'], $tos, 1, 0, '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">×</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'], $tos, 1, 0, '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">×</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'], $tos, 1, 0, '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
There is no need todo this, because vm3.2 has already a second layout.
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.
hi guys,
is there a solution yet?
i would need this too....
thanks a lot
You may use this plugin. Privacy Policy for VirtueMart - https://www.virtueplanet.com/extensions/privacy-policy-for-virtuemart
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
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.
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.
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.
If you need it quick,
You could create a TOS2 template override and create the link to your site privacy policy article within that as a popout
Thanks, it was something what I was looking for but I have next problem (form couple of weeks). Do you know any way to have shopper fields visible in registration and cart form but not while adding 'Bill To' address from cart? I'm able to hide those kind of fields in overwrites but if they are require, system doesn't allow to save data (billing address).