What I'm using here is the same code offered by Ajah Post#31 except the Qty Discount Table is added to the price column instead of creating a new column so others are not confused.
My code may look a little different for I use Flexible Product Listing.
This is exactly what I have to produce the outcome you desire. We will have to change the original edits back.
find:
PHP Code:
$lc_text .= '<table style="border:1px solid #E9E9E9" cellspacing="0" cellpadding="3">';
change back to without using a combined operator (=):
PHP Code:
$lc_text = '<table style="border:1px solid #E9E9E9" cellspacing="0" cellpadding="3">';
add the else statement back but this time using a combined operator (.=)
PHP Code:
else {
$lc_text .= '';
}
Full code below:
PHP Code:
$products_discount_type = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type');
$columns ++;
$products_id_current = (int)$listing->fields['products_id'];
$quantityDiscounts = array();
$products_discount_type_from = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type_from');
require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCTS_QUANTITY_DISCOUNTS));
for ($i=1, $m=$products_discounts_query->RecordCount(); $i<=$m; $i++) {
$discount_level_n = 'discount_level_' . $i;
$$discount_level_n = $quantityDiscounts[$i-1];
}
if ($products_discount_type != 0) {
$lc_text = '<table style="border:1px solid #E9E9E9" cellspacing="0" cellpadding="3">';
$lc_text .= '<tr style="background: #C0C0C0; font-weight: bold">';
$lc_text .= '<td colspan="2" align="center">'. TEXT_PL_QD_HEADING . '</font></td>';
$lc_text .= '</tr>';
$lc_text .= '<tr style="background: #F5F5F5;">';
$lc_text .= '<td>' . TEXT_PL_QD_QTY . '</td>';
$lc_text .= '<td>' . TEXT_PL_QD_PRICE . '</td>';
$lc_text .= '</tr>';
$lc_text .= '<tr>';
$lc_text .= '<td style="border-bottom:1px solid #F1F1F1;">' . $show_qty . '</td>';
$lc_text .= '<td style="border-bottom:1px solid #F1F1F1;">' . $currencies->display_price($show_price, zen_get_tax_rate($products_tax_class_id)) . '</td>';
$lc_text .= '</tr>';
for ($i=1, $m=$products_discounts_query->RecordCount(); $i<=$m; $i++) {
$discount_level_n = 'discount_level_' . $i;
$lc_text .= '<tr>';
$lc_text .= '<td style="border-bottom:1px solid #F1F1F1;">' . ${$discount_level_n}['show_qty'] . '</td>';
$lc_text .= '<td style="border-bottom:1px solid #F1F1F1;">' . $currencies->display_price(${$discount_level_n}['discounted_price'], zen_get_tax_rate($products_tax_class_id)) . '</td>';
$lc_text .= '</tr>';
}
$lc_text .= '</table>';
} else {
$lc_text .= '';
}
Originally Posted by
abcisme
Would it be possible to hide the base price if I'm showing the quantity discount table?
Bookmarks