Jump to content

Edit History

yakusa

yakusa

Welcome,

I am writing my first module which is to show in my template .tpl some info based on the data coming directly from the product controller, let's say {$product.name}.

Well, everything works but only on the product page ... On the category page when the module template is hooked to the hook {hook h='displayProductListReviews' product=$product} and contains {$product.name} then I get info

Notice: Undefined index: product ...

When I paste the code from the module's tpl directly into the file product.tpl (thumbnail) everything works.

When I add something like that to my tpl
 

{foreach from=$products item="product"}
      {$product.name} 
{/foreach} 

Then it works but as you can see it's not as I would like it - it does not display info for a given product.

I would add that I used all necessary implementations of the product from the ps_specials which should be just fine
 

$products = $this->getSpecialProducts();
	$this->smarty->assign(
		array(
			'products' => $products,
		));	
	return false;

Thanks for the help!

yakusa

yakusa

Welcome,

I am writing my first module which is to show in my template .tpl some info based on the data coming directly from the product controller, let's say {$product.name}.

Well, everything works but only on the product page ... On the category page when the module template is hooked to the hook {hook h='displayProductListReviews' product=$product} and contains {$product.name} then I get info

Notice: Undefined index: product ...

When I paste the code from the module's tpl directly into the file product.tpl (thumbnail) everything works.

When I add something like that to my tpl
 

{foreach from=$products item="product"}
      {$product.name} 
{/foreach} 

Then it works but as you can see it's not as I would like it - it does not display info for a given product.

I would add that I used all necessary implementations of the product from the ps_featuredproducts which should be just fine
 

$products = $this->getSpecialProducts();
	$this->smarty->assign(
		array(
			'products' => $products,
		));	
	return false;

Thanks for the help!

×
×
  • Create New...