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

#   Price information from another component

##

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

13 years 1 day ago [\#132071](#132071) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  *[Price information from another component](/forum/31-development/863557-price-information-from-another-component#132071 "Hi  I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.  I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.  Thanks in advance")* was created by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")*

Hi

I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.

I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.

Thanks in advance

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

13 years 1 day ago [\#132144](#132144) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Price information from another component](/forum/31-development/863557-price-information-from-another-component#132144 "Hi  I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.  I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.  Thanks in advance")*

Hi,

If you want to load an HikaShop product, the best is to use the HikaShop product class. Code:

$productClass = hikashop_get('class.product'); $product = $productClass-&gt;get($product_id);

It will load the values from the different tables (product, product_price, etc).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

13 years 23 hours ago [\#132164](#132164) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Price information from another component](/forum/31-development/863557-price-information-from-another-component#132164 "Hi  I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.  I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.  Thanks in advance")*

Thank you for the quick response Jerome. I'll give that a go ![:)](/media/kunena/emoticons/3.png ":)")

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

- **[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")**
- [![esotechie's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar7143.jpg)](/forum/user/7143-esotechie "View esotechie's Profile") Topic Author
- [ Offline](/forum/user/7143-esotechie)

Less More

- Posts: 180
- Thank you received: 13
-
-
-
- [](http://www.halare.co.uk/)
-

12 years 11 months ago [\#132871](#132871) by [esotechie](/forum/user/7143-esotechie "View esotechie's Profile")  Replied by *[esotechie](/forum/user/7143-esotechie "View esotechie's Profile")* on topic *[Price information from another component](/forum/31-development/863557-price-information-from-another-component#132871 "Hi  I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.  I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.  Thanks in advance")*

The line $productClass = hikashop_get('class.product'); crashes the page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg2MzU1Ny1wcmljZS1pbmZvcm1hdGlvbi1mcm9tLWFub3RoZXItY29tcG9uZW50P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

12 years 11 months ago [\#132961](#132961) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price information from another component](/forum/31-development/863557-price-information-from-another-component#132961 "Hi  I am accessing the product information from another component to display in a scroller with certain effects not available on the standard one.  I have successfully got the product name and image loading, but wanted to know where to get the best code to use for fetching the price, which takes into account the currency and discounts.  Thanks in advance")*

Of course you need to initialize HikaShop before calling HikaShop functions.
You can initialize HikaShop with that line of code: Code:

if(!include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikashop'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php')) return true;

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

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