Terms of Service Checkbox Display Problem

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

Terms of Service Checkbox Display Problem

Postby george@.....com » Tue Oct 06, 2015 3:34 am

I am using the Three_Column_Special_Blue template and I am not able to get the check box to the "I agree to the terms of service" to show in the template? Thanks.
george@.....com
 
Posts: 3
Joined: Tue Oct 06, 2015 3:29 am

Re: Terms of Service Checkbox Display Problem

Postby admin » Fri Oct 16, 2015 5:28 pm

hello, normally it can get enabled at the OPC's Display tab here:

Image

this will render the checkbox + text + link for the TOS.

if you see the text there, but you do not see just the checkbox itself, your template probably hides it. i can help with the CSS or javascript with this, but please write us an email with your URL. sometimes the theme hides the checkbox with CSS and tries to render it with javascript but we had never seen it working properly especially if 3rd party plugins are installed in browsers (like lastpass or similar) - this is usually a problem with jquery "kits" such as widgetkit or uikit or jquery-mobile.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Terms of Service Checkbox Display Problem

Postby admin » Thu Nov 05, 2015 11:33 pm

hello, after checking this problem on another site using Flatastic template we suggest the following solution:

within both onepage.unlogged + logged + registration (if available) .tpl.php

update from (this is band_box_german) but it's similar on all opc themes:
Code: Select all
<!-- show TOS and checkbox before button -->
<?php

if ($tos_required)
{

?>
<div id="comment_box" <?php if (!$show_full_tos) echo ' style="width: 100%;" '; ?> >
   <div id="comment_head" class="bandBoxStyle"><?php
   echo OPCLang::_('COM_VIRTUEMART_I_AGREE_TO_TOS');
   ?></div>
   <div id="comment_container">


   <div id="agreed_div" class="formLabel " >
   

<input value="1" type="checkbox" id="agreed_field" name="tosAccepted" <?php if (!empty($agree_checked)) echo ' checked="checked" '; ?> class="terms-of-service"  required="required" autocomplete="off" />
               <label for="agreed_field"><?php echo OPCLang::_('COM_VIRTUEMART_I_AGREE_TO_TOS');
               if (!empty($tos_link))
               {
               JHTMLOPC::_('behavior.modal', 'a.opcmodal');
               
               ?><br /><a target="_blank" rel="{handler: 'iframe', size: {x: 500, y: 400}}" class="opcmodal" href="<?php echo $tos_link; ?>" onclick="javascript: return op_openlink(this); " >(<?php echo OPCLang::_('COM_VIRTUEMART_CART_TOS').' *'; ?>)</a><?php } ?></label>
            
      
   <?php
   
echo $italian_checkbox; 
?>
   
   </div>
   
</div>
</div>

<?php
}
?>
<!-- end show TOS and checkbox before button -->



to this code (note that the only difference is that the checkbox is now inside the label element:

Code: Select all
<!-- show TOS and checkbox before button -->
<?php

if ($tos_required)
{

?>
<div id="comment_box" <?php if (!$show_full_tos) echo ' style="width: 100%;" '; ?> >
   <div id="comment_head" class="bandBoxStyle"><?php
   echo OPCLang::_('COM_VIRTUEMART_I_AGREE_TO_TOS');
   ?></div>
   <div id="comment_container">


   <div id="agreed_div" class="formLabel " >
   


               <label for="agreed_field">
               <input value="1" type="checkbox" id="agreed_field" name="tosAccepted" <?php if (!empty($agree_checked)) echo ' checked="checked" '; ?> class="terms-of-service"  required="required" autocomplete="off" />
               <?php echo OPCLang::_('COM_VIRTUEMART_I_AGREE_TO_TOS');
               if (!empty($tos_link))
               {
               JHTMLOPC::_('behavior.modal', 'a.opcmodal');
               
               ?><br /><a target="_blank" rel="{handler: 'iframe', size: {x: 500, y: 400}}" class="opcmodal" href="<?php echo $tos_link; ?>" onclick="javascript: return op_openlink(this); " >(<?php echo OPCLang::_('COM_VIRTUEMART_CART_TOS').' *'; ?>)</a><?php } ?></label>
            
      
   <?php
   
echo $italian_checkbox; 
?>
   
   </div>
   
</div>
</div>

<?php
}
?>
<!-- end show TOS and checkbox before button -->




update for italian_checkbox (privacy checkbox) + acymailing_checkbox (subscription checkbox)


subscription checkbox in:
\components\com_onepage\themes\band_box_german\overrides\acymailing_checkbox.php
Code: Select all

<div class="acy_wrapper" >
<div class="acy_checkbox_wrapper" style="">


<input type="hidden" value="<?php echo $opc_acy_id; ?>" name="acylistsdisplayed_dispall" />



<input type="hidden" name="allVisibleLists" value="<?php echo $opc_acy_id; ?>" />



</div>
               <div class="acy_label_wrapper" style=""><label for="acy_list_<?php echo $opc_acy_id; ?>" style="float: none; white-space: normal;">
<input type="checkbox" id="acy_list_<?php echo $opc_acy_id; ?>" class="acymailing_checkbox" name="acysub[]" value="<?php echo $opc_acy_id; ?>"/>               
               <span style="font-weight:bold;"><?php echo OPCLang::_('COM_VIRTUEMART_FIELDS_NEWSLETTER'); ?></span><br />
               <?php
               echo OPCLang::_('COM_ONEPAGE_NEWSLETTER_SUBSCRIPTION_DESC');
               ?>
               </label></div>
</div>   



privacy checkbox in:
\components\com_onepage\themes\band_box_german\overrides\italian_checkbox.php

Code: Select all
<!-- italian privacy checkbox -->
<div style="width: 100%; clear: both;">
<div >
<script type="text/javascript">
op_userfields.push('italianagreed');
custom_rendering_fields.push('italianagreed');
var italagreeerr = "<?php echo OPCloader::slash(JText::_('COM_ONEPAGE_ITALIAN_AGREE_ERROR')); ?>";
function validateItalian()
{
  d = document.getElementById('italianagreed_field');
  if (d != null)
  if (!d.checked)
  {
    alert(italagreeerr);
    return false;
  }
  return true;
}
addOpcTriggerer('callSubmitFunct', 'validateItalian');
</script>


</div>
               <div ><label for="italianagreed_field" style="float: none; white-space: normal;max-width: 90%;">
               <input value="1" type="checkbox" id="italianagreed_field" name="italianagreed" <?php if (!empty($agree_checked)) echo ' checked="checked" '; ?> class="terms-of-service required"  required="required" autocomplete="off" />
               <span style="font-weight:bold;"><?php echo OPCLang::_('COM_ONEPAGE_ITALIAN_AGREE_LABEL').'</span><br />';
               echo OPCLang::_('COM_ONEPAGE_ITALIAN_AGREE_DESC');
               ?>
               </label></div>
</div>   
<!-- END italian privacy checkbox -->



this should be also fixed by the theme creator (Flatastic) since it should either render the checkboxes properly, or not alter the display of them.

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x