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

#   get picture of product

##

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

Less More

- Posts: 21
- Thank you received: 0
-
-

11 years 7 months ago [\#193840](#193840) by [mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")  *[get picture of product](/forum/31-development/875528-get-picture-of-product#193840 "-- HikaShop version -- : 2.3.5  hy ,  i want display picture and link to a product  the object $product dont have this information  $productClass = hikashop&#95;get('class.product'); $product=$productClass-&gt;get($product&#95;id);    www.hikashop.com/support/support/documen...umentation.html#code  thanks for help")* was created by *[mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")*

-- HikaShop version -- : 2.3.5

hy ,

i want display picture and link to a product

the object $product dont have this information

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

[ www.hikashop.com/support/support/documen...umentation.html#code](http://www.hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html#code)

thanks for help

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

11 years 7 months ago [\#193873](#193873) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[get picture of product](/forum/31-development/875528-get-picture-of-product#193873 "-- HikaShop version -- : 2.3.5  hy ,  i want display picture and link to a product  the object $product dont have this information  $productClass = hikashop&#95;get('class.product'); $product=$productClass-&gt;get($product&#95;id);    www.hikashop.com/support/support/documen...umentation.html#code  thanks for help")*

Hello,
Can you give us more information about what do you want to do, like where do you exactly want to display it ?
Thanks.

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

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

Less More

- Posts: 21
- Thank you received: 0
-
-

11 years 7 months ago [\#194009](#194009) by [mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")  Replied by *[mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")* on topic *[get picture of product](/forum/31-development/875528-get-picture-of-product#194009 "-- HikaShop version -- : 2.3.5  hy ,  i want display picture and link to a product  the object $product dont have this information  $productClass = hikashop&#95;get('class.product'); $product=$productClass-&gt;get($product&#95;id);    www.hikashop.com/support/support/documen...umentation.html#code  thanks for help")*

hy
i want display it in my component , so i code a function in this way :

function get_image_product($id) {

$db = JFactory::getDbo();

$query = $db-&gt;getQuery(true);

$query-&gt;select(array('file_path'));

$query-&gt;from($db-&gt;quoteName('#__hikashop_file'));

$query-&gt;where($db-&gt;quoteName('file_ref_id') . ' = ' . $id);

$db-&gt;setQuery($query);

return $db-&gt;loadObject()-&gt;file_path;

}

if you have a better and a cleaner way , thank you to tell me how .

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 7 months ago [\#194019](#194019) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[get picture of product](/forum/31-development/875528-get-picture-of-product#194019 "-- HikaShop version -- : 2.3.5  hy ,  i want display picture and link to a product  the object $product dont have this information  $productClass = hikashop&#95;get('class.product'); $product=$productClass-&gt;get($product&#95;id);    www.hikashop.com/support/support/documen...umentation.html#code  thanks for help")*

Hi,

You code is correct, what is missing is the folder path, you can get it thanks to: Code:

$fileClass = hikashop_get('class.file'); $folderPath = $fileClass-&gt;get('image');

To get all the product data, you can too use the code: Code:

$productClass = hikashop_get('class.product'); $productClass-&gt;getProducts($id); $fullProduct = $productClass-&gt;products[$id];

The following user(s) said Thank You: [mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")

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

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

Less More

- Posts: 21
- Thank you received: 0
-
-

11 years 7 months ago [\#194619](#194619) by [mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")  Replied by *[mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")* on topic *[get picture of product](/forum/31-development/875528-get-picture-of-product#194619 "-- HikaShop version -- : 2.3.5  hy ,  i want display picture and link to a product  the object $product dont have this information  $productClass = hikashop&#95;get('class.product'); $product=$productClass-&gt;get($product&#95;id);    www.hikashop.com/support/support/documen...umentation.html#code  thanks for help")*

hy

one last question , how can i get the add to cart button ?

thanks for help ![:)](/media/kunena/emoticons/8.png ":)")

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 7 months ago [\#194622](#194622) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[get picture of product](/forum/31-development/875528-get-picture-of-product#194622 "-- HikaShop version -- : 2.3.5  hy ,  i want display picture and link to a product  the object $product dont have this information  $productClass = hikashop&#95;get('class.product'); $product=$productClass-&gt;get($product&#95;id);    www.hikashop.com/support/support/documen...umentation.html#code  thanks for help")*

Hi,

Whn you are in the backend, in Product, edit a product, then in the toolbar you will see a button "add to cart html", click on it.
This will display the code to add a product to the cart directly, so you can use this code and make it more dynamic to adapt it for each products.

The following user(s) said Thank You: [mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")

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

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

Less More

- Posts: 21
- Thank you received: 0
-
-

11 years 7 months ago [\#194960](#194960) by [mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")  Replied by *[mcambou1](/forum/user/35608-mcambou1 "View mcambou1's Profile")* on topic *[get picture of product](/forum/31-development/875528-get-picture-of-product#194960 "-- HikaShop version -- : 2.3.5  hy ,  i want display picture and link to a product  the object $product dont have this information  $productClass = hikashop&#95;get('class.product'); $product=$productClass-&gt;get($product&#95;id);    www.hikashop.com/support/support/documen...umentation.html#code  thanks for help")*

awesome !

thanks for help ![:)](/media/kunena/emoticons/8.png ":)")

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

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

[](#top)
