first commit
This commit is contained in:
36
modules/roy_contactinfo/Readme.md
Normal file
36
modules/roy_contactinfo/Readme.md
Normal file
@@ -0,0 +1,36 @@
|
||||
# Contact information
|
||||
|
||||
## About
|
||||
|
||||
Allows you to display additional information about your store\'s customer service.
|
||||
|
||||
## Contributing
|
||||
|
||||
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
|
||||
|
||||
### Requirements
|
||||
|
||||
Contributors **must** follow the following rules:
|
||||
|
||||
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
|
||||
* Do not update the module's version number.
|
||||
* Follow [the coding standards][1].
|
||||
|
||||
### Process in details
|
||||
|
||||
Contributors wishing to edit a module's files should follow the following process:
|
||||
|
||||
1. Create your GitHub account, if you do not have one already.
|
||||
2. Fork the ps_contactinfo project to your GitHub account.
|
||||
3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation.
|
||||
4. Create a branch in your local clone of the module for your changes.
|
||||
5. Change the files in your branch. Be sure to follow [the coding standards][1]!
|
||||
6. Push your changed branch to your fork in your GitHub account.
|
||||
7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3].
|
||||
8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code.
|
||||
|
||||
That's it: you have contributed to this open-source project! Congratulations!
|
||||
|
||||
[1]: http://doc.prestashop.com/display/PS16/Coding+Standards
|
||||
[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message
|
||||
[3]: https://help.github.com/articles/using-pull-requests
|
||||
19
modules/roy_contactinfo/composer.json
Normal file
19
modules/roy_contactinfo/composer.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "prestashop/ps_contactinfo",
|
||||
"description": "PrestaShop module ps_contactinfo",
|
||||
"homepage": "https://github.com/PrestaShop/ps_contactinfo",
|
||||
"license": "AFL - Academic Free License (AFL 3.0)",
|
||||
"authors": [
|
||||
{
|
||||
"name": "PrestaShop SA",
|
||||
"email": "contact@prestashop.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
},
|
||||
"type": "prestashop-module"
|
||||
}
|
||||
12
modules/roy_contactinfo/config.xml
Normal file
12
modules/roy_contactinfo/config.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>roy_contactinfo</name>
|
||||
<displayName><![CDATA[Roy Contact information]]></displayName>
|
||||
<version><![CDATA[3.0.0]]></version>
|
||||
<description><![CDATA[Allows you to display additional information about your store's customer service.]]></description>
|
||||
<author><![CDATA[RoyThemes]]></author>
|
||||
<tab><![CDATA[]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
12
modules/roy_contactinfo/config_pl.xml
Normal file
12
modules/roy_contactinfo/config_pl.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>roy_contactinfo</name>
|
||||
<displayName><![CDATA[Roy Contact information]]></displayName>
|
||||
<version><![CDATA[3.0.0]]></version>
|
||||
<description><![CDATA[Allows you to display additional information about your store's customer service.]]></description>
|
||||
<author><![CDATA[RoyThemes]]></author>
|
||||
<tab><![CDATA[]]></tab>
|
||||
<is_configurable>0</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
35
modules/roy_contactinfo/index.php
Normal file
35
modules/roy_contactinfo/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2015 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 license@prestashop.com 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 <contact@prestashop.com>
|
||||
* @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
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../../');
|
||||
BIN
modules/roy_contactinfo/logo.png
Normal file
BIN
modules/roy_contactinfo/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.9 KiB |
34
modules/roy_contactinfo/roy_contactinfo-rich.tpl
Normal file
34
modules/roy_contactinfo/roy_contactinfo-rich.tpl
Normal file
@@ -0,0 +1,34 @@
|
||||
<div class="contact-rich">
|
||||
<h4 class="page-header">{l s='Store information' d='Shop.Theme.Global'}</h4>
|
||||
<div class="block">
|
||||
<div class="icon"><i class="material-icons"></i></div>
|
||||
<div class="data">{$contact_infos.address.formatted nofilter}</div>
|
||||
</div>
|
||||
{if $contact_infos.phone}
|
||||
<div class="block">
|
||||
<div class="icon"><i class="material-icons"></i></div>
|
||||
<div class="data">
|
||||
{l s='Call us:' d='Shop.Theme.Global'}<br/>
|
||||
<a href="tel:{$contact_infos.phone}">{$contact_infos.phone}</a>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $contact_infos.fax}
|
||||
<div class="block">
|
||||
<div class="icon"><i class="material-icons"></i></div>
|
||||
<div class="data">
|
||||
{l s='Fax:' d='Shop.Theme.Global'}<br/>
|
||||
{$contact_infos.fax}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $contact_infos.email}
|
||||
<div class="block">
|
||||
<div class="icon"><i class="material-icons"></i></div>
|
||||
<div class="data email">
|
||||
{l s='Email us:' d='Shop.Theme.Global'}<br/>
|
||||
</div>
|
||||
<a href="mailto:{$contact_infos.email}">{$contact_infos.email}</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
98
modules/roy_contactinfo/roy_contactinfo.php
Normal file
98
modules/roy_contactinfo/roy_contactinfo.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use PrestaShop\PrestaShop\Core\Module\WidgetInterface;
|
||||
|
||||
class Roy_Contactinfo extends Module implements WidgetInterface
|
||||
{
|
||||
private $templates = array (
|
||||
'callus' => 'roy_nav.tpl',
|
||||
'contactus' => 'roy_nav2.tpl',
|
||||
'rich' => 'roy_contactinfo-rich.tpl',
|
||||
'default' => 'roy_contactinfo.tpl',
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'roy_contactinfo';
|
||||
$this->author = 'RoyThemes';
|
||||
$this->version = '3.0.0';
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->getTranslator()->trans('Roy Contact information', array(), 'Modules.Roycontactinfo.Admin');
|
||||
$this->description = $this->getTranslator()->trans('Allows you to display additional information about your store\'s customer service.', array(), 'Modules.Roycontactinfo.Admin');
|
||||
$this->ps_versions_compliancy = array('min' => '1.7.2.0', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install()
|
||||
&& $this->registerHook([
|
||||
'displayNav', // Standard hook
|
||||
'displayNav1',
|
||||
'displayNav2',
|
||||
'displayFooter',
|
||||
'actionAdminStoresControllerUpdate_optionsAfter',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function renderWidget($hookName = null, array $configuration = [])
|
||||
{
|
||||
if ($hookName == null && isset($configuration['hook'])) {
|
||||
$hookName = $configuration['hook'];
|
||||
}
|
||||
|
||||
if ($hookName == 'displayNav1') {
|
||||
$template_file = $this->templates['callus'];
|
||||
} elseif ($hookName == 'displayNav2') {
|
||||
$template_file = $this->templates['contactus'];
|
||||
} elseif ($hookName == 'displayLeftColumn') {
|
||||
$template_file = $this->templates['rich'];
|
||||
} else {
|
||||
$template_file = $this->templates['default'];
|
||||
}
|
||||
|
||||
$this->smarty->assign($this->getWidgetVariables($hookName, $configuration));
|
||||
|
||||
return $this->fetch('module:'.$this->name.'/'.$template_file);
|
||||
}
|
||||
|
||||
public function getWidgetVariables($hookName = null, array $configuration = [])
|
||||
{
|
||||
$address = $this->context->shop->getAddress();
|
||||
|
||||
$contact_infos = [
|
||||
'company' => Configuration::get('PS_SHOP_NAME'),
|
||||
'address' => [
|
||||
'formatted' => AddressFormat::generateAddress($address, array(), '<br />'),
|
||||
'address1' => $address->address1,
|
||||
'address2' => $address->address2,
|
||||
'postcode' => $address->postcode,
|
||||
'city' => $address->city,
|
||||
'state' => (new State($address->id_state))->name[$this->context->language->id],
|
||||
'country' => (new Country($address->id_country))->name[$this->context->language->id],
|
||||
],
|
||||
'phone' => Configuration::get('PS_SHOP_PHONE'),
|
||||
'fax' => Configuration::get('PS_SHOP_FAX'),
|
||||
'email' => Configuration::get('PS_SHOP_EMAIL'),
|
||||
];
|
||||
|
||||
return [
|
||||
'contact_infos' => $contact_infos,
|
||||
];
|
||||
}
|
||||
|
||||
public function hookActionAdminStoresControllerUpdate_optionsAfter()
|
||||
{
|
||||
foreach ($this->templates as $template) {
|
||||
$this->_clearCache($template);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
52
modules/roy_contactinfo/roy_contactinfo.tpl
Normal file
52
modules/roy_contactinfo/roy_contactinfo.tpl
Normal file
@@ -0,0 +1,52 @@
|
||||
<div class="block-contact col-md-4 links wrapper">
|
||||
<div class="hidden-sm-down">
|
||||
<h4 class="text-uppercase block-contact-title">{l s='Store information' d='Shop.Theme.Global'}</h4>
|
||||
<img class="logo_footer" src="{$urls.img_url}logo_footer.png" />
|
||||
<p>
|
||||
{$contact_infos.address.formatted nofilter}
|
||||
{if $contact_infos.phone}
|
||||
<br>
|
||||
{* [1][/1] is for a HTML tag. *}
|
||||
{l s='Call us: [1]%phone%[/1]'
|
||||
sprintf=[
|
||||
'[1]' => '<span>',
|
||||
'[/1]' => '</span>',
|
||||
'%phone%' => $contact_infos.phone
|
||||
]
|
||||
d='Shop.Theme.Global'
|
||||
}
|
||||
{/if}
|
||||
{if $contact_infos.fax}
|
||||
<br>
|
||||
{* [1][/1] is for a HTML tag. *}
|
||||
{l
|
||||
s='Fax: [1]%fax%[/1]'
|
||||
sprintf=[
|
||||
'[1]' => '<span>',
|
||||
'[/1]' => '</span>',
|
||||
'%fax%' => $contact_infos.fax
|
||||
]
|
||||
d='Shop.Theme.Global'
|
||||
}
|
||||
{/if}
|
||||
{if $contact_infos.email}
|
||||
<br>
|
||||
{* [1][/1] is for a HTML tag. *}
|
||||
{l
|
||||
s='Email us: [1]%email%[/1]'
|
||||
sprintf=[
|
||||
'[1]' => '<a href="mailto:'|cat:$contact_infos.email|cat:'" class="dropdown">',
|
||||
'[/1]' => '</a>',
|
||||
'%email%' => $contact_infos.email
|
||||
]
|
||||
d='Shop.Theme.Global'
|
||||
}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
<div class="hidden-md-up">
|
||||
<div class="title">
|
||||
<a class="h3" href="{$urls.pages.stores}">{l s='Store information' d='Shop.Theme.Global'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
16
modules/roy_contactinfo/roy_nav.tpl
Normal file
16
modules/roy_contactinfo/roy_nav.tpl
Normal file
@@ -0,0 +1,16 @@
|
||||
<div id="_desktop_contact_link">
|
||||
<div id="contact-link">
|
||||
{if $contact_infos.phone}
|
||||
{* [1][/1] is for a HTML tag. *}
|
||||
{l
|
||||
s='Call us: [1]%phone%[/1]'
|
||||
sprintf=[
|
||||
'[1]' => '<span>',
|
||||
'[/1]' => '</span>',
|
||||
'%phone%' => $contact_infos.phone
|
||||
]
|
||||
d='Shop.Theme.Global'
|
||||
}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
3
modules/roy_contactinfo/roy_nav2.tpl
Normal file
3
modules/roy_contactinfo/roy_nav2.tpl
Normal file
@@ -0,0 +1,3 @@
|
||||
<div id="contact-link">
|
||||
<a href="{$urls.pages.contact}">{l s='Contact us' d='Shop.Theme.Global'}</a>
|
||||
</div>
|
||||
35
modules/roy_contactinfo/translations/index.php
Normal file
35
modules/roy_contactinfo/translations/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2015 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 license@prestashop.com 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 <contact@prestashop.com>
|
||||
* @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
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
0
modules/roy_contactinfo/translations/pl.php
Normal file
0
modules/roy_contactinfo/translations/pl.php
Normal file
0
modules/roy_contactinfo/translations/ru.php
Normal file
0
modules/roy_contactinfo/translations/ru.php
Normal file
Reference in New Issue
Block a user