Problem with custom code after updating pro

I’m using the pro-child theme, and I have some customs codes in functions.php file.

after I updated pro to the last version my website and WordPress backend is broken like the attached photo.

I have tested all the custom codes until I found the one who caused this problem:

(add_filter( ‘gettext’, ‘wc_billing_field_strings’, 20, 3 );

add_filter( ‘woocommerce_get_order_item_totals’, ‘remove_subtotal_from_orders_total_lines’, 100, 1 );
function remove_subtotal_from_orders_total_lines( $totals ) {
unset($totals[‘cart_subtotal’] );
return $totals;
})

which used to remove subtotal from all checkout pages and emails.

any suggestion, please?

Hi Ahmed,

Thank you for reaching out to us. I tested the code in my local setup with the latest version of Pro and the current supported version of WooCommerce (see https://theme.co/docs/version-compatibility) and it didn’t break my dashboard.:

add_filter( 'woocommerce_get_order_item_totals', 'remove_subtotal_from_orders_total_lines', 100, 1 );
function remove_subtotal_from_orders_total_lines( $totals ) {
    unset($totals['cart_subtotal']  );
    return $totals;
}

Can you please check for the following first:

  1. Ensure everything is up to date according to our version compatibility list at https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195. Please follow the best practices when updating your theme and plugins. See https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62 for more details.

  2. If you’re using a caching plugin, clear all caches including browser cache then deactivate your caching plugin and other optimization plugins. If you’re using a CDN, please clear the CDN’s cache and disable optimization services.

  3. Test for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time.

Let us know how this goes!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.