Skip to main content

Display vat

More
12 years 7 months ago #144453 by Webmediacontent
Display vat was created by Webmediacontent
-- url of the page with the problem -- : mywebsite.com/mypage
-- HikaShop version -- : 2.3.0
-- Joomla version -- : 2.5.18
-- PHP version -- : 5.3
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hello

I need a different display for the vat in the shop.
There are several vat rates.
8.0% and 2.5%

The price must be displayed anywhere as follows:

CHF 8.75 (incl. 8% VAT)
or
CHF 8.75 (incl. 2.5% vat)

Why is HikaShop with such a problem?

Best Regards
Adrian

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

More
12 years 7 months ago #144513 by nicolas
Replied by nicolas on topic Display vat
Hi,

There is no option to display the tax rate next to the prices.
You would have to edit the file "listing_price" of the view "product" via the menu Display>views and add such line at the end:
Code:
(incl. <?php $this->row->prices[0]->tax->tax_rate*100; ?>% VAT)

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

More
12 years 7 months ago #144663 by Webmediacontent
Replied by Webmediacontent on topic Display vat
Thanks for the code.

Unfortunately for me the VAT is not displayed.
Part of the message is hidden for the guests. Please log in or register to see it.

Here are some screenshots.
Part of the message is hidden for the guests. Please log in or register to see it.

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

More
12 years 7 months ago #144826 by Eliot
Replied by Eliot on topic Display vat
You can do a <?php var_dump of $this->row->prices[0]; ?> to see if the parameter you want is stored here.
It should be the case and you will just have to use the right variable name.

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

More
12 years 7 months ago #144861 by Genusskanzlei
Replied by Genusskanzlei on topic Display vat
I also have the same issue and I can't get it to show.

I tried this in all way and I get nothing returned :-(

<?php
ob_start();
var_dump($this->row->prices[0]);
$result = ob_get_clean();
?>

Could you please help??

Thanks

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

More
12 years 7 months ago #144893 by nicolas
Replied by nicolas on topic Display vat
That code won't display anything.
<?php
var_dump($this->row->prices[0]);
?>
instead will.
Actually, the code is a bit more complex:
Code:
(incl. <?php $this->row->prices[0]->taxes[0]->tax_rate*100; ?>% VAT)

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

More
12 years 7 months ago - 12 years 7 months ago #145042 by Genusskanzlei
Replied by Genusskanzlei on topic Display vat
Hi!
Your last code didn't work :-( So I tried the "dump" and this is what I got:
Code:
object(stdClass)#714 (8) { ["price_id"]=> string(2) "21" ["price_currency_id"]=> string(1) "1" ["price_product_id"]=> string(2) "22" ["price_value"]=> string(7) "8.90909" ["price_min_quantity"]=> string(1) "0" ["price_access"]=> string(3) "all" ["price_value_with_tax"]=> float(9.8) ["taxes"]=> array(1) { [0]=> object(stdClass)#713 (12) { ["taxation_id"]=> string(1) "2" ["zone_namekey"]=> string(18) "country_Austria_14" ["category_namekey"]=> string(24) "tax_1392638628_186342312" ["tax_namekey"]=> string(11) "10 % - MwSt" ["taxation_published"]=> string(1) "1" ["taxation_type"]=> string(0) "" ["taxation_access"]=> string(3) "all" ["taxation_cumulative"]=> string(1) "1" ["taxation_post_code"]=> string(0) "" ["tax_rate"]=> string(7) "0.10000" ["zone_type"]=> string(7) "country" ["tax_amount"]=> float(0.89) } } }

The parameter and value are correct as well as the variable name in your code, but nothing shows up still.

Any ideas?
Last edit: 12 years 7 months ago by Genusskanzlei.

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

More
12 years 7 months ago #145051 by Webmediacontent
Replied by Webmediacontent on topic Display vat
As already stated, the code does not work for me.
Code:
(incl. <?php $this->row->prices[0]->taxes[0]->tax_rate*100; ?>% VAT)
I like to give the access to the admin.

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

More
12 years 7 months ago #145076 by nicolas
Replied by nicolas on topic Display vat
Nothing shows at all ? Not even the (incl. % VAT) ?
In that case, it means that either you didn't add it to the correct listing_price (there is also one for the checkout view while I told you to do it for the product view), or not for the correct template (if you do the change for another template than the one you're using on your frontend, you won't see any change.

Looking at your var_dump, it should definitely work with the code I gave.

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

More
12 years 7 months ago #145117 by Webmediacontent
Replied by Webmediacontent on topic Display vat
Hi

But it is already displayed something. But not the vat value

See here

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

More
12 years 7 months ago #145175 by Genusskanzlei
Replied by Genusskanzlei on topic Display vat
Yes this shows: (incl. % VAT) but the value not.
I thought the same after looking at the dump but something is missing and I can't see what.

:(

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

More
12 years 7 months ago #145186 by nicolas
Replied by nicolas on topic Display vat
Beginners's mistake, I forgot the echo:
Code:
(incl. <?php echo $this->row->prices[0]->taxes[0]->tax_rate*100; ?>% VAT)
The following user(s) said Thank You: Webmediacontent

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

More
12 years 7 months ago #145196 by Genusskanzlei
Replied by Genusskanzlei on topic Display vat
Perfect!! I didn't think about it either. Thanks a lot for the help

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

More
12 years 7 months ago #145261 by Webmediacontent
Replied by Webmediacontent on topic Display vat
Perfect thank you. In the checkout, however, need to be adjusted also something else.

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

Time to create page: 0.318 seconds
Powered by Kunena Forum