Author Topic: 2 TOS checkboxes on checkout  (Read 2642 times)

KrisTianoVS

  • Beginner
  • *
  • Posts: 6
  • A beginner
2 TOS checkboxes on checkout
« 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?

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27043
  • Always on vacation
    • Jenkin Hill Internet
Re: 2 TOS checkboxes on checkout
« Reply #1 on: December 01, 2017, 19:09:08 pm »
You can use Shopper Fields add another required checkbox to checkout .
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

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

Currently using VM 3.4.0.9935 on Joomla 3.8.12 PHP 7.0.31
Testing VM 3.4.0.9941 on Joomla 3.8.12

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9726
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2 TOS checkboxes on checkout
« Reply #2 on: December 03, 2017, 10:23:23 am »
It is also quite easy to create a clone of the tos.php
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

KrisTianoVS

  • Beginner
  • *
  • Posts: 6
  • A beginner
Re: 2 TOS checkboxes on checkout
« Reply #3 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.

Adwans

  • Beginner
  • *
  • Posts: 44
  • Beginner+
Re: 2 TOS checkboxes on checkout
« Reply #4 on: January 16, 2018, 14:51:34 pm »
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

  • Beginner
  • *
  • Posts: 2
  • A beginner
  • Skype Name: simonwythe1
Re: 2 TOS checkboxes on checkout
« Reply #5 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!

pkubik

  • Beginner
  • *
  • Posts: 24
Re: 2 TOS checkboxes on checkout
« Reply #6 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

Code: [Select]
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

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9726
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: 2 TOS checkboxes on checkout
« Reply #7 on: February 17, 2018, 17:26:42 pm »
There is no need todo this, because vm3.2 has already a second layout.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

pkubik

  • Beginner
  • *
  • Posts: 24
Re: 2 TOS checkboxes on checkout
« Reply #8 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.

adrian12

  • Beginner
  • *
  • Posts: 1
Re: 2 TOS checkboxes on checkout
« Reply #9 on: March 19, 2018, 15:11:50 pm »
hi guys,

is there a solution yet?

i would need this too....

thanks a lot

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 657
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always latest
Re: 2 TOS checkboxes on checkout
« Reply #10 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

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2811
  • VirtueMart Version: 3.4
Re: 2 TOS checkboxes on checkout
« Reply #11 on: May 17, 2018, 14:45:41 pm »
Quote
There 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.8.13
php 7.1

thefbi

  • Jr. Member
  • **
  • Posts: 72
Re: 2 TOS checkboxes on checkout
« Reply #12 on: May 20, 2018, 20:31:29 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.

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 657
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always latest
Re: 2 TOS checkboxes on checkout
« Reply #13 on: May 22, 2018, 07:52:15 am »
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

  • Beginner
  • *
  • Posts: 9
  • A beginner
Re: 2 TOS checkboxes on checkout
« Reply #14 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.