Results 1 to 10 of 10

Threaded View

  1. #1
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    131
    Plugin Contributions
    0

    Default Displaying price range for Quantity Discounts

    Hello

    I have spent the afternoon trying to get the product listing page to show the price range available for products with quantity discounts on them. After reading through a couple of related threads, I have successfully managed to do this with the following piece of code:

    PHP Code:
          <!--bof Product Price block -->
    <h2 id="productPrices" class="productGeneral">
    <?php
      
    if ($show_onetime_charges_description == 'true') {
        
    $one_time '<span >' TEXT_ONETIME_CHARGE_SYMBOL TEXT_ONETIME_CHARGE_DESCRIPTION '</span><br />';
      } else {
        
    $one_time '';
      }
    // qty discount
      
    $qty_discount zen_get_products_discount_price_qty((int)$_GET['products_id'],999999);
      
    $actual_price zen_get_products_actual_price((int)$_GET['products_id']);
      
    $base_price zen_get_products_base_price((int)$_GET['products_id']);
      if (
    $qty_discount $actual_price) {
      echo 
    $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE '') . '<meta itemprop="priceCurrency" content="' $_SESSION['currency'] . '" />' '<span itemprop="price"><span class="normalprice">' $currencies->display_price($base_pricezen_get_tax_rate($products_tax_class_id)) . '</span> ' $currencies->display_price($qty_discountzen_get_tax_rate($products_tax_class_id)) . ' - ' $currencies->display_price($actual_pricezen_get_tax_rate($products_tax_class_id)) . '</span>';
      } else {
    // base price
      
    echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE '') . '<meta itemprop="priceCurrency" content="' $_SESSION['currency'] . '" />' '<span itemprop="price">' zen_get_products_display_price((int)$_GET['products_id']) . '</span>';
      }
    ?></h2>
          <!--eof Product Price block -->
    My only issue with this is that this code leaves the base price of the product on the listing. As an example, we have a product with a price of $10 that is on special for $9 and has a quantity discount of $7.50 if you purchase 3 or more -- the code above produces the following:

    $10.00 $7.50 - $9.00

    This is fine for products with specials/sales on them, however I can't get it off products that don't have specials/sales on them.

    This is the code I've been trying to make work to remove the strike through on products without specials/sales:

    PHP Code:
          <!--bof Product Price block -->
    <h2 id="productPrices" class="productGeneral">
    <?php
      
    if ($show_onetime_charges_description == 'true') {
        
    $one_time '<span >' TEXT_ONETIME_CHARGE_SYMBOL TEXT_ONETIME_CHARGE_DESCRIPTION '</span><br />';
      } else {
        
    $one_time '';
      }
    // qty discount
      
    $qty_discount zen_get_products_discount_price_qty((int)$_GET['products_id'],999999);
      
    $actual_price zen_get_products_actual_price((int)$_GET['products_id']);
      
    $base_price zen_get_products_base_price((int)$_GET['products_id']);
      
    $special_price zen_get_products_special_price($products_idtrue);
      
    $sale_price zen_get_products_special_price($products_idfalse);
      
      if (
    $qty_discount $actual_price and ($special_price != or $sale_price != 1)) {
      echo 
    $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE '') . '<meta itemprop="priceCurrency" content="' $_SESSION['currency'] . '" />' '<span itemprop="price"><span class="normalprice">' $currencies->display_price($base_pricezen_get_tax_rate($products_tax_class_id)) . '</span> ' $currencies->display_price($qty_discountzen_get_tax_rate($products_tax_class_id)) . ' - ' $currencies->display_price($actual_pricezen_get_tax_rate($products_tax_class_id)) . '</span>';
      } elseif (
    $qty_discount $actual_price and ($special_price != or $sale_price != 0)) {
      echo 
    $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE '') . '<meta itemprop="priceCurrency" content="' $_SESSION['currency'] . '" />' '<span itemprop="price">' $currencies->display_price($qty_discountzen_get_tax_rate($products_tax_class_id)) . ' - ' $currencies->display_price($actual_pricezen_get_tax_rate($products_tax_class_id)) . '</span>';
      } else {
    // base price
      
    echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE '') . '<meta itemprop="priceCurrency" content="' $_SESSION['currency'] . '" />' '<span itemprop="price">' zen_get_products_display_price((int)$_GET['products_id']) . '</span>';
      }
    ?></h2>
          <!--eof Product Price block -->
    But this is doing nothing for me and just keeps the base price with a strike through and then follows with the quantity discounts:

    $10.00 $7.50 - $10.00

    Any ideas?
    Last edited by MortalWombat; 14 Mar 2016 at 08:30 AM.

 

 

Similar Threads

  1. Replies: 17
    Last Post: 19 Feb 2013, 12:45 PM
  2. Quantity Discounts Question: Call For Price option?
    By ray-the-otter in forum General Questions
    Replies: 2
    Last Post: 1 Dec 2011, 12:30 PM
  3. Product quantity price discounts & group discounts
    By Richard.Tung in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 11 Jun 2009, 03:24 PM
  4. Price range for price by attributes
    By tigergirl in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 27 Sep 2007, 05:58 PM
  5. Changing price range to time range (in Advanced Search)
    By jeffmic in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Sep 2006, 07:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg