Best Seller Block (Themeing)

Posts: 64
Joined: 02/13/2008

Hey all

i'm new to ubercart and i must say WOW what a great module i've only been playing with it for about a week now but i think it's great Smiling.

i have been messing with drupal themeing for about nearly a month now so i'm still new.

my problem is i'm trying to theme the best sellers block i have displayed on the right but i don't want all the crap ubercart seems to spit out when displayign the best sellers block all i want is to be able to theme it like so:

img
title
price

that's all i need to display how would i go about doing this?

Thanks for any help in advance.

Posts: 64
Joined: 02/13/2008
Posts: 4686
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

I haven't used this block before... can you post up a screenshot? I may be able to offer some insights or get it trimmed down in core.

Posts: 46
Joined: 11/22/2007

how about:

function phptemplate_uc_bestsellers_products($products){
$output = "<div id=\"view-bestsellers\">";
$nr = 1;
foreach($products as $p){
$node = node_load((int)$p);
$vars['nid'] = $node->nid;
$vars['nr'] = $nr;
$vars['name'] = $node->title;
$vars['description'] = $node->body;
$vars['image'] = (file_exists($node->field_image_cache[0]['filepath']))?l(theme('imagecache', 'product_list', $node->field_image_cache[0]['filepath']), "node/".$node->nid, array(), null, null, false, true):'';
$vars['list_price'] = $node->list_price;
$vars['sell_price'] =  $node->sell_price;
$vars['link'] =  url('node/'.$node->nid);
$output .= _phptemplate_callback('bestsellers', $vars);
$nr++;
}
return $output."</div>";
}

bestsellers.tpl.php: (didn't use images)

<div class="productlist-item">
<div class="row row-<?php print ($nr); ?>">
<a href="<?php print ($link); ?>"><span class="name"><?php print ($name);?></span></a>
</div>
</div>

Posts: 869
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

mykz-

I'd like to point out that I answered this question for you on IRC the same day you posted it here in these forums. Perhaps if you didn't understand what I told you, or if it didn't work for you, you could post what you tried and say what problems you still have. No need to act like your question has been ignored.

--

<tr>.

Posts: 64
Joined: 02/13/2008

TR i can't remember you posting anything in the channel?

the block i'm trying to theme ryan is the block in the red quare in the screenshot i have added to this post.

and thanks kcoworks i'll give it ago and post my feedback.

Mike

AttachmentSize
screenshot.png189.23 KB