Home › Forums › WoodMart support forum › I am getting a critical error when opening a product page
I am getting a critical error when opening a product page
- This topic has 19 replies, 3 voices, and was last updated 1 week ago by Artem Temos.
-
AuthorPosts
-
November 22, 2024 at 10:18 pm #614860
agenciawebinfiniteParticipantHello!
Yesterday I received this critical error when opening a product page, I had never seen it before.
I deactivated the theme’s core plugin and reactivated it and it worked.
Today, the same thing happened again, what could it be?
Warning: foreach() argument must be of type array|object, string given in /home/lhstore/public_html/wp-content/themes/woodmart/inc/modules/parts-css-files/class-parts-css-files.php on line 288 Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, string given in /home/lhstore/public_html/wp-content/themes/woodmart/inc/modules/parts-css-files/class-parts-css-files.php:403 Stack trace: #0 /home/lhstore/public_html/wp-content/themes/woodmart/inc/modules/parts-css-files/class-parts-css-files.php(403): in_array() #1 /home/lhstore/public_html/wp-content/themes/woodmart/inc/enqueue.php(1181): XTS\Modules\Parts_Css_Files->enqueue_inline_style() #2 /home/lhstore/public_html/wp-content/themes/woodmart/inc/modules/header-builder/functions.php(23): woodmart_enqueue_inline_style() #3 /home/lhstore/public_html/wp-content/themes/woodmart/header.php(26): whb_generate_header() #4 /home/lhstore/public_html/wp-includes/template.php(810): require_once('...') #5 /home/lhstore/public_html/wp-includes/template.php(745): load_template() #6 /home/lhstore/public_html/wp-includes/general-template.php(48): locate_template() #7 /home/lhstore/public_html/wp-content/themes/woodmart/woocommerce/single-product.php(14): get_header() #8 /home/lhstore/public_html/wp-includes/template-loader.php(106): include('...') #9 /home/lhstore/public_html/wp-blog-header.php(19): require_once('...') #10 /home/lhstore/public_html/index.php(17): require('...') #11 {main} thrown in /home/lhstore/public_html/wp-content/themes/woodmart/inc/modules/parts-css-files/class-parts-css-files.php on line 403 Há um erro crítico no seu site.
Can you help me check what it could be?
I haven’t updated Woodmart 8.0.0 yet.
November 23, 2024 at 5:03 pm #615093
agenciawebinfiniteParticipantNote:
Since it is critical and no one has gotten back to me, I updated the theme to 8.0 and for now, it seems to have resolved the issue.Let’s see if it is back to normal in 1 or 2 days.
November 24, 2024 at 12:01 pm #615240
agenciawebinfiniteParticipantHello,
After updating to Woodmart 8.0, the error mentioned in the previous message disappeared, but this error now started appearing on the product page:
Warning: foreach() argument must be of type array|object, string given in /home/lhstore/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/frequently-bought-together/class-frontend.php on line 161
You can test it at this link:
https://www.lhstoreshop.com.br/produto/vestido-oasis-de-verao/How to solve this?
November 24, 2024 at 12:07 pm #615241
agenciawebinfiniteParticipantAnd when editing the product, there is this other error:
https://imgur.com/mMMgHjpWarning: foreach() argument must be of type array|object, string given in /home/lhstore/public_html/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/frequently-bought-together/class-table.php on line 126
November 24, 2024 at 12:18 pm #615245
agenciawebinfiniteParticipantFor now, I’ve disabled frequently-bought-together so that the error doesn’t show up for clients.
I look forward to your correction.
November 24, 2024 at 11:49 pm #615308
arbuzasParticipantHave similar issue only critical error was due to Dynamic Pricing. Had to disable it. Any help would be appreciated
November 25, 2024 at 11:40 am #615432
Artem TemosKeymasterHello,
Could you please clarify where exactly we can see this error on your website now? How to reproduce it in real-time?
Also, please clarify if you used any kind of optimizations for your database.Kind Regards
November 25, 2024 at 6:12 pm #615705
agenciawebinfiniteParticipantHello!
About the first error, it is not possible to reproduce it because I updated the theme to 8.0 and it fixed it.
For the second error reported here, to reproduce it, you need to reactivate frequently-bought-together in the theme and analyze some products that do not appear (not in all). I sent you the link to one to test.
I use this plugin to optimize the database keys:
https://br.wordpress.org/plugins/index-wp-mysql-for-speed/November 25, 2024 at 6:45 pm #615725
Artem TemosKeymasterHello,
This plugin broke the key for our theme, and that is why the error occurred https://monosnap.com/file/lJwwKX19S9Syx1Xj6YxGR6zd658YDR
Kind Regards
November 25, 2024 at 8:54 pm #615765
agenciawebinfiniteParticipantOkay, what’s up?
I’ve been using this plugin for almost a year on all my sites, and I can’t remove it, especially because on large sites, they are very slow to open orders and products.
But this is only happening on this site, the others are fine.
Can you do something to help solve this?
Or can you INSTRUCT the support of the index wp mysql for speed plugin what to adjust so that this doesn’t happen?
November 26, 2024 at 10:49 am #615915
Artem TemosKeymasterHello,
This field should contain an array with the information required for our theme. As an empty array it should look like this
[]
. But it was modified by the plugin an it added an empty string to that array[""]
. And that is why you get the error on your website. The plugin shouldn’t change this field by adding extra elements to the array.Kind Regards
November 30, 2024 at 12:35 pm #617961
agenciawebinfiniteParticipantHello!
How do you know it was this plugin?
Because I disabled all the keys it optimizes, cleared cache and everything, and the error continues the same way.
As per your instructions, I edited that field and deleted the double quotes, leaving only [] and it was ok.
But it doesn’t seem like this plugin’s fault.
Could you explain to me where you identified that it was this plugin?
So I can check with the developer.
Thank you.
December 2, 2024 at 11:40 am #618337
Artem TemosKeymasterHello,
We can’t say exactly, but it was assumed that this plugin somehow optimized the database and changed this field. You can disable this plugin and check it for some time to see if the issue reappears.
Kind Regards
December 2, 2024 at 11:43 am #618340
agenciawebinfiniteParticipantHello!
I don’t agree with your statement, without any proof hehe.
But it’s okay, I accessed product by product, removed the double quotes, saved and it was ok.
I reviewed them all, and 90% of the products were ok, I only edited and saved the 10%.
I will monitor if the new products are ok.
Thank you.
December 2, 2024 at 11:50 am #618347
Artem TemosKeymasterHello,
OK, please let us know if the issue appears again while the plugin is turned off so we can check further.
Kind Regards
December 13, 2024 at 5:42 pm #622292
agenciawebinfiniteParticipantHello!
Just to update, for new products I edit the field and adjust it from [“”] to [] and the product is ok.
But every new product returns this way.
I’ll talk to Index MySQL For Speed support to see if they can help.
December 14, 2024 at 1:26 pm #622408
agenciawebinfiniteParticipantHello!
Can you check the response from the Index MySQL for Speed developer?
December 16, 2024 at 12:43 pm #622771
Artem TemosKeymasterHello,
OK, we will just add an extra condition in the code to fix the error. We have added this code on your website so please test how it works now.
Kind Regards
December 16, 2024 at 4:23 pm #622895
agenciawebinfiniteParticipantHello!
Could you please tell me if the code was a snippet or directly in the theme code?
So that I am aware.
I will let the client know to test new registrations to see if they will be normalized.
Thank you.
December 16, 2024 at 4:29 pm #622897
Artem TemosKeymasterHello,
We added an extra condition in the file
inc/integrations/woocommerce/modules/frequently-bought-together/class-frontend.php
on the line #157.Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register