Author Topic: Tip on how to customize QTY Discount Verbiage  (Read 3501 times)

Offline flyn

  • Full Member
  • ***
  • Posts: 142
  • Karma: +8/-0
    • View Profile
Tip on how to customize QTY Discount Verbiage
« on: August 12, 2014, 01:11:05 PM »
Hello today I was really looking into the code and figured out to how to change the default verbiage(text) that appears when you add a discount to a product and also how to have it all on one line. I will share this here with you. This does amount to adding or changing some code in core file (I believe core) so if you update you could loose the modifications you made. Always make a backup.

The file is product.tpl located in: /public_html/storefront/view/default_html5/template/pages/product

Around Line 130 in product.tpl

Original Discount Code:

<?php if ($discounts) { ?>
<div class="control-group">

<label class="control-label"><?php echo $text_discount; ?></label>

<div class="controls">
                                    

<?php echo $text_order_quantity; ?>
                                    

<?php echo $text_price_per_item; ?>
</div>
<?php foreach ($discounts as $discount) { ?>
                                    

<div class="controls">
                                    

   <?php echo $discount['quantity']; ?>
                                    

   <?php echo $discount['price']; ?>
                                    

</div>
<?php } ?>
</div>
<?php } ?>

and then after being modified.

New Discount Code Update

<?php if ($discounts) { ?>
<div class="control-group">

<label class="control-label"><?php echo $text_discount; ?></label>

<div class="controls">
                                    

<?php echo $text_order_quantity; ?>
                                    

<?php echo $text_price_per_item; ?>
                                 
<?php foreach ($discounts as $discount) { ?>
                                    
                                    

   <?php echo $discount['quantity']; ?>
                                    

   <?php echo $discount['price']; ?> Each
                                    

</div>
<?php } ?>
</div>
<?php } ?>

What the above change does is put it all one one line below the text Quantity Discount and I added at the end before the closing </div> the word Each to say that each piece they buy will be the discounted price as long as they purchase 3 or more.

You can see one I did here: http://www.hygienics.com/mens-underwear/water-resistant-incontinence-boxer-brief-with-waterproof-6-ply-integrated-absorbent-panel

As for changing the verbiage you can do that in the Admin under System > Localization > Language Definitions

Look for Key text_order_quantity. Just the verbiage under Translation and click save. I am glad I was told about the Definitions as it is quick and quite handy to change text for certain things.

Hope this helps,

Victor

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 4351
  • Karma: +204/-0
    • View Profile
Re: Tip on how to customize QTY Discount Verbiage
« Reply #1 on: August 13, 2014, 01:24:08 AM »
Thank You for sharing.
tip on how to share code:
use
Quote
[ code] [/code]
tags  :)


example
Code: [Select]
<?php if ($discounts) { ?>
<div class="control-group">

<label class="control-label"><?php echo $text_discount?></label>

<div class="controls">
                                   

<?php echo $text_order_quantity?>
                                   

<?php echo $text_price_per_item?>
</div>
<?php foreach ($discounts as $discount) { ?>
                                   

<div class="controls">
                                   

   <?php echo $discount['quantity']; ?>
                                   

   <?php echo $discount['price']; ?>
                                   

</div>
<?php ?>
</div>
<?php ?>
“Chuck Norris is so amazing.”
― Mother Teresa

Offline flyn

  • Full Member
  • ***
  • Posts: 142
  • Karma: +8/-0
    • View Profile
Re: Tip on how to customize QTY Discount Verbiage
« Reply #2 on: August 13, 2014, 01:36:09 PM »
Thanks. Did not know that

 

Powered by SMFPacks Social Login Mod