• Hi again,

    All is ok on my website back-office, except the Ocean Panel Library, landing to a WordPress error page :

    Une erreur critique est survenue sur ce site. Veuillez consulter la boite de réception de l’e-mail d’administration de votre site pour plus d’informations.
    En apprendre plus sur le débogage de WordPress.

    see image

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @gerardval,

    First, please make sure to use the latest versions of WordPress, plugins, and theme.
    Then please ensure the PHP version of your website is 7.2 at least.

    Next, for troubleshooting, please do the following steps and let me know the results:

    1- Head over to WP Dashboard > Plugin.
    2- Deactivate all plugins.
    3- Then, first activate the Ocean Extra plugin.
    4- Check your issue.
    5- Then, activate your plugins one by one
    6- After activation of any plugins, check your issue

    Note: if you have any cache plugin or server cache(CDN / Browser Cache and Cookies and …), you need to clear its cache contents or disable them to see your changes.

    _________

    If you cannot access wp-admin, there are other ways to deactivate plugins: https://www.ads-software.com/support/article/faq-troubleshooting/.

    Summary: you can using FTP and rename the current theme from root of the website / wp-content / theme / {{current theme name}} and deactivating any plugins with rename plugin folder(e.g, add -t) from root of the website / wp-content / plugins {{Plugin Name}}

    To see the error on WordPress, you can check the super administrator email(as the error says: https://i.postimg.cc/hvrHrg5C/image.png); Or turn on the WordPress debugger mode. To enable it, please follow the steps explained in this link: https://www.ads-software.com/support/article/debugging-in-wordpress/.

    Then please share the error message here as a code. We’ll find out what happened on your website with that error message.

    After fixing the error, please tell us a little about the versions of plugins you use. To do this, please go to WP Dashboard > Tools > Site Health > Info Tab and click on the button Copy site info to clipboard. You can send the information as code here or upload them to https://pastebin.com/ and get an exclusive link.

    Note 1: you can ask your host provider to return the backup.

    I hope that helps.

    Please keep us informed.

    Thank you,
    Best Regards

    Thread Starter gerardval

    (@gerardval)

    I put the WP_debug to true and this is the error :

    Uncaught Error: Call to a member function get_attribute() on bool in /home/leslibw/www/sitetest/wp-content/themes/oceanwp-child-theme-master/functions.php:166 Stack trace: 
    #0 /home/leslibw/www/sitetest/wp-includes/class-wp-hook.php(307): remove_addcart(Object(WP)) 
    #1 /home/leslibw/www/sitetest/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(false, Array) 
    #2 /home/leslibw/www/sitetest/wp-includes/plugin.php(524): WP_Hook->do_action(Array) 
    #3 /home/leslibw/www/sitetest/wp-includes/class-wp.php(787): do_action_ref_array('wp', Array) 
    #4 /home/leslibw/www/sitetest/wp-includes/functions.php(1330): WP->main(Array) 
    #5 /home/leslibw/www/sitetest/wp-admin/includes/post.php(1239): wp(Array) 
    #6 /home/leslibw/www/sitetest/wp-admin/includes/class-wp-posts-list-table.php(166): wp_edit_posts_query() 
    #7 /home/leslibw/www/sitetest/wp-admin/edit.php(225): WP_Posts_List_Table->prepare_items() 
    #8 {main} thrown in /home/leslibw/www/sitetest/wp-content/themes/oceanwp-child-theme-master/functions.php on line 166

    The line 166 is :
    $dispo = $product->get_attribute( 'pa_disponibilite' );

    I removed the entire function (which is working fine except on archive page):

    function remove_addcart() {
       $product = get_product();
    	$dispo = $product->get_attribute( 'pa_disponibilite' );
       if (($dispo > 1) && (($product->stock) == 0)) {
           remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
           remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
           remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );
           remove_action( 'woocommerce_grouped_add_to_cart', 'woocommerce_grouped_add_to_cart', 30 );
           remove_action( 'woocommerce_variable_add_to_cart', 'woocommerce_variable_add_to_cart', 30 );
           remove_action( 'woocommerce_external_add_to_cart', 'woocommerce_external_add_to_cart', 30 );
       }
    }
    add_action( 'wp', 'remove_addcart' );

    and the “panel library” is ok.

    Where was my error ? Why this ~#[|`[{ line 166 damaged the library ?

    Thanks for helping

    Hello @gerardval,

    The method for getting the custom attribute is not correct, and the action is not working with WooCommerce on your code. Please use something like this one: https://i.postimg.cc/t4kHZmqL/image.png.

    Please check this topic: https://stackoverflow.com/questions/63527081/display-woocommerce-product-attribute-on-archive-page.

    Best Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘White screen on Ocean Panel Library’ is closed to new replies.