$node->teaser includes price - twice!

Posts: 5
Joined: 09/01/2008

Hi guys,

Thank you for a great module. I'm just starting out with drupal and ubercart - and I've created a table-view listing products - but the view, (when I chose to display the teaser) showed the price (TWICE even) with the teaser output. It also shows the "Add to cart" button - as can be seen here: http://virk3.virkpaanettet.dk/da/view/produkter

I then installed contemplate - and set the template for products (the taxonomy term my products belong to) teaser to:

<?php
echo $node->teaser
?>

Yet it still displays the price.
It also shows the price in the "teaser variables" output - under the $node->teaser variable.

This seems wrong to me - or perhaps I'm just missing something obvious, I did wrong?

Posts: 1300
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Well you don't show the "teaser" on the product detail page. I think the default teaser that Ubercart displays includes the price and the add to cart button; but then you are also showing the node Body, which also displays the add to cart button and the price.

So to fix that you should not show the teaser in your node-product template.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 5
Joined: 09/01/2008

I'm only showing the teaser - not the body. atleast according to the views fields setup.

That's hardly a fix.

To use a teaser to show a short introduction to the item (article/whatever) is not exactly uncommon. What other purpose would a teaser have?
(edit: see f.ex. amazon uses this: http://www.amazon.com/gp/feature.html/ref=amb_link_5832602_1?ie=UTF8&doc... - they have a "part of the body and a "read more" link).
Also - having the cart-button and price as a seperate value ONLY - means I can freely place them as I see fit.

how do I template the teaser output? I find it VERY odd, that it would be "normal" to have a seperate variable for the sell_price - and a variable for the "add to cart"-button - and then also have those in the teaser variable. Makes absolutely no sense to me.

Posts: 5
Joined: 09/01/2008

I found that the teaser and body are only stored in node_revisions - and the price and "add to cart"-button is NOT in the teaser field. So when I access $node->teaser it would make sense that it shouldn't be in there either.

That the default template for the "product show" page - adds "add to cart"-button and sell_price - by modifying the $node->teaser variable - instead of just printing those to variables (that are readily accessible) is just plain ugly and wrong to me.

Is this done due to some short coming in drupal (as the shop items are nodes - perhaps the default nodeview can't easily be "altered" to show the button and price)?

Posts: 5
Joined: 09/01/2008

I just found this post:
http://www.ubercart.org/forum/support/3540/display_products_grid

Where he says he wants a layout like this:
http://www.lingvini.com/files/teaser_view.png

the answer there - is to use views - yet you say that displaying a teaser (like shown in the png above) is not possible without it adding the sell_price and a cart button.

I could probably hack the CSS and say display:none to the .display_price and button-class. But that's just plain ugly - and if anything else, ever uses the same class - I'm in a bad place Sad