Sunday, 15 June 2014

magento - Remove tag from formatPrice -



magento - Remove <span class="price"> tag from formatPrice -

how can remove/turn off <span class="price">...</span>

<?php echo $this->helper('checkout')->formatprice($_item->getcalculationprice()) ?>

in

<?php echo $_corehelper->currency($_finalprice, true, false) ?>

i alter lastly argument false , cost print without <span class="price">...</span> wonder how can in

<?php echo $this->helper('checkout')->formatprice($_item->getcalculationprice()) ?>

i dont want alter core file. thx help.

you have rewrite checkout helper (data.php) namespace, overwrite function :

public function formatprice($price) { homecoming $this->getquote()->getstore()->formatprice($price); }

replace

public function formatprice($price,$includecontainer = false) { homecoming $this->getquote()->getstore()->formatprice($price,$includecontainer); }

then you'll need :

<?php echo $this->helper('checkout')->formatprice($_item->getcalculationprice()) ?

to hide span , :

<?php echo $this->helper('checkout')->formatprice($_item->getcalculationprice(),true) ?

to back.

magento

No comments:

Post a Comment