VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: juanki on December 01, 2015, 23:06:16 PM

Title: Checkout and terms of service confirmation after having read TOS
Post by: juanki on December 01, 2015, 23:06:16 PM
Hello, when a buyer wants to checkout, he has to fist check" I agree to terms of service", and after, he can read the terms of service using the modal window link. How could i invert the order?

Now it is:

1. Terms of Service (and check box)

2. Click here to read terms of service and check the box to accept them.

I think the user should be able to read terms of servive before accepting them, so it should be:


1. Click here to read terms of service and check the box to accept them. (modal window link)

2. Terms of Service (and check box)

So buyer can accept someting he has previously read.

How can i change the order of this lines in the cart?
Thanks much
Title: Re: Checkout and terms of service confirmation after having read TOS
Post by: GJC Web Design on December 02, 2015, 00:04:16 AM
just swap them around in  an over ride of   

sublayouts\tos.php

the chk box is

echo VmHtml::checkbox ($_prefix.$field['name'], $tos, 1, 0, 'class="terms-of-service required"', 'tos');

the link is below it
Title: Re: Checkout and terms of service confirmation after having read TOS
Post by: juanki on December 04, 2015, 00:11:37 AM
Hello, thanks much for your fast answer. Yes, you are right in

if(!class_exists('VmHtml')) require(VMPATH_ADMIN.DS.'helpers'.DS.'html.php');
echo VmHtml::checkbox ($_prefix.$field['name'], $tos, 1, 0, 'class="terms-of-service required"', 'tos');

i can change the checkbox location, and can change the link to above the checkbox. . But, where can i control the location of the text  COM_VIRTUEMART_STORE_FORM_TOS = Terms of Service, just before the checkbox? , i don't don't know how to delete or move that text to other place. It think that "Terms of service" text is called from other php file :(
Thanks much

Btw, i bought your zip code virtuemart extension and it is great.
Title: Re: Checkout and terms of service confirmation after having read TOS
Post by: GJC Web Design on December 04, 2015, 00:33:59 AM
Thanks about the zip code.. reviews on JED always appreciated..  :)

components\com_virtuemart\views\cart\tmpl\default_cartfields.php


<fieldset class="vm-fieldset-<?php echo str_replace('_','-',$field['name']) ?>">
      <div  class="cart <?php echo str_replace('_','-',$field['name']) ?>" title="<?php echo strip_tags($field['description']) ?>">
      <!--<span class="cart <?php echo str_replace('_','-',$field['name']) ?>" ><?php echo $field['title'] ?></span>-->

      <?php
      if ($field['hidden'] == true) {
         // We collect all hidden fields
         // and output them at the end
         $hiddenFields .= $field['formcode'] . "\n";
      } else { ?>
      
            <?php echo $field['formcode'] ?>
            <span class="cart <?php echo str_replace('_','-',$field['name']) ?>" ><?php echo $field['title'] ?></span>
            
         </div>
   <?php } ?>

   </fieldset>