[Skip to main content](#vessel-content)

#   Vote and Comment: Display votes as compact on listing, vote avarage, vote total.

##

- **[flexsus](/forum/user/39807-flexsus "View flexsus's Profile")**
- [![flexsus's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar39807.jpg)](/forum/user/39807-flexsus "View flexsus's Profile") Topic Author
- [ Offline](/forum/user/39807-flexsus)

Less More

- Posts: 136
- Thank you received: 7
-
-
-

8 years 7 months ago -  8 years 7 months ago [\#290944](#290944) by [flexsus](/forum/user/39807-flexsus "View flexsus's Profile")  *[Vote and Comment: Display votes as compact on listing, vote avarage, vote total.](/forum/50-feature-request/894374-vote-and-comment-display-votes-as-compact-on-listing-vote-avarage-vote-total#290944 "-- HikaShop version -- : 3.4.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 7.0.10  Hi Hikashop  I would like to suggest the option to make a compact view of vote stars in listings. Like Fiverr.com does it:  And the option to show/hide vote avarage and vote total after the stars.  And I think 1 decimal in aggregateRating would be enough.  I can do this in view-override and I will do, but I hope some day this will be a feature in Hikashop. Then I can have as few overridden files as possible :-)  Best regards, Henrik")* was created by *[flexsus](/forum/user/39807-flexsus "View flexsus's Profile")*

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.6
-- PHP version -- : 7.0.10

Hi Hikashop

I would like to suggest the option to make a compact view of vote stars in listings. Like Fiverr.com does it:

[ ![fiverr.png](/forum/attachment/43283) ](/forum/attachment/43283 "fiverr.png")

And the option to show/hide vote avarage and vote total after the stars.

[ ![votes-feature-request.png](/forum/attachment/43284) ](/forum/attachment/43284 "...re-request.png")

And I think 1 decimal in aggregateRating would be enough.

I can do this in view-override and I will do, but I hope some day this will be a feature in Hikashop. Then I can have as few overridden files as possible ![:-)](/media/kunena/emoticons/3.png ":-)")

Best regards,
Henrik

---

.ninja { color: black; visibility: hidden; }
In case of fire:
1. git commit
2. git push
3. exit building

- [ ![fiverr.png](/forum/attachment/43283) ](/forum/attachment/43283 "fiverr.png") [ ](/forum/attachment/43283?download=1 "fiverr.png")
- [ ![votes-feature-request.png](/forum/attachment/43284) ](/forum/attachment/43284 "...re-request.png") [ ](/forum/attachment/43284?download=1 "...re-request.png")

Last edit: 8 years 7 months ago by [flexsus](/forum/user/39807-flexsus "View flexsus's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84OTQzNzQtdm90ZS1hbmQtY29tbWVudC1kaXNwbGF5LXZvdGVzLWFzLWNvbXBhY3Qtb24tbGlzdGluZy12b3RlLWF2YXJhZ2Utdm90ZS10b3RhbD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[flexsus](/forum/user/39807-flexsus "View flexsus's Profile")**
- [![flexsus's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar39807.jpg)](/forum/user/39807-flexsus "View flexsus's Profile") Topic Author
- [ Offline](/forum/user/39807-flexsus)

Less More

- Posts: 136
- Thank you received: 7
-
-
-

8 years 7 months ago -  8 years 7 months ago [\#290963](#290963) by [flexsus](/forum/user/39807-flexsus "View flexsus's Profile")  Replied by *[flexsus](/forum/user/39807-flexsus "View flexsus's Profile")* on topic *[Vote and Comment: Display votes as compact on listing, vote avarage, vote total.](/forum/50-feature-request/894374-vote-and-comment-display-votes-as-compact-on-listing-vote-avarage-vote-total#290963 "-- HikaShop version -- : 3.4.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 7.0.10  Hi Hikashop  I would like to suggest the option to make a compact view of vote stars in listings. Like Fiverr.com does it:  And the option to show/hide vote avarage and vote total after the stars.  And I think 1 decimal in aggregateRating would be enough.  I can do this in view-override and I will do, but I hope some day this will be a feature in Hikashop. Then I can have as few overridden files as possible :-)  Best regards, Henrik")*

Hi

Here is what my view override looks like now:

[ ![vote-improvements.png](/forum/attachment/43286) ](/forum/attachment/43286 "...provements.png")

I did not find a way to call if I'm in a listing view or product/vendor view so that I could achieve only showing 1 star in listing view and all stars (5) in vendor/product detail page.

Modified code below.

Best regards,
Henrik

Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 3.4.0 * @author hikashop.com * @copyright (C) 2010-2018 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php $row =&amp; $this-&gt;rows; $config = hikashop_config(); if($row-&gt;vote_enabled != 1) return; $voteAccess = $config-&gt;get('access_vote','public'); $user = hikashop_loadUser(); $hasBought = false; if($voteAccess == 'buyed' &amp;&amp; !empty($user)){ $voteClass = hikashop_get('class.vote'); $hasBought = $voteClass-&gt;hasBought($row-&gt;vote_ref_id, $user); } $canVote = $voteAccess == 'public' &#124;&#124; ($voteAccess == 'registered' &amp;&amp; !empty($user)) &#124;&#124; ($voteAccess == 'buyed' &amp;&amp; $hasBought); if(!$canVote &amp;&amp; $row-&gt;hikashop_vote_total_vote == '0'){ echo '&lt;div class="hikashop_vote_stars"&gt;&lt;span class="hk-rate-star state-full"&gt;&lt;/span&gt;&lt;span class="hikashop_no_vote"&gt;'.JText::_('HIKA_NO_VOTE').'&lt;/span&gt;&lt;/div&gt;'; return; } $row-&gt;hikashop_vote_average_score = round((float)hikashop_toFloat($row-&gt;hikashop_vote_average_score),1); hikaInput::get()-&gt;set("rate_rounded",$row-&gt;hikashop_vote_average_score_rounded); hikaInput::get()-&gt;set("nb_max_star",$row-&gt;hikashop_vote_nb_star); $select_id = "select_id_".$row-&gt;vote_ref_id; if(!empty($row-&gt;main_div_name)){ $select_id .= "_".$row-&gt;main_div_name; }else{ $select_id .= "_hikashop_main_div_name"; } if($row-&gt;hikashop_vote_total_vote == '0'){ $tooltip = JText::_('HIKA_NO_VOTE'); }else{ $user_rating = JText::_('HIKA_NO_VOTE'); if(isset($this-&gt;user_vote-&gt;vote_rating)) $user_rating = $this-&gt;user_vote-&gt;vote_rating; $tooltip = "&lt;span class='hikashop_vote_tooltip hikashop_vote_tooltip_average'&gt;&lt;span class='hikashop_vote_tooltip_label'&gt;".JText::_('VOTE_AVERAGE').": &lt;/span&gt;&lt;span class='hikashop_vote_tooltip_value'&gt;".$row-&gt;hikashop_vote_average_score."&lt;/span&gt;&lt;/span&gt;"; $tooltip .= "&lt;br&gt;&lt;span class='hikashop_vote_tooltip hikashop_vote_tooltip_total'&gt;&lt;span class='hikashop_vote_tooltip_label'&gt;".JText::_('HIKA_VOTE_TOTAL').": &lt;/span&gt;&lt;span class='hikashop_vote_tooltip_value'&gt;".$row-&gt;hikashop_vote_total_vote."&lt;/span&gt;&lt;/span&gt;"; $tooltip .= "&lt;br&gt;&lt;span class='hikashop_vote_tooltip hikashop_vote_tooltip_customer_vote'&gt;&lt;span class='hikashop_vote_tooltip_label'&gt;".JText::_('HIKA_VOTE_CUSTOMER_VOTE').": &lt;/span&gt;&lt;span class='hikashop_vote_tooltip_value'&gt;".$user_rating."&lt;/span&gt;&lt;/span&gt;"; } ?&gt; &lt;div class="hikashop_vote_stars"&gt; &lt;?php if($config-&gt;get('enable_status_vote', 'vote') != 'both' &amp;&amp; $canVote) { ?&gt; &lt;input type="hidden" name="hikashop_vote_rating" data-votetype="&lt;?php echo $row-&gt;type_item; ?&gt;" data-max="&lt;?php echo $row-&gt;hikashop_vote_nb_star; ?&gt;" data-ref="&lt;?php echo $row-&gt;vote_ref_id;?&gt;" data-rate="&lt;?php echo $row-&gt;hikashop_vote_average_score_rounded; ?&gt;" data-original-title="&lt;?php echo $tooltip; ?&gt;" id="&lt;?php echo $select_id;?&gt;" /&gt; &lt;?php if ($row-&gt;hikashop_vote_total_vote &gt; 0) { ?&gt; &lt;div class="hikashop_vote_aggregate"&gt; &lt;div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"&gt; &lt;span itemprop="ratingValue"&gt;&lt;strong&gt;&lt;?php echo $row-&gt;hikashop_vote_average_score; ?&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span itemprop="ratingCount"&gt;(&lt;?php echo $row-&gt;hikashop_vote_total_vote; ?&gt;)&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php } ?&gt; &lt;span id="hikashop_vote_status_&lt;?php echo $row-&gt;vote_ref_id;?&gt;" class="hikashop_vote_notification_mini"&gt;&lt;/span&gt; &lt;?php } else { ?&gt; &lt;div class="hk-rating" data-original-title="&lt;?php if ($canVote) { echo $tooltip; } ?&gt;" data-toggle="hk-tooltip"&gt; &lt;?php for($i = 1; $i &lt;= $row-&gt;hikashop_vote_average_score_rounded; $i++) { echo '&lt;span class="hk-rate-star state-full"&gt;&lt;/span&gt;'; } for($i = $row-&gt;hikashop_vote_average_score_rounded; $i &lt; $row-&gt;hikashop_vote_nb_star; $i++) { echo '&lt;span class="hk-rate-star state-empty"&gt;&lt;/span&gt;'; } ?&gt; &lt;/div&gt; &lt;?php if ($row-&gt;hikashop_vote_total_vote &gt; 0) { ?&gt; &lt;div class="hikashop_vote_aggregate"&gt; &lt;div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"&gt; &lt;span itemprop="ratingValue"&gt;&lt;strong&gt;&lt;?php echo $row-&gt;hikashop_vote_average_score; ?&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span itemprop="ratingCount"&gt;(&lt;?php echo $row-&gt;hikashop_vote_total_vote; ?&gt;)&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php } } ?&gt; &lt;input type="hidden" class="hikashop_vote_rating" data-rate="&lt;?php echo $row-&gt;hikashop_vote_average_score_rounded; ?&gt;" /&gt; &lt;/div&gt;

---

.ninja { color: black; visibility: hidden; }
In case of fire:
1. git commit
2. git push
3. exit building

- [ ![vote-improvements.png](/forum/attachment/43286) ](/forum/attachment/43286 "...provements.png") [ ](/forum/attachment/43286?download=1 "...provements.png")

Last edit: 8 years 7 months ago by [flexsus](/forum/user/39807-flexsus "View flexsus's Profile").

The following user(s) said Thank You: [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84OTQzNzQtdm90ZS1hbmQtY29tbWVudC1kaXNwbGF5LXZvdGVzLWFzLWNvbXBhY3Qtb24tbGlzdGluZy12b3RlLWF2YXJhZ2Utdm90ZS10b3RhbD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

8 years 7 months ago [\#290979](#290979) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Vote and Comment: Display votes as compact on listing, vote avarage, vote total.](/forum/50-feature-request/894374-vote-and-comment-display-votes-as-compact-on-listing-vote-avarage-vote-total#290979 "-- HikaShop version -- : 3.4.0 -- Joomla version -- : 3.8.6 -- PHP version -- : 7.0.10  Hi Hikashop  I would like to suggest the option to make a compact view of vote stars in listings. Like Fiverr.com does it:  And the option to show/hide vote avarage and vote total after the stars.  And I think 1 decimal in aggregateRating would be enough.  I can do this in view-override and I will do, but I hope some day this will be a feature in Hikashop. Then I can have as few overridden files as possible :-)  Best regards, Henrik")*

Hello Henrik,

> I can do this in view-override and I will do, but I hope some day this will be a feature in Hikashop. Then I can have as few overridden files as possible ![:-)](/media/kunena/emoticons/3.png ":-)")

We'll take that into account, thank you for your feedback !

Best regards,
Mohamed Thelji.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUwLWZlYXR1cmUtcmVxdWVzdC84OTQzNzQtdm90ZS1hbmQtY29tbWVudC1kaXNwbGF5LXZvdGVzLWFzLWNvbXBhY3Qtb24tbGlzdGluZy12b3RlLWF2YXJhZ2Utdm90ZS10b3RhbD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.048 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
