Display cat descrip on product page for one cat

  • Posts: 332
  • Thank you received: 6
9 years 6 months ago #231192

-- url of the page with the problem -- : fearlessrider.com/store/category/fearless-rider-2-day-clinic
-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5
-- Browser(s) name and version -- : various
-- Error-message(debug-mod must be tuned on) -- : none

I have a need to display the category description on all products that are assigned to one category but not on all the others. I cannot find any setting that will give me this ability. Can it be done?

Also, I could find no documentation for import formats for customers and sales. Do you have a layout of how the tables link up?

Last edit: 9 years 6 months ago by LukeDouglas.

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

  • Posts: 84307
  • Thank you received: 13701
  • MODERATOR
9 years 6 months ago #231209

Hi,

1. There is no such setting. You can do that by adding CSS like that:
#hikashop_product_description_main{
display:none;
}
.hikashop_product_of_category_XXX #hikashop_product_description_main{
display:block;
}
where XXX is the id of the category for which you want to display the description.

2. There is no import system for customers or sales.
You can find the database structure of HikaShop here:
www.hikashop.com/support/documentation/6...ocumentation.html#db

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

  • Posts: 332
  • Thank you received: 6
9 years 6 months ago #231283

Nicholas,

Thanks for the link to the database structure. :)

As far as the category title / description being displayed on a product page, if there is no setting to display category info on a product page, then the CSS would be useless. Now if there is a setting to display category info on each product page within that category, I would like to know where that setting is so I can make it happen. :cheer:

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

  • Posts: 13201
  • Thank you received: 2322
9 years 6 months ago #231315

Hi,

You can edit the view "product / show_default" and use code like:

<?php
$productClass = hikashop_get('class.product');
$categories = $productClass->getCategories($this->element->product_id);
if(count($categories) == 1){
	$categoryClass = hikashop_get('class.category');
	$category = $categoryClass->get($categories[0]);
	echo $category->category_description;
}
?>

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

Time to create page: 0.068 seconds
Powered by Kunena Forum