Rating error helpful comment

  • Posts: 410
  • Thank you received: 15
7 months 2 days ago #355355

-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.3.4
-- PHP version -- : 8.1.17
-- Browser(s) name and version -- : Google Chrome 117

Hi, I'm getting the following error when rating a helpful comment: POST http://localhost/demo/index.php/component/hikashop/vote/save?tmpl=component 500 (Internal Server Error)

0 round(): Argument #1 ($num) must be of type int|float, string given

Last edit: 7 months 2 days ago by neo191987.

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

  • Posts: 4519
  • Thank you received: 612
  • MODERATOR
7 months 2 days ago #355359

Hello,

Can you active the Joomla Debug at maximum level, and process a screenshot in order to show us everything?
This will allow us to better understand the error and his context.

Regards

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

  • Posts: 410
  • Thank you received: 15
7 months 1 day ago #355373
Attachments:

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

  • Posts: 410
  • Thank you received: 15
7 months 1 day ago #355376

fixed

components/com_hikashop/controllers/vote.php

row 72 and 73

$return['values'] = array('average' => round($voteClass->values['average'],2), 'rounded' => round($voteClass->values['average']), 'total' => $voteClass->values['total']);
$return['tooltip'] = JText::sprintf('HIKA_VOTE_TOOLTIP',round($voteClass->values['average'],2),$voteClass->values['total'],$element->vote_rating);

changed to
$return['values'] = array('average' => round((float)$voteClass->values['average'],2), 'rounded' => round((float)$voteClass->values['average']), 'total' => $voteClass->values['total']);
$return['tooltip'] = JText::sprintf('HIKA_VOTE_TOOLTIP',round((float)$voteClass->values['average'],2),$voteClass->values['total'],$element->vote_rating);

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
7 months 1 day ago #355378

Hi,

Thank you for the details and the patch. We've added it on our end.
For others with the issue, you can download the install package of HikaShop on our website and install it on yours and it will automatically apply the patch.

The following user(s) said Thank You: neo191987

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

Time to create page: 0.069 seconds
Powered by Kunena Forum