Support » Plugin: YITH WooCommerce Compare » Custom shortcodes in comparison table

  • deonsa

    (@deonsa)


    I have the newest WordPress and YITH WooCommerce Compare installed.

    I have enabled shortcodes in short descriptions for woocommerce products and I am using the Collapse-O-Matic plugin for accordions. They work on the product pages but not on the comparison table.

    I would like to add more information on the comparison pages, but I need to hide it by default using accordions. Would it be possible to enable custom shortcodes for the short descriptions on the comparison tables?

    Thank you

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    and thank you for writing in!

    Please try adding the following code snippet to your theme functions.php

    if ( !function_exists( 'yith_compare_collapse_o_matic_fix' ) ) {
        add_action( 'yith_woocompare_popup_head', 'yith_compare_collapse_o_matic_fix' );
    
        function yith_compare_collapse_o_matic_fix() {
            global $WP_Collapse_O_Matic;
            if ( $WP_Collapse_O_Matic && is_callable( array( $WP_Collapse_O_Matic, 'colomat_js_vars' ) ) ) {
                wp_print_styles( 'collapseomatic-css' );
                $WP_Collapse_O_Matic->colomat_js_vars();
            }
        }
    }

    and let us know if this will do the trick! 😉

    • This reply was modified 6 months, 2 weeks ago by YITHEMES.

    Hi,

    Thanks for the reply. I’ve copied the code to my functions.php file. However, the collapsible headings now appear as links, but they are not clickable. Also, they are collapsed by default.

    Also, at the bottom of the compare table “Undefined” is printed three times.

    If you’d like to have a look, you can go to and just add a couple of products to the compare table.

    Thanks a lot.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom shortcodes in comparison table’ is closed to new replies.