Combining rows in the product compare table HOW TO

  • Posts: 69
  • Thank you received: 1
10 years 2 weeks ago #178555

-- HikaShop version -- : 3.2.3
-- Joomla version -- : 3.3.6

Hi,

I plan to alter the search results and add product compare functionality to the search results that are returned. I think I know how to do this. What I have a question about is the compare table that is generated via compare.php

In a normal compare table, the results are from a single category. In my case, the search + compare may return a compare table that has products from two different categories. This gives me my list of custom fields, but I get too many fields returned. For example I have a product field for GLOVE COLOR and another field for JACKET COLOR... so if I search for "blue" then compare a jacket and a glove, I get both product fields (two different rows) in my compare table, when I would like to have just a single row in the table called COLOR with the values from each of GLOVE COLOR and JACKET COLOR displayed in that single row. Please understand that the GLOVE COLOR field will be null for a jacket and the JACKET COLOR field will be null for a glove

So here is my question... having looked at compare.php I cannot determine how to combine two rows in the compare table. Is there any advice you can give me toward this effort?

Thanks so much,

Dennis


______________
Dennis Kmetz

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 2 weeks ago #178583

Hi,

The compage page allow you to compare products from different categories.
It is just that for a customer, he has to see the two products in the same page if he want to compare them ; but the system can be improved, the page just require product id in his parameters to work.

About your aggregation of fields ; it will require some override of the compare view.
The view create one row per element, so in your case you have to create an algorithm which will join several fields into the same row.
For the first column it will be mostly a skip of the fields and a replacement by their common name ; for the product columns it will be the display of all join fields.
Because a product can just have one value (glove color or jacket color but not both), only the field with a value will be displayed.

I hope my explanation is clear enough.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum