Product's Rank on the product list

  • Posts: 175
  • Thank you received: 0
11 years 5 months ago #148042

Hello

i would like to ask is there anyway to add rank number to the product displayed in hikashop?
i've sorted it based on the average rating so i just need to display the rank

something like this for every product displayed

Last edit: 11 years 5 months ago by veeco.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #148067

Hi,
A solution can be to :
1. Add Badges to your products.
Or
2. Create and use product custom field through "Hikashop->Display->Custom fields" named "Rank"
Or
3.. Directly edit the code of the file of the product view through "Hikashop->Display->Views", but some development skills will be required.

Hope this will help you a little.

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

  • Posts: 175
  • Thank you received: 0
11 years 5 months ago #148203

hello, thanks for your reply

the first and second solution isn't viable since the rank depends on the product's rating and comment and must be dynamically generated

i don't mind coding but could you guide me through it?

i've only figured where the product list is generated

[line 195-ish]

if($filter_type !== 3) {
	$this->setLayout('listing');
	-->$html = $this->loadTemplate($layout_type);<--

and then a few line after that

[line 217-ish]
}
-->echo $html;<--
		
?>
	</div>

the $html contains generated data of the products [after reading it's template]

in the view->product->listing.php

but that's it..
i need to figure where the loop for each product is generated

could you please tell me where the loop for each product is?

Last edit: 11 years 5 months ago by veeco.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #148236

Hi,

i need to figure where the loop for each product is generated

could you please tell me where the loop for each product is?


If you have set the "type of layout" option of your product listing content menu to "DIV", you'll have to edit the "listing_div" file of the "product" view of your front-end template, through the page "Hikashop->Display->Views" :
foreach($this->rows as $row){

The following user(s) said Thank You: veeco

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

  • Posts: 175
  • Thank you received: 0
11 years 3 months ago #154845

Hello, sorry to bump this thread but i've found new problem

the rank system can't work with the pagination system as hikashop will take the item based on it's limit

for example, if you choose the category parent, it will show it's child and their rank, the problem is that if you limit it by 10, it will only take the first 10 item and ignoring their category, this will affect the rank system

page 1



page 2


as you can see, the categories are different so i can't use the pagination as my base for product's rank

any suggestion?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 3 months ago #154886

Hello,
Firstly, can you show me how did you proceed to add our ranks through your product listing ?

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

  • Posts: 175
  • Thank you received: 0
11 years 3 months ago #154949

hi

basically, i set the sorting from content module to sort the list based on the average product score
then i create a variable that will adds every time the product displayed

this method's problem occurred if you display based on category parent [where it show all it's children items]

the only solution i know is to display all items in one page but it will make the page loads much more slower

any suggestion

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

  • Posts: 84293
  • Thank you received: 13693
  • MODERATOR
11 years 3 months ago #155094

Hi,

Maybe creating a HikaShop plugin implementing the onBeforeProductListingLoad trigger and changing the query which loads the elements of the page and do the sorting directly in MySQL would help ?
www.hikashop.com/support/support/documen...reProductListingLoad

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

Time to create page: 0.096 seconds
Powered by Kunena Forum