| Project: | Ubercart Discounts (Alternative) |
| Version: | 6.x-2.2 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
| Issue tags: | advanced catalog, Discounts Alternative, Ubercart |
Issue Summary
Hallo
I need to show the discounted price in the catalog.
An example for the page http://myshop.com/catalog/mycategory is the following:
| product image | product name | sell price | discounted price | buy now buttom |
I try to use the uc_advanced_catalog module but in the admin/build/ds/layout/product/list or in admin/store/settings/catalog/edit/advanced I do not see the Discounted Price field .
I found the Discounted Price field only in views.
I have the same need to show the discounted price in cart
| delete | product image | product name | Qty. | total | total discounted price |
The discount amount apperar only after subtotal but this can confuse the buyer because he does not know what products it was applied the discount
Thank you
Comments
#1
subscribing
#2
I was using this fix:
http://drupal.org/node/905368#comment-4694998
to show the discounted price on my catalog pages. It was working great but the dicount was not showing on the payment section on the review order page. So i updated to Discount 2.2 and it fixed the other issue but this stopped working.
This looks like it would solve one of your problems, however it may not solve them both. It needs to be tweaked to work with the latest update, I have been attempting to figure it out but have had no success yet.
#3
Here is the fixed function if anyone else needs it, just put this in your template.php and then flush your theme reg.
Note: the get_discounted_price changed to uc_discounts_get_discounted_price_for_product($product) commented out old line and added that. Works a charm and you can use css to cross out old price and put new price in red if ya want.
function phptemplate_uc_catalog_product_grid($products) {
$product_table = '<div class="category-grid-products"><table>';
$count = 0; $context = array(
'revision' => 'themed',
'type' => 'product',
);
foreach ($products as $nid) {
$product = node_load($nid);
$context['subject'] = array('node' => $product);
if ($count == 0) {
$product_table .= "<tr>";
}
elseif ($count % variable_get('uc_catalog_grid_display_width', 3) == 0) {
$product_table .= "</tr><tr>";
}
$titlelink = l($product->title, "node/$nid", array('html' => TRUE));
if (module_exists('imagecache') && ($field = variable_get('uc_image_'. $product->type, '')) && isset($product->$field) && file_exists($product->{$field}[0]['filepath'])) {
$imagelink = l(theme('imagecache', 'product_list', $product->{$field}[0]['filepath'], $product->title, $product->title), "node/$nid", array('html' => TRUE));
}
else {
$imagelink = '';
}
$product_table .= '<td>';
if (variable_get('uc_catalog_grid_display_title', TRUE)) {
$product_table .= '<span class="catalog-grid-title">'. $titlelink .'</span>';
}
if (variable_get('uc_catalog_grid_display_model', TRUE)) {
$product_table .= '<span class="catalog-grid-ref">'. $product->model .'</span>';
}
$product_table .= '<span class="catalog-grid-image">'. $imagelink .'</span>';
if (module_exists('uc_discounts')) {
$discounted_price = uc_discounts_get_discounted_price_for_product($product);
/*$discounted_price = theme("uc_discounts_get_discounted_price_for_product", $product);*/
if (!is_null($discounted_price) && $product->sell_price > $discounted_price) {
if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
$product_table .= '<p class="original-sell-price">'. uc_price($product->sell_price, $context) .'</p>';
}
$product_table .= '<span class="field-type-discounted-price">SALE<br /> '. theme("product_discounted_price", $product, uc_price($discounted_price, $context)) .'</span>'; }
else {
if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
$product_table .= '<span class="catalog-grid-sell-price">'. uc_price($product->sell_price, $context) .'</span>';
}
}
theme("add_product_price_altering_css", $product);
theme("add_product_price_altering_javascript", $product);
}
else {
if (variable_get('uc_catalog_grid_display_sell_price', TRUE)) {
$product_table .= '<span class="catalog-grid-sell-price">'. uc_price($product->sell_price, $context) .'</span>';
}
}
if (module_exists('uc_cart') && variable_get('uc_catalog_grid_display_add_to_cart', TRUE)) {
if (variable_get('uc_catalog_grid_display_attributes', TRUE)) {
$product_table .= theme('uc_product_add_to_cart', $product);
}
else {
$product_table .= drupal_get_form('uc_catalog_buy_it_now_form_'. $product->nid, $product);
}
}
$product_table .= '</td>'; $count++;
}
$product_table .= "</tr></table></div>";
return $product_table;
}
#4
Great this was helpful thanks.
#5
hi there,
i use the default danland theme, in witch file do i add the code to ?
thanks
johan
#6
anyone a idea ? , i need the discount price in the field prijs ! , any idea how ???, i use the danland theme !
see attached image for my catalog page
thanks
johan