Jump to content
Sign in to follow this  
BertrandD

How to add a new element for the grdp

Recommended Posts

Hi,

First, Do you have installed or not the gdrp header tag modules ? 

ClicShopping propose a nice approach about the registred customer but for the not registred, you must install a specific module.

You we will found the modules the : https://github.com/ClicShoppingOfficialModulesV3/module_header_tags_gdpr or you can install via the extensions.

maybe it can help you to manage your need.

you can find a module cookie consent.

 

Else look the directory : Clichopping/Modules/Hooks/Account.

You will find some GRPD modules. it's easy to create another :

Copy the files and change the name :

example

 

<?php
/**
 *
 *  @copyright 2008 - https://www.clicshopping.org
 *  @Brand : ClicShopping(Tm) at Inpi all right Reserved
 *  @Licence GPL 2 & MIT
 *  @licence MIT - Portion of osCommerce 2.4 
 *
 *
 */

  namespace ClicShopping\OM\Module\Hooks\Shop\Account;

  use ClicShopping\OM\CLICSHOPPING;

  use ClicShopping\OM\Registry;
  use ClicShopping\OM\HTML;

  class AccountGdprNoIp {

    protected $IpAddress;

    public function getIpAddress() {
      $CLICSHOPPING_Db = Registry::get('Db');
      $CLICSHOPPING_Customer = Registry::get('Customer');

      $Qgdpr = $CLICSHOPPING_Db->prepare('select no_ip_address
                                          from :table_customers_gdpr
                                          where customers_id = :customers_id
                                        ');
      $Qgdpr->bindInt(':customers_id', $CLICSHOPPING_Customer->getID());
      $Qgdpr->execute();

      $ip_address = $Qgdpr->valueInt('no_ip_address');

      return $ip_address;
    }

    public function display() {
        $output = '<div>';
        $output .= '<label class="checkbox-inline">';
        $output .= HTML::checkboxField('no_ip_address', $this->getIpAddress(), $this->getIpAddress());
        $output .= '</label>';
        $output .= CLICSHOPPING::getDef('module_account_customers_gdpr_no_ip_address');
        $output .= '</div>';

        return $output;
    }
  }

To create another module change 

AccountGdprNoIp

by 

AccountGdprMyModule

Note : AccountGdpr is very important, it allow you  to implement the code in your catalog the new module. The files is reading dynamicly

I hope it can be an help to create your own module.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thank @Patrick,

 

That's mean you can develop a specific module/apps and you can insert a grpd hooks in funcion the module/apps ?

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use