Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

…Add “Ea.” to prices in all views (i.e. “$19.99 Ea.") - SOLVED! 
 
Nottawa
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2009-06-24
 

Hey everyone,

I have been fiddling around with a modified demo template for a2iwheels.com for the last month or so.

We sell our wheels individually and we would like to to specify all of our items on the front end that the price shown is for EACH item, not a set of 4 wheels.

Currently, users see:

$145.00

We would like to change it to:

$145.00 Ea.

Is their a certain call file I haven’t been able to find?
Any point in the right direction would be GREATLY appreciated!
I’d like to think I’m a quick learner and every tidbit like this brings me one step closer to creating my own template! =D

-Nottawa

 
Magento Community Magento Community
Magento Community
Magento Community
 
vianetz
Guru
 
Avatar
Total Posts:  537
Joined:  2008-04-13
Munich, Germany
 

app/design/frontend/default/default/template/catalog/product/view/price.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
Nottawa
Jr. Member
 
Avatar
Total Posts:  3
Joined:  2009-06-24
 

"app/design/frontend/default/default/template/catalog/product/view/price.phtml” didn’t work for me but I did dig up a solution!

----

In “app/design/frontend/default/default/template/catalog/product/price.phtml”:  I added <?php echo $this->__('Ea.') ?> to each price span.

Here’s the example.

<div class="price-box">
<?php $_price = $_taxHelper->getPrice($_product, $_product->getPrice()) ?>
<?php $_regularPrice = $_taxHelper->getPrice($_product, $_product->getPrice(), $_simplePricesTax) ?>
<?php $_finalPrice = $_taxHelper->getPrice($_product, $_product->getFinalPrice()) ?>
<?php $_finalPriceInclTax = $_taxHelper->getPrice($_product, $_product->getFinalPrice(), true) ?>
<?php $_weeeDisplayType = $_weeeHelper->getPriceDisplayType(); ?>
<?php if ($_finalPrice == $_price): ?>
<?php if ($_taxHelper->displayBothPrices() && $_finalPriceInclTax != $_finalPrice): ?>
<?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)): // including ?>
<span class="price-excluding-tax">
<span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax:') ?></span>
<span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price+$_weeeTaxAmount,true,false) ?>
<?php echo $this->__('Ea.') ?>
</span>
</span>
<span class="price-including-tax">
<span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax:') ?></span>
<span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?>
<?php echo $this->__('Ea.') ?>
</span>
</span>
<?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // incl. + weee ?>
<span class="price-excluding-tax">
<span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax:') ?></span>
<span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price+$_weeeTaxAmount,true,false) ?>
<?php echo $this->__('Ea.') ?>
</span>
</span>
<span class="price-including-tax">
<span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax:') ?></span>
<span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?>
<?php echo $this->__('Ea.') ?>
</span>
<br />
<span class="weee">(<small>
<?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
<?php echo $_weeeSeparator; ?>
<?php echo $_weeeTaxAttribute->getName(); ?>:
<?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount(), true, true); ?>
<?php $_weeeSeparator = ' + '; ?>
<?php endforeach; ?>
</small>)</span>
</span>
<?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
<span class="price-excluding-tax">
<span class="label"><?php echo Mage::helper('tax')->__('Excl. Tax:') ?></span>
<span class="price" id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price+$_weeeTaxAmount,true,false) ?>
<?php echo $this->__('Ea.') ?>
</span>
</span>
<span class="price-including-tax">
<span class="label"><?php echo Mage::helper('tax')->__('Incl. Tax:') ?></span>
<span class="price" id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_finalPriceInclTax+$_weeeTaxAmount,true,false) ?>
<?php echo $this->__('Ea.') ?>
</span>
<br />
<span class="weee">(<small>
<?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
<?php echo $_weeeSeparator; ?>
<?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount()+$_weeeTaxAttribute->getTaxAmount(), true, true); ?>
<?php $_weeeSeparator = ' + '; ?>
<?php endforeach; ?>
</small>)</span>
</span>

................

There are about 40 of these to add but it works for all views (Grid, List, Product View) and all prices (Regular, Special, Grouped, Bundle, etc.).

I hope this helps others!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top