Announcement

Collapse
No announcement yet.

Display discount, not price, in quantity pricing table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Display discount, not price, in quantity pricing table

    I'd like to display the amount of the discount instead of the discounted price in the quantity discount table of the product listing page. Why? Because of MAP...I can't display the discounted price.

    So, if my discount is $5 off when you buy 5-999 items (as defined in the products discount tab), I want the table to say "5-999 Save $5 per item" or something like that.

    I currently have the code commented out so the table doesn't display and I have the discount info in the product description. I'd like to use the table to make the discount more obvious before people bounce. Appreciate any thoughts. Code snippet is from listing_0.html.


    <!--START: quantity-->
    <div class="quantityBlock">
    <a href="javascript:void(0);" id="showQtyTable"><i class="icon-down-open"></i> [product_Header-quantitypricing]</a>
    <div class="clear"></div>
    <div class="quantity-table" style="display: block;">
    <div class="title-header">[product_quantitypricing-quantity]</div>
    <div class="title-header">[product_quantitypricing-price]</div>
    <div class="clear"></div>
    <ul>
    <!--START: quantity_items-->
    <li>[lowbound][highbound]</li>
    <li>[PRICE]</li>
    <!--END: quantity_items-->
    </ul>
    <div class="clear"></div>
    </div>
    </div>
    <!--END: quantity-->

  • #2
    Hi jason

    <script type="text/javascript">

    var pr = '[ITEMPRICE]'.replace("$", "");

    var sl = '[product_quantitypricing-price]'.replace("$", "");

    var perc = Math.round((((pr - sl) / pr) * 100));

    document.write('' + perc + '% Off!');
    </script>

    I use this to display discount percentages on my category and product pages. I'm sure if you swapped the variables you could make it work the same way.

    Comment


    • #3
      Originally posted by Toocutebeads View Post
      Hi jason

      <script type="text/javascript">

      var pr = '[ITEMPRICE]'.replace("$", "");

      var sl = '[product_quantitypricing-price]'.replace("$", "");

      var perc = Math.round((((pr - sl) / pr) * 100));

      document.write('' + perc + '% Off!');
      </script>

      I use this to display discount percentages on my category and product pages. I'm sure if you swapped the variables you could make it work the same way.

      Thanks for your reply. Your code works great for most items.

      Unfortunately, my single item price is also below MAP, so I have the product display text set to "Add To Cart For Low Price". I don't see a way to get the actual price as it appears no variable contains that information in this case.

      If anyone can point me to a variable that contains the actual price, that would be handy.

      Comment


      • #4
        Hi Jason,

        duplicate your listing template and name it listing_2 or whatever. Go into the price area and replace the variable [ITEMPRICE] with the text you want to display. Add a div with display:none or display:hidden. Wrap [itemprice] in the hidden div, and adjust script as needed.
        Last edited by Toocutebeads; 06-28-2018, 09:18 AM.

        Comment

        Working...
        X