Home Forums WoodMart support forum Compare feature returns with an error.

Compare feature returns with an error.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #400079

    gadget
    Participant

    I turned off the compare feature, but we received the error below in the error logs.

    [2022-08-28T20:07:42.910266+00:00] PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in /domain/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/compare.php:418
    [2022-08-28T20:07:42.910291+00:00] Stack trace:
    [2022-08-28T20:07:42.910295+00:00] #0 /domain/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/compare.php(351): woodmart_get_compare_fields()
    [2022-08-28T20:07:42.910300+00:00] #1 /domain/wp-content/themes/woodmart/inc/integrations/woocommerce/modules/compare.php(23): woodmart_get_compared_products_table()
    [2022-08-28T20:07:42.910303+00:00] #2 /domain/wp-includes/shortcodes.php(356): woodmart_compare_shortcode(”, ”, ‘woodmart_compar…’)
    [2022-08-28T20:07:42.910306+00:00] #3 [internal function]: do_shortcode_tag(Array)

    thanks

    #400151

    Luke Nielsen
    Keymaster

    Hello,

    Thank you for reaching out to us!

    Please navigate to inc/integrations/woocommerce/modules/compare.php file and on the 418th string replace this old if ( class_exists( 'XTS\Options' ) && count( $fields_settings ) > 1 ) { condition to that if ( class_exists( 'XTS\Options' ) && $fields_settings && count( $fields_settings ) > 1 ) {.

    https://prnt.sc/04TMwX3GCZv1

    Kind Regards

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