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

#   Get the price with tax

##

- **[Julien](/forum/user/3732-julien "View Julien's Profile")**
- [![Julien's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3732-julien "View Julien's Profile") Topic Author
- [ Offline](/forum/user/3732-julien)

Less More

- Posts: 17
- Thank you received: 0
-
-

15 years 2 months ago [\#24653](#24653) by [Julien](/forum/user/3732-julien "View Julien's Profile")  *[Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24653 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")* was created by *[Julien](/forum/user/3732-julien "View Julien's Profile")*

Hi everybody,

I don't find my question on the forum so I post here.
I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id_product.
I find getPrices() in hikashopCurrencyClass but it seems a little complex.

Thanks for answers !

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 2 months ago [\#24656](#24656) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24656 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")*

That's indeed the function you should use.
$productClass = hikashop_get('class.product');
$product = $productClass -&gt;get($id);
$currencyClass = hikashop_get('class.currency');
$products = array(&amp;$product);
$ids = array($id);
$config =&amp; hikashop_config();
$main_currency = $currency_id = (int)$config-&gt;get('main_currency',1);
$zone_id = explode(',',$config-&gt;get('main_tax_zone',0));
if(count($zone_id)){
$zone_id = array_shift($zone_id);
}else{
$zone_id=0;
}
$discount_before_tax = (int)$config-&gt;get('discount_before_tax',0);
$currencyClass-&gt;getPrices($products,$ids,hikashop_getCurrency(),$main_currency,$zone_id,$discount_before_tax);

Then, the prices will be in $products[0]-&gt;prices

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Julien](/forum/user/3732-julien "View Julien's Profile")**
- [![Julien's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3732-julien "View Julien's Profile") Topic Author
- [ Offline](/forum/user/3732-julien)

Less More

- Posts: 17
- Thank you received: 0
-
-

15 years 2 months ago [\#24662](#24662) by [Julien](/forum/user/3732-julien "View Julien's Profile")  Replied by *[Julien](/forum/user/3732-julien "View Julien's Profile")* on topic *[Re: Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24662 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")*

Thanks a lot for this and your rapididty. I'll try soon.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Julien](/forum/user/3732-julien "View Julien's Profile")**
- [![Julien's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3732-julien "View Julien's Profile") Topic Author
- [ Offline](/forum/user/3732-julien)

Less More

- Posts: 17
- Thank you received: 0
-
-

15 years 2 months ago [\#24710](#24710) by [Julien](/forum/user/3732-julien "View Julien's Profile")  Replied by *[Julien](/forum/user/3732-julien "View Julien's Profile")* on topic *[Re: Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24710 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")*

Thanks for the code, it was exactly what I want. But I've a new problem, getPrices() return anything when the product have a price_min_quantity, does anybody know why ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 2 months ago [\#24712](#24712) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24712 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")*

getPrices returns all the prices of the product. There is no reason it wouldn't.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Julien](/forum/user/3732-julien "View Julien's Profile")**
- [![Julien's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3732-julien "View Julien's Profile") Topic Author
- [ Offline](/forum/user/3732-julien)

Less More

- Posts: 17
- Thank you received: 0
-
-

15 years 2 months ago [\#24713](#24713) by [Julien](/forum/user/3732-julien "View Julien's Profile")  Replied by *[Julien](/forum/user/3732-julien "View Julien's Profile")* on topic *[Re: Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24713 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")*

When I print_r($products) I've no informations about prices. When I do the same thing on a product which have no price_min_quantity, I've right informations.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 2 months ago [\#24715](#24715) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24715 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")*

Are you sure that it's not something else like the currency of your prices which are different ?
Also, do you have a price without a minimum quantity ? You can have prices with a minimum quantity, but you always need a price without a minimum quantity. Maybe that's your problem ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Julien](/forum/user/3732-julien "View Julien's Profile")**
- [![Julien's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/3732-julien "View Julien's Profile") Topic Author
- [ Offline](/forum/user/3732-julien)

Less More

- Posts: 17
- Thank you received: 0
-
-

15 years 2 months ago [\#24716](#24716) by [Julien](/forum/user/3732-julien "View Julien's Profile")  Replied by *[Julien](/forum/user/3732-julien "View Julien's Profile")* on topic *[Re: Get the price with tax](/forum/4-how-to/24653-get-the-price-with-tax#24716 "Hi everybody,  I don't find my question on the forum so I post here. I'm writing a classical Joomla module and I search an easy way to get prices of a product which I've the id&#95;product. I find getPrices() in hikashopCurrencyClass but it seems a little complex.  Thanks for answers !")*

Ok that's it, you're right (like always ?). Thanks a lot again.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzI0NjUzLWdldC10aGUtcHJpY2Utd2l0aC10YXg/dG1wbD1tYXJrZG93bg==) 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.065 seconds

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