{"id":309,"date":"2020-02-28T16:03:54","date_gmt":"2020-02-28T16:03:54","guid":{"rendered":"http:\/\/wiki2.plumserver.com\/knowledge-base\/magento-gdpr-v1-x-developers-guide-and-api-reference"},"modified":"2021-09-27T06:22:16","modified_gmt":"2021-09-27T10:22:16","slug":"magento-gdpr-v1-x-developers-guide-and-api-reference","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide","title":{"rendered":"Magento 1 GDPR v1.x Developer Guide and API Reference"},"content":{"rendered":"\n<p>In this developer documentation for the&nbsp;<a href=\"\/magento-1-gdpr\">Magento GDPR &amp; CCPA Extension<\/a>, you will find step-by-step instructions, sample code, and API references to fully customize your plugin.<\/p>\n\n\n\n<h2 id=\"downloading-deleting-and-anonymizing-customer-data\">Downloading, Deleting and Anonymizing Customer Data<\/h2>\n\n\n\n<p>Plumrocket GDPR Magento 1 extension allows you to manage any third-party data stored in your Magento database. Use this manual to make your third-party extension GDPR compliant. Contact vendors of the third-party extensions you are using, and ask them if their extensions record any personal customer data in your Magento database. If they collect any personal data, they may become GDPR compliant by integrating their plugins with Plumrocket GDPR Extension using the provided API.<\/p>\n\n\n\n<p><strong>Export, delete or anonymize third-party data in 2 simple steps:<\/strong><\/p>\n\n\n\n<ol><li>Create a new observer in your module:\n    <ol type=\"a\"><li>Register observer in config.xml<\/li>\n        <li>Create observer method<\/li><\/ol>\n<\/li><li>Create GDPR model in the third-party plugin to manage your customer data.<\/li><\/ol>\n\n\n\n<h4 id=\"step-1-create-a-new-observer-in-your-module\">Step 1. Create a New Observer in Your Module<\/h4>\n\n\n\n<p><strong>a) Register observer in config.xml file.<\/strong><\/p>\n\n\n\n<p>Open the file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/community\/VendorName\/ModuleName\/etc\/config.xml<\/code><\/pre><\/div>\n\n\n\n<p>and add the code as shown below (or <a href=\"\/docs\/wp-content\/uploads\/2020\/05\/config.zip\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">download the template here<\/a>.):<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;global>\n    &lt;events>\n        &lt;prgdpr_processors_collect_after>\n            &lt;observers>\n                &lt;observer_name>\n                    &lt;type>singleton&lt;\/type>\n                    &lt;class>groupedClassName\/observerModelName&lt;\/class>\n                    &lt;method>prgdprProcessorsCollectAfter&lt;\/method>\n                 &lt;\/observer_name>\n            &lt;\/observers>\n        &lt;\/prgdpr_processors_collect_after>\n    &lt;\/events>\n&lt;\/global><\/code><\/pre><\/div>\n\n\n\n<p><strong>b) Create observer method<\/strong><\/p>\n\n\n\n<p>Your observer method must receive one argument &#8211; <strong>$observer<\/strong> with instance of <strong>Plumrocket_GDPR_Model_AbstractGdprTool<\/strong> in it.<\/p>\n\n\n\n<p>Method <strong>Plumrocket_GDPR_Model_AbstractGdprTool::addProcessorWithSort<\/strong> can have 3 arguments:<\/p>\n\n\n\n<ul><li>\n    <strong>&#8220;$processor&#8221;<\/strong> &#8211; &#8220;GDPR&#8221; model that should process all data (export \/ anonymize \/ delete)<\/li><li>\n    <strong>&#8220;[$sort]&#8221;<\/strong> &#8211; describes the sort position of each GDPR model defined in $sortValue. Allowed values: &#8220;before&#8221;, &#8220;after&#8221;. Default value is &#8220;before&#8221;.<\/li><li><strong>&#8220;[$sortValue]&#8221;<\/strong> &#8211; Key name of your GDPR model which is used in sorting. Allowed values: Key name of GDPR model (example: &#8220;order&#8221;) or use dash (-) to position your GDPR model before\/after all other models in the list. Default value is &#8220;customer&#8221;.<\/li><\/ul>\n\n\n\n<p>Please note: The last two arguments are not required. They are useful when you need to specify the order in which your GDPR model must be executed. Example: let\u2019s say you have 3 GDPR models with key names &#8211; &#8220;myCustomGDPRmodel&#8221;, &#8220;order&#8221; and &#8220;customer&#8221;. You can set the execution position of these models and specify that &#8220;myCustomGDPRmodel&#8221; should be executed after the &#8220;customer&#8221; model.<\/p>\n\n\n\n<p><strong>Example:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">$tool->addProcessorWithSort($myCustomGDPRmodel, \u2018after\u2019, \u2018customer\u2019);<\/code><\/pre><\/div>\n\n\n\n<p>Now let\u2019s create our observer method.<\/p>\n\n\n\n<p>Open or create file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/community\/VendorName\/ModuleName\/Model\/ObserverModelName.php<\/code><\/pre><\/div>\n\n\n\n<p>Add method prgdprProcessorsCollectAfter() and add the code as shown below (or <a href=\"\/docs\/wp-content\/uploads\/2020\/05\/ObserverModelName.zip\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">download the template here<\/a>.):<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">\/**\n * @param Varien_Event_Observer $observer\n * @return void\n *\/\npublic function prgdprProcessorsCollectAfter($observer)\n{\n    \/** @var VendorName_ModuleName_Model_ProcessorModelName $processor *\/\n    $processor = Mage::getModel('groupedClassName\/processorModelName');\n\n    \/** @var Plumrocket_GDPR_Model_AbstractGdprTool $tool *\/\n    $tool = $observer->getTool();\n\n    $tool->addProcessorWithSort($processor, \u2018before\u2019, \u2018customer\u2019);\n}\n\n\n<\/code><\/pre><\/div>\n\n\n\n<h4 id=\"step-2-create-gdpr-model\">Step 2. Create GDPR Model<\/h4>\n\n\n\n<p>Create your class <strong>&#8220;VendorName_ModuleName_Model_Gdpr_Processor&#8221;<\/strong> that extends Plumrocket_GDPR_Model_AbstractProcessor.<\/p>\n\n\n\n<p>Class <strong>Plumrocket_GDPR_Model_AbstractProcessor<\/strong> has the following methods:<\/p>\n\n\n\n<ul><li><strong>_anonymize(Mage_Core_Model_Abstract $model)<\/strong><\/li><li><strong>_erase(Mage_Core_Model_Abstract $model)<\/strong><\/li><li><strong>_export(Varien_Object $model)<\/strong><\/li><li><strong>_massExport($models)<\/strong><\/li><li><strong>_massAnonymize(array $models, callable $callback = null)<\/strong><\/li><li><strong>_massErase(array $models, callable $callback = null)<\/strong><\/li><\/ul>\n\n\n\n<p><i>Please note:<\/i> <strong>$callback<\/strong> &#8211; is a function executed for each model before mass erasure or anonymization.<\/p>\n\n\n\n<p><strong>function getMapping()<\/strong> defines which data will be anonymized or exported.<\/p>\n\n\n\n<p><i><strong>Where:<\/strong><\/i><\/p>\n\n\n\n<p><strong>&#8220;db_field_name1&#8221; is the name of the database field or attribute code that should be anonymized or exported:<\/strong><\/p>\n\n\n\n<p><i><strong>Data anonymization options:<\/strong><\/i><\/p>\n\n\n\n<ul><li>Array Key <strong>(bool)<\/strong> <strong>&#8220;anonymize&#8221;<\/strong> defines whether field should be anonymized or not. Default value is &#8220;true&#8221;.<\/li><li>Array Key <strong>(string)<\/strong> <strong>&#8220;default&#8221;<\/strong> &#8211; replaces field value with your string value. if nothing is defined, [Anonymization Key] + &#8220;-&#8221; + [Customer Id] will be set instead.<i>Please note: the &#8220;Anonymization Key&#8221; can be set in Magento System Configuration -&gt; GDPR -&gt; Account Removal Settings -&gt; Anonymization Key.<\/i><\/li><\/ul>\n\n\n\n<p><i><strong>Data export options:<\/strong><\/i><\/p>\n\n\n\n<ul><li>Array Key <strong>(bool)<\/strong> <strong>&#8220;export&#8221;<\/strong> defines whether field should be exported or not. Default value is &#8220;true&#8221;.<\/li><li>Array Key <strong>(string)<\/strong> <strong>&#8220;title&#8221;<\/strong> allows you to rename <strong>&#8220;db_field_name1&#8221;<\/strong> column in the CSV file. Default value is a result of the function uc_words( <strong>&#8220;db_field_name1&#8221;<\/strong> ).<\/li><li>Array Key <strong>(callable)<\/strong> <strong>&#8220;decorator&#8221;<\/strong> &#8211; anonymous function allows you to define custom format of the field <strong>&#8220;db_field_name1&#8221;<\/strong> before it&#8217;s exported to the CSV file. This function can receive two arguments &#8211; value of the &#8220;db_field_name1&#8221; and the current model. Example of the code below allows you to format Order Grand Total using our anonymous function:<\/li><\/ul>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">'decorator' => function ($value, $order) {\n    return $order>getOrderCurrency()->formatPrecision($value, 2, array(), false);\n},<\/code><\/pre><\/div>\n\n\n\n<p><i>Lastly, if you provide empty array of options, (see &#8216; <strong>db_field_name2&#8242;<\/strong> in example below), the default values will be set.<\/i><\/p>\n\n\n\n<p>Now, let\u2019s create GDPR Model file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/pool\/VendorName\/ModuleName\/Model\/Gdpr\/Processor.php<\/code><\/pre><\/div>\n\n\n\n<p>and add the code as shown below (or <a href=\"\/docs\/wp-content\/uploads\/2020\/05\/Processor.zip\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">download the template here<\/a>.):<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">class VendorName_ModuleName_Model_Gdpr_Processor extends Plumrocket_GDPR_Model_AbstractProcessor implements Plumrocket_GDPR_Model_ProcessorInterface\n{\n    public function getKey()\n    {\n        return 'unique_key'; \/\/ unique key of your GDPR model\n    }\n\n    public function getModuleName()\n    {\n        return 'VendorName_ModuleName';\n    }\n\n    public function getPublicFilename()\n    {\n        return 'your_filename'; \/\/ your CSV file name\n    }\n\n    \/**\n     * @return array\n     *\/\n    public function getMapping()\n    {\n        return array(\n            'db_field_name1' => array(\n                \/\/ data anonymization options\n                \u2018anonymize\u2019 => bool,\n                'default' => string,\n                \/\/ data export options\n                'export' => bool,\n                \u2018title\u2019 => string,\n                \u2018decorator\u2019 => callable\n            ),\n            'db_field_name2' => array(),\n            'db_field_name3' => array(\n                'export' => bool,\n                \u2018title\u2019 => string,\n                \u2018decorator\u2019 => callable\n            )\n        );\n    }\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return bool\n     *\/\n    public function anonymize($customer)\n    {\n        $collection = $this->_getCollectionByCustomer($customer);\n\n        return $this->_massAnonymize($collection);\n    }\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return bool\n     *\/\n    public function erase($customer)\n    {\n        $collection = $this->_getCollectionByCustomer($customer);\n\n        return $this->_massErase($collection);\n    }\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return bool\n     *\/\n    public function export($customer)\n    {\n        $collection = $this->_getCollectionByCustomer($customer);\n\n        return $this->_massExport($collection);\n    }\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return Mage_Core_Model_Abstract[]\n     *\/\n    protected function _getCollectionByCustomer($customer)\n    {\n        \/** @var Mage_Core_Model_Resource_Db_Collection_Abstract $collection *\/\n        $collection = Mage::getModel('groupedClassName\/entity_name')->getCollection();\n        $collection->addFieldToFilter('customer_id', $customer->getId());\n\n        return $collection->getItems();\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<p>Example<\/p>\n\n\n\n<p><strong>This example is based on Free Plumrocket Twitter &amp; Facebook Login Extension for Magento 1. You can <a href=\"\/magento-1-twitter-facebook-login\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">download it from our store<\/a> for your reference.<\/strong><\/p>\n\n\n\n<p><strong>Step 1.a &#8220;config.xml&#8221; file of Plumrocket Twitter &amp; Facebook Login Extension<\/strong><\/p>\n\n\n\n<p><strong>1.a) Observer in config.xml file<\/strong> Open the file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/community\/Plumrocket\/SocialLogin\/etc\/config.xml<\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;global>\n    &lt;events>\n        &lt;prgdpr_processors_collect_after>\n            &lt;observers>\n                &lt;pslogin_observer>\n                    &lt;type>singleton&lt;\/type>\n                    &lt;class>pslogin\/observer&lt;\/class>\n                    &lt;method>prgdprProcessorsCollectAfter&lt;\/method>\n                &lt;\/pslogin_observer>\n            &lt;\/observers>\n        &lt;\/prgdpr_processors_collect_after>\n    &lt;\/events>\n&lt;\/global><\/code><\/pre><\/div>\n\n\n\n<p><strong>Step 1.b &#8220;Observer.php&#8221; file of Plumrocket Twitter &amp; Facebook Login Extension<\/strong><\/p>\n\n\n\n<p><strong>1.b) Observer method<\/strong> Open the file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/community\/Plumrocket\/SocialLogin\/Model\/Observer.php<\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">\/**\n * @param Varien_Event_Observer $observer\n * @return void\n *\/\npublic function prgdprProcessorsCollectAfter($observer)\n{\n    \/** @var Plumrocket_SocialLogin_Model_Gdpr_Processor $processor *\/\n    $processor = Mage::getModel('pslogin\/gdpr_processor');\n\n    \/** @var Plumrocket_GDPR_Model_AbstractGdprTool $tool *\/\n    $tool = $observer->getTool();\n\n    $tool->addProcessorWithSort($processor);\n}<\/code><\/pre><\/div>\n\n\n\n<p><strong>Step 2. GDPR Model of Plumrocket Twitter &amp; Facebook Login Extension<\/strong><\/p>\n\n\n\n<p>File path:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/community\/Plumrocket\/SocialLogin\/Model\/Gdpr\/Processor.php<\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">class Plumrocket_SocialLogin_Model_Gdpr_Processor extends Plumrocket_GDPR_Model_AbstractProcessor\n{\n    const KEY = 'pslogin';\n\n    \/**\n     * @return string\n     *\/\n    public function getKey()\n    {\n        return self::KEY;\n    }\n\n    \/**\n     * @return string\n     *\/\n    public function getPublicFilename()\n    {\n        return 'social_accounts';\n    }\n\n    \/**\n     * @return string\n     *\/\n    public function getModuleName()\n    {\n        return 'Plumrocket_SocialLogin';\n    }\n\n    \/**\n     * @return array\n     *\/\n    public function getMapping()\n    {\n        return array(\n            'type' => array(\n                'title' => 'Social network',\n                'anonymize' => false\n            ),\n            'user_id' => array(\n                'title' => 'Id in social network'\n            ),\n            'photo' => array(\n                'title' => 'Photo',\n                'decorator' => $this->getPhotoDecorator()\n            )\n            \/\/ In this case, photo is not a db field, its created by our \"decorator\" - anonymous function using helper and model\n        );\n    }\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return bool\n     *\/\n    public function anonymize($customer)\n    {\n        return $this->_massAnonymize($this->getSocialAccounts($customer), $this->getRemovePhotoCallback());\n    }\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return bool\n     *\/\n    public function erase($customer)\n    {\n        return $this->_massErase($this->getSocialAccounts($customer), $this->getRemovePhotoCallback());\n    }\n    \/\/ $this->getRemovePhotoCallback() - is used to remove profile photo. Returns function that will be called before anonymization\/erasure procedure and will delete the picture file.\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return array|null\n     *\/\n    public function export($customer)\n    {\n        return $this->_massExport($this->getSocialAccounts($customer));\n    }\n\n    \/**\n     * @param Mage_Customer_Model_Customer $customer\n     * @return array\n     *\/\n    protected function getSocialAccounts($customer)\n    {\n        \/** @var Plumrocket_SocialLogin_Model_Mysql4_Account_Collection $collection *\/\n        $collection = Mage::getResourceModel('pslogin\/account_collection');\n        $collection->addFieldToFilter('customer_id', $customer->getId());\n\n        return $collection->getItems();\n    }\n\n    \/**\n     * @return Closure\n     *\/\n    private function getRemovePhotoCallback()\n    {\n        $io            = new Varien_Io_File();\n        \/** @var Plumrocket_SocialLogin_Helper_Data $psLoginHelper *\/\n        $psLoginHelper = Mage::helper('pslogin');\n        \/** @var Plumrocket_GDPR_Helper_Data $gdprHelper *\/\n        $gdprHelper    = Mage::helper('prgdpr');\n\n        \/**\n         * @param Plumrocket_SocialLogin_Model_Account $model\n         *\/\n        $removePhotoCallback = function($model) use ($io, $psLoginHelper, $gdprHelper)\n        {\n            $photo = $psLoginHelper->getAbsolutePhotoPath($model->getCustomerId());\n            if ($photo) {\n                if (!$io->rm($photo)) {\n                    $gdprHelper->logError('Unlink file ' . $photo . ' failed');\n                }\n            }\n\n            $photo = $psLoginHelper->getAbsolutePhotoPath($model->getCustomerId(), $model->getType());\n            if ($photo) {\n                if (!$io->rm($photo)) {\n                    $gdprHelper->logError('Unlink file ' . $photo . ' failed');\n                }\n            }\n        };\n\n        return $removePhotoCallback;\n    }\n\n    \/**\n     * @return Closure\n     *\/\n    private function getPhotoDecorator()\n    {\n        return function($photo, $model)\n        {\n            \/** @var Plumrocket_SocialLogin_Model_Account $model *\/\n            $photo = Mage::helper('pslogin')->getPhotoPath(false, $model->getCustomerId(), $model->getType());\n\n            if (!$photo) {\n                $photo = $model->getAccountImage();\n            }\n\n            return $photo;\n        };\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<h2 id=\"gdpr-developer-s-faq\">GDPR Developer\u2019s FAQ:<\/h2>\n\n\n\n<ol><li><strong>How do I change the default Magento 1 GDPR config?<\/strong>Edit files in folder:<\/li><\/ol>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/community\/Plumrocket\/GDPR\/Model\/Processor<\/code><\/pre><\/div>\n\n\n\n<p><strong>2. Can I anonymize all data instead of deleting it?<\/strong>Yes, you can. In order to enable or disable the erasure\/anonymization, you must set the value returned by the method <strong>isEraseMode<\/strong> in file<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-bash\">\/app\/code\/community\/Plumrocket\/GDPR\/Helper\/Config.php<\/code><\/pre><\/div>\n\n\n\n<p>to &#8220;false&#8221;.<\/p>\n\n\n\n<p>However, please note, that you can only enable the anonymization for a part of data, see more details below:<\/p>\n\n\n\n<p><strong>Data that can be erased or anonymized:<\/strong><\/p>\n\n\n\n<ul><li>customer_address<\/li><li>customer_information<\/li><li>customer_log<\/li><li>log_of_account_removal_requests<\/li><li>reviews<\/li><\/ul>\n\n\n\n<p><strong>Data that is always erased:<\/strong><\/p>\n\n\n\n<ul><li>price_and_stock_alerts<\/li><li>compare_products<\/li><li>email_in_queue<\/li><li>enterprise_customerbalance<\/li><li>enterprise_giftregistry<\/li><li>enterprise_giftregistry_person<\/li><li>enterprise_invitation<\/li><li>enterprise_reward<\/li><li>log_of_account_data_downloads<\/li><li>log_of_customer_consents<\/li><li>order_gift_messages<\/li><li>poll_vote<\/li><li>addresses_saves_in_cart<\/li><li>cart_information<\/li><li>cart_flat<\/li><li>products_in_cart<\/li><li>forgot_password<\/li><li>newsletter_subscriber<\/li><li>rating<\/li><li>wishlist<\/li><\/ul>\n\n\n\n<p><strong>Data that is always anonymized:<\/strong><\/p>\n\n\n\n<ul><li>archive_order<\/li><li>archive_creditmemo<\/li><li>archive_invoice<\/li><li>archive_shipment<\/li><li>enterprise_rma<\/li><li>order_addresses<\/li><li>order_information<\/li><\/ul>\n\n\n\n<p><strong>3. I have implemented the GDPR support in my third-party extension, can I share it with you?<\/strong> Yes, absolutely. We can add the built-in support of the third-party extension to our GDPR module after we review your code. Please contact <a href=\"\/contacts\" target=\"_blank\" rel=\"noopener noreferrer nofollow\">our tech support<\/a> and submit your request.<\/p>\n\n\n\n<p><strong>4. What data and Magento tables are affected by the GDPR extension?<\/strong> During download, deletion or anonymization process, the following database tables are affected:<\/p>\n\n\n\n<figure class=\"wp-block-table dev_table_twocolumn\"><table><tbody><tr><th>Magento 1.x Community Edition (CE)<\/th><th>Magento 1.x Enterprise Edition (EE)<\/th><\/tr><tr><td>customer_entity<br>customer_entity<br>customer_entity_*<br>product_alert_price<br>product_alert_stock<br>core_email_queue_recipients<br>customer_flowpassword<br>customer_address_entity<br>customer_address_entity_*<br>review<br>review_detail<br>wishlist<br>wishlist_item<br>catalog_compare_item<br>newsletter_subscriber<br>poll_vote<br>poll_answer<br>rating_option_vote<br>log_quote<br>log_url<br>log_visitor<br>log_visitor_info<br>log_customer<br>sales_flat_order<br>sales_flat_order_address<br>sales_flat_order_grid<br>sales_flat_order_item<br>gift_message<br>sales_flat_quote<br>sales_flat_quote_address<br>plumrocket_gdpr_consent<br>plumrocket_gdpr_eraser_log<br>plumrocket_gdpr_exporter_log<\/td><td>customer_entity<br>customer_entity_*<br>product_alert_price<br>product_alert_stock<br>customer_address_entity<br>customer_address_entity_*<br>review<br>review_detail<br>wishlist<br>wishlist_item<br>catalog_compare_item<br>newsletter_subscriber<br>poll_vote<br>poll_answer<br>rating_option_vote<br>log_quote<br>log_url<br>log_visitor<br>log_visitor_info<br>log_customer<br>sales_flat_order<br>sales_flat_order_address<br>sales_flat_order_grid<br>sales_flat_order_item<br>gift_message<br>sales_flat_quote<br>sales_flat_quote_address<br>enterprise_rma<br>enterprise_rma_grid<br>enterprise_rma_item_entity<br>enterprise_rma_item_entity_*<br>enterprise_giftregistry_entity<br>enterprise_giftregistry_person<br>enterprise_sales_order_grid_archive<br>enterprise_sales_creditmemo_grid_archive<br>enterprise_sales_invoice_grid_archive<br>enterprise_sales_shipment_grid_archive<br>enterprise_customerbalance<br>enterprise_invitation<br>enterprise_reward<br>plumrocket_gdpr_consent<br>plumrocket_gdpr_eraser_log<br>plumrocket_gdpr_exporter_log<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>See Magento <a href=\"https:\/\/devdocs.magento.com\/guides\/v2.2\/architecture\/gdpr\/magento-1x.html\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"> Magento DevDocs<\/a> for more information about the Magento 1.x GDPR compliance and data storage.<\/p>\n\n\n\n<h2 id=\"adding-consent-checkboxes-manually\">Adding Consent Checkboxes Manually<\/h2>\n\n\n\n<p>Use the documentation below to manually place checkboxes in the needed location of the page. At the moment 3 checkbox locations are supported: registration, checkout or newsletter subscription forms.<\/p>\n\n\n\n<p>Please note, you must first add the &#8220;Consent Checkboxes&#8221; in the Magento System Configuration -> GDPR -> Consent Checkboxes. See <a href=\"\/docs\/magento-1-gdpr\/v1\/configuration\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">wiki configuration<\/a> page for more details.<\/p>\n\n\n\n<p>Example 1. Displaying Checkboxes Using Structural Blocks<\/p>\n\n\n\n<p><strong>If your page is built using structural blocks (core\/text_list blocks), then you should use the code from the example below.<\/strong><\/p>\n\n\n\n<p>In this example we will add checkboxes on the Registration Page. Add structural block to the XML layout file:<\/p>\n\n\n\n<p>Open the file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-\">\/app\/design\/frontend\/base\/default\/layout\/your_module_layout_file.xml<\/code><\/pre><\/div>\n\n\n\n<p>and add the code as shown below:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;reference name=\"form.additional.info\">\n    &lt;block type=\"prgdpr\/checkboxes\" name=\"prgdpr.register.checkbox\">\n        &lt;action method=\"setTemplate\" ifconfig=\"prgdpr\/general\/enable\">\n            &lt;template>prgdpr\/form\/checkbox.phtml&lt;\/template>\n       &lt;\/action>\n       &lt;action method=\"setType\">&lt;type>register&lt;\/type>&lt;\/action>\n    &lt;\/block>\n&lt;\/reference><\/code><\/pre><\/div>\n\n\n\n<p><strong><i>Where:<\/i>&#8220;type&#8221; argument describes the type of the checkbox. E.G:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;action method=\"setType\">&lt;type>PageType&lt;\/type>&lt;\/action><\/code><\/pre><\/div>\n\n\n\n<p><i>&#8220;PageType&#8221; can have the following values: &#8220;register&#8221;, &#8220;newsletter&#8221; or &#8220;checkout&#8221;.<\/i><\/p>\n\n\n\n<p>Example 2. Displaying Checkboxes Using Layout Blocks<\/p>\n\n\n\n<p><strong>Create layout blocks (core\/template) if you need to add checkboxes within HTML content. Use the code from the example below.<\/strong><\/p>\n\n\n\n<p>In this example we will add checkboxes into the Newsletter Subscription form.<\/p>\n\n\n\n<p>Open the file:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-\">\/app\/design\/frontend\/base\/default\/template\/newsletter\/subscribe.phtml<\/code><\/pre><\/div>\n\n\n\n<p>and add the highlighted code as shown below:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre data-line=\"16-25\"><code class=\"language-markup\">&lt;div class=\"block block-subscribe\">\n &lt;div class=\"block-title\">\n &lt;strong>&lt;span>&lt;?php echo $this->__('Newsletter') ?>&lt;\/span>&lt;\/strong>\n &lt;\/div>\n &lt;form action=\"&lt;?php echo $this->getFormActionUrl() ?>\" method=\"post\" id=\"newsletter-validate-detail\">\n &lt;div class=\"block-content\">\n &lt;div class=\"form-subscribe-header\">\n &lt;label for=\"newsletter\">&lt;?php echo $this->__('Sign Up for Our Newsletter:') ?>&lt;\/label>\n &lt;\/div>\n &lt;div class=\"input-box\">\n &lt;input type=\"text\" name=\"email\" id=\"newsletter\" title=\"&lt;?php echo Mage::helper('core')->quoteEscape($this->__('Sign up for our newsletter')) ?>\" class=\"input-text required-entry validate-email\" \/>\n &lt;\/div>\n &lt;div class=\"actions\">\n &lt;button type=\"submit\" title=\"&lt;?php echo Mage::helper('core')->quoteEscape($this->__('Subscribe')) ?>\" class=\"button\">&lt;span>&lt;span>&lt;?php echo $this->__('Subscribe') ?>&lt;\/span>&lt;\/span>&lt;\/button>\n &lt;\/div>\n &lt;\/div>\n &lt;div class=\"prgdpr-newsletter-checkboxes-container\">&lt;\/div>\n &lt;script>\n pjQuery_1_12_4(document).ready(function($) {\n $.get('&lt;?php echo $this->getUrl('prgdpr\/newsletter\/html') ?>', function (data) {\n $('.prgdpr-newsletter-checkboxes-container').each(function (index, elem) {\n $(elem).html(data);\n });\n })\n });\n &lt;\/script>\n &lt;\/form>\n &lt;script type=\"text\/javascript\">\n \/\/&lt;![CDATA[\n var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');\n \/\/]]>\n &lt;\/script>\n&lt;\/div><\/code><\/pre><\/div>\n\n\n\n<h4 id=\"displaying-checkboxes-on-checkout-page\">Displaying Checkboxes On Checkout Page<\/h4>\n\n\n\n<p><i>Plumrocket GDPR extension uses native Magento functionality of &#8220;Terms and Conditions&#8221; (Agreements) to display GDPR consent checkboxes on checkout page. This allows you to stay compatible with majority of third party extensions. Consent validation and logging also replicates this functionality. In order to display GDPR checkboxes make sure that your third party checkout extension supports native Magento &#8220;Terms and Conditions&#8221;.<\/i><\/p>\n\n\n\n<p><i>Go to your <strong>&#8220;Magento Admin -&gt; Sales -&gt; Terms and Conditions&#8221;<\/strong> to view this functionality.<\/i><\/p>\n\n\n\n<h2 id=\"blocking-non-essential-cookies\">Blocking non-essential Cookies<\/h2>\n\n\n\n<p>Plumrocket GDPR extension uses the native Magento &#8220;Cookie Restriction Mode&#8221; functionality to display Cookie Restriction Notice Block. It allows you to block all non-essential cookies until visitor consent is given. Only after the visitor consent is given (eg: &#8220;Allow Cookies&#8221; button is pressed), the non-essential cookies will be created.<\/p>\n\n\n\n<p>According to GDPR, non-essential cookies, such as those used for analytics, cookies from advertisers or third parties, including affiliates and those that identify a user when he returns to the website should not be used until the consent is provided.<\/p>\n\n\n\n<p><strong>If your JavaScript code creates cookies, you can block it from execution, until the customer consent is given. To do so, copy the code below and insert your JavaScript in the highlighted section:<\/strong><\/p>\n\n\n\n<p><i>Copy File:<\/i><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-\">\/app\/design\/frontend\/base\/default\/template\/prgdpr\/cookie\/alert.phtml<\/code><\/pre><\/div>\n\n\n\n<p><i>To the folder with your Magento theme:<\/i><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-\">\/app\/design\/frontend\/rwd\/default\/template\/prgdpr\/cookie\/alert.phtml<\/code><\/pre><\/div>\n\n\n\n<p><i>Where &#8220;rwd&gt;\/default&#8221; is the name of your theme name \/ package name<\/i><\/p>\n\n\n\n<p><strong>Then add\/edit the following code:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-php\">&lt;?php if ($this->isAllowGtm()) : ?>\n    &lt;script type=\"text\/javascript\">\n        var gtm_tag = document.createElement('script');\n        gtm_tag.type = 'text\/javascript';\n        gtm_tag.text = '(function(w,d,s,l,i){w[l]=w[l]||[];\n        w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});\n        var f=d.getElementsByTagName(s)[0],j=d.createElement(s),\n        dl=l!='dataLayer'?'&amp;l='+l:'';j.async=true;j\n        .src='https:\/\/www.googletagmanager.com\/gtm.js?id='+i+dl;\n        f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer',\n            '&lt;?php echo $this->getGtmContainerId(); ?>');';\n        document.body.appendChild(gtm_tag);\n \n    \/\/ Add your js code here\n    &lt;\/script>\n&lt;?php endif; ?><\/code><\/pre><\/div>\n\n\n\n<h2 id=\"developer-s-guide-for-geoip-functionality\">Developer\u2019s Guide for GeoIP Functionality<\/h2>\n\n\n\n<p>Plumrocket GDPR extension comes bundled with <strong>Plumrocket GeoIP Lookup extension<\/strong> . This add-on is used to identify customer\u2019s location from IP and deliver targeted content. With this plugin enabled, GDPR can be configured to display cookie restriction notice and consent checkboxes only for visitors from EU countries or custom list of countries. Learn more about GeoIP Rest API and other methods of retrieving customer location here &#8211; <strong><a href=\"\/docs\/magento-geoip-lookup\/v1\/devguide\n\" title=\"Magento GeoIP Lookup v1.x Developers Guide and API Reference\">Magento GeoIP Lookup Developers Guide and API Reference<\/a>.<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this developer documentation for the&nbsp;Magento GDPR &amp; CCPA Extension, you will find step-by-step instructions, sample code, and API references to fully customize your plugin. Downloading, Deleting and Anonymizing Customer Data Plumrocket GDPR Magento 1 extension allows you to manage any third-party data stored in your Magento database. Use this manual to make your third-party &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Magento 1 GDPR v1.x Developer Guide and API Reference&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[215],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento GDPR v1.x Developer Guide and API Reference - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"In this developer documentation for the&nbsp;Magento GDPR &amp; CCPA Extension, you will find step-by-step instructions, sample code, and API references\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 1 GDPR v1.x Developer Guide and API Reference\" \/>\n<meta property=\"og:description\" content=\"In this developer documentation for the&nbsp;Magento GDPR &amp; CCPA Extension, you will find step-by-step instructions, sample code, and API references\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-28T16:03:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-09-27T10:22:16+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Magento GDPR v1.x Developer Guide and API Reference - Plumrocket Documentation","description":"In this developer documentation for the&nbsp;Magento GDPR &amp; CCPA Extension, you will find step-by-step instructions, sample code, and API references","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide","og_locale":"en_US","og_type":"article","og_title":"Magento 1 GDPR v1.x Developer Guide and API Reference","og_description":"In this developer documentation for the&nbsp;Magento GDPR &amp; CCPA Extension, you will find step-by-step instructions, sample code, and API references","og_url":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide","og_site_name":"Plumrocket Documentation","article_published_time":"2020-02-28T16:03:54+00:00","article_modified_time":"2021-09-27T10:22:16+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide#webpage","url":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide","name":"Magento 1 GDPR v1.x Developer Guide and API Reference - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"datePublished":"2020-02-28T16:03:54+00:00","dateModified":"2021-09-27T10:22:16+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20"},"description":"In this developer documentation for the&nbsp;Magento GDPR &amp; CCPA Extension, you will find step-by-step instructions, sample code, and API references","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1\/devguide#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento Extensions","item":"https:\/\/plumrocket.com\/magento-1-extensions"},{"@type":"ListItem","position":2,"name":"Magento GDPR &amp; CCPA","item":"https:\/\/plumrocket.com\/magento-1-gdpr"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr"},{"@type":"ListItem","position":4,"name":"v1","item":"https:\/\/plumrocket.com\/docs\/magento-1-gdpr\/v1"},{"@type":"ListItem","position":5,"name":"Developer Guide"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/38b360639b934d6c984ee4f3ffce7d20","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/72392a92ae750c66560be284502b6676?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/72392a92ae750c66560be284502b6676?s=96&d=mm&r=g","caption":"Plumrocket"},"sameAs":["https:\/\/plumrocket.com\/docs"]}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/309"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=309"}],"version-history":[{"count":2,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/309\/revisions"}],"predecessor-version":[{"id":24519,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/309\/revisions\/24519"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}