Merge branch 'shoping-cart_refonte' of gitlab.antadis.net:dev-antadis/toutpratique into shoping-cart_refonte
This commit is contained in:
commit
fa6049199d
47
modules/antadis_cross_selling/antadis_cross_selling.php
Normal file
47
modules/antadis_cross_selling/antadis_cross_selling.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
if (!defined('_CAN_LOAD_FILES_'))
|
||||
exit;
|
||||
|
||||
class Antadis_Cross_Selling extends Module
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'antadis_cross_selling';
|
||||
$this->tab = 'administration';
|
||||
$this->version = '1.0';
|
||||
$this->author = 'Antadis';
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Antadis Cross Selling');
|
||||
$this->description = $this->l('Ajouter un élément au panier.');
|
||||
$this->secure_key = Tools::encrypt($this->name);
|
||||
|
||||
$this->confirmUninstall = $this->l('Are you sure ?');
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install() && $this->registerHook('displayProductLineShoppingCart');
|
||||
}
|
||||
|
||||
public function hookdisplayProductLineShoppingCart($params)
|
||||
{
|
||||
$id_product = 34;
|
||||
$cart = Context::getContext()->cart;
|
||||
$product = new Product($id_product, true, Context::getContext()->language->id);
|
||||
$image = Image::getCover($product->id);
|
||||
$product->id_image = $image['id_image'];
|
||||
|
||||
|
||||
if (empty($cart->containsProduct($product->id))) {
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'product' => $product
|
||||
)
|
||||
);
|
||||
return $this->display(__FILE__, 'cartCrossSelling.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
35
modules/antadis_cross_selling/index.php
Normal file
35
modules/antadis_cross_selling/index.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
BIN
modules/antadis_cross_selling/logo.gif
Normal file
BIN
modules/antadis_cross_selling/logo.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 778 B |
BIN
modules/antadis_cross_selling/logo.png
Normal file
BIN
modules/antadis_cross_selling/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,20 @@
|
||||
<div class="table-row valign-middle product_cross_selling">
|
||||
<div class="col-md-2 col-xs-3 image">
|
||||
<a href="{$link->getProductLink($product->id, $product->link_rewrite)|escape:'html':'UTF-8'}">
|
||||
<img src="{$link->getImageLink($product->link_rewrite, $product->id_image, 'home_default')|escape:'html':'UTF-8'}" alt="{$product->name|escape:'html':'UTF-8'}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-4 product-infos">
|
||||
<a href="{$link->getProductLink($product->id, $product->link_rewrite)|escape:'html':'UTF-8'}">
|
||||
<span>{$product->name|strip}</span>
|
||||
</a>
|
||||
</div>
|
||||
<div id="product_price" class="col-md-4 hidden-sm hidden-xs hidden-xxs">
|
||||
<span class="price">{convertPrice price=$product->getPrice(true)}</span>
|
||||
</div>
|
||||
<div class="col-md-2 form-group add">
|
||||
<a class="buttons_bottom_block no-print ajax_add_to_cart_button" data-id-product="{$product->id}" data-minimal_quantity="1">
|
||||
<span>{l s='Ajouter' mod='antadis_cross_selling'}</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
@ -4553,9 +4553,25 @@ main#categorycms { margin-bottom: 30px }
|
||||
|
||||
#shopping-cart #calcul.table-row { margin: 10px -15px 0 -15px; }
|
||||
|
||||
|
||||
|
||||
|
||||
#shopping-cart #shopping-cart-products .product_cross_selling {
|
||||
background: #f6f0f0
|
||||
}
|
||||
#shopping-cart #shopping-cart-products .product_cross_selling .price {
|
||||
color: #e4535d;
|
||||
}
|
||||
#shopping-cart #shopping-cart-products .product_cross_selling .ajax_add_to_cart_button {
|
||||
border: 1px solid;
|
||||
cursor: pointer;
|
||||
font-family: "pompiere_regular";
|
||||
padding: 8px 15px;
|
||||
text-transform: uppercase;
|
||||
float: right;
|
||||
margin-right: 30px;
|
||||
}
|
||||
#shopping-cart #shopping-cart-products .product_cross_selling .ajax_add_to_cart_button:hover { text-decoration: none;}
|
||||
#shopping-cart #shopping-cart-products .product_cross_selling .ajax_add_to_cart_button:hover { background: #e4535d; color:#fff; }
|
||||
|
||||
@media (min-width: 1399px) {
|
||||
#shopping-cart .table-head .text-right, #shopping-cart #shopping-cart-products .total {
|
||||
padding-right: 50px;
|
||||
|
@ -3,7 +3,6 @@
|
||||
<section>
|
||||
<div class="intro_top order-process">
|
||||
<div class="container">
|
||||
|
||||
{include file="$tpl_dir./order-steps.tpl" current_step="summary"}
|
||||
</div>
|
||||
|
||||
@ -86,9 +85,10 @@
|
||||
></a>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
{/foreach}
|
||||
|
||||
{hook h='displayProductLineShoppingCart'}
|
||||
|
||||
{foreach $gift_products as $product}
|
||||
{include file="$tpl_dir./shopping-cart-product-line.tpl" product=$product}
|
||||
{/foreach}
|
||||
|
Loading…
x
Reference in New Issue
Block a user