Jump to content

Access to product variables from the custom module tpl

Recommended Posts


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"}

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();
			'products' => $products,
	return false;

Thanks for the help!

Edited by yakusa (see edit history)

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More