Skip to content

Commit

Permalink
Merge pull request #21 from florian-nolte/gdpr
Browse files Browse the repository at this point in the history
Display consent checkbox (from psgdpr module) in contactform.
  • Loading branch information
eternoendless authored May 23, 2018
2 parents bef34d2 + f97cf09 commit a2a7d20
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<module>
<name>contactform</name>
<displayName><![CDATA[Contact form]]></displayName>
<version><![CDATA[4.0.0]]></version>
<version><![CDATA[4.1.0]]></version>
<description><![CDATA[Description for contact form module]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>0</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>
</module>
7 changes: 4 additions & 3 deletions contactform.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct()
$this->name = 'contactform';
$this->author = 'PrestaShop';
$this->tab = 'front_office_features';
$this->version = '4.0.0';
$this->version = '4.1.0';
$this->bootstrap = true;

parent::__construct();
Expand All @@ -70,7 +70,7 @@ public function __construct()
*/
public function install()
{
return parent::install();
return parent::install() && $this->registerHook('registerGDPRConsent');
}

/**
Expand Down Expand Up @@ -309,7 +309,8 @@ public function getWidgetVariables($hookName = null, array $configuration = [])
return [
'contact' => $this->contact,
'notifications' => $notifications,
'token' => $this->context->cookie->contactFormToken
'token' => $this->context->cookie->contactFormToken,
'id_module' => $this->id
];
}

Expand Down
34 changes: 34 additions & 0 deletions upgrade/Upgrade-4.1.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <[email protected]>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/

if (!defined('_PS_VERSION_')) {
exit;
}

function upgrade_module_4_1_0($object)
{
return $object->registerHook('registerGDPRConsent');
}
2 changes: 2 additions & 0 deletions views/templates/widget/contactform.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
<span>{l s='Message' d='Modules.Contactform.Shop'}</span>
<textarea cols="67" rows="3" name="message">{if $contact.message}{$contact.message}{/if}</textarea>
</label>

{hook h='displayGDPRConsent' id_module=$id_module}

</section>

Expand Down

0 comments on commit a2a7d20

Please sign in to comment.