Skip Navigation

[Resolved] Invalid argument woocommerce/content-product.php on line 47

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by tomaszT 6 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#616995

I am trying to:

Link to a page where the issue can be seen:

I expected to see:

Instead, I got:

Hello, I got a problem with some of my products since I have moved the website to another server and domain (on the old one everything works fine).
There is a message:
Warning: Invalid argument supplied for foreach() in /home/ [...] /woocommerce/content-product.php on line 47

It is shown only in some cases.
After I moved the website I noticed that the templates created with Toolset were switched off, so I had to switched them on. The woocommerce plugin used the default template, so I had to changed it too. I also re-installed the woocommerce, but it did not do any improvement. Then i copied the woocommerce catalog from the old server but it did not improve anything as well. Then I reinstalled the database - again nothing changed.
Could you help me with it?

#617002

The full error is:

Warning: Invalid argument supplied for foreach() in /public_html/some_custom_name/some_custom_name/themes/some_custom-theme/woocommerce/content-product.php on line 47

This is a customized WordPress install, and it should be an error coming from your theme, if I read the path right, although this is not the native default WordPress path, so it could be anything - I assume thou it's the theme's folder.

Does it persist if you disable Toolset?
Please try that after a Backup or on a test site.

I think this is a issue with the Theme you use.

#617057

Hello, thank you for the tip. Of course I can give a try, but the old site is still working and there i no problem, as I mentioned above.

#617059

We need to know if the issue is due to Toolset first.

As it seems it's not unless that error has a Call Stack mentioning Toolset, which I do not know.

Disabling the Toolset and testing again will do it.

Please do this either on a test site or a backed up site.

#617079

I switched off Toolset Types, Views, Woocommerce Views and the error is still visible. But stangely a custom taxonomy called 'author' created with help of Tollset Views is visible as well.

#617102

Hello again,
I tried again to examine carefully my files. I found a catalogue woocommerce in my custom theme that caused the issue. I really do not know why they do not create that problem on the original site but when I cancelled them from the page no. 2, the issue disappeared so the ticket is resolved.
Thank you for all the guides.