Page 1 of 1

Related Products bug?

Posted: 25 Feb 2018, 15:20
by Reijo83
Every time when I add Related Products to an item, then this Related Products are added two times in product view.
Example image

Update

After Related Products added and when we go back products list, then there we see twice product what I add to related products.
Example image

Re: Related Products bug?

Posted: 25 Feb 2018, 19:40
by Jan
Hi, which version do you use? Testing now version 3.0.3 without any such problem:

Image

???

Jan

Re: Related Products bug?

Posted: 25 Feb 2018, 20:00
by Reijo83
My ver 3.0.3. Ok i try clean install (jooomla and Phoca Cart). Maybe update messed up something.

Re: Related Products bug?

Posted: 26 Feb 2018, 12:23
by Reijo83
Hi, Jan
So these two sites were in my local machine. But now moved to the server and problems still exist (Clean install).
My test site: https://omakoduleht.ee/test/tuisk/1-vobler/1-hall-ujuv

Re: Related Products bug?

Posted: 03 Mar 2018, 16:32
by Jan
Hi, this seems like it is related to only full group by database rule, try to open this file:

administrator\components\com_phocacart\libraries\phocacart\related\related.php

And try to edit it.
LINE cca. 82
FROM

Code: Select all

$query = ' SELECT a.id as id, a.title as title, a.image as image, a.alias as alias,'
		.' c.id as catid, c.alias as catalias, c.title as cattitle';
TO

Code: Select all

//$query = ' SELECT a.id as id, a.title as title, a.image as image, a.alias as alias,'
//		.' c.id as catid, c.alias as catalias, c.title as cattitle';
$query = ' SELECT DISTINCT a.id as id, a.title as title, a.image as image, a.alias as alias,'
.' SUBSTRING_INDEX(GROUP_CONCAT(c.id ORDER BY c.parent_id), \',\', 1) as catid,'
.' SUBSTRING_INDEX(GROUP_CONCAT(c.title ORDER BY c.parent_id), \',\', 1) as cattitle,'
.' SUBSTRING_INDEX(GROUP_CONCAT(c.alias ORDER BY c.parent_id), \',\', 1) as catalias';
LINE cca. 115
FROM

Code: Select all

$query .= ' GROUP BY a.id, a.title, a.image, a.alias, c.id, c.alias, c.title';
TO

Code: Select all

//$query .= ' GROUP BY a.id, a.title, a.image, a.alias, c.id, c.alias, c.title';
$query .= ' GROUP BY a.id, a.title, a.image, a.alias';
Testing now, it should work. Please let me know if this is working for you.

Thank you, Jan

Re: Related Products bug?

Posted: 08 Mar 2018, 12:16
by Reijo83
Hi Jan
Tested and its working.

Re: Related Products bug?

Posted: 08 Mar 2018, 12:57
by Reijo83
another bug. When you want to delete related Products you can't. After clearing fields and save it, then related products are still there.
See video: https://youtu.be/YqbUg_Lka1A

Re: Related Products bug?

Posted: 13 Mar 2018, 15:18
by Jan
Hi, thank you very much for the info, this was caused but not removing the changes for the debugging, will be fixed in next version, for now just make a quick fix, open:
administrator\components\com_phocacart\models\fields\phocaselectitem.php

on line cca 138
uncomment: // $s[] = ' jQuery(element).val(\'\');';

so
FROM:

Code: Select all

//$s[] = '    jQuery(element).val(\'\');';
TO:

Code: Select all

$s[] = '    jQuery(element).val(\'\');';
Thank you, Jan