Thanks for a great module!
Just a few little bits and bobs that would really help me (and possibly other themers)
Adding a span/div container around the fields on the blocks would really help us themers. Also can we please remove the line breaks (br) - and allow us to theme using the block model.
Within uc_upsell_block_contents() - remove the br, and add the following wrappers:
$output .= '<div class="upsell-block-product-title">';
$output .= l($node->title, drupal_get_path_alias("node/". $node->nid), array('class' => 'buy-related-item'), NULL, NULL, FALSE, TRUE);
$output .= '</div>';
Having some theming options within the module would also be helpful for example showing/hiding fields (ie image, title, description, price, model (sku), and an other custom cck fields that have been added. Something similar to catalog would be perfect. (/admin/store/settings/catalog/edit/grid)
The price should also not link to the Add to cart - but to the product, reserve this link for add to cart link please!
I have been posting for ages for having default image functionality included within the UC core. This functionality basically takes an input from either the cck field default value OR a UC defined value to show the default image when no image is found for the node. At the moment I add this functionality myself for all modules. If this is functionality you are looking for then try the following:
Replace
if ($node->field_image_cache) {
$output .= l(theme('imagecache', uc_upsell_get_imagecache_preset(), $node->image['filepath'] . $node->field_image_cache[0]['filepath'], $node->title, $node->title, array('class' => 'buy-related-item')), drupal_get_path_alias("node/". $node->nid), array('class' => 'buy-related-item'), NULL, NULL, FALSE, TRUE);
}
With the following code. (I've also included a clause in the if statement to see if the file actually exists, avoids the annoying red square of doom).
if ($node->field_image_cache && file_exists($node->image['filepath'] . $node->field_image_cache[0]['filepath'])) {
$output .= l(theme('imagecache', uc_upsell_get_imagecache_preset(), $node->image['filepath'] . $node->field_image_cache[0]['filepath'], $node->title, $node->title, array('class' => 'buy-related-item')), drupal_get_path_alias("node/". $node->nid), array('class' => 'buy-related-item'), NULL, NULL, FALSE, TRUE);
} else {
//use the default image
$output .= l(theme('imagecache', uc_upsell_get_imagecache_preset(), 'files/default_product.jpg' , $title, $title), drupal_get_path_alias("node/". $node->nid), array('class' => 'buy-related-item'), NULL, NULL, FALSE, TRUE);
}
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | uc_upsell.module.cartlinks.patch | 11.85 KB | torgospizza |
| #3 | uc_upsell.module.411644.patch | 4.21 KB | torgospizza |
Comments
Comment #1
mtraherne commentedSame goes for theme_pane_upsell()
Comment #2
torgospizzaThanks! I'll look at putting this in the next commit.
Comment #3
torgospizzaI wrote a patch (against the latest 5.x version) with your changes. Please try it out and let me know if it works.
Comment #4
torgospizzaHere is a patch for 6.x that includes fixes to cart links functionality.
Comment #5
torgospizzaThis code is being used on a live 6.x site with no issues, so I'm closing this. Feel free to open a new issue if you encounter any problems.
Comment #6
torgospizza