9 replies [Last post]
ksalling's picture
Offline
Joined: 02/19/2009
Juice: 34
Was this information Helpful?

I have tried to do a custom node-product template in my theme. I have the theme enabled via the sections module and node/* is included in the list. I have added node-product.tpl.php to my theme but is does not seem to have any effect. Can anyone point me in the right direction?

Thanks,

-K

imstillatwork's picture
Offline
Bug Finder
Joined: 12/27/2008
Juice: 207
Re: custom product template?

Same problem here in 6.1 / 2.0 beta5

created a node-product.tpl.php file in the theme folder and added the code found here: http://www.ubercart.org/forum/development/3868/nifty_products_tutorial_p...

disabled caches & theme registry
cleared caches
disabled cache on browser

can't get anything to change on a product detail page. Sort of totally disappointing.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: custom product template?

I created a node-product.tpl.php in the theme directory of the theme I'm using (e.g. /themes/garland/ ), emptied the cache tables with the devel module, and viola it worked. As it always has ... I guess you put your node-product.tpl.php in the wrong place, named it wrong (product classes use a different .tpl.php, not node-product), didn't clear all the cache tables, or something of that nature. Nothing really that Ubercart could be doing to mess up this Drupal template loading mechanism.

<tr>.
torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Re: custom product template?

For some reason I have found that the registry won't accept your node-product.tpl.php if there is not a node.tpl.php file in your theme directory. I haven't seen this documented anywhere (but I haven't looked a whole lot) but on our site, we have a D6 sandbox, and experienced the same thing. I created node-product.tpl.php, but still our nodes were not being rendered with the new template. (This is using a Zen subtheme, btw.) As soon as I copied the node.tpl.php file from the Zen folder into my Subtheme folder, the node-product.tpl.php file started taking effect. Very strange.

--
Help directly fund development: Donate via PayPal!

mor_eli's picture
Offline
Joined: 07/06/2009
Juice: 40
That did it

You advise worked perfectly. and it is strange it would do that...

timdiacon's picture
Offline
Joined: 12/13/2009
Juice: 23
Thank you!

torgosPizza - Thankyou so much! I've been staring at my node-product.tpl.php for 2 days now completly unable to fathom why it was not doing anything. I copied the zen node.tpl.php into my sub theme and bang it worked straight away.

Thankyou so much for figuring this out!

jdixon567's picture
Offline
Joined: 10/25/2009
Juice: 75
Re: Re: Re: Re: custom product template?

Thanks for the tip, you just saved me hours of frustration!

ncosic's picture
Offline
Joined: 11/26/2011
Juice: 9
Drupal 7 template names

I've spent some time over this, modifying my website www.cp-dev.com . The issue with Drupal 7 and product templates is in minuses in file name. So you have to have two dashes instead of one. The template that sells content type 'services' turns from node-services.tpl.php into node--services.tpl.php .

mpalermo's picture
Offline
Joined: 01/20/2012
Juice: 22
Re: Drupal 7 template names

I'm trying to customize my product page for Drupal 7. Do you have a valid template file that you would be willing to share as a starting point? I can't find a workable one on here.

Visit us at: http://totaldev.com

ncosic's picture
Offline
Joined: 11/26/2011
Juice: 9
Re: Re: Drupal 7 template names

As far as I know, any Drupal 7 template will work for you. I remember using just the first template I liked, there were no compatibility issues with Ubercart.