Comments and votes for categories

  • Posts: 85
  • Thank you received: 9
1 year 4 months ago #316626

-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9.16
-- PHP version -- : 7.2.26

Hello,

is it possible to add comments and rating for categories?

Because me I have a website where I used a category for each restaurant, and each restaurant has the products that it sells. Me I want to permit to the customers to add comments and ratings for each restaurant.


Thank yoiu for you support

Last edit: 8 months 4 weeks ago by pagemaster.

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

  • Posts: 73432
  • Thank you received: 11245
  • MODERATOR
1 year 4 months ago #316634

Hi,

There is no mechanism for that in HikaShop. You can only have comments and votes for products or for vendors, not categories.
Adding that would require coding that capability, which isn't something that can be done rapidely as the system wasn't made to support it.

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

  • Posts: 85
  • Thank you received: 9
1 year 4 months ago #316697

Ok, thank you anyway. I try to bypass the problem with some code.

Best regards

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

  • Posts: 85
  • Thank you received: 9
8 months 4 weeks ago #325467

I solved with custom code. I added a button for each category that has a vendor with the same name of the category.

This is the code of the view HikaShop - category / listing_img_title.php:

<?php

		// Get a db connection.
		$db = JFactory::getDbo();
		
		// Create a new query object.
		$query = $db->getQuery(true);
		
		$query->select('vendor_id');
		$query->from($db->quoteName('tbuonapp_hikamarket_vendor'));
		$query->where('vendor_name = ' . '"' . $this->row->category_name . '"');

		// Reset the query using our newly populated query object.
		$db->setQuery($query);
		$idVendor = $db->loadResult();
		
		
		// Get a db connection.
		$db = JFactory::getDbo();
		
		// Create a new query object.
		$query = $db->getQuery(true);
		
		$query->select('vendor_alias');
		$query->from($db->quoteName('tbuonapp_hikamarket_vendor'));
		$query->where('vendor_name = ' . '"' . $this->row->category_name . '"');

		// Reset the query using our newly populated query object.
		$db->setQuery($query);
		$aliasVendor = $db->loadResult();
		
	?>

<?php if($idVendor != null and $idVendor != ""){ ?>
		<br><br>
		<div>
			<a class ='hikabtn hikawishlist' href='<?php echo "https://www.buonapp.ch/voti-ristoranti/vendor/show/" .  $idVendor . "-" . $aliasVendor; ?>'><span>Vota ristorante</span></a>
		</div>
<?php } ?>

Last edit: 8 months 4 weeks ago by pagemaster.
The following user(s) said Thank You: nicolas

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

Time to create page: 0.060 seconds
Powered by Kunena Forum