spider17 0 Posted October 10, 2013 Bonjour a tous, je voulais créer dans mon thème acheter, un nouveau tpl pour la présentation du blocknewproducts.tpl au niveau de l'accueil, je suis sous presta 1.5.6 et dans le fichier blocknewproducts.php de monsite/modules/blocknewproducts j'ai modifier: public function hookHome($params) { return $this->hookRightColumn($params); } à public function hookHome($params) { if (!$this->isCached('blocknewproductsHome.tpl', $this->getCacheId())) { if (!Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY')) return; $newProducts = Product::getNewProducts((int) $params['cookie']->id_lang, 0, (int) Configuration::get('NEW_PRODUCTS_NBR')); if (!$newProducts) return; $this->smarty->assign(array( 'new_products' => $newProducts, 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), )); } return $this->display(__FILE__, 'blocknewproductsHome.tpl', $this->getCacheId()); } puis j'ai creer un nouveau fichier dans mon theme : blocknewproductsHome.tpl {* * 2007-2012 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-2012 PrestaShop SA * @version Release: $Revision: 6594 $ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <style> .title_block_home{ font-size: 15px; font-weight: bold; padding: 17px 7px 18px 37px; text-transform: uppercase; height: 35px; background: #8dc63f; line-height: 35px; width: 200px; } .title_block_home a{ text-decoration: none; } .add_to_cart{ margin-left: 28px; } </style> <!-- MODULE Block new products --> <div id="new-products_block" class="block products_block"> <br><br> <p class="title_block_home"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blocknewproducts'}">{l s='    Nouveaux Produits' mod='blocknewproducts'}</a></p> <br><br> <div class="block_content"> {if $new_products !== false} <ul class="products clearfix"> {foreach from=$new_products item='product' name='newProducts'} <li {if $smarty.foreach.newProducts.first} class="first"{/if} style="margin: 0 7px 55px 0 !important; width: 180px !important;"> <div class="prod_image"> <a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.legend|escape:html:'UTF-8'}" /></a> </div> <div class="prod_content"> <h5><a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}">{$product.name|truncate:20:'...'|escape:html:'UTF-8'}</a></h5> <span class="price">{convertPrice price=$product.price}</span> </div> <div class="add_to_cart"> <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='homefeatured'}">{l s='Ajouter au panier' mod='homefeatured'}</a> </div> </li> {/foreach} </ul> {else} <p>» {l s='No new products at this time' mod='blocknewproducts'}</p> {/if} </div> </div> <!-- /MODULE Block new products --> le problème c'est que sur l'accueil du site, tout s'affiche bien, mais lorsque je clique sur "ajouter au panier" rien ne se passe, et quand j'actualise la page, le/les produits ajouter sont bien dans le panier. je ne comprend pas le probleme. Merci pour votre aide. Share this post Link to post Share on other sites
spider17 0 Posted October 10, 2013 Svp besoin d'aide. Share this post Link to post Share on other sites
spider17 0 Posted October 10, 2013 y a t'il quelqu'un ici qui pourra m'aider? Share this post Link to post Share on other sites
spider17 0 Posted October 11, 2013 Bonjour a tous, s'il vous plait j'ai vraiment besoin de vous. Share this post Link to post Share on other sites
spider17 0 Posted October 11, 2013 personne ici n'est capable de m'aider? Share this post Link to post Share on other sites
coeos.pro 609 Posted October 11, 2013 salut, je viens de tester ton code et ça fonctionne chez moi, quand je clique sur "ajouter au panier" il est bien dans le panier une petite seconde après. Share this post Link to post Share on other sites
spider17 0 Posted October 11, 2013 (edited) merci coesos.pro pour votre reponse. je vous donne le lien test : ***** quand je clique dessus, rien ne se passe. Edited October 30, 2013 by spider17 (see edit history) Share this post Link to post Share on other sites
indesign47 101 Posted October 12, 2013 Bonsoir, Je viens de tester sur le site, les produits sont bien ajoutés au panier. Cordialement Share this post Link to post Share on other sites
spider17 0 Posted October 12, 2013 merci indesign. vous avez essayer l'accueil!? moi je doit rafraichir la page pour que ça marche, en plus j'ai pas l'animation d'ajout au panier. Share this post Link to post Share on other sites
indesign47 101 Posted October 12, 2013 Oui, j'avais vu qu'il n'y avait pas l'animation d'ajout du panier (elle pouvait avoir été enlevée ) Oui, aussi que le nombre de produit dans le panier n'était pas actualisé. Mais les produits sont bien rajoutés dans le panier. J'avoue ne pas avoir d'idée sur le sujet Share this post Link to post Share on other sites
spider17 0 Posted October 30, 2013 je vous remercie dans tout les cas. Share this post Link to post Share on other sites