Forums / Templates, Stylesheets, Page Layout / Qty Discounts on Product Listing

Qty Discounts on Product Listing

Views: 11,763

Results 41 to 46 of 46
23 Jun 2014, 8:23 PM
#41
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

Qty Discounts on Product Listing

Would it be possible to hide the base price if I'm showing the quantity discount table?

Attachment 14196

24 Jun 2014, 4:36 PM
#42
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Qty Discounts on Product Listing

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:

 $lc_text .= '<table style="border:1px solid #E9E9E9" cellspacing="0" cellpadding="3">';  

change back to without using a combined operator (=):

$lc_text = '<table style="border:1px solid #E9E9E9" cellspacing="0" cellpadding="3">';  

add the else statement back but this time using a combined operator (.=)

 else {
  $lc_text .= '';
  } 

Full code below:

  $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 .= '';
  }  

abcisme:

Would it be possible to hide the base price if I'm showing the quantity discount table?

Attachment 14196

24 Jun 2014, 4:42 PM
#43
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

Re: Qty Discounts on Product Listing

PERFECT! Thank you so much for taking the time to respond to me. I really appreciate your help!

21 Jul 2015, 7:24 PM
#44
nishajh avatar

nishajh

Zen Follower

Join Date:
May 2009
Posts:
105
Plugin Contributions:
0

Re: Qty Discounts on Product Listing

right now product quantity pricing shows on product listing page even if customer is logged in. Can anyone give the code to show the product quantity listing only to logged in customers- thanks

21 Jul 2015, 7:53 PM
#45
nishajh avatar

nishajh

Zen Follower

Join Date:
May 2009
Posts:
105
Plugin Contributions:
0

Re: Qty Discounts on Product Listing

right now product quantity pricing shows on product listing page even if customer is logged in. Can anyone give the code to show the product quantity listing only to logged in customers- thanks Attachment #15443

21 Jul 2015, 9:08 PM
#46
nishajh avatar

nishajh

Zen Follower

Join Date:
May 2009
Posts:
105
Plugin Contributions:
0

Re: Qty Discounts on Product Listing

Never mind. Fixed it.