How to get First Category Name and Second Category name on Product Listing

  • Posts: 177
  • Thank you received: 1
8 years 5 months ago #267961

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.x
-- PHP version -- : 5.x

Hi all,
i need to make a custumization about page (product / listing.php) and i need to get the categories names:
wich php string can i use it?

Something like $this->categories ..... ?

Because this string it doesn't work on listing.php

Thanks in advance.

A.

Please Log in or Create an account to join the conversation.

  • Posts: 26284
  • Thank you received: 4046
  • MODERATOR
8 years 5 months ago #267989

Hello,

Which category names ?

You're in a product listing ; you want the categories of the products ?
If that's so, you need to read the information directly in the list of product objects.

" $this->categories " is used for the "group by category" features.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 1
8 years 5 months ago #268021

How ?

Please Log in or Create an account to join the conversation.

  • Posts: 26284
  • Thank you received: 4046
  • MODERATOR
8 years 5 months ago #268023

Hello,

I'm sorry but it does not answer to my questions.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 1
8 years 5 months ago #268082

Sorry Jerome! My keyboard is gone! :)))

Yes, i want the product's category! How can i get it by code?

Sorry again!

A.

Please Log in or Create an account to join the conversation.

  • Posts: 26284
  • Thank you received: 4046
  • MODERATOR
8 years 5 months ago #268083

Hello,

You're in a product listing ; you want the categories of the products ?
If that's so, you need to read the information directly in the list of product objects.


You can't really have the information in the view "product / listing" because you are not "browsing" the products.
As I told you, the information is directly in the product object, so you need to read the product categories for each product during the "loop", when you have access to the product via
$this->row
Then you will have access to
$this->row->categories

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 177
  • Thank you received: 1
8 years 5 months ago #268182

Thanks.

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum