Page 2 of 2

Re: GDPR privacy policy

PostPosted: Thu May 17, 2018 1:44 pm
by admin
i've added the GDPR/privacy/italian checkbox to sandwitch themes as well and the current content for any template based on sandwitch themes can be:

Code: Select all

<?php
/**
* Italian privacy checkbox support file
*
* @package One Page Checkout for VirtueMart 2
* @subpackage opc
* @author stAn
* @author RuposTel s.r.o.
* @copyright Copyright (C) 2007 - 2012 RuposTel - All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* One Page checkout is free software released under GNU/GPL and uses some code from VirtueMart
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*
*/
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
?><!-- italian privacy checkbox -->
<div style="width: 100%;float:left;">
<div style="width: 5%; float: left;">
<script>
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>
<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" />

</div>
               <div style="width: 95%; float:left;"><label for="italianagreed_field" style="float: none; white-space: normal;">
                  <span style="font-weight:bold;"><?php echo OPCLang::_('COM_ONEPAGE_ITALIAN_AGREE_LABEL'); ?>
                  
                  <?php
               if (!empty($privacy_link)) {
               JHTMLOPC::_('behavior.modal', 'a.opcmodalprivacy');
               ?>
               
               <a target="_blank" rel="{handler: 'iframe', size: {x: 500, y: 400}}" class="opcmodalprivacy"  href="<?php echo $privacy_link; ?>" onclick="javascript: return Onepage.op_openlink(this); "><?php echo JText::_('COM_ONEPAGE_ITALIAN_AGREE_LABEL_LINK'); ?></a>
               <?php
               }
               ?>
                  </span><br /><?php
               echo OPCLang::_('COM_ONEPAGE_ITALIAN_AGREE_DESC');
               ?>
               </label></div>
</div>   
<!-- END italian privacy checkbox -->



the above mods are all included in core OPC for next release.

the link must open within fancybox or facebox pop-up depending on which one is being used in VM, if there is a javascript error anywhere on the site, the link will be open in a new window.

best regards, stan

Re: GDPR privacy policy

PostPosted: Thu May 17, 2018 1:45 pm
by admin
hello, to display TOS checkbox for logged in, this has to be enabled in OPC at the Display tab.

if your opc template does not include the privacy checkbox for logged in users, you can simply put:

<?php echo $italian_checkbox; ?>

within any position at onepage.logged (+registration).tpl.php ideally right after the TOS checkbox.

for example on sandwtich themes, it can be inserted right before TOS wrapper:

Code: Select all
<div class="field_wrapper" style="margin-bottom: 20px;">

<?php

if ($tos_required)
{


so it looks like:

Code: Select all

<?php
echo $italian_checkbox;
?>

<div class="field_wrapper" style="margin-bottom: 20px;">

<?php

if ($tos_required)
{



the wrapper may not be used in all OPC themes, but the line with "if ($tos_required)" must be availble on all opc themes.

best regards, stan

Re: GDPR privacy policy

PostPosted: Thu May 17, 2018 2:09 pm
by admin
hello, depending on your language strings setup you may need to remove any links from your current language constants such as COM_ONEPAGE_ITALIAN_AGREE_LABEL and make sure you configure a new article for the popup which will be shown at the section as COM_ONEPAGE_ITALIAN_AGREE_LABEL_LINK

best regards,stan

Re: GDPR privacy policy

PostPosted: Mon May 21, 2018 11:11 am
by info@.....com
admin wrote:the link must open within fancybox or facebox pop-up depending on which one is being used in VM, if there is a javascript error anywhere on the site, the link will be open in a new window.


Thank you so much Stan. The link is now displayed to logged in users too, although the link still opens in a new window and I cant see any javascript error. TOS works fine though

How can I fix this?

Re: GDPR privacy policy

PostPosted: Mon May 21, 2018 8:28 pm
by admin
hello, i do not know how you can fix it since it's not clear what the error is - we already implemented this on cca 20 sites and we got it working properly. you should contact us via email, let us know your URL so we can see what javascript error you are getting which prevents the pop-up to work properly.

it's important that:
- the URL's and links are removed from the language constants as the pop-up won't work if you used your own link inside language constant
- you should use OPC config to set the Article which will be shown inside the pop-up
- opc will take care of creating the URL for fancybox / facebox / mootools popup (j2)

best regards, stan

Re: GDPR privacy policy

PostPosted: Tue May 22, 2018 1:54 pm
by info@.....com
Hello Stan, it's working already. Turns out I didn't have the component's last version installed, so I wasn't using OPC config to set the article. My bad, I'm sorry

Everything's good now. Thank you so much for all the help