[Skip to main content](#vessel-content)

#   Changing Price Layout and Adding Text

##

- **[tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")**
- [![tscmedia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar44118.png)](/forum/user/44118-tscmedia "View tscmedia's Profile") Topic Author
- [ Offline](/forum/user/44118-tscmedia)

Less More

- Posts: 5
- Thank you received: 1
-
-
-

4 years 6 months ago [\#340942](#340942) by [tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")  *[Changing Price Layout and Adding Text](/forum/26-product-category-display/904273-changing-price-layout-and-adding-text#340942 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : Joomla! 3.10.8 -- PHP version -- : 7.4.X -- Browser(s) name and version -- : Version 100.0.4896.127 -- Error-message(debug-mod must be tuned on) -- : No error  Hi  I am far from understanding PHP and would really like some assistance please.  I know that I need to work in this view but I am completely lost as to what to do: product / listing&#95;price.php  I currently have prices showing as follows on my products (all on one line): Saving Price. Original Price with Strikethrough. Current Price.  I would like to add text, breaks and change the order so that it displays as follows:  Original Price: Add text &quot;Was PRICE&quot;. Add . Current Price: Add text &quot;Now Only PRICE&quot;. Remove the word &quot;each&quot;. Add . Saving Price: Add text &quot;You save PRICE&quot;.  Please could someone assist me with the correct modification to the view file?  I would be massively grateful for the assistance!  Thank you in advance.")* was created by *[tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")*

-- HikaShop version -- : 4.5.0
-- Joomla version -- : Joomla! 3.10.8
-- PHP version -- : 7.4.X
-- Browser(s) name and version -- : Version 100.0.4896.127
-- Error-message(debug-mod must be tuned on) -- : No error

Hi

I am far from understanding PHP and would really like some assistance please.

I know that I need to work in this view but I am completely lost as to what to do: product / listing_price.php

I currently have prices showing as follows on my products (all on one line):
Saving Price. Original Price with Strikethrough. Current Price.

I would like to add text, breaks and change the order so that it displays as follows:

Original Price: Add text "Was PRICE". Add &lt;br /&gt;.
Current Price: Add text "Now Only PRICE". Remove the word "each". Add &lt;br /&gt;.
Saving Price: Add text "You save PRICE".

Please could someone assist me with the correct modification to the view file?

I would be massively grateful for the assistance!

Thank you in advance.

- [ ![Price.png](/forum/attachment/54680) ](/forum/attachment/54680 "Price.png") [ ](/forum/attachment/54680?download=1 "Price.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDQyNzMtY2hhbmdpbmctcHJpY2UtbGF5b3V0LWFuZC1hZGRpbmctdGV4dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14286
-
-

4 years 6 months ago [\#340948](#340948) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Changing Price Layout and Adding Text](/forum/26-product-category-display/904273-changing-price-layout-and-adding-text#340948 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : Joomla! 3.10.8 -- PHP version -- : 7.4.X -- Browser(s) name and version -- : Version 100.0.4896.127 -- Error-message(debug-mod must be tuned on) -- : No error  Hi  I am far from understanding PHP and would really like some assistance please.  I know that I need to work in this view but I am completely lost as to what to do: product / listing&#95;price.php  I currently have prices showing as follows on my products (all on one line): Saving Price. Original Price with Strikethrough. Current Price.  I would like to add text, breaks and change the order so that it displays as follows:  Original Price: Add text &quot;Was PRICE&quot;. Add . Current Price: Add text &quot;Now Only PRICE&quot;. Remove the word &quot;each&quot;. Add . Saving Price: Add text &quot;You save PRICE&quot;.  Please could someone assist me with the correct modification to the view file?  I would be massively grateful for the assistance!  Thank you in advance.")*

Hi,

First, I would recommend doing as little modifications as you can via view overrides.
For example, you have the prices on different lines, you don't need to change anything in the view override.
You can just add custom CSS to your website.
For example: Code:

.hikashop_product_discount, .hikashop_product_price_before_discount, .hikashop_product_price_with_discount { display: block; }

Similarly, to remove the "each" word, you don't need to change anything in the view override. You can change that text with a translation override:
[ www.hikashop.com/download/languages.html#modify](https://www.hikashop.com/download/languages.html#modify)
In fact, you can also add extra texts with translation overrides too, for example, with the translation key PRICE_DISCOUNT_START

Now regarding moving the order of the display of the prices, that can only be done with a view override.
And it's actually not that easy if you don't know PHP.
It would require changing the code: Code:

if(!empty($this-&gt;row-&gt;discount)) { if(in_array($this-&gt;params-&gt;get('show_discount'), array(1, 4))) { echo '&lt;span class="hikashop_product_discount"&gt;'.JText::_('PRICE_DISCOUNT_START').'&lt;span class="hikashop_product_discount_amount"&gt;'; if(bccomp($this-&gt;row-&gt;discount-&gt;discount_flat_amount, 0, 5) !== 0) { echo $this-&gt;currencyHelper-&gt;format( -1 * $this-&gt;row-&gt;discount-&gt;discount_flat_amount, $price-&gt;price_currency_id); } elseif(bccomp($this-&gt;row-&gt;discount-&gt;discount_percent_amount, 0, 5) !== 0) { echo -1*$this-&gt;row-&gt;discount-&gt;discount_percent_amount.'%'; } echo '&lt;/span&gt;'.JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; } if(in_array($this-&gt;params-&gt;get('show_discount'), array(2, 4))) { echo '&lt;span class="hikashop_product_price_before_discount"&gt;'.JText::_('PRICE_DISCOUNT_START').'&lt;span class="hikashop_product_price_before_discount_amount"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount_with_tax)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount)) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt;'.JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; } elseif($this-&gt;params-&gt;get('show_discount') == 3) { } } $attributes = ''; if(!empty($this-&gt;element-&gt;product_id) &amp;&amp; !$microDataForCurrentProduct) { $round = $this-&gt;currencyHelper-&gt;getRounding($price-&gt;price_currency_id, true); $prefix = 'data-'; $microDataForCurrentProduct = true; if(empty($this-&gt;displayed_price_microdata)) { $this-&gt;displayed_price_microdata = true; $prefix = ''; } if($this-&gt;params-&gt;get('price_with_tax')) { $price_attributes = str_replace(',','.',$this-&gt;currencyHelper-&gt;round($price-&gt;price_value_with_tax, $round, 0, true)); } else { $price_attributes = str_replace(',','.',$this-&gt;currencyHelper-&gt;round($price-&gt;price_value, $round, 0, true)); } $this-&gt;itemprop_price = new stdClass(); $this-&gt;itemprop_price = $price_attributes .''; } echo '&lt;span class="'.implode(' ',$classes).'"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt; ';

to: Code:

if(!empty($this-&gt;row-&gt;discount)) { if(in_array($this-&gt;params-&gt;get('show_discount'), array(2, 4))) { echo '&lt;span class="hikashop_product_price_before_discount"&gt;'.JText::_('PRICE_DISCOUNT_START').'&lt;span class="hikashop_product_price_before_discount_amount"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount_with_tax)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount)) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt;'.JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; } elseif($this-&gt;params-&gt;get('show_discount') == 3) { } echo '&lt;span class="'.implode(' ',$classes).'"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt; '; if(in_array($this-&gt;params-&gt;get('show_discount'), array(1, 4))) { echo '&lt;span class="hikashop_product_discount"&gt;'.JText::_('PRICE_DISCOUNT_START').'&lt;span class="hikashop_product_discount_amount"&gt;'; if(bccomp($this-&gt;row-&gt;discount-&gt;discount_flat_amount, 0, 5) !== 0) { echo $this-&gt;currencyHelper-&gt;format( -1 * $this-&gt;row-&gt;discount-&gt;discount_flat_amount, $price-&gt;price_currency_id); } elseif(bccomp($this-&gt;row-&gt;discount-&gt;discount_percent_amount, 0, 5) !== 0) { echo -1*$this-&gt;row-&gt;discount-&gt;discount_percent_amount.'%'; } echo '&lt;/span&gt;'.JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; } } else { echo '&lt;span class="'.implode(' ',$classes).'"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt; '; } $attributes = ''; if(!empty($this-&gt;element-&gt;product_id) &amp;&amp; !$microDataForCurrentProduct) { $round = $this-&gt;currencyHelper-&gt;getRounding($price-&gt;price_currency_id, true); $prefix = 'data-'; $microDataForCurrentProduct = true; if(empty($this-&gt;displayed_price_microdata)) { $this-&gt;displayed_price_microdata = true; $prefix = ''; } if($this-&gt;params-&gt;get('price_with_tax')) { $price_attributes = str_replace(',','.',$this-&gt;currencyHelper-&gt;round($price-&gt;price_value_with_tax, $round, 0, true)); } else { $price_attributes = str_replace(',','.',$this-&gt;currencyHelper-&gt;round($price-&gt;price_value, $round, 0, true)); } $this-&gt;itemprop_price = new stdClass(); $this-&gt;itemprop_price = $price_attributes .''; }

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDQyNzMtY2hhbmdpbmctcHJpY2UtbGF5b3V0LWFuZC1hZGRpbmctdGV4dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")**
- [![tscmedia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar44118.png)](/forum/user/44118-tscmedia "View tscmedia's Profile") Topic Author
- [ Offline](/forum/user/44118-tscmedia)

Less More

- Posts: 5
- Thank you received: 1
-
-
-

4 years 6 months ago [\#340962](#340962) by [tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")  Replied by *[tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")* on topic *[Changing Price Layout and Adding Text](/forum/26-product-category-display/904273-changing-price-layout-and-adding-text#340962 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : Joomla! 3.10.8 -- PHP version -- : 7.4.X -- Browser(s) name and version -- : Version 100.0.4896.127 -- Error-message(debug-mod must be tuned on) -- : No error  Hi  I am far from understanding PHP and would really like some assistance please.  I know that I need to work in this view but I am completely lost as to what to do: product / listing&#95;price.php  I currently have prices showing as follows on my products (all on one line): Saving Price. Original Price with Strikethrough. Current Price.  I would like to add text, breaks and change the order so that it displays as follows:  Original Price: Add text &quot;Was PRICE&quot;. Add . Current Price: Add text &quot;Now Only PRICE&quot;. Remove the word &quot;each&quot;. Add . Saving Price: Add text &quot;You save PRICE&quot;.  Please could someone assist me with the correct modification to the view file?  I would be massively grateful for the assistance!  Thank you in advance.")*

Hi Nicolas

Thank you for the explanation. Most of this works perfectly! I am just running into an issue with 2 of the suggestions.

**LANGUAGE OVERRIDE FOR DISCOUNT** I am displaying the before and after discount prices.
If I add text to PRICE_DISCOUNT_START="Saving", it shows on both the discount amount as well the original price. I would like to different text before the original price and different text before the discount amount.
[ ![Price2.png](/forum/attachment/54691) ](/forum/attachment/54691 "Price2.png")

**VIEW OVERRIDE**
I tried the override but I think I am missing something like a . or something because I get an error:
syntax error, unexpected '.'
I have attached a text file of what I am using for the override provided on what you sent. I have start and end comments for ease of reference.
*This attachment is hidden for guests.
Please log in or register to see it.*

Have a fantastic day and thank you so very much for the help.

- [ ![Price2.png](/forum/attachment/54691) ](/forum/attachment/54691 "Price2.png") [ ](/forum/attachment/54691?download=1 "Price2.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDQyNzMtY2hhbmdpbmctcHJpY2UtbGF5b3V0LWFuZC1hZGRpbmctdGV4dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14286
-
-

4 years 6 months ago [\#340964](#340964) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Changing Price Layout and Adding Text](/forum/26-product-category-display/904273-changing-price-layout-and-adding-text#340964 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : Joomla! 3.10.8 -- PHP version -- : 7.4.X -- Browser(s) name and version -- : Version 100.0.4896.127 -- Error-message(debug-mod must be tuned on) -- : No error  Hi  I am far from understanding PHP and would really like some assistance please.  I know that I need to work in this view but I am completely lost as to what to do: product / listing&#95;price.php  I currently have prices showing as follows on my products (all on one line): Saving Price. Original Price with Strikethrough. Current Price.  I would like to add text, breaks and change the order so that it displays as follows:  Original Price: Add text &quot;Was PRICE&quot;. Add . Current Price: Add text &quot;Now Only PRICE&quot;. Remove the word &quot;each&quot;. Add . Saving Price: Add text &quot;You save PRICE&quot;.  Please could someone assist me with the correct modification to the view file?  I would be massively grateful for the assistance!  Thank you in advance.")*

Hi,

You made some mistakes when copy/pasting.
Here is the full view file modified code: Code:

&lt;?php $config =&amp; hikashop_config(); $class = (!empty($this-&gt;row-&gt;prices) &amp;&amp; count($this-&gt;row-&gt;prices) &gt; 1) ? ' hikashop_product_several_prices' : ''; if(!empty($this-&gt;row-&gt;has_options)) $class.=' hikashop_product_has_options'; if(isset($this-&gt;element-&gt;main-&gt;product_msrp) &amp;&amp; !(@$this-&gt;row-&gt;product_msrp &gt; 0.0)) $this-&gt;row-&gt;product_msrp = $this-&gt;element-&gt;main-&gt;product_msrp; if(isset($this-&gt;row-&gt;product_msrp) &amp;&amp; $this-&gt;row-&gt;product_msrp &gt; 0.0 &amp;&amp; hikaInput::get()-&gt;getCmd('layout') == 'show' &amp;&amp; $this-&gt;params-&gt;get('from_module','') == '') { $show_msrp = true; $mainCurr = $this-&gt;currencyHelper-&gt;mainCurrency(); $currCurrency = hikashop_getCurrency(); if($currCurrency == $mainCurr &amp;&amp; !empty($this-&gt;row-&gt;prices)) { $price = reset($this-&gt;row-&gt;prices); if(!empty($this-&gt;unit) &amp;&amp; isset($price-&gt;unit_price)) $price =&amp; $price-&gt;unit_price; if($this-&gt;row-&gt;product_msrp == $price-&gt;price_value_with_tax) { $show_msrp = false; } unset($price); } } if(!empty($show_msrp)) { ?&gt; &lt;span class="hikashop_product_msrp_price hikashop_product_price_full"&gt; &lt;span class="hikashop_product_msrp_price_title"&gt;&lt;?php echo JText::_('PRODUCT_MSRP_BEFORE'); ?&gt;&lt;/span&gt; &lt;span class="hikashop_product_price"&gt;&lt;?php $mainCurr = $this-&gt;currencyHelper-&gt;mainCurrency(); $currCurrency = hikashop_getCurrency(); $msrpCurrencied = $this-&gt;currencyHelper-&gt;convertUniquePrice($this-&gt;row-&gt;product_msrp, $mainCurr, $currCurrency); if($msrpCurrencied == $this-&gt;row-&gt;product_msrp) echo $this-&gt;currencyHelper-&gt;format($this-&gt;row-&gt;product_msrp, $mainCurr); else { echo $this-&gt;currencyHelper-&gt;format($msrpCurrencied, $currCurrency); if($this-&gt;params-&gt;get('show_original_price')) echo ' ('.$this-&gt;currencyHelper-&gt;format($this-&gt;row-&gt;product_msrp, $mainCurr).')'; } ?&gt;&lt;/span&gt; &lt;/span&gt; &lt;?php } ?&gt; &lt;span class="hikashop_product_price_full&lt;?php echo $class; ?&gt;"&gt;&lt;?php if(empty($this-&gt;row-&gt;prices)) { echo JText::_('FREE_PRICE'); } else { $first = true; echo JText::_('PRICE_BEGINNING'); $i = 0; if(!empty($show_msrp)) { echo '&lt;span class="hikashop_product_our_price_title"&gt;'.JText::_('PRODUCT_MSRP_AFTER').'&lt;/span&gt; '; } if($this-&gt;params-&gt;get('price_with_tax', 3) == 3) { $this-&gt;params-&gt;set('price_with_tax', (int)$config-&gt;get('price_with_tax')); } $microDataForCurrentProduct = false; foreach($this-&gt;row-&gt;prices as $k =&gt; $price) { if($first)$first=false; else echo JText::_('PRICE_SEPARATOR'); if(!empty($this-&gt;unit) &amp;&amp; isset($price-&gt;unit_price)) { $price =&amp; $price-&gt;unit_price; } if(empty($price-&gt;price_currency_id)) continue; $start = JText::_('PRICE_BEGINNING_'.$i); if($start != 'PRICE_BEGINNING_'.$i) { echo $start; } if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $price-&gt;price_min_quantity &gt; 1) { echo '&lt;span class="hikashop_product_price_with_min_qty hikashop_product_price_for_at_least_'.$price-&gt;price_min_quantity.'"&gt;'; } $classes = array('hikashop_product_price hikashop_product_price_'.$i); if(!empty($this-&gt;row-&gt;discount)) { $classes[]='hikashop_product_price_with_discount'; } if(!empty($this-&gt;row-&gt;discount)) { if(in_array($this-&gt;params-&gt;get('show_discount'), array(2, 4))) { echo '&lt;span class="hikashop_product_price_before_discount"&gt;'.JText::_('PRICE_DISCOUNT_START').'Was &lt;span class="hikashop_product_price_before_discount_amount"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_value_without_discount, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount_with_tax)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax') &amp;&amp; !empty($price-&gt;price_orig_value_without_discount)) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_without_discount, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt;'.JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; } elseif($this-&gt;params-&gt;get('show_discount') == 3) { } echo '&lt;span class="'.implode(' ',$classes).'"&gt;Now Only '; if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt; '; if(in_array($this-&gt;params-&gt;get('show_discount'), array(1, 4))) { echo '&lt;span class="hikashop_product_discount"&gt;'.JText::_('PRICE_DISCOUNT_START').'You save &lt;span class="hikashop_product_discount_amount"&gt;'; if(bccomp($this-&gt;row-&gt;discount-&gt;discount_flat_amount, 0, 5) !== 0) { echo $this-&gt;currencyHelper-&gt;format( -1 * $this-&gt;row-&gt;discount-&gt;discount_flat_amount, $price-&gt;price_currency_id); } elseif(bccomp($this-&gt;row-&gt;discount-&gt;discount_percent_amount, 0, 5) !== 0) { echo -1*$this-&gt;row-&gt;discount-&gt;discount_percent_amount.'%'; } echo '&lt;/span&gt;'.JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; } } else { echo '&lt;span class="'.implode(' ',$classes).'"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value_with_tax, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format(@$price-&gt;price_value, $price-&gt;price_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } if($this-&gt;params-&gt;get('show_original_price') &amp;&amp; !empty($price-&gt;price_orig_value)) { echo JText::_('PRICE_BEFORE_ORIG'); if($this-&gt;params-&gt;get('price_with_tax')) { echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value_with_tax, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')){ echo $this-&gt;currencyHelper-&gt;format($price-&gt;price_orig_value, $price-&gt;price_orig_currency_id); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo JText::_('PRICE_AFTER_ORIG'); } echo '&lt;/span&gt; '; } $attributes = ''; if(!empty($this-&gt;element-&gt;product_id) &amp;&amp; !$microDataForCurrentProduct) { $round = $this-&gt;currencyHelper-&gt;getRounding($price-&gt;price_currency_id, true); $prefix = 'data-'; $microDataForCurrentProduct = true; if(empty($this-&gt;displayed_price_microdata)) { $this-&gt;displayed_price_microdata = true; $prefix = ''; } if($this-&gt;params-&gt;get('price_with_tax')) { $price_attributes = str_replace(',','.',$this-&gt;currencyHelper-&gt;round($price-&gt;price_value_with_tax, $round, 0, true)); } else { $price_attributes = str_replace(',','.',$this-&gt;currencyHelper-&gt;round($price-&gt;price_value, $round, 0, true)); } $this-&gt;itemprop_price = new stdClass(); $this-&gt;itemprop_price = $price_attributes .''; } if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $this-&gt;params-&gt;get('per_unit', 1)) { if($price-&gt;price_min_quantity &gt; 1) { echo '&lt;span class="hikashop_product_price_per_unit_x"&gt;'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity).'&lt;/span&gt;'; } else { echo '&lt;span class="hikashop_product_price_per_unit"&gt;'.JText::_('PER_UNIT').'&lt;/span&gt;'; } } if($this-&gt;params-&gt;get('show_price_weight')){ if(!empty($this-&gt;element-&gt;product_id) &amp;&amp; isset($this-&gt;row-&gt;product_weight) &amp;&amp; bccomp($this-&gt;row-&gt;product_weight, 0, 3)) { echo JText::_('PRICE_SEPARATOR').'&lt;span class="hikashop_product_price_per_weight_unit"&gt;'; if($this-&gt;params-&gt;get('price_with_tax')){ $weight_price = $price-&gt;price_value_with_tax / $this-&gt;row-&gt;product_weight; echo $this-&gt;currencyHelper-&gt;format($weight_price, $price-&gt;price_currency_id).' / '.JText::_($this-&gt;row-&gt;product_weight_unit); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_BEFORE_TAX'); } if($this-&gt;params-&gt;get('price_with_tax') == 2 &#124;&#124; !$this-&gt;params-&gt;get('price_with_tax')) { $weight_price = $price-&gt;price_value / $this-&gt;row-&gt;product_weight; echo $this-&gt;currencyHelper-&gt;format($weight_price, $price-&gt;price_currency_id).' / '.JText::_($this-&gt;row-&gt;product_weight_unit); } if($this-&gt;params-&gt;get('price_with_tax') == 2) { echo JText::_('PRICE_AFTER_TAX'); } echo '&lt;/span&gt;'; } } if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $price-&gt;price_min_quantity &gt; 1) { echo '&lt;/span&gt;'; } $end = JText::_('PRICE_ENDING_'.$i); if($end != 'PRICE_ENDING_'.$i) { echo $end; } $i++; } echo JText::_('PRICE_END'); } ?&gt;&lt;/span&gt;

I've also added the extra text in there so that you won't have to deal with extra modifications for the translation overrides to work like you want so you can remove the translation override for the PRICE_DISCOUNT_START key.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDQyNzMtY2hhbmdpbmctcHJpY2UtbGF5b3V0LWFuZC1hZGRpbmctdGV4dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")**
- [![tscmedia's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar44118.png)](/forum/user/44118-tscmedia "View tscmedia's Profile") Topic Author
- [ Offline](/forum/user/44118-tscmedia)

Less More

- Posts: 5
- Thank you received: 1
-
-
-

4 years 6 months ago [\#340993](#340993) by [tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")  Replied by *[tscmedia](/forum/user/44118-tscmedia "View tscmedia's Profile")* on topic *[Changing Price Layout and Adding Text](/forum/26-product-category-display/904273-changing-price-layout-and-adding-text#340993 "-- HikaShop version -- : 4.5.0 -- Joomla version -- : Joomla! 3.10.8 -- PHP version -- : 7.4.X -- Browser(s) name and version -- : Version 100.0.4896.127 -- Error-message(debug-mod must be tuned on) -- : No error  Hi  I am far from understanding PHP and would really like some assistance please.  I know that I need to work in this view but I am completely lost as to what to do: product / listing&#95;price.php  I currently have prices showing as follows on my products (all on one line): Saving Price. Original Price with Strikethrough. Current Price.  I would like to add text, breaks and change the order so that it displays as follows:  Original Price: Add text &quot;Was PRICE&quot;. Add . Current Price: Add text &quot;Now Only PRICE&quot;. Remove the word &quot;each&quot;. Add . Saving Price: Add text &quot;You save PRICE&quot;.  Please could someone assist me with the correct modification to the view file?  I would be massively grateful for the assistance!  Thank you in advance.")*

Hi Nicolas
This works perfectly! Thank you so much for the assistance and guidance for future changes.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDQyNzMtY2hhbmdpbmctcHJpY2UtbGF5b3V0LWFuZC1hZGRpbmctdGV4dD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.111 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
