- Posts: 14
- Thank you received: 0
Categories from menu itemid
12 years 2 weeks ago #171871
by cms4biz
Categories from menu itemid was created by cms4biz
-- 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.
-- 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.
12 years 2 weeks ago #171878
by nicolas
Replied by nicolas on topic Categories from menu itemid
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.
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.
12 years 2 weeks ago #171920
by cms4biz
Replied by cms4biz on topic Categories from menu itemid
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.
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.
12 years 2 weeks ago #171922
by Xavier
Replied by Xavier on topic Categories from menu itemid
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
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.205 seconds