amro Posted June 12, 2013 Share Posted June 12, 2013 bonjour, je suis entrain de réaliser un site local,j ai développé également un module. mon problème c'est que je veux mettre un lien hypertexte dans une page tpl qui mènera à une autre.pouvez vous m'aider svp? merci Link to comment Share on other sites More sharing options...
amro Posted June 12, 2013 Author Share Posted June 12, 2013 voila dans le fichier php j ai mis : public function hookDisplayHome($params) { global $smarty, $cookie; $category = new Category(1); $nb = intval(Configuration::get('HOME_SPECIALS_NBR')); $rand = intval(Configuration::get('HOME_SPECIALS_RANDOM')); if ($rand == 1) { $products = Product::getPricesDrop(intval($cookie->id_lang), 0, $nb); if ( $products ) { shuffle($products); array_splice($products, ($nb ? $nb : 10)); } } else { $products = Product::getPricesDrop(intval($cookie->id_lang), NULL - 0, (intval($nb ? $nb : 4)), false, NULL, NULL); } $smarty->assign(array( 'allow_buy_when_out_of_stock' => Configuration::get('PS_ORDER_OUT_OF_STOCK', false), 'max_quantity_to_allow_display' => Configuration::get('PS_LAST_QTIES'), 'category' => $category, 'products' => $products, 'currency' => new Currency(intval($params['cart']->id_currency)), 'lang' => Language::getIsoById(intval($params['cookie']->id_lang)), 'productNumber' => sizeof($products), 'homeSize' => Image::getSize('home'), 'ps_version' => _PS_VERSION_)); $sql = 'SELECT * FROM `'._DB_PREFIX_.'appeldoffre`'; if ($results = Db::getInstance()->ExecuteS($sql)) foreach ($results as $row) echo $row[‘title’] ; echo $row[‘date’]; echo $row[‘id_offer’]; $smarty->assign('results',$results); $this->context->smarty->assign( array( 'my_module_name' => Configuration::get('MYMODULE_NAME'), 'my_module_link' => $this->context->link->getModuleLink('appeldoffre', 'display') ) ); return $this->display(__FILE__, 'appeldoffre.tpl'); } et dans /controllers/front j ai mis display.php: <?php class appeldoffredisplayModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->setTemplate('appeldoffre1.tpl'); } } ?> sachant que appeldoffre1.tpl se trouve dans views/templates/front et enfin j ai dans le ficher tpl principale qui se trouve dans /views/templates/hook et qui contient le lien: {foreach $results as $r} <li class="latest_row_s"> <div style="float: right;" class="latest_date_s"> {$r.date} </div> <a href="{$my_module_link}"> <img src="/prestashop/modules/contentbox/imgs/tn.png" border="0"> <span>{$r.title}</span> </a> </li>{/foreach} Résultat:le lien redirige vers index.php(juste la page s'actualise)!!!!!! Link to comment Share on other sites More sharing options...
amro Posted June 15, 2013 Author Share Posted June 15, 2013 personne ne peut m'aider? Link to comment Share on other sites More sharing options...
amro Posted June 19, 2013 Author Share Posted June 19, 2013 petit up je suis encore coincé 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