- Posts: 5
- Thank you received: 1
How to show Product Categories under Products
8 years 7 months ago #287400
by pjwood52
How to show Product Categories under Products was created by pjwood52
-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.3
Is there a way to show the related product categories underneath products, the same way Related products can be shown as per the tutorial, but display related categories instead?
For example. If we were creating football kits, the user goes onto a particular Football Shirt product page, and underneath it shows the related categories of Football Shorts and Football Socks?
-- Joomla version -- : 3.8.3
Is there a way to show the related product categories underneath products, the same way Related products can be shown as per the tutorial, but display related categories instead?
For example. If we were creating football kits, the user goes onto a particular Football Shirt product page, and underneath it shows the related categories of Football Shorts and Football Socks?
Please Log in or Create an account to join the conversation.
8 years 7 months ago #287407
by nicolas
Replied by nicolas on topic How to show Product Categories under Products
Hi,
There is no such system.
You could create a custom product field to enter that information in the products, configure a module under the product page to display all the categories of the shop, and then write a small plugin implementing the "onBeforeCategoryListingLoad" trigger of HikaShop to filter out the categories so that it only displays the ones selected in the current product.
www.hikashop.com/support/documentation/6...eCategoryListingLoad
So if you're a developer or hire one to develop the plugin, it's totally possible.
There is no such system.
You could create a custom product field to enter that information in the products, configure a module under the product page to display all the categories of the shop, and then write a small plugin implementing the "onBeforeCategoryListingLoad" trigger of HikaShop to filter out the categories so that it only displays the ones selected in the current product.
www.hikashop.com/support/documentation/6...eCategoryListingLoad
So if you're a developer or hire one to develop the plugin, it's totally possible.
Please Log in or Create an account to join the conversation.
8 years 7 months ago #287590
by pjwood52
Replied by pjwood52 on topic How to show Product Categories under Products
Hi nicolas
Thanks for your help. I've followed your instructions so far and got all of the categories sitting underneath the product which is great. I'm keen to understand myself how to implement the onBeforeCategoryListingLoad(&$filters) function to filter out the categories but can't seem to grasp what the HikaSHop development documention you linked is saying. Do you have any examples of the onBeforeCategoryListingLoad(&$filters) function being used so I can use as an example?
Grateful for any help
Thanks for your help. I've followed your instructions so far and got all of the categories sitting underneath the product which is great. I'm keen to understand myself how to implement the onBeforeCategoryListingLoad(&$filters) function to filter out the categories but can't seem to grasp what the HikaSHop development documention you linked is saying. Do you have any examples of the onBeforeCategoryListingLoad(&$filters) function being used so I can use as an example?
Grateful for any help
Please Log in or Create an account to join the conversation.
8 years 7 months ago #287591
by nicolas
Replied by nicolas on topic How to show Product Categories under Products
Hi,
For example, something like that:
For example, something like that:
Code:
function onBeforeCategoryListingLoad( &$filters, &$order, &$parentObject, &$leftjoin){
if(@$_REQUEST['ctrl'] == 'product' && @$_REQUEST['task'] == 'show' ){
$product_id = $_REQUEST['cid'];
$productClass = hikashop_get('class.product');
$categories = $productClass->getCategories($product_id);
$filters[] = 'category_id IN ('.implode(',', $categories).' )';
}
}
Please Log in or Create an account to join the conversation.
Time to create page: 0.217 seconds