This commit is contained in:
Tout Pratique 2015-11-17 10:12:52 +01:00
parent f79fec87ed
commit 5d50494bf6
26 changed files with 269 additions and 3944 deletions

View File

@ -2,25 +2,23 @@
class HomeStoreControllerCore extends FrontController
{
public $php_self = 'homestore';
public function canonicalRedirection($canonical_url = '') {
parent::canonicalRedirection($this->context->link->getHomeStoreLink());
}
public $php_self = 'homestore';
public function canonicalRedirection($canonical_url = '')
{
parent::canonicalRedirection($this->context->link->getHomeStoreLink());
}
public function init() {
parent::init();
}
public function init()
{
parent::init();
}
public function initContent() {
parent::initContent();
$id_lang = Context::getContext()->language->id;
public function initContent()
{
parent::initContent();
$id_lang = Context::getContext()->language->id;
$this->setTemplate(_PS_THEME_DIR_.'homestore.tpl');
}
// $this->context->smarty->assign(array(
// 'p' => $this->page,
// ));
$this->setTemplate(_PS_THEME_DIR_.'homestore.tpl');
}
}
}

View File

@ -174,6 +174,7 @@ class Blockadshooks extends Module
$this->getIdByPageName($page_name),
Context::getContext()->language->id
);
if ($publicite['link']) {
$this->smarty->assign(array(
'link' => $publicite['content'],

View File

@ -143,7 +143,7 @@ class BlockAds extends ObjectModel
} else {
if(!empty($publication->link)) {
return array(
'content' => $publication->link,
'content' => (isset($publication->link) ? $publication->link : ''),
'id' => $publication->id,
'link' => true
);
@ -151,11 +151,19 @@ class BlockAds extends ObjectModel
}
}
return array(
'content' => $publication,
'id' => NULL,
'link' => false
);
if(isset($publication->content)) {
return array(
'content' => $publication->content,
'id' => NULL,
'link' => false
);
} else{
return array(
'content' => $publication,
'id' => NULL,
'link' => false
);
}
}
}

View File

@ -193,6 +193,7 @@ class Publication extends ObjectModel
'postcms', //Article
'categorycms', //Category d'article
'postedito', //Article mise en forme différent
'homestore', //Accueil de la boutique
);
}
@ -203,6 +204,7 @@ class Publication extends ObjectModel
'postcms' => 'Article', //Article
'categorycms' => 'Catégorie d\'article', //Category d'article
'postedito' => 'Edito', //Article mise en forme différent
'homestore' => 'Boutique', //Article mise en forme différent
);
return isset($array[$page_name]) ? $array[$page_name] : $page_name;
@ -213,7 +215,8 @@ class Publication extends ObjectModel
return array(
'postcms',
'categorycms',
'postedito'
'postedito',
'homestore'
);
}

View File

@ -90,6 +90,10 @@ class BlockBanner extends Module
public function hookDisplayTop($params)
{
if (!Configuration::get('BLOCKBANNER_ACTIVE')) {
return false;
}
if (!$this->isCached('blockbanner.tpl', $this->getCacheId()))
{
$imgname = Configuration::get('BLOCKBANNER_IMG', $this->context->language->id);
@ -166,6 +170,7 @@ class BlockBanner extends Module
Configuration::updateValue('BLOCKBANNER_LINK', $values['BLOCKBANNER_LINK']);
Configuration::updateValue('BLOCKBANNER_DESC', $values['BLOCKBANNER_DESC']);
Configuration::updateValue('BLOCKBANNER_ACTIVE', Tools::getValue('BLOCKBANNER_ACTIVE') );
$this->_clearCache('blockbanner.tpl');
return $this->displayConfirmation($this->l('The settings have been updated.'));
@ -201,6 +206,25 @@ class BlockBanner extends Module
'name' => 'BLOCKBANNER_LINK',
'desc' => $this->l('Enter the link associated to your banner. When clicking on the banner, the link opens in the same window. If no link is entered, it redirects to the homepage.')
),
array(
'type' => 'switch',
'label' => $this->l('Actif'),
'name' => 'BLOCKBANNER_ACTIVE',
'required' => false,
'is_bool' => true,
'values' => array(
array(
'id' => 'active_on',
'value' => 1,
'label' => $this->l('Enabled')
),
array(
'id' => 'active_off',
'value' => 0,
'label' => $this->l('Disabled')
)
)
),
array(
'type' => 'text',
'lang' => true,
@ -247,6 +271,7 @@ class BlockBanner extends Module
$fields['BLOCKBANNER_LINK'][$lang['id_lang']] = Tools::getValue('BLOCKBANNER_LINK_'.$lang['id_lang'], Configuration::get('BLOCKBANNER_LINK', $lang['id_lang']));
$fields['BLOCKBANNER_DESC'][$lang['id_lang']] = Tools::getValue('BLOCKBANNER_DESC_'.$lang['id_lang'], Configuration::get('BLOCKBANNER_DESC', $lang['id_lang']));
}
$fields['BLOCKBANNER_ACTIVE'] = Tools::getValue('BLOCKBANNER_ACTIVE', Configuration::get('BLOCKBANNER_ACTIVE') );
return $fields;
}

View File

@ -1,63 +1,84 @@
<?php
if (!defined('_CAN_LOAD_FILES_'))
exit;
exit;
class Homeproduct extends Module
{
public function __construct()
{
$this->name = 'homeproduct';
$this->tab = 'front_office_features';
$this->version = '1.0';
$this->author = 'Antadis';
$this->need_instance = 0;
public $ids = array();
$this->bootstrap = true;
parent::__construct();
public function __construct()
{
$this->name = 'homeproduct';
$this->tab = 'front_office_features';
$this->version = '1.0';
$this->author = 'Antadis';
$this->need_instance = 0;
$this->displayName = $this->l('Display product on Home');
$this->description = $this->l('Display product on Home');
$this->secure_key = Tools::encrypt($this->name);
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}
$this->bootstrap = true;
parent::__construct();
public function install()
{
if (Shop::isFeatureActive())
Shop::setContext(Shop::CONTEXT_ALL);
$this->displayName = $this->l('Display product on Home');
$this->description = $this->l('Display product on Home');
$this->secure_key = Tools::encrypt($this->name);
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
}
if (!parent::install()
|| !$this->registerHook('displayHomeProduct')
)
return false;
}
public function install()
{
if (Shop::isFeatureActive())
Shop::setContext(Shop::CONTEXT_ALL);
if (!parent::install()
|| !$this->registerHook('displayHomeProduct')
|| !$this->registerHook('displayHomeProductBottom')
)
return false;
}
public function hookdisplayHomeProduct($params)
{
$products = self::loadProduct(Context::getContext()->language->id, 2);
$this->smarty->assign(array(
'products' => $products,
));
return $this->display(__FILE__, 'home.tpl');
}
public function hookdisplayHomeProduct($params)
{
$products = $this->loadProduct(Context::getContext()->language->id, 2);
$this->smarty->assign(array(
'products' => $products,
));
return $this->display(__FILE__, 'home.tpl');
}
public static function loadProduct($id_lang, $limit)
{
$collection = new Collection('Product', $id_lang);
$collection->where('active', '=', 1);
$collection->where('online_only', '=', 1);
$collection->setPageSize($limit);
$collection->sqlOrderBy('RAND()');
$products = $collection->getResults();
public function hookdisplayHomeProductBottom($params)
{
$products = $this->loadProduct(Context::getContext()->language->id, 2);
$this->smarty->assign(array(
'products' => $products,
));
return $this->display(__FILE__, 'home_bottom.tpl');
}
$products = array_map(function($elem) {
$elem = $elem->loadReductionInfo();
return get_object_vars($elem);
}, $products);
public function loadProduct($id_lang, $limit)
{
$collection = new Collection('Product', $id_lang);
$collection->where('active', '=', 1);
$collection->where('online_only', '=', 1);
if ($this->ids) {
foreach ($this->ids as $key => $id) {
$collection->where('id_product', '!=', (int) $id);
}
}
$collection->setPageSize($limit);
$collection->sqlOrderBy('RAND()');
$products = $collection->getResults();
return $products;
}
foreach ($products as $key => $product) {
$this->ids[] = $product->id;
}
$products = array_map(function($elem) {
$elem = $elem->loadReductionInfo();
return get_object_vars($elem);
}, $products);
return $products;
}
}

View File

@ -0,0 +1,3 @@
<div class="product_home row">
{include file="$tpl_dir./product-list.tpl" products=$products position=6 position_sm=6}
</div>

View File

@ -0,0 +1,40 @@
<?php
class Customer extends CustomerCore
{
public function getByEmail($email, $passwd = null, $ignore_guest = true)
{
if (($passwd && !Validate::isPasswd($passwd)))
die (Tools::displayError());
$result = Db::getInstance()->getRow('
SELECT *
FROM `'._DB_PREFIX_.'customer`
WHERE `email` = \''.pSQL($email).'\'
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
'.(isset($passwd) ? 'AND `passwd` = \''.pSQL(Tools::encrypt($passwd)).'\'' : '').'
AND `deleted` = 0
'.($ignore_guest ? ' AND `is_guest` = 0' : ''));
if (!$result) {
$result = Db::getInstance()->getRow('
SELECT *
FROM `'._DB_PREFIX_.'customer`
WHERE `email` = \''.pSQL($email).'\'
'.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).'
'.(isset($passwd) ? 'AND `passwd` = \''.pSQL(Tools::encryptOld($passwd)).'\'' : '').'
AND `deleted` = 0
'.($ignore_guest ? ' AND `is_guest` = 0' : ''));
}
if (!$result)
return false;
$this->id = $result['id_customer'];
foreach ($result as $key => $value)
if (array_key_exists($key, $this))
$this->{$key} = $value;
return $this;
}
}

View File

@ -25,6 +25,7 @@ class Dispatcher extends DispatcherCore {
if (isset($controllers['contact']))
$controllers['contactform'] = $controllers['contact'];
// SEOURL
if ($this->controller == 'pagenotfound') {
$request = substr($this->request_uri, 1, strlen($this->request_uri));
@ -33,7 +34,8 @@ class Dispatcher extends DispatcherCore {
$context = Context::getContext();
$current_uri = ManageSeoUrl::getUrl($request, $context->language->id, $context->shop->id);
if(!empty($current_uri['redirect'])){
if(!empty($current_uri['redirect'])
&& $current_uri != 'notfound') {
header("Status: 301 Moved Permanently", false, 301);
header("Location:" . $current_uri['redirect']);
exit();

View File

@ -115,4 +115,11 @@ class Tools extends ToolsCore
return Tools::getPath($category->id_parent, $full_path, $link_on_the_item, $category_type);
}
}
public static function encryptOld($passwd)
{
$old_cookiekey = 'OMpLSFgIVRfv81Ti9ib4oYk6VBFOOr099tyRugfNQK3QV0UjIPrEu4r2';
return md5($old_cookiekey.$passwd);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -135,6 +135,14 @@
<div class="col-md-6 col-sm-6">
{include file="./post_img.tpl" post=$post}
</div>
{if $key == 0
&& !empty($articles.$key_up->products)}
<div class="col-md-6 col-sm-6">
{hook h='displayProductCategory'}
</div>
{/if}
{assign var=is_product value=false}
{/if}
{/foreach}

View File

@ -8,7 +8,6 @@ body.content_only { margin: 0 }
/*************************************************************************************************************
**************************************** INDEX ******************************************
**************************************************************************************************************/
#header {
background: #fff;
position: relative;
@ -328,6 +327,10 @@ body .ac_results {
text-align: center;
margin: 15px 0;
}
#index main .rightHome .pub {
margin: 29px 0;
margin-top: 23px;
}
.inner_edito {
border-bottom: 3px solid #333333;
@ -2591,6 +2594,7 @@ body .ac_results {
margin: 0 auto;
margin-bottom: 30px;
}
#product #features ul {
float: left;
width: 100%;
@ -2608,6 +2612,37 @@ body .ac_results {
#product .attachments h3{ font-family: 'vidaloka'; border-bottom: 2px solid #333; }
#product .attachments a.link{ color: #333; }
/** PACK PRODUIT **/
#product .short_description_pack {}
#product .short_description_pack .pack_content { margin-bottom: 30px; }
#product .short_description_pack h5 {
border-bottom: 1px solid #ccc;
padding-bottom: 5px;
text-transform: uppercase;
}
#product #features.short_description_pack .img_pack { text-align: center;}
#product #features.short_description_pack .img_pack img { display: inline;}
#product #features.short_description_pack a.link { color :#e44e58; }
#product #features.short_description_pack .content_pack ul { padding: 0; font-size: 13px;}
#product #features.short_description_pack .content_pack ul {
float: left;
width: 100%;
}
#product #features.short_description_pack .price {}
#product #features.short_description_pack .price .red { color :#e44e58; font-size: 15px; }
#product #features.short_description_pack .content_pack ul li {
background: #f5f5f5;
height: 25px;
line-height: 25px;
}
#product #features.short_description_pack .content_pack ul li:nth-child(even) {
background: #fff;
}
#product #features.short_description_pack ul li span:first-child { font-weight: normal; }
/** PACK PRODUIT **/
#product #related .subtitle {
background: url('../img/bg_title.png') no-repeat 0 0px;
color: #fff;

View File

@ -908,3 +908,5 @@ body .fancybox-overlay {
}
.banner { text-align: center; }
.banner img { display: inline; }

View File

@ -34,7 +34,7 @@
<script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script>
{/foreach}
{/if}
{$HOOK_HEADER}
{$HOOK_HEADER}
<!--[if IE 8]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
@ -48,6 +48,8 @@
<p>{l s='You cannot place a new order from your country.'} <span class="bold">{$geolocation_country|escape:'html':'UTF-8'}</span></p>
</div>
{/if}
<div class="banner">{hook h='displayBanner'}</div>
<header id="header">
<div class="bg-pink">

View File

@ -57,7 +57,9 @@
{foreach from=$posts_home_1 item=post key=key}
{if $key == 2}
<div class="col-md-6 col-sm-6 pub">
{hook h='displayHomeRight2'}
<article>
{hook h='displayHomeRight2'}
</article>
</div>
{/if}
<div class="col-md-6 col-sm-6">
@ -66,7 +68,7 @@
{/foreach}
</div>
</div>
<div class="col-md-4">
<div class="col-md-4 rightHome">
<div class="pub">
{hook h='displayHomeRight1'}
</div>
@ -109,9 +111,8 @@
{/foreach}
</div>
<div class="col-md-4 col-sm-6">
PUB
</div>
deriner ligne
{hook h='displayHomeProductBottom'}
</div>
</div>
<div class="row">

View File

@ -543,6 +543,7 @@ $_LANG['product_9a9a97ca85af73f90515e72745f730f0'] = 'au lieu de';
$_LANG['product_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description';
$_LANG['product_bc0f7082192ef02e934a036cf4991789'] = 'Ce produit n\'est plus en stock';
$_LANG['product_cb0645f153ad1a4e8b9a2978aa09b815'] = 'Agrandir';
$_LANG['product_e54a973d0c3342dac6ee7d9e145c6f83'] = 'Contenu du pack';
$_LANG['product_e635032a5f71d809146d3872389f5b0c'] = 'Ajouter';
$_LANG['product_f787618e514c038851726224d7e4421e'] = 'Aucun fichier sélectionné';
$_LANG['product_fa3638ce880fddddb872f53943933487'] = 'avec ces options mais reste disponible avec d\'autres options';

View File

@ -1,13 +1,3 @@
<div class="intro_top intro_product">
<div class="container">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
PUB
</div>
</div>
</div>
</div>
<main>
{include file="$tpl_dir./errors.tpl"}
{if $errors|@count == 0}
@ -410,11 +400,41 @@
<div class="col-md-6">
<section id="features-docs" class="tab-title">
<div class="row">
{if $packItems|@count > 0}
<div id="features" class="short_description_pack">
<h3 class="subtitle">{l s='Pack content'}</h3>
{foreach from=$packItems item=packItem}
<div class="pack_content row">
<div class="col-md-3 img_pack">
<img class="img-responsive" src="{$link->getImageLink($packItem.link_rewrite, $packItem.id_image, 'cart_default')|escape:'html':'UTF-8'}" alt="{$packItem.name|escape:'html':'UTF-8'}">
</div>
<div class="col-md-9 content_pack">
{$packItem.pack_quantity} x <a class="link" href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)|escape:'html':'UTF-8'}">{$packItem.name|escape:'html':'UTF-8'}</a>
<p class="price">
{l s='Prix unitaire :'} <span class="red">{convertPrice price=$packItem.price}</span>
</p>
<!-- <h5>{l s='Data sheet'}</h5> -->
<ul class="features">
{foreach from=$packItem.features item=feature}
<li>
{if isset($feature.value)}
<span class="col-xs-5">{$feature.name|escape:'html':'UTF-8'}</span>
<span class="col-xs-7">{$feature.value|escape:'html':'UTF-8'}</span>
{/if}
</li>
{/foreach}
</ul>
</div>
</div>
{/foreach}
</div>
{/if}
<!-- Features -->
{if isset($features) && $features}
<div id="features">
<header>
<h3 class="subtitle">{l s='Data sheet'}</h3>
<h3 class="subtitle">{l s='Data sheet'}</h3>
</header>
<ul class="col-xs-12">
{foreach from=$features item=feature}