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

#   price display

##

- **[Teto](/forum/user/8045-teto "View Teto's Profile")**
- [![Teto's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8045-teto "View Teto's Profile")
- [ Offline](/forum/user/8045-teto)

Less More

- Posts: 184
- Thank you received: 4
-
- [](http://www.madeinvino.com)
-

13 years 8 months ago [\#93391](#93391) by [Teto](/forum/user/8045-teto "View Teto's Profile")  Replied by *[Teto](/forum/user/8045-teto "View Teto's Profile")* on topic *[price display](/forum/2-general-talk-about-hikashop/76106-price-display?start=20#93391 "Hi,  I am using business version of hikashop. login customers have their own price (group price), which are usually lower than the general price. how can I display both the prices after the customer logs in with a red slash on the genearal price ? Thanks.  Yong")*

I did something similar but I have also added a line ** special price **
Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.1.0 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $class =''; if(!empty($this-&gt;row-&gt;prices) &amp;&amp; count($this-&gt;row-&gt;prices)&gt;1){ $class = ' hikashop_product_several_prices'; } ?&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($this-&gt;params-&gt;get('price_with_tax',3)==3){ $config =&amp; hikashop_config(); $this-&gt;params-&gt;set('price_with_tax',$config-&gt;get('price_with_tax')); } // Stefano Start //foreach($this-&gt;row-&gt;prices as $price){ // if($first)$first=false; // else echo JText::_('PRICE_SEPARATOR'); $specialPrice = false; foreach($this-&gt;row-&gt;prices as $price) { if($price-&gt;price_access != 'all') { $specialPrice = true; break; } } foreach($this-&gt;row-&gt;prices as $price) { if($first)$first=false; else echo JText::_('PRICE_SEPARATOR'); if($specialPrice &amp;&amp; $price-&gt;price_access == 'all') { echo '&lt;span class="hikashop_strike_price"&gt;'; } // Stefano End $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($this-&gt;params-&gt;get('show_discount',3)==3){ $config =&amp; hikashop_config(); $this-&gt;params-&gt;set('show_discount',$config-&gt;get('show_discount')); } if($this-&gt;params-&gt;get('show_discount')==1){ echo '&lt;span class="hikashop_product_discount"&gt;'.JText::_('PRICE_DISCOUNT_START'); 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 JText::_('PRICE_DISCOUNT_END').'&lt;/span&gt;'; }elseif($this-&gt;params-&gt;get('show_discount')==2){ echo '&lt;span class="hikashop_product_price_before_discount"&gt;'.JText::_('PRICE_DISCOUNT_START'); 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','-1')=='-1'){ $config =&amp; hikashop_config(); $this-&gt;params-&gt;set('show_original_price',$config-&gt;get('show_original_price')); } 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 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','-1')=='-1'){ $config =&amp; hikashop_config(); $this-&gt;params-&gt;set('show_original_price',$config-&gt;get('show_original_price')); } 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(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 JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price-&gt;price_min_quantity); }else{ echo JText::_('PER_UNIT'); } } 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;'; } // Stefano Start // Chiude lo spam per il barrato del prezzo assegnato a ALL if($specialPrice &amp;&amp; $price-&gt;price_access == 'all') { echo '&lt;/span&gt;'; } // NB: ho messo le 3 righe qui sopra anche appena sopa $i++ ma di fatto non cambia nulla // aggiunge la parte che inserisce la scritta PREZZO ESCLUSIVO if(isset($price-&gt;price_min_quantity) &amp;&amp; empty($this-&gt;cart_product_price) &amp;&amp; $price-&gt;price_min_quantity&gt;1){ if($specialPrice &amp;&amp; $price-&gt;price_access != 'all') { //echo '&lt;span style="color: #751f2c;"&gt;&lt;em&gt; Prezzo a te riservato&lt;/em&gt;&lt;/span&gt;'; //echo '&lt;span class="hikashop_special_price"&gt; ** Prezzo esclusivo **&lt;/span&gt;'; echo '&lt;span class="hikashop_special_price"&gt;'.JText::_('PRICE_SPECIAL').'&lt;/span&gt;'; } } // Stefano End $end = JText::_('PRICE_ENDING_'.$i); if($end!='PRICE_ENDING_'.$i){ echo $end; } $i++; } echo JText::_('PRICE_END'); } ?&gt;&lt;/span&gt;

You have to add this class into the CSS
Code:

/* Stefano Start 2013-03-06*/ /* questa parte server per mettere il prezzo barrato nel caso in cui sia presente un prezzo speciale per certi utenti */ span.hikashop_strike_price { text-decoration: line-through; } /* per formattare la scritta "prezzo riservato" */ span.hikashop_special_price { color: #751f2c; font-style: italic; font-size: 10pt; } /* Stefano End */

And you have to insert a new constant into "language override"
PRICE_SPECIAL = ** esclusiva abbonati **

This is the result

[ ![pagina&#95;prodotto&#95;2013-03-07.png](/forum/attachment/8970) ](/forum/attachment/8970 "...2013-03-07.png")

[ ![vista&#95;complessiva.png](/forum/attachment/8971) ](/forum/attachment/8971 "...omplessiva.png")

If you have any suggestion please let me know.

I am finding a way to show the special price to all the customers and not only to the subscribers (that are a joomla specific group).

- [ ![pagina&#95;prodotto&#95;2013-03-07.png](/forum/attachment/8970) ](/forum/attachment/8970 "...2013-03-07.png") [ ](/forum/attachment/8970?download=1 "...2013-03-07.png")
- [ ![vista&#95;complessiva.png](/forum/attachment/8971) ](/forum/attachment/8971 "...omplessiva.png") [ ](/forum/attachment/8971?download=1 "...omplessiva.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc2MTA2LXByaWNlLWRpc3BsYXk/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) 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.053 seconds

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