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

#   Getting the Prices of a Product

##

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

Less More

- Posts: 10
- Thank you received: 0
-
-

11 years 9 months ago [\#185697](#185697) by [philipp](/forum/user/35353-philipp "View philipp's Profile")  *[Getting the Prices of a Product](/forum/31-development/874089-getting-the-prices-of-a-product#185697 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : latest -- Browser(s) name and version -- : modern html 5 browser  Hello Everybody,  I am about to create a View for a certain product collection… Well, I could manage to retrive the list of products from the database, so I have each nessesary »product&#95;id«.  Is there a function I can use to get the prices of each Product, or do I have to code that myself?  Have a look at the attachment, I am interessted in the Prices Array, how can I get that?")* was created by *[philipp](/forum/user/35353-philipp "View philipp's Profile")*

-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : latest
-- Browser(s) name and version -- : modern html 5 browser

Hello Everybody,

I am about to create a View for a certain product collection… Well, I could manage to retrive the list of products from the database, so I have each nessesary »product_id«.

Is there a function I can use to get the prices of each Product, or do I have to code that myself?

Have a look at the attachment, I am interessted in the Prices Array, how can I get that?

[ ![Selection&#95;015.png](/forum/attachment/21529) ](/forum/attachment/21529 "Selection&#95;015.png")

- [ ![Selection&#95;015.png](/forum/attachment/21529) ](/forum/attachment/21529 "Selection&#95;015.png") [ ](/forum/attachment/21529?download=1 "Selection&#95;015.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NDA4OS1nZXR0aW5nLXRoZS1wcmljZXMtb2YtYS1wcm9kdWN0P3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14266
-
-

11 years 9 months ago [\#185713](#185713) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Getting the Prices of a Product](/forum/31-development/874089-getting-the-prices-of-a-product#185713 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : latest -- Browser(s) name and version -- : modern html 5 browser  Hello Everybody,  I am about to create a View for a certain product collection… Well, I could manage to retrive the list of products from the database, so I have each nessesary »product&#95;id«.  Is there a function I can use to get the prices of each Product, or do I have to code that myself?  Have a look at the attachment, I am interessted in the Prices Array, how can I get that?")*

Hi,

Once you have the product data in a $product variable you can use that code: Code:

&lt;?php $productClass = hikashop_get('class.product'); $ids = array($product-&gt;product_id); $config = hikashop_config(); $main_currency = $config-&gt;get('main_currency'); $discount_before_tax = $config-&gt;get('discount_before_tax'); $productClass-&gt;getPrices($product, $ids,hikashop_getCurrency(), $main_currency, hikashop_getZone(), $discount_before_tax); var_dump($product-&gt;prices); ?&gt;

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

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

[](#top)
