Ask the community

This is a community support forum where you can ask
questions and interact with other PremiumPress Customers.

Errors in product page

  • steven
    steven
    Newbie 41 points
    July 8, 2019 at 6:07 am

    Getting these errors in my product pages disabled as many plugins as possible but still have the problem, any ideas?

    Warning: Illegal string offset ‘tab’ in /homepages/4/d640547588/htdocs/submersiblepumpsupplier/wp-content/themes/ST-2/framework/class/class_shortcodes.php on line 1928

    Warning: Illegal string offset ‘tab’ in /homepages/4/d640547588/htdocs/submersiblepumpsupplier/wp-content/themes/ST-2/framework/class/class_shortcodes.php on line 1950

  • JamesD
    JamesD
    Super Guru 1,345 points
    July 8, 2019 at 9:24 pm

    Hello steven,
    Is the theme being used the default ST9 theme and renamed to ST-2 or a child theme?
    If renamed then that could potentially be the problem.

    There are hard-coded theme directory references riddled throughout the files which will prevent it from working properly when the directory is different. Using a child theme should fix it.


  • steven
    Newbie 4 points
    July 8, 2019 at 9:43 pm

    Its been working fine but all of a sudden after an update a month or so ago it has has this problem.

    The reason the file is ST-2 is because there were two theme file on my mac, the original file was ST

    I just tried uploading the ST version and its still has errors. I uploaded the new Shop theme and the website has errors.

    I uploaded a fresh copy of wrdpress and the website still has errors I’m at a loss.

  • JamesD
    JamesD
    Super Guru 1,345 points
    July 9, 2019 at 1:04 am

    @steven
    ST hasn’t been used since v8 I believe.
    Sorry, I just noticed by the path that you’re using an older version, which is handled differently than v9 (which I was referencing).

    Which versions of the theme and PHP are you using?

    Note: PHP 7+ can cause those errors if theme is v8.9.6 or below. This would be my first guess as to the issue you’re experiencing. Version 8 had a handful of themes that had updates to v8.9.7, which corrected this problem.

  • JamesD
    JamesD
    Super Guru 1,345 points
    July 9, 2019 at 1:25 am

    @steven

    You’ll need to edit a core file, but it’s an older version with out any more updates so you should be fine. Just be sure to make a backup copy of any files that will be changed first.

    Open the /ST-2/framework/class/class_shortcodes.php file and add the following snippet right before line #1928 (the first warning) and it should take care of the offset ‘tab’ warnings:

    if(!isset($atts) || !is_array($atts)) { $atts = [ 'tab'=>true ]; }

    Note: This is just one fix for those specific errors. There may be other messages lurking elsewhere that will need to be corrected as well.


  • steven
    Newbie 4 points
    July 10, 2019 at 8:07 am

    Thanks James, i put the code in and there’s still errors see screen shot.

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    Super Guru 1,345 points
    July 10, 2019 at 8:43 am

    @steven
    Those are the other potential errors mentioned.

    Are those all of the remaining warnings you’re seeing?


  • steven
    Newbie 4 points
    July 10, 2019 at 9:08 am

    They are the errors after installing the code you provided

  • JamesD
    JamesD
    Super Guru 1,345 points
    July 11, 2019 at 12:18 am

    @steven
    Adding the following snippet right before line #1796 (same file as before) should resolve those warnings:

    if(!isset($atts) || !is_array($atts)) { $atts = [ 'class'=>'' ]; }

    Note: Those warnings existed prior to the code (similar problem as first fix), you just didn’t see them.


  • steven
    Newbie 4 points
    July 11, 2019 at 7:33 am

    Thanks James that worked a treat. Do you know why the them broke in the first place?

    As I’m not a coder, I normally re-install WordPress or overwrite the theme 99.9 percent of the time i fix things but not on this occasion.

    I originally tried uploading the new Shoptheme but it had the same problems.

    Is it the reason some of the products are missing images because the theme broke? See photo attached.

    Also, is there a way of the theme not to import duplicate products or is that in the new theme?

    Thanks James for your help i really appreciate it.

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    Super Guru 1,345 points
    July 11, 2019 at 8:48 pm

    @steven
    You’re welcome.

    The main issue is as stated before. I suppose there could be a number of other things that could complicate it as well, but that would be based on thee overall setup, so it’s hard to say what else could be going on or happened without digging through the code/setup.

    <bloickquote>Is it the reason some of the products are missing images because the theme broke?
    Sorry, I have no idea. There could be a number of possible reasons..

    Also, is there a way of the theme not to import duplicate products or is that in the new theme?

    Not that I’m aware of.

    Note: There will always be potential for new errors/warnings to arise when using older themes since they are no longer updated to work with current changes in tech like PHP and WP.

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