• Priority: 0
  • Status: Queued
  • Theme: Alysum
  • Assigned To: Fred
  • Private: No
  • Open Date: 25.03.25, 10:20
  • Opened by: Aude C

Ticket #26003 - Notice "country" on module "pkfavorites"

Hello,

I bought Alysum theme 9.0.0. I have notices with pkfavorites theme on homepage, I use Jewelry template:

Notice: Trying to get property ‘country’ of non-object
in Module.php line 2426
at ModuleCore→getCacheId()in DisplayProductButton.php line 49
at DisplayProductButton→init()in pkfavorites.php line 140
at Pkfavorites→executeHook()in pkfavorites.php line 101
at Pkfavorites→hookDisplayProductButton()in Hook.php line 1007

Regards,
Aude.

Comments

Fred 25 Mar 2025, 22:13

Hi, Aude C.
What prestashop version do you use?

Aude C 26 Mar 2025, 08:28

Hi,
I use PrestaShop 1.7.8.11.

Regards,
Aude

Fred 26 Mar 2025, 21:41

Ok, where I can see that error? Because I can't find it

Aude C 27 Mar 2025, 09:31

Hi,
You need to active debug mode or to check error logs to see it.
You can see it in my screenshot attached.
I toke it on home page : http://ps17811.stbh8010.odns.fr/

But, I need to enable debug mode today before 6PM. You can set it this evening or tomorrow.

Regards,
Aude

Attachments:

Fred 31 Mar 2025, 23:26

Yes, I see now.
I assume you have added favorites module to a page in a wrong way, like through the "module" widget. Can you check that?

Aude C 01 Apr 2025, 11:07

Hi,
I set favorites module with Elementor, please see scrennshot.
But, when I remove this widget, I always have notice "country".

Attachments:

Fred 01 Apr 2025, 21:45

It looks like a cache, have you tried to clear it?
As for that widget it can be used on Product page only. I know that's confusing. We will try to make that more clear

Aude C 02 Apr 2025, 08:29

Hi,
I will want to add a favorite widget in header (with a badge with favorites number) and a link to access to favorites list, is it possible?

Aude C 02 Apr 2025, 08:35

But this error occures even if the favorite widget is removed and I removed all other widget except navigation and logo from my header.
I think it's other thing that create this notice.

Fred 03 Apr 2025, 22:30

I see this hook when Debug Mode is enabled https://mega.nz/file/tcIHVJYT#vQh5XHbDExiwOyuBxUwk3D8TlqJnzNQfwYC0AnYAurw and there is no such hook in the theme by default. How did you add it and which modules are hooked there?

Aude C 04 Apr 2025, 09:20

Hi,

I don't find this hook in all of files (I use a grep search)… But, more strange, this hook have a random name! Please, see my new screenshot: now it looks for "displayProductButton1".
I didn't install module on this test website. Only your theme.
So, 2 options:
- it comes from your theme
OR
- it comes from a PrestaShop module

This hook name is created dynamically.

Attachments:

Aude C 04 Apr 2025, 09:25

But it's a cache call with product ID (so the 1 or 2 comes from a product ID), I think this hook is called here:
/modules/pkfavorites/src/Hooks/DisplayProductButton.php line 49