How to show comment & vote in category page?

  • Posts: 6
  • Thank you received: 0
8 years 7 months ago #232502

-- HikaShop version -- : 2.6.0

Hi

I have a category page, showing the products in the category. Since I disabled "Link to the product page" from configuration and there is no product page, I decided to show comment on category page. But when I took a little look at configuration and database I noticed that comment system is only available in product page and for a single product, not category of products. But there a "vote_type" field in #__hikashop_vote table which can be 'category' instead of 'product'. (correct me if I'm wrong)

So, How to do that? is it possible to use default Hikashop system (or jcomments) to show comment & vote form for a category with little changes, or do I have to use a custom component to make it happen?

Thanks in advance.

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

  • Posts: 82723
  • Thank you received: 13338
  • MODERATOR
8 years 7 months ago #232510

Hi,

The comment system isn't meant to be used on the listings.
The vote_type is used to allow votes on vendors, not categories, at least for now.
So it's not easy to add that to the categories. It's not impossible, but it requires a developer to work on that.

Adding jcomments on the listings should be easy on the other hand.
You can add such code:

<?php
$comments = HIKASHOP_ROOT . 'components' . DS . 'com_jcomments' . DS . 'jcomments.php';
require_once ($comments);
echo JComments::showComments($this->element->category_id, 'com_hikashop', $this->element->category_name);
?>
in the file "listing" of the view "product" via the menu Display>Views and that should do it.

The following user(s) said Thank You: ::REZA::

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

Time to create page: 0.052 seconds
Powered by Kunena Forum