This commit is contained in:
Thibault GUILLAUME 2015-09-18 12:16:58 +02:00
parent f367e06de2
commit f0828dad43
13 changed files with 76 additions and 24 deletions

View File

@ -81,7 +81,12 @@ class Cms_Pack extends Module
$collection_product = new Collection('Product', $id_lang);
$collection_product->where('id_product', 'IN', $pack->products);
$collection_product->where('active', '=', 1);
$result['products'] = $collection_product->getResults();
$products = $collection_product->getResults();
$products = array_map(function($product) {
return $product->loadReductionInfo();
}, $products);
$result['products'] = $products;
$price = array_map(function($product) {
return floatval($product->price);

View File

@ -97,4 +97,5 @@ class AdminCmsPackController extends ModuleAdminController
}
parent::processDelete();
}
}

View File

@ -22,8 +22,10 @@
<p class="name">{$product->name}</p>
</div>
<div class="col-md-2">
<div class="quantity">
<div class="quantity quantity_box">
<span class="change_quantity" data-action="down">-</span>
<input type="text" value="1" size="3" data-product-id="{$product->id}" name="quantity_{$product->id}" class="product_add_{$product->id} quantity_bottom">
<span class="change_quantity" data-action="up">+</span>
</div>
</div>
<div class="col-md-3">
@ -49,6 +51,26 @@
</div>
</div>
</div>
{hook h='reassuranceTopProduct'}
</div>
<div class="reassurance">
<div class="reinsurance">
<div class="row">
<div class="col-sm-4">
<div class="border bloc">
<span class="icon-logistics3"></span>{l s='Livraison express' mod='cms_pack'}
</div>
</div>
<div class="col-sm-4 bloc">
<div class="border">
<span class="icon-coins30"></span>{l s='Satisfait ou remboursé' mod='cms_pack'}
</div>
</div>
<div class="col-sm-4 bloc">
<div class="border">
<span class="icon-lock39"></span>{l s='Paiement sécurisé' mod='cms_pack'}
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,8 +1,11 @@
<?php
if (!defined('_CAN_LOAD_FILES_'))
exit;
include_once dirname(__FILE__).'/classes/CmsPsPost.php';
include_once dirname(__FILE__).'/classes/CmsPsEdito.php';
include_once dirname(__FILE__).'/classes/CmsPsCategory.php';
class CmsPS extends Module
{
public function __construct()
@ -45,6 +48,12 @@ class CmsPS extends Module
public function hookdisplayRelatedProduct($params) {
$id_product = $params['product']->id;
p($id_product);
$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');
}
}
}

View File

@ -1,5 +1,5 @@
<?php
include_once dirname(__FILE__).'/../../classes/CmsPsCategory.php';
include_once dirname(__FILE__).'/../../cmsps.php';
class AdminCmsPsCategoriesController extends ModuleAdminController {

View File

@ -1,5 +1,5 @@
<?php
include_once dirname(__FILE__).'/../../classes/CmsPsEdito.php';
include_once dirname(__FILE__).'/../../cmsps.php';
class AdminCmsPsEditosController extends ModuleAdminController {

View File

@ -109,6 +109,13 @@
{block name="defaultForm"}
<script type="text/javascript">
searchUrl = "{$link->getAdminLink('AdminSearch', true)}";
{literal}
$(document).ready(function() {
$('select#id_category').chosen({width: '250px'}).trigger("chosen:updated");
});
{/literal}
</script>
{$smarty.block.parent}
{/block}

View File

@ -0,0 +1,10 @@
<div class="relation_post">
<h3 class="subtitle">{l s='Ce produit peut vous sauver la vie pour' mod='cmsps'}</h3>
<div class="row">
{foreach from=$relations item=post key=key}
<div class="col-sm-4">
{include file="$tpl_dir/post_img.tpl" post=$post}
</div>
{/foreach}
</div>
</div>

View File

@ -49,7 +49,6 @@ i.awesome {
.btn.add_to_cart_button,
.btn.ajax_add_to_cart_button,
.btn.add_to_cart_pack {
padding-left: 50px;
padding-right: 20px;
}
.btn.add_to_cart_button i,
@ -237,8 +236,11 @@ span.title {
padding: 10px 20px;
position: relative;
text-transform: uppercase;
transition: all 0.2s ease;
}
.btn span {
margin-left: 30px;
}
.btn:hover, .btn:focus, .btn.focus { background: #6ac5bb; color: #fff }
.btn-black {

View File

@ -33,6 +33,12 @@
<div class="separator"></div>
<div id="best_sales">
{hook h='displayHome' mod='blockbestsellers'}
</div>
<div class="separator"></div>
<div id="home_products">
{hook h='displayHome' mod='categorieshome'}
</div>
@ -54,11 +60,6 @@
</div>
</div>
<div class="separator"></div>
<div id="best_sales">
{hook h='displayHome' mod='blockbestsellers'}
</div>
<div class="separator"></div>

View File

@ -391,8 +391,6 @@
<div class="container">
<div class="separator"></div>
{hook h='displayRelatedProduct' product=$product}
<h3 class="subtitle">{l s='Ce produit peut vous sauver la vie pour'}</h3>
</div>
{/if}
</main>

View File

@ -2,7 +2,7 @@
<div class="inner clearfix">
<div class="col-md-2 col-xs-3 image">
<a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'html':'UTF-8'}">
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html':'UTF-8'}" alt="{$pnames.name|escape:'html':'UTF-8'}" />
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html':'UTF-8'}" alt="{$product.name|escape:'html':'UTF-8'}" />
</a>
</div>
<div class="col-md-3 product-infos">
@ -37,14 +37,11 @@
<span class="old-price barre">{convertPrice price=$product.price_without_specific_price}</span>
{/if}
{if $product.ecotax > 0 || $product.sorecop > 0}
{if $product.ecotax > 0}
<ul class="taxes">
{if $product.ecotax > 0}
<li>{l s='Including'} {displayPrice price=($product.ecotax)*1.2-($product.sorecop*1.2)} {l s='of Ecotax'}</li>
{/if}
{if $product.sorecop > 0}
<li>{l s='Including'} {displayPrice price=$product.sorecop*1.2} {l s='of Sorecop'}</li>
{/if}
</ul>
{/if}
</div>
@ -66,7 +63,7 @@
<!-- Moins -->
{if $product.minimal_quantity < ($product.cart_quantity-$quantityDisplayed) OR $product.minimal_quantity <= 1}
<a rel="nofollow" class="cart_quantity_down" id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "add=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery={$product.id_address_delivery|intval}&amp;op=down&amp;token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Subtract'}">
<span class="icon icon-minus"></span>
<span class="icon icon-minus">-</span>
</a>
{else}
<a class="cart_quantity_down icon disabled" href="#" id="cart_quantity_down_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" title="{l s='You must purchase a minimum of %d of this product.' sprintf=$product.minimal_quantity}">
@ -79,7 +76,7 @@
<!-- Plus -->
<a rel="nofollow" class="cart_quantity_up" id="cart_quantity_up_{$product.id_product}_{$product.id_product_attribute}_{if $quantityDisplayed > 0}nocustom{else}0{/if}_{$product.id_address_delivery|intval}" href="{$link->getPageLink('cart', true, NULL, "add=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery={$product.id_address_delivery|intval}&amp;token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add'}">
<span class="icon icon-plus"></span>
<span class="icon icon-plus">+</span>
</a>
</div>
{/if}

View File

@ -11,7 +11,7 @@
<h1>
{l s='Shopping-cart summary'}
</h1>
{include file="$tpl_dir./order-steps.tpl"}
{include file="$tpl_dir./order-steps.tpl" current_step="summary"}
</div>
</header>