How to add a label after price?

The problem is that this store has so many different products and each is sold differently. Well one is sold by Square Meter like tiles and laminate flooring, the other one is sold by Pieces like Bottles of ink, doors and e.t.c. The other one is sold in Kg (Weight) and so far and so on…

So i thought of doing it by creating a attribute and make it a label. like Wieght and then to echo this label right after the price. The question is where should i echo this label? in what file?

thank you very much!

or maybe you know a extension that meets my needs. p.s. i use Community 1.8.1

3 answers

Profile photo of Alexandru Gorbenco 240.00 $tone March 28, 2014
Public

Thnx to Sherlock’s reply in a port i managed to figure it out:

in the app/design/frontend/default/jm_megamall/template/catalog/ -- i edited the price.phtml file; fin where you add it and paste in line 214 after the </span>

Code:

<?php if($_product->getTipCalcul()): ?>
<span class="tip-calcul">
        <?php echo $_product->getTipCalcul(); ?>
</span>
<?php endif; ?>

replace TipCalcul -- with the attribute code of your attribute.

also i have introduced id into a span with the tip-calcul class so that i can customize it. Also replace it with your css class;

p.s. Use the same code to paste it in other places so that it will be displayed in the cart and e.t.c. if you do not know how to do it just let me know.

! -- Note: the attribute should be created as Text Field or Text Area and it’s scope to Global -- and it will work perfectly.
Cause i do not know how to make it work with the MultipleSelect or drowpdown; If somebody has an idea please post it. Thank you

#1
Profile photo of Sherlock 0.00 $tone March 31, 2014
Public

If your attribute is Multipleselect or dropdown, you could try to use the code below to get it’s selected text:

PHP Code:

 $_product->getAttributeText('TipCalcul'




Hope it helps.

#2

Please login or Register to Submit Answer

Written By

Comments