Categories from menu itemid

  • Posts: 14
  • Thank you received: 0
10 years 11 months ago #171871

-- url of the page with the problem -- : www.raddtp.nl/anatomie/index.php?option=...t=listing&Itemid=168
-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : FF 31

I'm building a module which has to display all the values of customfields after click on a menuitem of hikashop.

For instance I have this url
raddtp.nl/anatomie/index.php?option=com_...t=listing&Itemid=214
This is an menuitem of hikashop with a product list from a certain categories.
If i clicked this link/menuitem, i want to show a listing of alle values of the custom fields linked to all listed products in this view.

I want to retreive the category-id's from this menuitem, but i don't know how to do this. How can i retreive these categories.

When I have these categories, i want query directly the databse to get alle customfields data of the related product from the categories.

Is there a better way to do is. Is it possible to use a object/class to acces this data more easy?

Many thanks in advance.

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

  • Posts: 84301
  • Thank you received: 13697
  • MODERATOR
10 years 11 months ago #171878

Hi,

Edit the file "listing" of the view "product" via the menu Display>Views. There, in $this->element you'll get the data of the current category, like for example $this->category->category_id for the id of the category.
You can then run your query on the table hikashop_field in order to get the list of all the fields of the current category.

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

  • Posts: 14
  • Thank you received: 0
10 years 11 months ago #171920

Thank your very munch for quick response

How can i acces $this->element in a module?
I want to view this data via a module.

Do i have to load some class/object.

Many thanks for your reply.

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #171922

Hi,

The modules are calling the views, so editing the view as Nicolas said will allow you to get the $this->element and so do what you want.

The view called is based on the settings of your module, but the view "listing" is always called.

Module > Listing view > Listing_xxx view

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

Time to create page: 0.056 seconds
Powered by Kunena Forum