Home New Guten Forums WoodMart support forum wc_get_related_products error

wc_get_related_products error

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #668585

    Kejserjorn
    Participant

    Hello,

    I get a lot of these errors in my Woocommerce log.

    Only place I remember setting the related product count to 8 is in the theme settings under single product.

    2025-06-20T00:01:51+00:00 ERROR Invalid limit type passed to wc_get_related_products. Expected integer, got string with value: “8”

    #668668

    Hello,

    Please make a full backup of your site and check how it works with the default WordPress theme like Twenty-Twenty-Five, to understand if it is our theme’s issue or not.

    Best Regards,

    #668670

    Kejserjorn
    Participant

    I just tested on a staging site. The error occurs only with your theme active. With Twenty Twenty-Five the error doesn’t happen any more.

    It seems to happen every time a product page, that has related products, is loaded in the front end.

    • This reply was modified 1 month, 4 weeks ago by Kejserjorn.
    #668693

    Hello,

    Sorry to hear about the inconvenience. Kindly, please share your Site WP-ADMIN Login details in the Private Content field so that we can check this concern on your Site and help you out accordingly.

    Best Regards,

    #668696

    Kejserjorn
    Participant

    Thank You. I have shared the login details in the Private Content area.

    Here is how to trigger and observe the issue:

    1. Visit a product in the frontend

    2. Go to Woocommerce –> Status –> Logs –> wc_get_related_products

    Here You will see that the error triggers every time a product is visited in the frontend

    #668795

    Hello,

    I have checked your site with the default theme, and it is the same.
    See video for clarification: https://uploadnow.io/files/hkN7B6Z

    Best Regards,

    #668810

    Kejserjorn
    Participant

    I cant see the video. I requires me to log in

    #668812

    Kejserjorn
    Participant

    But when I test it there are no NEW entries with timestamp in the log file called “wc_get_related_products” when visiting a product page with default theme.

    New lines are only created in the log file when using Woodmart theme and visiting a product.

    Please check again with both default and Woodmart theme and reload both the log and the product page and look for NEW lines with timestamp in the log file called “wc_get_related_products”.

    Everytime I reload a product page or visit a new one with Woodmart active, there is a new entry in the log file “wc_get_related_products”

    There seems to be only one daily log file called “wc_get_related_products”. Look for new lines in that

    #668830

    Hello,

    Please share some screenshots of the issues you’re encountering. This will help me analyze the problem and provide you with the best possible solution.

    Best Regards,

    #668839

    Kejserjorn
    Participant

    Please open 2 tabs in your browser. 1 tab with the admin panel and one tab with the website frontend:

    tabs in browser

    In the admin panel please open Woocommerce —> Status:

    Woocommerce status

    In the Status page please click the Logs tab and locate the log file called “wc_get_related_products”:

    Status Logs

    Open the log file called “wc_get_related_products” and You will see many identical error entries with a timestamp and this text:

    Invalid limit type passed to wc_get_related_products. Expected integer, got string with value: "8"

    Errors

    Note the time stamp on the latest entry all the way in the bottom of the file, and keep this tab open.

    Now go to the other browser tab with the webshop frontend. Browse to any product.

    Go back to the admin browser tab with the log open and refresh the page, Now you will see a new entry in the error file with exact timestamp as when you opened the product page in the frontend:

    Error 2

    You can browse to other products or just reload the frontend with a product open. Every time a new entry will be added to the log file.

    Now change the theme to default Twenty Twenty-Five and do everything again as described above.

    This time You will see that no new entries are added to the log file when browsing products in the frontend.

    This error is only recorded with Woodmart active

    • This reply was modified 1 month, 3 weeks ago by Kejserjorn.
    #668843

    Kejserjorn
    Participant

    I can’t get images to work here in the forum…. Tried both from Imgur and from Google Drive

    • This reply was modified 1 month, 3 weeks ago by Kejserjorn.
    • This reply was modified 1 month, 3 weeks ago by Kejserjorn.
    #668846

    Kejserjorn
    Participant

    Updated with attached images

    Please open 2 tabs in your browser. 1 tab with the admin panel and one tab with the website frontend:

    In the admin panel please open Woocommerce —> Status:

    See attached image 1

    In the Status page please click the Logs tab and locate the log file called “wc_get_related_products”:

    See attached image 2

    Open the log file called “wc_get_related_products” and You will see many identical error entries with a timestamp and this text:

    Invalid limit type passed to wc_get_related_products. Expected integer, got string with value: "8"

    See attached image 3

    Note the time stamp on the latest entry all the way in the bottom of the file, and keep this tab open.

    Now go to the other browser tab with the webshop frontend. Browse to any product.

    Go back to the admin browser tab with the log open and refresh the page, Now you will see a new entry in the error file with exact timestamp as when you opened the product page in the frontend:

    See attached image 4

    You can browse to other products or just reload the frontend with a product open. Every time a new entry will be added to the log file.

    Now change the theme to default Twenty Twenty-Five and do everything again as described above.

    This time You will see that no new entries are added to the log file when browsing products in the frontend.

    This error is only recorded with Woodmart active

    • This reply was modified 1 month, 3 weeks ago by Kejserjorn.
    Attachments:
    You must be logged in to view attached files.
    #668964

    Kejserjorn
    Participant

    I did some more testing, and I found that the settings in Theme settings —-> Single product —-> Related & Upsells are responsible for this error message in the logs.

    If Show related products is turned off the error stops. When turned on the error is back.

    The number in Product count is the string value in the error message in the logs.

    Invalid limit type passed to wc_get_related_products. Expected integer, got string with value: "8"

    If the number is changed, the string value also changes in the error message.

    There is no doubt that the Product count number is the issue. It is somehow sent as a string and not as an integer as it should be.

    Please fix

    Attachments:
    You must be logged in to view attached files.
    #669109

    Hello,

    This is an issue in our theme, and we will fix it in our next update.

    Thanks for your patience.

    Best Regards,

Viewing 14 posts - 1 through 14 (of 14 total)