Display prices both tax and no tax problem

  • Posts: 129
  • Thank you received: 2
9 years 3 months ago #243183

-- url of the page with the problem -- : www.tiendamat.com
-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1

Hello,

I'm trying to display the prices without taxes and with no taxes. What I'd like to do would be something similar to this (note that this is done with paint):



So I try to use both prices from the configuration, and the result is this:



to make it the other way, I know I should chose "floating tax prices", but that would make me change all the prices of the products, which right now would be a pain in the ass to do.
Also, is there is a way to do this, is there a way to make that the taxed price appears under the other price and smaller?

I hope I've been clear enough and you can help me.

Thank you very much.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
9 years 3 months ago #243201

Hello,

You can create on override view in order to modify the way to display your price product page.
For this follow these steps :
- Go to Components => HikaShop => Configuration
- On Display dropdown select Views
- Use the three filter dropdown and define on 'Product', your front-end template and 'front-end'.
- Look for listing_price, and click on his name to edit it.
- Go around line 136 and replace this :

...
	if($this->params->get('price_with_tax')==2){
				echo JText::_('PRICE_BEFORE_TAX');
			}
			if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo JText::_('PRICE_AFTER_TAX') ;
...
by this
...
	if($this->params->get('price_with_tax')==2){
				echo '<span class="hikashop_discount_price" style="display:block; font-size: 12px; color: red;">';
			}
			if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo JText::_('PRICE_AFTER_TAX') . '</span>';
...

And I think you will have what you want.

Regards.

Last edit: 9 years 3 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 129
  • Thank you received: 2
9 years 3 months ago #243287

Hi Philip,

thank you very much for your help. I did what you told me and yes it shows the price without tax below, but my aim is to show the price with tax.

Also, I don't know why, the first bracket appears on the first line. I attach an image:




Thank you very much for your help, is really apreciate it.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
9 years 3 months ago #243308

Hello,

Ok I misunderstood you so, like my previous post, from your already custom view, around line 131 change this :

...
echo '<span class="'.implode(' ',$classes).'"'.$attributes.'>';

			if($this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo '<span class="hikashop_discount_price" style="display:block; font-size: 12px; color: red;">';
			}
			if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo JText::_('PRICE_AFTER_TAX') . '</span>';
			}
			if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
...
by this
...
	echo '<span class="'.implode(' ',$classes).'"'.$attributes.'>';
			
			if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo '<span class="hikashop_discount_price" style="display:block; font-size: 12px; color: red;">';
			}
			if($this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
			}
			
			if($this->params->get('price_with_tax')==2){
				echo ' PUT HERE YOUR WANTED TEXT</span>';
			}
			if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
...

Hope this will fit your needs.

Regards

Last edit: 9 years 3 months ago by Philip.
The following user(s) said Thank You: vanway

Please Log in or Create an account to join the conversation.

  • Posts: 129
  • Thank you received: 2
9 years 2 months ago #243486

Hi Philip,

thank you very much for your help. Effectively, now it looks good. I changed the color to suit it better with the template, but there's only one thing I can't make it right. The text that shows what kind of unit it s, shows now behind both prices, when it should be after the first price. In this picture I think you'll understand better what I mean:



I've tried to change some lines, but I can't make it works.

Thank you very much for your help.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 129
  • Thank you received: 2
9 years 2 months ago #243503

Hi Philip,

I've found another big problem that didn't realized before. On the check out, we have 4 lines:

Product -> Price with IVA (price without IVA)
Subtotal -> Here should be the price without IVA
Shipment -> Price of the shipment
IVA -> Price of the IVA (that's VAT)
Total -> Subtotal + Shipment + IVA

But here's the problem: On the second line, the subtotal shows the price with IVA. That makes a bit of confusion, since later the IVA it shows the correct ammount. Here you can see an example of what I'm saying:



How can I fix this? Thank you very much.

Attachments:
Last edit: 9 years 2 months ago by vanway.

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
9 years 2 months ago #243497

Hello,

For this last point replace this code :

...
echo '<span class="'.implode(' ',$classes).'"'.$attributes.'>';
			
			if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
			}
			if($this->params->get('price_with_tax')==2){
				echo '<span class="hikashop_discount_price" style="display:block; font-size: 12px; color: red;">';
			}
			if($this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
			}
			
			if($this->params->get('price_with_tax')==2){
				echo ' PUT HERE YOUR WANTED TEXT</span>';
			}
			if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
				echo JText::_('PRICE_BEFORE_ORIG');
				if($this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_BEFORE_TAX');
				}
				if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_AFTER_TAX');
				}
				echo JText::_('PRICE_AFTER_ORIG');
			}
			echo '</span> ';
			if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
				if($price->price_min_quantity>1){
					echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity).'</span>';
				}else{
					echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
				}
			}
...

by this :
...
echo '<span class="'.implode(' ',$classes).'"'.$attributes.'>';
			
			if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
			}
			if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
				if($price->price_min_quantity>1){
					echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity).'</span>';
				}else{
					echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
				}
			}
			if($this->params->get('price_with_tax')==2){
				echo '<span class="hikashop_discount_price" style="display:block; font-size: 12px; color: red;">';
			}
			if($this->params->get('price_with_tax')){
				echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
			}
			
			if($this->params->get('price_with_tax')==2){
				echo ' PUT HERE YOUR WANTED TEXT</span>';
			}
			if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
				echo JText::_('PRICE_BEFORE_ORIG');
				if($this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_BEFORE_TAX');
				}
				if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
					echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id);
				}
				if($this->params->get('price_with_tax')==2){
					echo JText::_('PRICE_AFTER_TAX');
				}
				echo JText::_('PRICE_AFTER_ORIG');
			}
			echo '</span> ';
...

For your second post, that's strange because our custom modification can't modify this checkout part... So do you have some override view on your checkout/cart view ? If yes you have to remove it or maybe custom it to fit your needs.
I can't tell you more because right now when I looking on your checkout I see this :




Hope that will fit your needs.

Regards

Attachments:
Last edit: 9 years 2 months ago by Philip.
The following user(s) said Thank You: vanway

Please Log in or Create an account to join the conversation.

  • Posts: 129
  • Thank you received: 2
9 years 2 months ago #243578

Hi Philip,
thank you very much for your help. Your change worked smoothly.

For the check out, you can see it now if you test it. It's because before I had show both prices off. Now it's on and you can test it. Here's a screenshot in case we use a coupon. It makes it really hard to understand for the costumer:


Attachments:
Last edit: 9 years 2 months ago by vanway.

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
9 years 2 months ago #243599

Hello,

I know what you have to do, Modify your Show taxed prices option for : "With tax", and not "Display both".

You can reach this option :
- Components => HikaShop => Configuration
- go in Main tab, go on Taxes part
- Look for Show taxed prices option

You will have each product price with tax and so subtotal and tax will be more easy to read.

For the second point just start with a SPACE (" ") in your custom code text.
That's why I write it like this : ' 'PUT HERE YOUR WANTED TEXT.

Hope this will fit your needs.

Regards

Last edit: 9 years 2 months ago by Philip.
The following user(s) said Thank You: vanway

Please Log in or Create an account to join the conversation.

  • Posts: 129
  • Thank you received: 2
9 years 2 months ago #243688

Hi Philip,

if I chose "with tax", nothing that we've done up to now would be worth it, since the main point was to show prices with and without tax.

It's ok, I can leave it like this.

Thank you very much for your help!

Please Log in or Create an account to join the conversation.

Time to create page: 0.113 seconds
Powered by Kunena Forum