BIG PRINT Posted September 23, 2013 Share Posted September 23, 2013 Bonjour à tous. J'ai besoin de vos précieux conseils!! j'ai mis en page d'accueil un module de la société RSI (ICI). Que j'ai modifié à mon goût. www.impression-drapeaux.fr Mais j'aimerais juste que les prix HT de mes produits s'affichent! et là c'est impossible pour moi!! Pouvez vous m'aider? ci-joint mon homefeatered.tpl <div id="featured-products_block_center" class="block products_block" style="width:100%;margin-top:20px;"> <h2 style="margin:0 auto">{l s='Featured products' mod='homefeaturedm'}</h2> <div style="height:800px;"> {foreach from=$currencies key=k item=f_currency} {if $id_currency_cookie == $f_currency.id_currency} {assign var='symabolCurrency' value=$f_currency.sign} {/if} {/foreach} {foreach from=$productsfs item=productfs name=homeFeaturedProducts2} {assign var='productLink' value=$link->getProductLink($productfs.id_product, $productfs.link_rewrite)} <div class="boxgrid caption"> <a href="{$productfs.link}" title="More" style="border:none" > {if $psversion < "1.5.0.0"} <img src="{$link->getImageLink($productfs.link_rewrite, $productfs.id_image, 'large')}" height="200"/> {else} <img src="{$link->getImageLink($productfs.link_rewrite, $productfs.id_image, 'large_default')}" height="200"/> {/if} </a> <div class="cover boxcaption"> <h3>{$productfs.name|escape:htmlall:'UTF-8'|truncate:35}</h3> <p class="product_desc"><a href="{$productfs.link}" title="More" style="color:#FFF;font-style:italic">{$productfs.description_short|strip_tags:'UTF-8'|truncate:130}</a> </p> </div> </div> {/foreach} </div> </div> <!-- /MODULE Home Featured Products --> je suis en presta 1.5.4.1 sur le template de Thomas PEIGNE (responsive simple). Merci Link to comment Share on other sites More sharing options...
indesign47 Posted September 23, 2013 Share Posted September 23, 2013 Bonsoir, Essayes de rajouter ceci : (trouver dans le homefeatured.tpl) <a class="lnk_more" href="{$product.link|escape:'html'}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a> {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if} en remplaçant à l'intérieur ceci {if !$priceDisplay}{convertPrice price=$product.price_tax_exc}{else}{convertPrice price=$product.price}{/if} Link to comment Share on other sites More sharing options...
BIG PRINT Posted September 23, 2013 Author Share Posted September 23, 2013 Bonsoir, Essayes de rajouter ceci : (trouver dans le homefeatured.tpl) <a class="lnk_more" href="{$product.link|escape:'html'}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a> {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if} en remplaçant à l'intérieur ceci {if !$priceDisplay}{convertPrice price=$product.price_tax_exc}{else}{convertPrice price=$product.price}{/if} Merci de ton aide Mais j'ai essayé sans résultat (cache vidé + recompilation smarty). Rine ne s'affiche. mon fichier homefeatured.tpl modifié est comme ça <div id="featured-products_block_center" class="block products_block" style="width:100%;margin-top:20px;"> <h2 style="margin:0 auto">{l s='Featured products' mod='homefeaturedm'}</h2> <div style="height:800px;"> {foreach from=$currencies key=k item=f_currency} {if $id_currency_cookie == $f_currency.id_currency} {assign var='symabolCurrency' value=$f_currency.sign} {/if} {/foreach} {foreach from=$productsfs item=productfs name=homeFeaturedProducts2} {assign var='productLink' value=$link->getProductLink($productfs.id_product, $productfs.link_rewrite)} <div class="boxgrid caption"> <a href="{$productfs.link}" title="More" style="border:none" > {if $psversion < "1.5.0.0"} <img src="{$link->getImageLink($productfs.link_rewrite, $productfs.id_image, 'large')}" height="200"/> {else} <img src="{$link->getImageLink($productfs.link_rewrite, $productfs.id_image, 'large_default')}" height="200"/> {/if} </a> <div class="cover boxcaption"> <h3>{$productfs.name|escape:htmlall:'UTF-8'|truncate:35}</h3> <p class="product_desc"><a href="{$productfs.link}" title="More" style="color:#FFF;font-style:italic">{$productfs.description_short|strip_tags:'UTF-8'|truncate:130}</a> <a class="lnk_more" href="{$product.link|escape:'html'}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a> {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price_tax_exc}{else}{convertPrice price=$product.price}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}</p> </div> </div> {/foreach} </div> </div> <!-- /MODULE Home Featured Products --> ai je loupé un truc? Link to comment Share on other sites More sharing options...
indesign47 Posted September 23, 2013 Share Posted September 23, 2013 (edited) Essayes en rajoutant uniquement ceci {if !$priceDisplay}{convertPrice price=$product.price_tax_exc}{else}{convertPrice price=$product.price}{/if} Vérifies le fichier php du module il faut qu'il appelle les différentes variables : $priceDisplay et $product.price_tax_exc et $product.price Edited September 23, 2013 by indesign (see edit history) Link to comment Share on other sites More sharing options...
BIG PRINT Posted September 23, 2013 Author Share Posted September 23, 2013 Essayes en rajoutant uniquement ceci {if !$priceDisplay}{convertPrice price=$product.price_tax_exc}{else}{convertPrice price=$product.price}{/if} Vérifies le fichier php du module il faut qu'il appelle les différentes variables : $priceDisplay et $product.price_tax_exc et $product.price Salut, je pense que le soucis viens du .php <?php class HomeFeaturedm extends Module { private $_html = ''; private $_postErrors = array(); function __construct() { $this->name = 'homefeaturedm'; if(_PS_VERSION_ > "1.4.0.0" && _PS_VERSION_ < "1.5.0.0"){ $this->tab = 'front_office_features'; $this->author = 'RSI'; $this->need_instance = 1; } elseif(_PS_VERSION_ > "1.5.0.0"){ $this->tab = 'front_office_features'; $this->author = 'RSI'; } else{ $this->tab = 'Home'; } $this->version = '1.3'; parent::__construct(); $this->displayName = $this->l('Featured Products on the homepage with slide'); $this->description = $this->l('Displays Featured Products in the middle of your homepage with slide- www.catalogo-onlinersi.com.ar'); } function install() { if (!Configuration::updateValue('HOME_FEATUREDM_NBR', 8) OR !Configuration::updateValue('HOME_FEATUREDM_COLOR', 000000) OR !parent::install() OR !$this->registerHook('home') OR !$this->registerHook('header')) return false; return true; } public function getContent() { $output = '<h2>'.$this->displayName.'</h2>'; if (Tools::isSubmit('submitHomeFeatured')) { $nbr = intval(Tools::getValue('nbr')); $color = Tools::getValue('color'); Configuration::updateValue('HOME_FEATUREDM_COLOR', $color); if (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr)) $errors[] = $this->l('Invalid number of product'); else Configuration::updateValue('HOME_FEATUREDM_NBR', $nbr); if (isset($errors) AND sizeof($errors)) $output .= $this->displayError(implode('<br />', $errors)); else $output .= $this->displayConfirmation($this->l('Settings updated')); } return $output.$this->displayForm(); } public function displayForm() { $output = ' <link rel="stylesheet" href="../modules/homefeaturedm/css/colorpicker.css" type="text/css" /> <script type="text/javascript" src="../modules/homefeaturedm/js/colorpicker.js"></script> <script type="text/javascript" src="../modules/homefeaturedm/js/eye.js"></script> <script type="text/javascript" src="../modules/homefeaturedm/js/utils.js"></script> <script type="text/javascript" src="../modules/homefeaturedm/js/layout.js?ver=1.0.2"></script> <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Settings').'</legend> <p>'.$this->l('In order to add products to your homepage, just add them to the "home" category.').'</p><br /> <label>'.$this->l('Number of product displayed').'</label> <div class="margin-form"> <input type="text" size="5" name="nbr" value="'.Tools::getValue('nbr', Configuration::get('HOME_FEATUREDM_NBR')).'" /> <p class="clear">'.$this->l('The number of products displayed on homepage (default: 10)').'</p> </div> <label>'.$this->l('Background color').'</label> <div class="margin-form"> <div id="customWidget"> <input type="text" maxlength="6" name="color" size="6" id="colorpickerField4" value="'.Tools::getValue('color', Configuration::get('HOME_FEATUREDM_COLOR')).'" /> <p class="clear">'.$this->l('Color of the glow (default 000000)').'</p> </div> </div> <center><input type="submit" name="submitHomeFeatured" value="'.$this->l('Save').'" class="button" /></center> <center> <a href="../modules/homefeaturedm/moduleinstall.pdf">README</a></center><br/> <center> <a href="../modules/homefeaturedm/termsandconditions.pdf">TERMS</center></a><br/> </fieldset> </form><form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <fieldset><legend><img src="'.$this->_path.'logo.gif" alt="" title="" />'.$this->l('Contribute').'</legend> <p class="clear">'.$this->l('You can contribute with a donation if our free modules and themes are usefull for you. Clic on the link and support us!').'</p> <p class="clear">'.$this->l('For more modules & themes visit: www.catalogo-onlinersi.com.ar').'</p> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="HMBZNQAHN9UMJ"> <input type="image" src="https://www.paypalobjects.com/WEBSCR-640-20110401-1/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypalobjects.com/WEBSCR-640-20110401-1/en_US/i/scr/pixel.gif" width="1" height="1"> </fieldset> </form>'; return $output; } function hookHome($params) { global $smarty; if(_PS_VERSION_ < "1.5.0.0"){ $category = new Category(1); } else{ $category = new Category(Context::getContext()->shop->getCategory(), Configuration::get('PS_LANG_DEFAULT')); } $nb = intval(Configuration::get('HOME_FEATUREDM_NBR')); if(_PS_VERSION_ < "1.5.0.0"){ $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); } else{ $products = $category->getProducts($params['cookie']->id_lang, 1, ($nb ? $nb : 10)); } $products = $category->getProducts(intval($params['cookie']->id_lang), 1, 100); if ($products) { shuffle($products); array_splice($products, ($nb ? $nb : 10)); } $smarty->assign(array( 'psversion' => _PS_VERSION_, 'productsfs' => $products, 'currency' => new Currency(intval($params['cart']->id_currency)), )); return $this->display(__FILE__, 'homefeatured.tpl'); } function hookHeader($params) { global $smarty; $color = Configuration::get('HOME_FEATUREDM_COLOR'); if(_PS_VERSION_ > "1.4.0.0" && _PS_VERSION_ < "1.5.0.0"){ Tools::addCSS(__PS_BASE_URI__.'modules/homefeaturedm/style.css', 'all'); Tools::addJS(__PS_BASE_URI__.'modules/homefeaturedm/script.js'); } if(_PS_VERSION_ > "1.5.0.0"){ $this->context->controller->addCSS(($this->_path).'style.css', 'all'); $this->context->controller->addJS(($this->_path).'script.js'); } $smarty->assign(array( 'colorhfm' => $color, 'psversion' => _PS_VERSION_, )); return $this->display(__FILE__, 'homefeatured-header.tpl'); } } Je ne vois pas les variables dont tu parles dans le fichier. Comment faire pour les "appeller"?? Merci, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now