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

#   CHECKOUT - Get category data of the entry products

##

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 10 months ago -  11 years 10 months ago [\#187357](#187357) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187357 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")* was created by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")*

Hi,

Can you help me please?
Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.

Can you help me how can I acess this data?

Hi have tried to access in "$this-&gt;element", "$this-&gt;rows", "$row", "$this-&gt;...") and don't find nothing about category.

Last edit: 11 years 10 months ago by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NDM2NC1jaGVja291dC1nZXQtY2F0ZWdvcnktZGF0YS1vZi10aGUtZW50cnktcHJvZHVjdHM/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: 86587
- Thank you received: 14326
-
-

11 years 10 months ago [\#187363](#187363) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187363 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

Hi,

On which page/view/file do you need to get that data ?

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

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 10 months ago [\#187471](#187471) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  Replied by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187471 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

In checkout page. More exact in cart.php to show the category image with the product image.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NDM2NC1jaGVja291dC1nZXQtY2F0ZWdvcnktZGF0YS1vZi10aGUtZW50cnktcHJvZHVjdHM/dG1wbD1tYXJrZG93bg==) 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: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 10 months ago [\#187532](#187532) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187532 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

Hi,

Because a product can have several categories, this information is not load by default (in the listings).
So you need to load the categories of the listed product (using a SQL query).

Here some code from the product show Code:

$query = 'SELECT b.* FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('category').' AS b ON a.category_id = b.category_id WHERE a.product_id = '.(int)$prod-&gt;product_id.' ORDER BY a.product_category_id ASC'; $database-&gt;setQuery($query); $categories = $database-&gt;loadObjectList(); $this-&gt;assignRef('categories',$categories);

In your case you have to handle several product id depending the listing you have.

Regards,

---

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

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

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

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 10 months ago [\#187628](#187628) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  Replied by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187628 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

Thanks.

But for example, the product have a variable for default image, that image that you define that will show if you don't have a product image.
Maybe if we set that or if we create a session variable we can get after this variable.

For example, $variablename[$idproduct] = "xpto.jpg".

If we define an array where the idproduct define the position of the array and set there the image access maybe it will works.
What you think about that?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NDM2NC1jaGVja291dC1nZXQtY2F0ZWdvcnktZGF0YS1vZi10aGUtZW50cnktcHJvZHVjdHM/dG1wbD1tYXJrZG93bg==) 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: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 10 months ago [\#187715](#187715) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187715 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

Hi,

I am sorry but I don't understand your last message regarding the previous discussion.

Regards,

---

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

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

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 10 months ago [\#187788](#187788) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  Replied by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187788 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

Hi,

I have tried to said that maybe if we works with session variables maybe is better, but isn't because if we make a logout and return to the cart we don't have session variables so we don't have fields to override.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NDM2NC1jaGVja291dC1nZXQtY2F0ZWdvcnktZGF0YS1vZi10aGUtZW50cnktcHJvZHVjdHM/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: 86587
- Thank you received: 14326
-
-

11 years 10 months ago [\#187817](#187817) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187817 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

Hi,

You could indeed use $_SESSION to do that, but it's not perfect. If the user logs to his account and already has a cart for it and goes directly to the checkout, the $_SESSION array won't contain any product data and you won't be able to use the data coming from the product page.
Ideally, it would be safer to load again the data you need where you need it.

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

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

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

Less More

- Posts: 57
- Thank you received: 4
-
-

11 years 10 months ago [\#187943](#187943) by [rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")  Replied by *[rfernandes](/forum/user/29593-rfernandes "View rfernandes's Profile")* on topic *[CHECKOUT - Get category data of the entry products](/forum/27-checkout/874364-checkout-get-category-data-of-the-entry-products#187943 "Hi,  Can you help me please? Hi need to get all the information of the categories of products inserted to use (for example) category namekey, category image or category name with the product information.  Can you help me how can I acess this data?  Hi have tried to access in &quot;$this-&gt;element&quot;, &quot;$this-&gt;rows&quot;, &quot;$row&quot;, &quot;$this-&gt;...&quot;) and don't find nothing about category.")*

Yes it's true.
I have saw this sittuation yesterday before report the last post.
Thanks for your attention I hope that this topic can help anothers users.

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

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