Merge branch 'master' of gitlab.antadis.fr:dev-antadis/toutpratique

This commit is contained in:
Marion Muszynski 2015-11-06 11:19:24 +01:00
commit fd84386473
40 changed files with 987 additions and 297 deletions

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
.gitconfig
.viminfo
.bash_history
.mysql_history
.htpasswd
.buildpath
.htaccess

View File

@ -36,8 +36,8 @@ if (Configuration::get('PS_JS_HTML_THEME_COMPRESSION'))
$smarty->registerPlugin("function","printCouleur", "print_couleur");
function print_couleur($params, $smarty) {
$colors = ['#d2e1e6', '#d7e9e7', '#ebd1dc',
'#ddd6e1', '#efd2d4', '#ebebd9'];
$colors = array('#d2e1e6', '#d7e9e7', '#ebd1dc',
'#ddd6e1', '#efd2d4', '#ebebd9');
return $colors[array_rand($colors)];
}

View File

@ -1,5 +1,7 @@
<?php
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
if (!class_exists('CmsPsEdito')) {
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
}
class HomeEditoControllerCore extends FrontController
{

View File

@ -1,5 +1,7 @@
<?php
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
if (!class_exists('CmsPsEdito')) {
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
}
class PostEditoControllerCore extends FrontController
{

View File

@ -22,7 +22,7 @@
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
*/
require(dirname(__FILE__).'/config/config.inc.php');
Dispatcher::getInstance()->dispatch();

View File

@ -23,7 +23,7 @@ class AdvMenuLink extends ObjectModel {
// Lang fields
'url' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isUrl', 'required' => FALSE, 'size' => 255),
'title' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName', 'required' => TRUE, 'size' => 40),
'title' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName', 'required' => TRUE, 'size' => 255),
'text' => array('type' => self::TYPE_HTML, 'lang' => TRUE, 'validate' => 'isCleanHtml')
)
);

View File

@ -220,6 +220,11 @@ class Blockadshooks extends Module
return $this->runByHook('displayPubliciteRight');
}
public function hookDisplayPubliciteRightBottom($params)
{
return $this->runByHook('displayPubliciteRightBottom');
}
public function hookDisplayPubliciteBottom($params)
{
return $this->runByHook('displayPubliciteBottom');

View File

@ -76,6 +76,7 @@ class Categorieshome extends Module
$collection = new Collection('Category', $id_lang);
$collection->where('id_parent', '=', '2');
$collection->where('active', '=', '1');
$collection->orderBy('position', 'ASC');
return $collection->getResults();
}

View File

@ -5,99 +5,99 @@ require_once dirname(__FILE__).'/classes/CmsComments.php';
require_once dirname(__FILE__).'../../cmsps/classes/CmsPsPost.php';
$result = array();
$id_element = Tools::getValue('id_element');
$id_element = Tools::getValue('id_element');
$cmsps = new CmsPsPost($id_element);
$code = Tools::getValue('g-recaptcha-response');
if(isValid($code) == FALSE) {
$result['errors'] = true;
$result['html'] = 'Êtes-vous un robot ? Veuillez cocher la case svp.';
die(Tools::jsonEncode($result));
$result['errors'] = true;
$result['html'] = 'Êtes-vous un robot ? Veuillez cocher la case svp.';
die(Tools::jsonEncode($result));
}
if (Validate::isLoadedObject($cmsps)) {
$name = Tools::getValue('name');
$email = Tools::getValue('email');
$commentaire = Tools::getValue('comments');
$name = Tools::getValue('name');
$email = Tools::getValue('email');
$commentaire = Tools::getValue('comments');
if (Tools::getValue('offre')) {
$context = Context::getContext();
if (!isNewsletterRegistered($email, $context->shop->id)) {
$sql = '
INSERT INTO '._DB_PREFIX_.'newsletter (id_shop, id_shop_group, email, newsletter_date_add, ip_registration_newsletter, http_referer, active)
VALUES
('.$context->shop->id.',
'.$context->shop->id_shop_group.',
\''.pSQL($email).'\',
NOW(),
\''.pSQL(Tools::getRemoteAddr()).'\',
(
SELECT c.http_referer
FROM '._DB_PREFIX_.'connections c
WHERE c.id_guest = '.(int)$context->customer->id.'
ORDER BY c.date_add DESC LIMIT 1
),
1
)';
Db::getInstance()->execute($sql);
}
}
if (Tools::getValue('offre')) {
$context = Context::getContext();
if (!isNewsletterRegistered($email, $context->shop->id)) {
$sql = '
INSERT INTO '._DB_PREFIX_.'newsletter (id_shop, id_shop_group, email, newsletter_date_add, ip_registration_newsletter, http_referer, active)
VALUES
('.$context->shop->id.',
'.$context->shop->id_shop_group.',
\''.pSQL($email).'\',
NOW(),
\''.pSQL(Tools::getRemoteAddr()).'\',
(
SELECT c.http_referer
FROM '._DB_PREFIX_.'connections c
WHERE c.id_guest = '.(int)$context->customer->id.'
ORDER BY c.date_add DESC LIMIT 1
),
1
)';
Db::getInstance()->execute($sql);
}
}
$comments = new CmsComments();
$comments->published = 0;
$comments->name = $name;
$comments->email = $email;
$comments->comments = $commentaire;
$comments->id_element = $cmsps->id;
$comments = new CmsComments();
$comments->published = 0;
$comments->name = $name;
$comments->email = $email;
$comments->comments = $commentaire;
$comments->id_element = $cmsps->id;
if ($comments->add()) {
$result['errors'] = false;
}
if ($comments->add()) {
$result['errors'] = false;
}
} else {
$result['errors'] = true;
$result['errors'] = true;
}
die(Tools::jsonEncode($result));
function isValid($code)
{
if (empty($code)) {
return false;
}
$params = [
'secret' => '6LchYwsTAAAAAFSK4EEtSJV3kJon6H7bEgOTpLA0',
'response' => $code
];
$url = "https://www.google.com/recaptcha/api/siteverify?" . http_build_query($params);
if (function_exists('curl_version')) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
} else {
$response = file_get_contents($url);
}
if (empty($code)) {
return false;
}
$params = [
'secret' => '6LchYwsTAAAAAFSK4EEtSJV3kJon6H7bEgOTpLA0',
'response' => $code
];
$url = "https://www.google.com/recaptcha/api/siteverify?" . http_build_query($params);
if (function_exists('curl_version')) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_TIMEOUT, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
} else {
$response = file_get_contents($url);
}
if (empty($response) || is_null($response)) {
return false;
}
if (empty($response) || is_null($response)) {
return false;
}
$json = json_decode($response);
return $json->success;
$json = json_decode($response);
return (bool) $json->success;
}
function isNewsletterRegistered($customer_email, $id_shop) {
$sql = 'SELECT `email`
FROM '._DB_PREFIX_.'newsletter
WHERE `email` = \''.pSQL($customer_email).'\'
AND id_shop = '.$id_shop;
$sql = 'SELECT `email`
FROM '._DB_PREFIX_.'newsletter
WHERE `email` = \''.pSQL($customer_email).'\'
AND id_shop = '.$id_shop;
if (Db::getInstance()->getRow($sql))
return TRUE;
if (Db::getInstance()->getRow($sql))
return TRUE;
return FALSE;
return FALSE;
}

View File

@ -95,6 +95,13 @@ class Cms_Pack extends Module
$result['price_total'] = array_sum($price);
$result['pack'] = $pack->title;
if ($pack->id_cart_rule) {
$result['remise'] = true;
$result['remise_percent'] = $pack->getPercentageReduction();
} else {
$result['remise']= false;
}
}
return $result;

View File

@ -67,9 +67,12 @@ function addCmsPackToCart(checkboxes, pack) {
}
}
});
ajaxCart.updateInfoCart(quantity_add);
$('#layer_cart_pack #product-info').html(html);
if($('#layer_cart_pack').hasClass('open') == false)
$('#layer_cart_pack').addClass('open');
$('.layer_cart_overlay_pack').show();
setTimeout(function(){
ajaxCart.updateInfoCart(quantity_add);
$('#layer_cart_pack #product-info').html(html);
if($('#layer_cart_pack').hasClass('open') == false)
$('#layer_cart_pack').addClass('open');
$('.layer_cart_overlay_pack').show();
}, 1500);
}

View File

@ -2,9 +2,14 @@
<p class="col-md-offset-2 title">
{l s='La séléction de produit pour vous aider' mod='cms_pack'}
</p>
<p class="desc">
{l s='+ de produit = + de réductions' mod='cms_pack'}
</p>
{if $pack.remise}
<p class="desc">
<span class="remise">
{l s='Vous économisez'} <span>{$pack.remise_percent} %</span> {l s='sur cette sélection'}
</span>
{l s='+ de produit = + de réductions' mod='cms_pack'}
</p>
{/if}
<div class="products">
<div class="inner">

View File

@ -157,7 +157,10 @@ class CmsPsCategory extends ObjectModel {
$collection_post->orderBy('date_add', 'DESC');
$collection_post->setPageSize(1);
$tips_category = $collection_post->getFirst();
return CmsPsPost::injectsData($tips_category, TRUE);
if(!empty($tips_category))
return CmsPsPost::injectsData($tips_category, TRUE);
return array();
}
public function getArticles($id_lang, $limit = 10, $num_page, $total = FALSE, $order_by = 'date_add', $filter_word = '')

View File

@ -107,7 +107,7 @@ class CmsPsPost extends ObjectModel {
foreach ($articles as $key => $article) {
$article->new = $article->isNew();
$article->id = $article->id_post;
if (file_exists(_PS_ROOT_DIR_.'/img/cms_post/'.$article->id_post.'/small.jpg')) {
if (Tools::file_exists_cache(_PS_ROOT_DIR_.'/img/cms_post/'.$article->id_post.'/small.jpg')) {
$article->have_image = true;
} else {
$article->have_image = false;

View File

@ -7,110 +7,112 @@ include_once dirname(__FILE__).'/classes/CmsPsEdito.php';
include_once dirname(__FILE__).'/classes/CmsPsCategory.php';
include_once dirname(__FILE__).'/../cms_extrafields/classes/CmsPsExtraFieldsValue.php';
class CmsPS extends Module
{
public function __construct()
if (!class_exists('CmsPS')) {
class CmsPS extends Module
{
$this->name = 'cmsps';
$this->tab = 'front_office_features';
$this->version = '1.0';
$this->author = 'Antadis';
$this->need_instance = 0;
public function __construct()
{
$this->name = 'cmsps';
$this->tab = 'front_office_features';
$this->version = '1.0';
$this->author = 'Antadis';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('CMS component by Antadis');
$this->description = $this->l('Manage CMS data in Prestashop');
$this->secure_key = Tools::encrypt($this->name);
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}
public function install()
{
if (Shop::isFeatureActive())
Shop::setContext(Shop::CONTEXT_ALL);
if (!parent::install()
|| !$this->registerHook('displayRelatedProduct')
|| !$this->registerHook('displayProductCategory')
|| !$this->registerHook('footer')
|| !$this->createTables()
)
return false;
}
public function createTables (){
return true;
}
public function hookdisplayFooter() {
$this->context->controller->addJS(($this->_path).'voting.js', 'all');
if($this->context->controller->php_self == 'categorycms' && $this->context->controller->categorycms->id_category == 1){
$this->context->controller->addJqueryUI('ui.autocomplete', $theme = 'toutpratique', $check_dependencies = true);
$allTags = CmsPsExtraFieldsValue::getAll(false,true,false,Context::getContext()->language->id);
$tags = array();
foreach ($allTags as $key => $value) {
$tags[] = array(
'value' => $value->value,
'id' => $value->id_cmsps_extrafields_value,
);
}
$allSupports = CmsPsExtraFieldsValue::getAll(false,false,true,Context::getContext()->language->id);
$supports = array();
foreach ($allSupports as $key => $value) {
$supports[] = array(
'value' => $value->value,
'id' => $value->id_cmsps_extrafields_value,
);
}
global $smarty;
$smarty->assign(array(
'tags' => $tags,
'supports' => $supports
));
$this->displayName = $this->l('CMS component by Antadis');
$this->description = $this->l('Manage CMS data in Prestashop');
$this->secure_key = Tools::encrypt($this->name);
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}
}
public function hookdisplayRelatedProduct($params) {
$id_product = $params['product']->id;
$relations = CmsPsPost::getPostRelationWithProduct($id_product, 3, Context::getContext()->language->id);
if ($relations) {
$this->smarty->assign(array(
'relations' => $relations,
));
return $this->display(__FILE__, 'product_relationscms.tpl');
public function install()
{
if (Shop::isFeatureActive())
Shop::setContext(Shop::CONTEXT_ALL);
if (!parent::install()
|| !$this->registerHook('displayRelatedProduct')
|| !$this->registerHook('displayProductCategory')
|| !$this->registerHook('footer')
|| !$this->createTables()
)
return false;
}
}
public function hookdisplayProductCategory($params)
{
if (isset(Context::getContext()->controller->categorycms)) {
$categorycms = Context::getContext()->controller->categorycms;
$products = $categorycms->loadProductForCategoryDisplay();
public function createTables (){
return true;
}
if (!empty($products)) {
$this->smarty->assign(array(
'products' => $products,
public function hookdisplayFooter() {
$this->context->controller->addJS(($this->_path).'voting.js', 'all');
if($this->context->controller->php_self == 'categorycms' && $this->context->controller->categorycms->id_category == 1){
$this->context->controller->addJqueryUI('ui.autocomplete', $theme = 'toutpratique', $check_dependencies = true);
$allTags = CmsPsExtraFieldsValue::getAll(false,true,false,Context::getContext()->language->id);
$tags = array();
foreach ($allTags as $key => $value) {
$tags[] = array(
'value' => $value->value,
'id' => $value->id_cmsps_extrafields_value,
);
}
$allSupports = CmsPsExtraFieldsValue::getAll(false,false,true,Context::getContext()->language->id);
$supports = array();
foreach ($allSupports as $key => $value) {
$supports[] = array(
'value' => $value->value,
'id' => $value->id_cmsps_extrafields_value,
);
}
global $smarty;
$smarty->assign(array(
'tags' => $tags,
'supports' => $supports
));
return $this->display(__FILE__, 'category_products.tpl');
}
}
}
public function hookdisplayHomeVideo($params) {
$context = Context::getContext();
$video_article = CmsPsPost::getVideoPost($context->language->id, 1);
public function hookdisplayRelatedProduct($params) {
$id_product = $params['product']->id;
$relations = CmsPsPost::getPostRelationWithProduct($id_product, 3, Context::getContext()->language->id);
if ($relations) {
$this->smarty->assign(array(
'relations' => $relations,
));
return $this->display(__FILE__, 'product_relationscms.tpl');
}
}
if ($video_article) {
$this->smarty->assign(array(
'video_article' => $video_article,
));
return $this->display(__FILE__, 'video_article.tpl');
public function hookdisplayProductCategory($params)
{
if (isset(Context::getContext()->controller->categorycms)) {
$categorycms = Context::getContext()->controller->categorycms;
$products = $categorycms->loadProductForCategoryDisplay();
if (!empty($products)) {
$this->smarty->assign(array(
'products' => $products,
));
return $this->display(__FILE__, 'category_products.tpl');
}
}
}
public function hookdisplayHomeVideo($params) {
$context = Context::getContext();
$video_article = CmsPsPost::getVideoPost($context->language->id, 1);
if ($video_article) {
$this->smarty->assign(array(
'video_article' => $video_article,
));
return $this->display(__FILE__, 'video_article.tpl');
}
}
}
}

493
override/classes/Mail.php Normal file
View File

@ -0,0 +1,493 @@
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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/osl-3.0.php Open Software License (OSL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include_once(_PS_SWIFT_DIR_.'Swift.php');
include_once(_PS_SWIFT_DIR_.'Swift/Connection/SMTP.php');
include_once(_PS_SWIFT_DIR_.'Swift/Connection/NativeMail.php');
include_once(_PS_SWIFT_DIR_.'Swift/Plugin/Decorator.php');
class Mail extends MailCore
{
public $id;
/** @var string Recipient */
public $recipient;
/** @var string Template */
public $template;
/** @var string Subject */
public $subject;
/** @var unsigned integer Language ID */
public $id_lang;
/** @var timestamp Date */
public $date_add;
/**
* @see ObjectModel::$definition
*/
public static $definition = array(
'table' => 'mail',
'primary' => 'id_mail',
'fields' => array(
'recipient' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'copy_post' => false, 'required' => true, 'size' => 126),
'template' => array('type' => self::TYPE_STRING, 'validate' => 'isTplName', 'copy_post' => false, 'required' => true, 'size' => 62),
'subject' => array('type' => self::TYPE_STRING, 'validate' => 'isMailSubject', 'copy_post' => false, 'required' => true, 'size' => 254),
'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false, 'required' => true),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false, 'required' => true),
),
);
const TYPE_HTML = 1;
const TYPE_TEXT = 2;
const TYPE_BOTH = 3;
/**
* Send Email
*
* @param int $id_lang Language of the email (to translate the template)
* @param string $template Template: the name of template not be a var but a string !
* @param string $subject
* @param string $template_vars
* @param string $to
* @param string $to_name
* @param string $from
* @param string $from_name
* @param array $file_attachment Array with three parameters (content, mime and name). You can use an array of array to attach multiple files
* @param bool $modeSMTP
* @param string $template_path
* @param bool $die
* @param string $bcc Bcc recipient
*/
public static function Send($id_lang, $template, $subject, $template_vars, $to,
$to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null,
$template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null, $bcc = null, $reply_to = null)
{
if (!$id_shop)
$id_shop = Context::getContext()->shop->id;
$configuration = Configuration::getMultiple(array(
'PS_SHOP_EMAIL',
'PS_MAIL_METHOD',
'PS_MAIL_SERVER',
'PS_MAIL_USER',
'PS_MAIL_PASSWD',
'PS_SHOP_NAME',
'PS_MAIL_SMTP_ENCRYPTION',
'PS_MAIL_SMTP_PORT',
'PS_MAIL_TYPE'
), null, null, $id_shop);
// Returns immediatly if emails are deactivated
if ($configuration['PS_MAIL_METHOD'] == 3)
return true;
$theme_path = _PS_THEME_DIR_;
// Get the path of theme by id_shop if exist
if (is_numeric($id_shop) && $id_shop)
{
$shop = new Shop((int)$id_shop);
$theme_name = $shop->getTheme();
if (_THEME_NAME_ != $theme_name)
$theme_path = _PS_ROOT_DIR_.'/themes/'.$theme_name.'/';
}
if (!isset($configuration['PS_MAIL_SMTP_ENCRYPTION']))
$configuration['PS_MAIL_SMTP_ENCRYPTION'] = 'off';
if (!isset($configuration['PS_MAIL_SMTP_PORT']))
$configuration['PS_MAIL_SMTP_PORT'] = 'default';
// Sending an e-mail can be of vital importance for the merchant, when his password is lost for example, so we must not die but do our best to send the e-mail
if (!isset($from) || !Validate::isEmail($from))
$from = $configuration['PS_SHOP_EMAIL'];
if (!Validate::isEmail($from))
$from = null;
// $from_name is not that important, no need to die if it is not valid
if (!isset($from_name) || !Validate::isMailName($from_name))
$from_name = $configuration['PS_SHOP_NAME'];
if (!Validate::isMailName($from_name))
$from_name = null;
// It would be difficult to send an e-mail if the e-mail is not valid, so this time we can die if there is a problem
if (!is_array($to) && !Validate::isEmail($to))
{
Tools::dieOrLog(Tools::displayError('Error: parameter "to" is corrupted'), $die);
return false;
}
if (!is_array($template_vars))
$template_vars = array();
// Do not crash for this error, that may be a complicated customer name
if (is_string($to_name) && !empty($to_name) && !Validate::isMailName($to_name))
$to_name = null;
if (!Validate::isTplName($template))
{
Tools::dieOrLog(Tools::displayError('Error: invalid e-mail template'), $die);
return false;
}
if (!Validate::isMailSubject($subject))
{
Tools::dieOrLog(Tools::displayError('Error: invalid e-mail subject'), $die);
return false;
}
/* Construct multiple recipients list if needed */
$to_list = new Swift_RecipientList();
if (is_array($to) && isset($to))
{
foreach ($to as $key => $addr)
{
$addr = trim($addr);
if (!Validate::isEmail($addr))
{
Tools::dieOrLog(Tools::displayError('Error: invalid e-mail address'), $die);
return false;
}
if (is_array($to_name) && $to_name && is_array($to_name) && Validate::isGenericName($to_name[$key]))
$to_name = $to_name[$key];
$to_name = (($to_name == null || $to_name == $addr) ? '' : self::mimeEncode($to_name));
$to_list->addTo($addr, $to_name);
}
$to_plugin = $to[0];
}
else
{
/* Simple recipient, one address */
$to_plugin = $to;
$to_name = (($to_name == null || $to_name == $to) ? '' : self::mimeEncode($to_name));
$to_list->addTo($to, $to_name);
}
if (isset($bcc))
$to_list->addBcc($bcc);
try {
/* Connect with the appropriate configuration */
if ($configuration['PS_MAIL_METHOD'] == 2)
{
if (empty($configuration['PS_MAIL_SERVER']) || empty($configuration['PS_MAIL_SMTP_PORT']))
{
Tools::dieOrLog(Tools::displayError('Error: invalid SMTP server or SMTP port'), $die);
return false;
}
$connection = new Swift_Connection_SMTP(
$configuration['PS_MAIL_SERVER'],
$configuration['PS_MAIL_SMTP_PORT'],
$configuration['PS_MAIL_SMTP_ENCRYPTION'] == 'ssl' ? Swift_Connection_SMTP::ENC_SSL : (($configuration['PS_MAIL_SMTP_ENCRYPTION'] == 'tls' ? Swift_Connection_SMTP::ENC_TLS : Swift_Connection_SMTP::ENC_OFF))
);
$connection->setTimeout(4);
if (!$connection)
return false;
if (!empty($configuration['PS_MAIL_USER']))
$connection->setUsername($configuration['PS_MAIL_USER']);
if (!empty($configuration['PS_MAIL_PASSWD']))
$connection->setPassword($configuration['PS_MAIL_PASSWD']);
}
else
$connection = new Swift_Connection_NativeMail();
if (!$connection)
return false;
$swift = new Swift($connection, Configuration::get('PS_MAIL_DOMAIN', null, null, $id_shop));
/* Get templates content */
$iso = Language::getIsoById((int)$id_lang);
if (!$iso)
{
Tools::dieOrLog(Tools::displayError('Error - No ISO code for email'), $die);
return false;
}
$iso_template = $iso.'/'.$template;
$module_name = false;
$override_mail = false;
// get templatePath
if (preg_match('#'.__PS_BASE_URI__.'modules/#', str_replace(DIRECTORY_SEPARATOR, '/', $template_path)) && preg_match('#modules/([a-z0-9_-]+)/#ui', str_replace(DIRECTORY_SEPARATOR, '/',$template_path), $res))
$module_name = $res[1];
if ($module_name !== false && (file_exists($theme_path.'modules/'.$module_name.'/mails/'.$iso_template.'.txt') ||
file_exists($theme_path.'modules/'.$module_name.'/mails/'.$iso_template.'.html')))
$template_path = $theme_path.'modules/'.$module_name.'/mails/';
elseif (file_exists($theme_path.'mails/'.$iso_template.'.txt') || file_exists($theme_path.'mails/'.$iso_template.'.html'))
{
$template_path = $theme_path.'mails/';
$override_mail = true;
}
if (!file_exists($template_path.$iso_template.'.txt') && ($configuration['PS_MAIL_TYPE'] == Mail::TYPE_BOTH || $configuration['PS_MAIL_TYPE'] == Mail::TYPE_TEXT))
{
Tools::dieOrLog(Tools::displayError('Error - The following e-mail template is missing:').' '.$template_path.$iso_template.'.txt', $die);
return false;
}
elseif (!file_exists($template_path.$iso_template.'.html') && ($configuration['PS_MAIL_TYPE'] == Mail::TYPE_BOTH || $configuration['PS_MAIL_TYPE'] == Mail::TYPE_HTML))
{
Tools::dieOrLog(Tools::displayError('Error - The following e-mail template is missing:').' '.$template_path.$iso_template.'.html', $die);
return false;
}
$template_html = file_get_contents($template_path.$iso_template.'.html');
$template_txt = strip_tags(html_entity_decode(file_get_contents($template_path.$iso_template.'.txt'), null, 'utf-8'));
if ($override_mail && file_exists($template_path.$iso.'/lang.php'))
include_once($template_path.$iso.'/lang.php');
elseif ($module_name && file_exists($theme_path.'mails/'.$iso.'/lang.php'))
include_once($theme_path.'mails/'.$iso.'/lang.php');
elseif (file_exists(_PS_MAIL_DIR_.$iso.'/lang.php'))
include_once(_PS_MAIL_DIR_.$iso.'/lang.php');
else
{
Tools::dieOrLog(Tools::displayError('Error - The language file is missing for:').' '.$iso, $die);
return false;
}
/* Create mail and attach differents parts */
$subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject;
$message = new Swift_Message($subject);
$message->setCharset('utf-8');
/* Set Message-ID - getmypid() is blocked on some hosting */
$message->setId(Mail::generateId());
$message->headers->setEncoding('Q');
$template_vars = array_map(array('Tools', 'htmlentitiesDecodeUTF8'), $template_vars);
$template_vars = array_map(array('Tools', 'stripslashes'), $template_vars);
if (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop)))
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop);
else
{
if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop)))
$logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop);
else
$template_vars['{shop_logo}'] = '';
}
ShopUrl::cacheMainDomainForShop((int)$id_shop);
if ((Context::getContext()->link instanceof Link) === false)
Context::getContext()->link = new Link();
/* Personnalisation des mails */
$template_vars['{header_img}'] = Context::getContext()->smarty->tpl_vars['base_dir']->value . 'themes/fanavenue/mails/header-mail.png';
$template_vars['{footer_img}'] = Context::getContext()->smarty->tpl_vars['base_dir']->value . 'themes/fanavenue/mails/footer-mail.png';
$template_vars['{box-border-color}'] = '#e4535d';
$template_vars['{box-bg-color}'] = '#ffffff';
$template_vars['{mail-bg-color}'] = '#f0f0f0';
$template_vars['{table-bg-color}'] = '#ffffff';
$template_vars['{titre1-color}'] = '#e4535d';
$template_vars['{titre2-color}'] = '#e4535d ';
$template_vars['{link-color}'] = '#e4535d';
$template_vars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME', null, null, $id_shop));
$template_vars['{shop_url}'] = Context::getContext()->link->getPageLink('index', true, Context::getContext()->language->id, null, false, $id_shop);
$template_vars['{my_account_url}'] = Context::getContext()->link->getPageLink('my-account', true, Context::getContext()->language->id, null, false, $id_shop);
$template_vars['{guest_tracking_url}'] = Context::getContext()->link->getPageLink('guest-tracking', true, Context::getContext()->language->id, null, false, $id_shop);
$template_vars['{history_url}'] = Context::getContext()->link->getPageLink('history', true, Context::getContext()->language->id, null, false, $id_shop);
$template_vars['{color}'] = Tools::safeOutput(Configuration::get('PS_MAIL_COLOR', null, null, $id_shop));
$swift->attachPlugin(new Swift_Plugin_Decorator(array($to_plugin => $template_vars)), 'decorator');
if ($configuration['PS_MAIL_TYPE'] == Mail::TYPE_BOTH || $configuration['PS_MAIL_TYPE'] == Mail::TYPE_TEXT)
$message->attach(new Swift_Message_Part($template_txt, 'text/plain', '8bit', 'utf-8'));
if ($configuration['PS_MAIL_TYPE'] == Mail::TYPE_BOTH || $configuration['PS_MAIL_TYPE'] == Mail::TYPE_HTML)
$message->attach(new Swift_Message_Part($template_html, 'text/html', '8bit', 'utf-8'));
if ($file_attachment && !empty($file_attachment))
{
// Multiple attachments?
if (!is_array(current($file_attachment)))
$file_attachment = array($file_attachment);
foreach ($file_attachment as $attachment)
if (isset($attachment['content']) && isset($attachment['name']) && isset($attachment['mime']))
$message->attach(new Swift_Message_Attachment($attachment['content'], $attachment['name'], $attachment['mime']));
}
/* Send mail */
$send = $swift->send($message, $to_list, new Swift_Address($from, $from_name));
$swift->disconnect();
ShopUrl::resetMainDomainCache();
if ($send && Configuration::get('PS_LOG_EMAILS'))
{
$mail = new Mail();
$mail->template = substr($template, 0, 62);
$mail->subject = substr($subject, 0, 254);
$mail->id_lang = (int)$id_lang;
foreach (array_merge($to_list->getTo(), $to_list->getCc(), $to_list->getBcc()) as $recipient)
{
$mail->id = null;
$mail->recipient = substr($recipient->getAddress(), 0, 126);
$mail->add();
}
}
return $send;
}
catch (Swift_Exception $e) {
return false;
}
}
public static function eraseAllLogs()
{
return Db::getInstance()->execute('TRUNCATE TABLE '._DB_PREFIX_.'mail');
}
public static function sendMailTest($smtpChecked, $smtpServer, $content, $subject, $type, $to, $from, $smtpLogin, $smtpPassword, $smtpPort = 25, $smtpEncryption)
{
$result = false;
try {
if ($smtpChecked)
{
$smtp = new Swift_Connection_SMTP($smtpServer, $smtpPort, ($smtpEncryption == 'off') ?
Swift_Connection_SMTP::ENC_OFF : (($smtpEncryption == 'tls') ? Swift_Connection_SMTP::ENC_TLS : Swift_Connection_SMTP::ENC_SSL));
$smtp->setUsername($smtpLogin);
$smtp->setpassword($smtpPassword);
$smtp->setTimeout(5);
$swift = new Swift($smtp, Configuration::get('PS_MAIL_DOMAIN'));
}
else
$swift = new Swift(new Swift_Connection_NativeMail(), Configuration::get('PS_MAIL_DOMAIN'));
$message = new Swift_Message($subject, $content, $type);
if ($swift->send($message, $to, $from))
$result = true;
$swift->disconnect();
} catch (Swift_ConnectionException $e) {
$result = $e->getMessage();
} catch (Swift_Message_MimeException $e) {
$result = $e->getMessage();
}
return $result;
}
/**
* This method is used to get the translation for email Object.
* For an object is forbidden to use htmlentities,
* we have to return a sentence with accents.
*
* @param string $string raw sentence (write directly in file)
*/
public static function l($string, $id_lang = null, Context $context = null)
{
global $_LANGMAIL;
if (!$context)
$context = Context::getContext();
if ($id_lang == null)
$id_lang = (!isset($context->language) || !is_object($context->language)) ? (int)Configuration::get('PS_LANG_DEFAULT') : (int)$context->language->id;
$iso_code = Language::getIsoById((int)$id_lang);
$file_core = _PS_ROOT_DIR_.'/mails/'.$iso_code.'/lang.php';
if (Tools::file_exists_cache($file_core) && empty($_LANGMAIL))
include($file_core);
$file_theme = _PS_THEME_DIR_.'mails/'.$iso_code.'/lang.php';
if (Tools::file_exists_cache($file_theme))
include($file_theme);
if (!is_array($_LANGMAIL))
return (str_replace('"', '&quot;', $string));
$key = str_replace('\'', '\\\'', $string);
return str_replace('"', '&quot;', stripslashes((array_key_exists($key, $_LANGMAIL) && !empty($_LANGMAIL[$key])) ? $_LANGMAIL[$key] : $string));
}
/* Rewrite of Swift_Message::generateId() without getmypid() */
protected static function generateId($idstring = null)
{
$midparams = array(
"utctime" => gmstrftime("%Y%m%d%H%M%S"),
"randint" => mt_rand(),
"customstr" => (preg_match("/^(?<!\\.)[a-z0-9\\.]+(?!\\.)\$/iD", $idstring) ? $idstring : "swift") ,
"hostname" => (isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : php_uname("n")),
);
return vsprintf("<%s.%d.%s@%s>", $midparams);
}
public static function isMultibyte($data)
{
$length = strlen($data);
for ($i = 0; $i < $length; $i++)
if (ord(($data[$i])) > 128)
return true;
return false;
}
public static function mimeEncode($string, $charset = 'UTF-8', $newline = "\r\n")
{
if (!self::isMultibyte($string) && strlen($string) < 75)
return $string;
$charset = strtoupper($charset);
$start = '=?'.$charset.'?B?';
$end = '?=';
$sep = $end.$newline.' '.$start;
$length = 75 - strlen($start) - strlen($end);
$length = $length - ($length % 4);
if ($charset === 'UTF-8')
{
$parts = array();
$maxchars = floor(($length * 3) / 4);
$stringLength = strlen($string);
while ($stringLength > $maxchars)
{
$i = (int)$maxchars;
$result = ord($string[$i]);
while ($result >= 128 && $result <= 191)
$result = ord($string[--$i]);
$parts[] = base64_encode(substr($string, 0, $i));
$string = substr($string, $i);
$stringLength = strlen($string);
}
$parts[] = base64_encode($string);
$string = implode($sep, $parts);
}
else
{
$string = chunk_split(base64_encode($string), $length, $sep);
$string = preg_replace('/' . preg_quote($sep) . '$/', '', $string);
}
return $start.$string.$end;
}
}

View File

@ -1,6 +1,6 @@
<?php
include _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
include _PS_MODULE_DIR_.'cmsps/classes/CmsPsPost.php';
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsEdito.php';
require_once _PS_MODULE_DIR_.'cmsps/classes/CmsPsPost.php';
class IndexController extends IndexControllerCore
{
@ -13,8 +13,8 @@ class IndexController extends IndexControllerCore
$this->context->smarty->assign(array(
'edito' => $edito,
'posts_home_1' => array_slice($posts, 0, 4),
'posts_home_2' => array_slice($posts, 4, 3),
'posts_home_1' => array_slice($posts, 0, 3),
'posts_home_2' => array_slice($posts, 3, 4),
'posts_home_3' => array_slice($posts, 7, 3),
'posts_home_4' => array_slice($posts, 10, 3),
'posts_home_5' => array_slice($posts, 11, 1)

View File

@ -374,7 +374,8 @@ class BlockNewsletterOverride extends BlockNewsletter
$fileAttachment['content'] = file_get_contents(_CMS_CAT_IMG_DIR_.'pdf/Tout-pratique-'.$cmsCategory['slug'].'.pdf');
$fileAttachment['name'] = 'Tout-pratique-'.$cmsCategory['slug'].'.pdf';
$fileAttachment['mime'] = "application/pdf";
$data['{attached_file_url}'] = _CMS_CAT_IMG_DIR_.'pdf/Tout-pratique-'.$cmsCategory['slug'].'.pdf';
$data['{attached_file_url}'] = _PS_BASE_URL_.'img/cms_c/pdf/Tout-pratique-'.$cmsCategory['slug'].'.pdf';
$data['{attached_file}'] = "Tout-pratique-".$cmsCategory['slug'];
} else {
// on envoie le pdf générique
@ -383,12 +384,12 @@ class BlockNewsletterOverride extends BlockNewsletter
}
$fileAttachment['name'] = 'Tout-pratique.pdf';
$fileAttachment['mime'] = "application/pdf";
$data['{attached_file_url}'] = _CMS_CAT_IMG_DIR_.'pdf/Tout-pratique.pdf';
$data['{attached_file_url}'] = _PS_BASE_URL_.'img/cms_c/pdf/Tout-pratique.pdf';
$data['{attached_file}'] = "Tout-pratique";
}
} elseif($genericPdf != false) {
$fileAttachment = $genericPdf;
$data['{attached_file_url}'] = _CMS_CAT_IMG_DIR_.'pdf/Tout-pratique.pdf';
$data['{attached_file_url}'] = _PS_BASE_URL_.'img/cms_c/pdf/Tout-pratique.pdf';
$data['{attached_file}'] = $genericPdf['name'];
}
return Mail::Send($this->context->language->id, 'newsletter_conf', Mail::l('Newsletter confirmation', $this->context->language->id), $data, pSQL($email), null, null, null, $fileAttachment, null, _THEME_DIR_.'modules/blocknewsletter/mails/', false, $this->context->shop->id);

View File

@ -42,7 +42,7 @@
</div>
<div class="row">
<div class="col-md-8 desc_category">
<section class="col-md-8 desc_category">
{if $categorycms->description}
<div class="desc">
{$categorycms->description}
@ -81,8 +81,10 @@
{/if}
<!-- All posts -->
<div class="all_posts">
<span class="title blue">{l s='Toutes les astuces'}</span>
<section class="all_posts">
<header>
<span class="title blue">{l s='Toutes les astuces'}</span>
</header>
<div class="search_category">
<form class="form-horizontal" action="" method="GET">
@ -158,9 +160,9 @@
</div>
{/if}
</div>
</div>
<div class="col-md-4">
</section>
</section>
<aside class="col-md-4 right_column_category">
<div class="pub">
{hook h='displayPubliciteRight'}
</div>
@ -202,11 +204,13 @@
</div>
{/if}
<div style="padding: 20px; background:#f1f1f1; margin-bottom:30px;" class="pub"></div>
<div class="pub">
{hook h='displayPubliciteRightBottom'}
</div>
<div class="hidden-sm hidden-xs">
{include file="$tpl_dir./encart_boutique.tpl"}
</div>
</div>
</aside>
</div>
</main>

View File

@ -568,8 +568,8 @@ body .ac_results {
font-family: 'vidaloka';
letter-spacing: -1px;
font-size: 48px;
margin: 0;
margin-bottom: 15px;
margin-top: 20px;
margin-bottom: 25px;
}
.video_home iframe {
width: 100%;
@ -658,9 +658,12 @@ body .ac_results {
padding: 0 300px;
}
.newsletter_footer p.nw-alert-footer{
color: #ebccd1;
background-color: rgba(0, 0, 0, 0);
border: none;
background: none;
border: 1px solid;
color: #000;
margin: 7px auto 0;
padding: 0;
width: 300px;
}
.newsletter_footer .form-group {
width: 450px;
@ -1256,34 +1259,81 @@ body .ac_results {
font-size: 15px;
line-height: 24px;
}
.article_content .content ul { margin-left: 20px; margin-bottom: 15px;}
.article_content .content ul li {
margin: 5px 0;
list-style: inside;
font-size: 14px;
}
.article_content .content h2 strong { font-weight: normal;}
.article_content .content h2 {
font-size: 22px;
font-size: 36px;
line-height: 42px;
font-weight: normal;
font-style: italic;
font-family: 'vidaloka';
font-family: 'pompiere_regular';
letter-spacing: -1px;
padding-bottom: 10px;
border-bottom: 3px solid #333333;
margin-bottom: 20px;
margin-top: 40px;
}
.article_content .content br {
display: block;
margin:0;
}
.article_content .content h3 {
font-weight: bold;
font-size: 18px;
padding: 15px;
background: #eeeeee;
margin-bottom: 20px;
margin-top: 20px;
}
.article_content .content h5, h4 {
font-size: 15px;
line-height: 24px;
}
.article_content .content p {margin-bottom: 0;}
.article_content .content .info {
background: #ccc;
padding: 15px;
border-radius: 5px;
margin-bottom: 15px;
margin-top: 40px;
margin-bottom: 20px;
background: url('../img/ico_danger.png') no-repeat left 15px center;
padding-left: 170px;
}
.article_content .content .info.asavoir { background-image: url('../img/ico_asavoir.png')}
.article_content .content .info.anoter { background-image: url('../img/ico_anoter.png')}
.article_content .content .info.truc { background-image: url('../img/ico_truc.png')}
.article_content .content .info h3 {
background: none;
text-transform: none;
padding: 0;
font-weight: normal;
font-size: 15px;
margin: 0;
margin-bottom: 10px;
}
.article_content .content .info h5 {
font-size: 18px;
text-transform: uppercase;
font-family: 'pt_sansbold';
color: #e4535d;
}
.article_content .content .info.truc{ background-color: #dfeaed;}
.article_content .content .info.truc h5 {color: #529bb6}
.article_content .content .info.warning{ background-color: #f4dfe1;}
.article_content .content .info.asavoir{ background-color: #e3f0ee;}
.article_content .content .info.asavoir h5 {color: #6ac5bb}
.article_content .content .info.anoter{ background-color: #ddd6e1;}
.article_content .content .info.anoter h5 {color: #8a669d}
.article_content .content a { color: #e44e58;}
.article_content .content .video { margin: 15px 0; }
.article_content .content .pub_bottom_post { margin: 15px 0; }
.article_content .content .info.truc{ background-color: #d7e9e7;}
.article_content .content .info.warning{ background-color: #efd2d4;}
.article_content .content .info.asavoir{ background-color: #ebebd9;}
.article_content .content .info.anoter{ background-color: #ebd1dc;}
.article_content .content a {
color: #e44e58;
.right_column_category .pub {
margin: 15px 0;
text-align: center;
}
.others {
@ -1733,6 +1783,12 @@ body .ac_results {
text-align: right;
font-family: 'pompiere_regular';
}
#postcms .pack_bottom .desc .remise {
float: left;
padding-left: 200px;
text-transform: none;
}
#postcms .pack_bottom .desc .remise span { font-weight: bold; color: #e4535d}
#postcms .pack_bottom .products {
border: 1px solid #dfdfdf;
-webkit-border-radius: 5px 5px 5px 5px;
@ -1888,6 +1944,7 @@ body .ac_results {
#postcms .pack_content .reinsurance .bloc span{ font-size: 18px;}
#postcms .pack_content .reinsurance .border { font-size: 12px; line-height: 18px; padding: 10px 0;}
#postcms .pack_bottom .desc .remise { padding-left: 150px; }
#postcms .share .share_btn a {width: 120px; margin: 0 auto;}
}
@ -1924,6 +1981,9 @@ body .ac_results {
#postcms .form_comment .submit input[type="submit"]{ width: 350px;}
#postcms .selection_bottom .reassurance{ padding-left: 15px;}
#postcms .pack_bottom .desc { margin-right: 0; }
#postcms .pack_bottom .desc .remise { padding-left: 0; }
#postcms .pack_bottom .name { font-family: "pt_sans"; font-size: 15px; font-weight: normal; width: 216px; }
#postcms .pack_bottom .custom-checkbox { margin-left: 15px; }
}
@ -1941,10 +2001,11 @@ body .ac_results {
}
@media (max-width: 570px) {
#postcms .pack_content .price-percent-reduction { background-size: 70% auto; font-size: 14px; line-height: 50px; right: 10px; }
#postcms .tips_utile .title {font-size: 25px;}
#postcms .intro_note .left { margin-left: 24%; margin-top: 16px; }
#postcms .intro_note .right { font-size: 14px; margin-right: 13%; margin-top: 25px; }
#postcms .pack_bottom .desc .remise { display: block; width: 100%; }
}
@media (max-width: 500px) {
.vote_box.button span {padding: 0px 18px;}
@ -2511,6 +2572,9 @@ body .ac_results {
}
#product #features ul li span:first-child { font-weight: bold; }
#product .attachments h3{ font-family: 'vidaloka'; border-bottom: 2px solid #333; }
#product .attachments a.link{ color: #333; }
#product #related .subtitle {
background: url('../img/bg_title.png') no-repeat 0 0px;
color: #fff;
@ -2556,6 +2620,15 @@ body .ac_results {
font-size: 24px;
width: 300px;
}
#product #related .subtitle {
background: #529bb6;
border-radius: 10px;
height: 50px;
line-height: 50px;
font-size: 24px;
width: 300px;
position: relative;
}
#product #features .subtitle {
background: #6ac5bb;
border-radius: 10px;

View File

@ -214,12 +214,12 @@ span.title {
/* ICONE */
@font-face {
font-family: 'icomoon';
src:url('../fonts/icomoon.eot?-sfq5xb');
src:url('../fonts/icomoon.eot?#iefix-sfq5xb') format('embedded-opentype'),
url('../fonts/icomoon.woff2?-sfq5xb') format('woff2'),
url('../fonts/icomoon.ttf?-sfq5xb') format('truetype'),
url('../fonts/icomoon.woff?-sfq5xb') format('woff'),
url('../fonts/icomoon.svg?-sfq5xb#icomoon') format('svg');
src:url('../fonts/icomoon.eot?uem8rg');
src:url('../fonts/icomoon.eot?uem8rg#iefix') format('embedded-opentype'),
url('../fonts/icomoon.woff2?uem8rg') format('woff2'),
url('../fonts/icomoon.ttf?uem8rg') format('truetype'),
url('../fonts/icomoon.woff?uem8rg') format('woff'),
url('../fonts/icomoon.svg?uem8rg#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
@ -238,6 +238,9 @@ span.title {
-moz-osx-font-smoothing: grayscale;
}
.icon-youtube:before {
content: "\e900";
}
.icon-wallet2:before {
content: "\e607";
}
@ -276,6 +279,9 @@ span.title {
}
/* BOUTONS */
.btn {
background: #e4535d;

View File

@ -19,4 +19,5 @@
<glyph unicode="&#xe609;" glyph-name="lock39" d="M512.003 960c-165.121 0-299.462-134.336-299.462-299.462v-171.031c0-1.944-2.398-5.218-4.282-5.845-16.194-5.4-29.346-10.080-41.385-14.721-14.357-5.535-25.186-21.446-25.186-37.011v-392.98c0-15.459 10.759-31.384 25.025-37.038 110.38-43.739 226.552-65.913 345.289-65.913s234.909 22.178 345.294 65.918c14.261 5.652 25.014 21.573 25.014 37.032v392.98c0 15.566-10.827 31.476-25.191 37.017-12.044 4.641-25.194 9.321-41.376 14.721-1.879 0.626-4.277 3.903-4.277 5.846v171.029c-0.009 165.121-134.341 299.457-299.462 299.457zM430.437 312.242c0 45.079 36.518 81.559 81.561 81.559 45.039 0 81.557-36.476 81.557-81.559 0-29.87-16.845-54.879-40.78-69.056v-134.843c0-22.542-18.239-40.78-40.78-40.78-22.542 0-40.78 18.237-40.78 40.78v134.843c-23.933 14.177-40.78 39.186-40.78 69.056zM708.494 660.543v-147.568c-64.436 13.865-130.543 20.887-196.465 20.893-65.892 0-131.985-7.024-196.521-20.877v147.552c0 108.347 88.144 196.489 196.489 196.489 108.344 0.002 196.496-88.142 196.496-196.489z" />
<glyph unicode="&#xe60a;" glyph-name="logistics3" d="M379.422 331.963c-47.266 0-85.464-38.333-85.464-85.601 0-47.127 38.198-85.464 85.464-85.464s85.464 38.336 85.464 85.464c-0.002 47.268-38.198 85.601-85.464 85.601zM379.422 203.63c-23.634 0-42.734 19.238-42.734 42.735 0 23.631 19.1 42.732 42.734 42.732 23.632 0 42.732-19.101 42.732-42.732-0.002-23.497-19.1-42.735-42.732-42.735zM1024 395.192v-91.258c0-22.764-18.454-41.219-41.221-41.219h-44.106c-7.969 54.687-55.097 96.731-111.982 96.731-56.745 0-103.876-42.046-111.845-96.731h-223.552c-7.969 54.687-55.099 96.731-111.845 96.731s-103.876-42.046-111.844-96.731h-55.236c-22.766 0-41.219 18.454-41.219 41.219v91.258h852.85zM826.801 331.963c-47.266 0-85.601-38.333-85.601-85.601 0-47.127 38.336-85.464 85.601-85.464 47.127 0 85.462 38.336 85.462 85.464 0 47.268-38.335 85.601-85.462 85.601zM826.801 203.63c-23.634 0-42.732 19.238-42.732 42.735 0 23.631 19.098 42.732 42.732 42.732 23.495 0 42.732-19.101 42.732-42.732 0-23.497-19.237-42.735-42.732-42.735zM1007.758 487.091l-161.994 160.211c-10.305 10.168-24.183 15.939-38.611 15.939h-81.753v30.641c0 22.807-18.412 41.219-41.219 41.219h-471.84c-22.672 0-41.219-18.414-41.219-41.219v-6.459l-167.273-19.279 296.401-38.597-300.25-29.827 299.192-42.538-299.192-25.941 171.132-32.276-0.012-80.988h852.851v30.093c0 14.702-5.908 28.716-16.213 39.021zM937.134 481.733h-156.774c-3.572 0-6.459 2.885-6.459 6.457v121.051c0 3.572 2.886 6.459 6.459 6.459h29.816c1.648 0 3.298-0.688 4.534-1.787l126.822-121.051c4.257-3.984 1.37-11.128-4.399-11.128z" />
<glyph unicode="&#xe60b;" glyph-name="menu61" d="M91.428 649.145h841.14c50.493 0 91.432 40.935 91.432 91.428s-40.935 91.428-91.432 91.428h-841.14c-50.493-0.004-91.428-40.935-91.428-91.432 0-50.493 40.935-91.424 91.428-91.424zM932.568 539.43h-841.14c-50.493 0-91.428-40.935-91.428-91.428 0-50.497 40.935-91.428 91.428-91.428h841.14c50.493 0 91.432 40.931 91.432 91.428 0 50.493-40.939 91.428-91.432 91.428zM932.568 246.859h-841.14c-50.493 0-91.428-40.931-91.428-91.428 0-50.493 40.935-91.428 91.428-91.428h841.14c50.493 0 91.432 40.935 91.432 91.428 0 50.497-40.939 91.428-91.432 91.428z" />
<glyph unicode="&#xe900;" glyph-name="youtube" d="M827.528 763.040h-631.080c-74.28 0-134.496-60.256-134.496-134.592v-360.888c0-74.336 60.216-134.592 134.496-134.592h631.080c74.304 0 134.512 60.256 134.512 134.592v360.888c0 74.336-60.208 134.592-134.512 134.592zM421.976 295.768v338.952l257.056-169.496-257.056-169.456z" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -36,6 +36,9 @@
<span class="social">
<a href="https://twitter.com/Toutpratique" target="_blank"><i class="icon icon-twitter"></i></a>
</span>
<span class="social">
<a href="https://www.youtube.com/user/toutpratique" target="_blank"><i class="icon icon-youtube"></i></a>
</span>
{l s='Contactez-nous'}
<span class="social">
<a href="{$link->getPageLink('contact')}"><i class="icon icon-email"></i></a>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -55,6 +55,11 @@
<div class="col-md-8">
<div class="row post_home_top">
{foreach from=$posts_home_1 item=post key=key}
{if $key == 2}
<div class="col-md-6 col-sm-6 pub">
{hook h='displayHomeRight2'}
</div>
{/if}
<div class="col-md-6 col-sm-6">
{include file="./post_img.tpl" post=$post}
</div>
@ -72,9 +77,6 @@
{/foreach}
</div>
</div>
<div class="pub">
{hook h='displayHomeRight2'}
</div>
</div>
</div>

View File

@ -997,31 +997,31 @@ function refreshDeliveryOptions()
});
}
function updateExtraCarrier(id_delivery_option, id_address)
function updateExtraCarrier(iddelivery_option, id_address)
{
var url = "";
var url = "";
if(typeof(orderOpcUrl) !== 'undefined')
url = orderOpcUrl;
else
url = orderUrl;
if(typeof(orderOpcUrl) !== 'undefined')
url = orderOpcUrl;
else
url = orderUrl;
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: url + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
data: 'ajax=true'
+ '&method=updateExtraCarrier'
+ '&id_address='+id_address
+ '&id_delivery_option='+id_delivery_option
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
$('#HOOK_EXTRACARRIER_' + id_address).html(jsonData['content']);
}
});
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: url + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
data: 'ajax=true'
+ '&method=updateExtraCarrier'
+ '&id_address='+id_address
+ '&id_delivery_option='+id_delivery_option
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
$('#HOOK_EXTRACARRIER' + id_address).html(jsonData['content']);
}
});
}

View File

@ -101,3 +101,32 @@ function updateCarriers(){
}
});
}
function updateExtraCarrier(id_delivery_option, id_address)
{
var url = "";
if(typeof(orderOpcUrl) !== 'undefined')
url = orderOpcUrl;
else
url = orderUrl;
$.ajax({
type: 'POST',
headers: { "cache-control": "no-cache" },
url: url + '?rand=' + new Date().getTime(),
async: true,
cache: false,
dataType : "json",
data: 'ajax=true'
+ '&method=updateExtraCarrier'
+ '&id_address='+id_address
+ '&id_delivery_option='+id_delivery_option
+ '&token='+static_token
+ '&allow_refresh=1',
success: function(jsonData)
{
$('#HOOK_EXTRACARRIER' + id_address).html(jsonData['content']);
}
});
}

View File

@ -537,6 +537,8 @@ $_LANG['product_476efcbaed950dd513ffc08e4e9a632f'] = 'Envoi en cours, veuillez p
$_LANG['product_63a78ed4647f7c63c2929e35ec1c95e3'] = 'Personnaliser';
$_LANG['product_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité :';
$_LANG['product_7dcd185f890fd28f69d1ed210292d77f'] = 'Fiche technique';
$_LANG['product_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Télécharger';
$_LANG['product_91f3a2c0e4424c87689525da44c4db11'] = 'Fichiers';
$_LANG['product_9a9a97ca85af73f90515e72745f730f0'] = 'au lieu de';
$_LANG['product_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description';
$_LANG['product_bc0f7082192ef02e934a036cf4991789'] = 'Ce produit n\'est plus en stock';

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -27,7 +27,7 @@
{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
<div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}
<span class="price" itemprop="price">
<span class="price">
{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
</span>
{if isset($product.specific_prices) && $product.specific_prices && isset($product.specific_prices.reduction) && $product.specific_prices.reduction > 0}
@ -52,6 +52,7 @@
{if (!$PS_CATALOG_MODE && $PS_STOCK_MANAGEMENT && ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
<span itemprop="offers" itemscope itemtype="http://schema.org/Offer" class="availability">
<link itemprop="price" content="{$product.price_without_reduction|number_format:2}">
{if (isset($product.allow_oosp) && $product.allow_oosp || $product.quantity > 0)}
<link itemprop="availability" href="http://schema.org/InStock" />
{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}

View File

@ -89,7 +89,7 @@
{else}
{assign var=imageTitle value=$product->name|escape:'html':'UTF-8'}
{/if}
<li id="thumbnail_{$image.id_image}"{if $smarty.foreach.thumbnails.last} class="image_thumb last"{else}class="image_thumb"{/if}>
<li id="thumbnail_{$image.id_image}" {if $smarty.foreach.thumbnails.last} class="image_thumb last"{else} class="image_thumb"{/if}>
<a{if $jqZoomEnabled && $have_image && !$content_only} href="javascript:void(0);" rel="{literal}{{/literal}gallery: 'gal1', smallimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'large_default')|escape:'html':'UTF-8'}',largeimage: '{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}'{literal}}{/literal}"{else} href="{$link->getImageLink($product->link_rewrite, $imageIds, 'thickbox_default')|escape:'html':'UTF-8'}" data-fancybox-group="other-views" class="fancybox{if $image.id_image == $cover.id_image} shown{/if}"{/if} title="{$imageTitle}">
<img class="img-responsive" id="thumb_{$image.id_image}" src="{$link->getImageLink($product->link_rewrite, $imageIds, 'cart_default')|escape:'html':'UTF-8'}" alt="{$imageTitle}" title="{$imageTitle}"{if isset($cartSize)} height="{$cartSize.height}" width="{$cartSize.width}"{/if} itemprop="image" />
</a>
@ -164,7 +164,7 @@
<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">{strip}
{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
{if $priceDisplay >= 0 && $priceDisplay <= 2}
<span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</span>
<span id="our_price_display" class="price" itemprop="price" content="{$productPrice|number_format:2}">{convertPrice price=$productPrice|floatval}</span>
<meta itemprop="priceCurrency" content="{$currency->iso_code}" />
{hook h="displayProductPriceBlock" product=$product type="price"}
{/if}
@ -258,7 +258,7 @@
{foreach from=$group.attributes key=id_attribute item=group_attribute}
{assign var='img_color_exists' value=file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')}
<li{if $group.default == $id_attribute} class="selected"{/if}>
<a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background:{$colors.$id_attribute.value|escape:'html':'UTF-8'};"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}">
<a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" id="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background:{$colors.$id_attribute.value|escape:'html':'UTF-8'};"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}">
{if $img_color_exists}
<img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" />
{/if}
@ -296,13 +296,30 @@
</button>
</p>
</div>
<p class="availlability">
{if $product->quantity > 0}
<p class="availlability" id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>
{*<span id="availability_label">{l s='Availability:'}</span>*}
<span id="availability_value">{if $product->quantity <= 0}
{if $PS_STOCK_MANAGEMENT && $allow_oosp}
{$product->available_later}
{else}
{l s='This product is no longer in stock'}
{/if}
{elseif $PS_STOCK_MANAGEMENT}
{l s='En stock'}
{else}
<span class="out">{l s='Hors stock'}</span>
{/if}
</span>
</p>
<p class="availlability">
{if $product->quantity <= 0}
{if $PS_STOCK_MANAGEMENT && $allow_oosp}
{$product->available_later}
{else}
{$product->available_later}
{/if}
{/if}
</p>
<div class="payment_logo">
<img src="{$img_dir}paiement.png" alt="">
</div>
@ -380,7 +397,7 @@
<!-- Infos -->
{if !$content_only}
<div class="container">
<section class="container">
<div class="row">
<div class="col-md-6">
<div id="description">
@ -391,12 +408,14 @@
</div>
</div>
<div class="col-md-6">
<div id="features-docs" class="tab-title">
<section id="features-docs" class="tab-title">
<div class="row">
<!-- Features -->
{if isset($features) && $features}
<div id="features">
<h3 class="subtitle">{l s='Data sheet'}</h3>
<header>
<h3 class="subtitle">{l s='Data sheet'}</h3>
</header>
<ul class="col-xs-12">
{foreach from=$features item=feature}
<li>
@ -410,27 +429,49 @@
</div>
{/if}
</div>
</div>
</section>
{if isset($attachments) && $attachments}
<!--Download -->
<section class="attachments">
{foreach from=$attachments item=attachment name=attachements}
<header>
<h3>{l s='Files'}</h3>
</header>
{if $smarty.foreach.attachements.iteration %3 == 1}<div class="row">{/if}
<div class="col-lg-4">
<a class="link" href="{$link->getPageLink('attachment', true, NULL, "id_attachment={$attachment.id_attachment}")|escape:'html':'UTF-8'}">{$attachment.name|escape:'html':'UTF-8'}</a>
<p class="text-muted">{$attachment.description|escape:'html':'UTF-8'}</p>
<a class="btn btn-default" href="{$link->getPageLink('attachment', true, NULL, "id_attachment={$attachment.id_attachment}")|escape:'html':'UTF-8'}">
<i class="icon-download"></i>
{l s='Download'} ({Tools::formatBytes($attachment.file_size, 2)})
</a>
<hr />
</div>
{if $smarty.foreach.attachements.iteration %3 == 0 || $smarty.foreach.attachements.last}</div>{/if}
{/foreach}
</section>
<!--end Download -->
{/if}
</div>
</div>
</div>
</section>
<!-- Produits relatifs / Accessoires -->
{if isset($accessories) && $accessories}
<div id="related" class="tab-title container">
<aside id="related" class="tab-title container">
<div class="separator"></div>
<h3 class="subtitle">{l s='Related Products'}</h3>
<div class="products row">
<!-- Blocs produits relatifs -->
{include file="./product-list.tpl" products=$accessories position='homestore' position=2 position_sm=4}
</div>
</div>
</aside>
{/if}
<div class="container">
<aside class="container">
<div class="separator"></div>
{hook h='displayRelatedProduct' product=$product}
</div>
</aside>
{/if}
</main>
{strip}