Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

2256
modules/ps_contactinfo/composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_contactinfo</name>
<displayName><![CDATA[Contact information]]></displayName>
<version><![CDATA[3.3.3]]></version>
<description><![CDATA[Allows you to display additional information about your store&#039;s customer service.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@@ -0,0 +1,43 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<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='Modules.Contactinfo.Shop'
}
{else}
<a href="{$urls.pages.contact}">{l s='Contact us' d='Modules.Contactinfo.Shop'}</a>
{/if}
</div>
</div>

View File

@@ -0,0 +1,72 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<div class="contact-rich">
<h4>{l s='Store information' d='Shop.Theme.Global'}</h4>
<div class="block">
<div class="icon"><i class="material-icons">&#xE55F;</i></div>
<div class="data">{$contact_infos.address.formatted nofilter}</div>
</div>
{if $contact_infos.phone}
<hr/>
<div class="block">
<div class="icon"><i class="material-icons">&#xE0CD;</i></div>
<div class="data">
{l s='Call us:' d='Modules.Contactinfo.Shop'}<br/>
<a href="tel:{$contact_infos.phone}">{$contact_infos.phone}</a>
</div>
</div>
{/if}
{if $contact_infos.fax}
<hr/>
<div class="block">
<div class="icon"><i class="material-icons">&#xE0DF;</i></div>
<div class="data">
{l s='Fax:' d='Modules.Contactinfo.Shop'}<br/>
{$contact_infos.fax}
</div>
</div>
{/if}
{if $contact_infos.email && $display_email}
<hr/>
<div class="block">
<div class="icon"><i class="material-icons">&#xE158;</i></div>
<div class="data email">
{l s='Email us:' d='Modules.Contactinfo.Shop'}<br/>
{mailto address=$contact_infos.email encode="javascript"}
</div>
</div>
{/if}
{if $contact_infos.details}
<hr/>
<div class="block">
<div class="icon"><i class="material-icons">&#xE88E;</i></div>
<div class="data">
{l s='Details:' d='Modules.Contactinfo.Shop'}<br/>
{$contact_infos.details|nl2br nofilter}
</div>
</div>
{/if}
</div>

View File

@@ -0,0 +1,185 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use PrestaShop\PrestaShop\Core\Module\WidgetInterface;
class Ps_Contactinfo extends Module implements WidgetInterface
{
private $templates = [
'light' => 'nav.tpl',
'rich' => 'ps_contactinfo-rich.tpl',
'default' => 'ps_contactinfo.tpl',
];
public function __construct()
{
$this->name = 'ps_contactinfo';
$this->author = 'PrestaShop';
$this->version = '3.3.3';
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->trans('Contact information', [], 'Modules.Contactinfo.Admin');
$this->description = $this->trans('Let your customers know how to reach you, display contact information on your store.', [], 'Modules.Contactinfo.Admin');
$this->ps_versions_compliancy = ['min' => '1.7.2.0', 'max' => _PS_VERSION_];
}
public function install()
{
return parent::install()
&& Configuration::updateValue('PS_CONTACT_INFO_DISPLAY_EMAIL', 1)
&& $this->registerHook([
'displayNav', // Standard hook
'displayNav1', // For Classic-inspired themes
'displayFooter',
'displayContactRightColumn',
'displayContactLeftColumn',
'displayContactContent',
'actionAdminStoresControllerUpdate_optionsAfter',
]);
}
public function renderWidget($hookName = null, array $configuration = [])
{
if ($hookName == null && isset($configuration['hook'])) {
$hookName = $configuration['hook'];
}
if (preg_match('/^displayNav\d*$/', $hookName)) {
$template_file = $this->templates['light'];
} elseif (in_array($hookName, ['displayContactLeftColumn', 'displayContactRightColumn', 'displayLeftColumn', 'displayRightColumn'])) {
$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();
$formattedAddress = AddressFormat::generateAddress($address, [], '<br />');
$is_state_multilang = !empty(State::$definition['multilang']);
$state_name = (new State($address->id_state))->name;
$contact_infos = [
'company' => Configuration::get('PS_SHOP_NAME'),
'address' => [
'formatted' => Validate::isCleanHtml($formattedAddress) ? $formattedAddress : '',
'address1' => $address->address1,
'address2' => $address->address2,
'postcode' => $address->postcode,
'city' => $address->city,
'state' => (!empty($address->id_state) ? (new State($address->id_state))->name[$this->context->language->id] : null),
'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'),
'details' => Configuration::get('PS_SHOP_DETAILS'),
];
return [
'contact_infos' => $contact_infos,
'display_email' => Configuration::get('PS_CONTACT_INFO_DISPLAY_EMAIL'),
];
}
public function hookActionAdminStoresControllerUpdate_optionsAfter()
{
foreach ($this->templates as $template) {
$this->_clearCache($template);
}
return true;
}
public function getContent()
{
$output = [];
if (Tools::isSubmit('submitContactInfo')) {
Configuration::updateValue('PS_CONTACT_INFO_DISPLAY_EMAIL', (int) Tools::getValue('PS_CONTACT_INFO_DISPLAY_EMAIL'));
foreach ($this->templates as $template) {
$this->_clearCache($template);
}
$output[] = $this->displayConfirmation($this->trans('Settings updated.', [], 'Admin.Notifications.Success'));
Tools::redirectAdmin($this->context->link->getAdminLink('AdminModules', true) . '&conf=6&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name);
}
$helper = new HelperForm();
$helper->submit_action = 'submitContactInfo';
$field = [
'type' => 'switch',
'label' => $this->trans('Display email address', [], 'Admin.Actions'),
'name' => 'PS_CONTACT_INFO_DISPLAY_EMAIL',
'desc' => $this->trans('Your theme needs to be compatible with this feature', [], 'Modules.Contactinfo.Admin'),
'values' => [
[
'id' => 'active_on',
'value' => 1,
'label' => $this->trans('Yes', [], 'Admin.Global'),
],
[
'id' => 'active_off',
'value' => 0,
'label' => $this->trans('No', [], 'Admin.Global'),
],
],
];
$helper->fields_value['PS_CONTACT_INFO_DISPLAY_EMAIL'] = Configuration::get('PS_CONTACT_INFO_DISPLAY_EMAIL');
$output[] = $helper->generateForm([
[
'form' => [
'legend' => [
'title' => $this->displayName,
'icon' => 'icon-share',
],
'input' => [$field],
'submit' => [
'title' => $this->trans('Save', [], 'Admin.Actions'),
],
],
],
]);
return implode($output);
}
}

View File

@@ -0,0 +1,66 @@
{**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*}
<div class="block-contact col-md-3 links wrapper">
<div class="hidden-sm-down">
<p class="h4 text-uppercase block-contact-title">{l s='Store information' d='Shop.Theme.Global'}</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='Modules.Contactinfo.Shop'
}
{/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='Modules.Contactinfo.Shop'
}
{/if}
{if $contact_infos.email && $display_email}
<br>
{l s='Email us:' d='Modules.Contactinfo.Shop'}
{mailto address=$contact_infos.email encode="javascript"}
{/if}
</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>

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
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;

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
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;

View File

@@ -0,0 +1,33 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_3_3_2($object)
{
return $object->registerHook(['displayContactRightColumn', 'displayContactLeftColumn']);
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_2_0($object)
{
return Configuration::deleteByName('BLOCKCONTACT_TELNUMBER')
&& Configuration::deleteByName('BLOCKCONTACT_EMAIL');
}