Related Products bug?

Reijo83
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 26 Jan 2018, 10:10

Related Products bug?

Post by Reijo83 » 25 Feb 2018, 15:20

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


User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 39784
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Related Products bug?

Post by Jan » 25 Feb 2018, 19:40

Hi, which version do you use? Testing now version 3.0.3 without any such problem:

Image

???

Jan
If you find Phoca extensions useful, please support the project

Reijo83
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 26 Jan 2018, 10:10

Re: Related Products bug?

Post by Reijo83 » 25 Feb 2018, 20:00

My ver 3.0.3. Ok i try clean install (jooomla and Phoca Cart). Maybe update messed up something.

Reijo83
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 26 Jan 2018, 10:10

Re: Related Products bug?

Post by Reijo83 » 26 Feb 2018, 12:23

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

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 39784
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Related Products bug?

Post by Jan » 03 Mar 2018, 16:32

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
If you find Phoca extensions useful, please support the project

Reijo83
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 26 Jan 2018, 10:10

Re: Related Products bug?

Post by Reijo83 » 08 Mar 2018, 12:16

Hi Jan
Tested and its working.

Reijo83
Phoca Newbie
Phoca Newbie
Posts: 9
Joined: 26 Jan 2018, 10:10

Re: Related Products bug?

Post by Reijo83 » 08 Mar 2018, 12:57

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

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 39784
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Related Products bug?

Post by Jan » 13 Mar 2018, 15:18

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
If you find Phoca extensions useful, please support the project

Post Reply