Jump to content

Modification Blocknews products


Recommended Posts

Bonjour,

 

J'ai modifié mon fichier blocknewproducts.php afin de pouvoir mettre le module sur ma Home.

 

Le problème c'est que j'utilise cette fonction :

 

public function hookHome($params)

{

return $this->hookRightColumn($params);

}

 

 

Et qu'elle retourne bien mon module sur la Home : Nouveaux produit avec un bouton en dessous : Tous les nouveaux produits.

 

Je n'arrive pas à faire une fonction pour retourner les nouveaux produits directement sur la page d'accueil et ne pas avoir à cliquer sur le bouton et aller sur une autre page

 

 

Merci de votre aide

Link to comment
Share on other sites

Bonjour,

 

Merci pour la réponse, actuellement j'ai sa qui s'affiche (voir PJ)

 

et quand je clique sur le bouton, j'ai mes nouveaux produits.

 

Je souhaiterais afficher directement sur ma page les nouveaux produits.

 

J’espère que mes explications seront plus clair !

 

Merci

post-497770-0-89500500-1363107166_thumb.png

Link to comment
Share on other sites

J'ai testé :

 

 

public function hookDisplayHome($params)

{

 

global $smarty;

$currency = new Currency(intval($params['cookie']->id_currency));

$newProducts = Product::getNewProducts(intval($params['cookie']->id_lang), 0, Configuration::get('NEW_PRODUCTS_NBR'));

 

$new_products = array();

if ($newProducts)

foreach ($newProducts AS $newProduct)

$new_products[] = $newProduct;

 

$smarty->assign('new_products', $new_products);

return $this->display(__FILE__, 'blocknewproducts.tpl');

 

 

}

 

 

Mais cela me retourne une miniature, avec la description en dessous + le bouton : " Tous les nouveaux produit.

 

Pour l'instant, je n'arrive pas à avoir la même mise en page que "Featured product"

Link to comment
Share on other sites

Pour ma part, j'ai ceci et ca fonctionne.

 

public function hookRightColumn($params)

{

$newProducts = Product::getNewProducts((int)(

$params['cookie']->id_lang), 0, (int)(Configuration::get('NEW_PRODUCTS_NBR')));

if (!$newProducts && !Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))

return;

$this->smarty->assign(array(

'new_products' => $newProducts,

'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),

));

return $this->display(__FILE__, 'blocknewproducts.tpl');

}

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...