Skip to content
View in the app

A better way to browse. Learn more.

Clicshopping AI, Free generative artificial intelligence e-commerce Open Source , Open Source Store Onlne

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Hooks GRPD

Featured Replies

Hello,

 

It's my first time, I installed ClicShopping without problem. I create an account and look the GRPD. I would if it's possible to include a new rule because I need to include a specific tracking.

 

Thank you

Solved by Patrick

  • Solution

 

Hello Gary,

Welcome in this new forum and e-commerce solution.

look this directory :  /includes/Module/Hooks/Shop/Account

For example, if you look the file DeleteAccount, you will see 2 files :

 

AccountGdprDeleteAccount ==> this file display the information

AccountGdprCallDeleteAccount ==> this files make the action process.

 

That I know, maybe @ClicShopping can confirm that, the files must start by this name AccountGdpr .....php

 

Good luck

  • 1 month later...

Hello,

Could you help me to create a new GRPD hooks,

It's in relation with this post  https://www.clicshopping.org/forum/topic/98-adverttisement-sms/?tab=comments#comment-308

If I understand well I must create 2 files,
One to display called AccountGdprSms  and one AccountGdprDeleteSms.

 

After I must create a new field inside customers_gdpr called no_sms

 

Is like this AccountGdprSms

 

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

  use ClicShopping\OM\CLICSHOPPING;

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

  class AccountGdprNoIp {

    protected $sms;

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

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

      $sms = $Qgdpr->valueInt('no_sms');

      return $sms;
    }

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

        return $output;
    }
  }

and for AccountGdprDeleteSms

 

<?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
 *  @Info : https://www.clicshopping.org/forum/trademark/
 *
 */

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

  use ClicShopping\OM\CLICSHOPPING;

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

  class AccountGdprCallNoSms {

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

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

      if ($Qcheck->fetch() === false) {
        $CLICSHOPPING_Db->save('customers_gdpr', ['customers_id' => $CLICSHOPPING_Customer->getID()]);
      } else {
        if (!is_null($_POST['no_sms'])) {
          $no_sms = 1;
        } else {
          $no_sms = 0;
        }

        $Qupdate = $CLICSHOPPING_Db->prepare('update :table_customers_gdpr
                                              set no_sms = :no_sms,
                                              customers_id = :customers_id
                                            ');
        $Qupdate->bindInt(':customers_id', $CLICSHOPPING_Customer->getID());
        $Qupdate->bindInt(':no_sms', no_sms);

        $Qupdate->execute();
      }
    }
  }

 

Edited by Grimoire

@Grimoire,

 

It's could be better if you can include a code to create automatically the new field inside the database.

you can include this in your code (in AccountGdprSms)

 

    private static function installNewField() {
      $CLICSHOPPING_Db = Registry::get('Db');

      $Qcheck = $CLICSHOPPING_Db->query("show columns from :table_account_grpd 'no_sms'");
      $check = $Qcheck->fetch();

      if ($check === false) {
        $sql = <<<EOD
ALTER TABLE :table_account_grpd ADD no_sms tynint(1) NULL AFTER no_ip_address;
EOD;

        $CLICSHOPPING_Db->exec($sql);
       }
     }          

and write inside display() function  this code

static::installNewField()

It must work.

 

  • 3 weeks later...

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.