WPIntell

Source evidence

Compare popup css not loading when changing languages

YITH WooCommerce Compare · support · 2025-08-26T13:44:00+00:00

complaintsentiment
mediumseverity
0.68relevance
5replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

4 / 14 rows with source links

28.6% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

10 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
eclipsedigital resolved
Hello there, I have a strange issue with Yith WooCommerce Compare v 3.2.0 (same with 3.3.0). The CSS file compare.css is not loading when I change the site language. Works in French (default) but not in other languages (WPML). I have deactivated css minifying/js minifying (WP Rocket). Still the issue. I try that snippet to force CSS compare.css to load and that works again : add_action( ‘wp_enqueue_scripts’, function() { wp_enqueue_style( ‘yith-woocompare-force’, YITH_WOOCOMPARE_ASSETS_URL . ‘/css/compare.css’, array(), YITH_WOOCOMPARE_VERSION ); }); But this not a good solution… Did somenone met that issue ? Any idea ? Thanks for your help. Hello there, thanks for contacting us! This is the first time we have had this report. I recommend running the following tests to see if the problem disappears at some point: Update the plugin, WC, and WP to the latest version. Switch to a default WP theme like 2025. Leave only WC and our plugin active, and activate your plugins in batches until you find the one that conflicts. Could you check it, please? Best regards. Hello Juan, I guess i have found something. For example, with german language. The compare.css file is identified here in page source code : <link rel='stylesheet' id='yith_woocompare_page-css' href='https://preprod.xxx.com/de/wp-content/plugins/yith-woocommerce-compare/assets/css/compare.css?ver=3.4.0' type='text/css' media='all' /> —-> 404 As you can see, there is a /de/ in url. In class-yith-woocompare-frontend.php, the stylesheet_url() method uses : $asset_url = home_url( $asset_path ); which return URL of home page with active language. If I use : $asset_url = site_url( $asset_path ); compare.css is loading fine (no language in url –> no 404) Hope it could help. Let me know. Thanks Hello there, Please replace this line: $asset_url = home_url( $asset_path ); with this new one: $asset_url = apply_filters( 'yith_woocompare_asset_url', home_url( $asset_path ), $asset_path ); then, add the following code in the functions.php file of your active theme: if ( ! function_exists( 'yith_woocompare_asset_url_custom' ) ) { function yith_woocompare_asset_url_custom( $url, $asset_path ) { return site_url( $asset_path ); } add_filter( 'yith_woocompare_asset_url', 'yith_woocompare_asset_url_custom', 99, 2 ); } If it works correctly for you, we will add it to the next version of the plugin. Could you check it, please? Best regards. Hello Juan Works for us. Thanks. Best regards Hello there, Could you confirm me correction has been included into the 3.7.0 version of module so I could remove snippet inside functions.php ? Best regards

Comments

5 shown
Juan Coronel 2025-08-27T12:27:00+00:00

Hello there, thanks for contacting us! This is the first time we have had this report. I recommend running the following tests to see if the problem disappears at some point: Update the plugin, WC, and WP to the latest version. Switch to a default WP theme like 2025. Leave only WC and our plugin active, and activate your plugins in batches until you find the one that conflicts. Could you check it, please? Best regards.

eclipsedigital 2025-09-10T12:34:00+00:00

Hello Juan, I guess i have found something. For example, with german language. The compare.css file is identified here in page source code : <link rel='stylesheet' id='yith_woocompare_page-css' href='https://preprod.xxx.com/de/wp-content/plugins/yith-woocommerce-compare/assets/css/compare.css?ver=3.4.0' type='text/css' media='all' /> —-> 404 As you can see, there is a /de/ in url. In class-yith-woocompare-frontend.php, the stylesheet_url() method uses : $asset_url = home_url( $asset_path ); which return URL of home page with active language. If I use : $asset_url = site_url( $asset_path ); compare.css is loading fine (no language in url –> no 404) Hope it could help. Let me know. Thanks

Juan Coronel 2025-09-12T13:23:00+00:00

Hello there, Please replace this line: $asset_url = home_url( $asset_path ); with this new one: $asset_url = apply_filters( 'yith_woocompare_asset_url', home_url( $asset_path ), $asset_path ); then, add the following code in the functions.php file of your active theme: if ( ! function_exists( 'yith_woocompare_asset_url_custom' ) ) { function yith_woocompare_asset_url_custom( $url, $asset_path ) { return site_url( $asset_path ); } add_filter( 'yith_woocompare_asset_url', 'yith_woocompare_asset_url_custom', 99, 2 ); } If it works correctly for you, we will add it to the next version of the plugin. Could you check it, please? Best regards.

eclipsedigital 2025-09-15T09:38:00+00:00

Hello Juan Works for us. Thanks. Best regards

eclipsedigital 2026-01-15T10:33:00+00:00

Hello there, Could you confirm me correction has been included into the 3.7.0 version of module so I could remove snippet inside functions.php ? Best regards