VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: KrisTianoVS on December 01, 2017, 15:07:18 PM

Title: 2 TOS checkboxes on checkout
Post by: KrisTianoVS on December 01, 2017, 15:07:18 PM
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?
Title: Re: 2 TOS checkboxes on checkout
Post by: jenkinhill on December 01, 2017, 19:09:08 PM
You can use Shopper Fields add another required checkbox to checkout .
Title: Re: 2 TOS checkboxes on checkout
Post by: Milbo on December 03, 2017, 10:23:23 AM
It is also quite easy to create a clone of the tos.php
Title: Re: 2 TOS checkboxes on checkout
Post by: KrisTianoVS on December 05, 2017, 13:36:05 PM
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.
Title: Re: 2 TOS checkboxes on checkout
Post by: Adwans on January 16, 2018, 14:51:34 PM
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?  :)
Title: Re: 2 TOS checkboxes on checkout
Post by: asomaro on January 20, 2018, 00:07:11 AM
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!
Title: Re: 2 TOS checkboxes on checkout
Post by: pkubik on February 16, 2018, 08:23:45 AM
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
Title: Re: 2 TOS checkboxes on checkout
Post by: Milbo on February 17, 2018, 17:26:42 PM
There is no need todo this, because vm3.2 has already a second layout.
Title: Re: 2 TOS checkboxes on checkout
Post by: pkubik on February 18, 2018, 17:34:24 PM
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.
Title: Re: 2 TOS checkboxes on checkout
Post by: adrian12 on March 19, 2018, 15:11:50 PM
hi guys,

is there a solution yet?

i would need this too....

thanks a lot
Title: Re: 2 TOS checkboxes on checkout
Post by: 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
Title: Re: 2 TOS checkboxes on checkout
Post by: AH on May 17, 2018, 14:45:41 PM
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
Title: Re: 2 TOS checkboxes on checkout
Post by: 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.
Title: Re: 2 TOS checkboxes on checkout
Post by: Jumbo! on May 22, 2018, 07:52:15 AM
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.
Title: Re: 2 TOS checkboxes on checkout
Post by: panjarek on May 24, 2018, 15:11:59 PM
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.
Title: Re: 2 TOS checkboxes on checkout
Post by: AH on May 24, 2018, 21:57:10 PM
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
Title: Re: 2 TOS checkboxes on checkout
Post by: panjarek on August 01, 2018, 19:56:13 PM
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).