5 replies [Last post]
mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 203
Was this information Helpful?

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.

mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 203
?

anyone?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: ?

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.

kcoworks's picture
Offline
Joined: 11/22/2007
Juice: 103
how about: function

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>
TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
mykz- I'd like to point out

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>.
mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 203
Thanks all

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.png 189.23 KB