Custom WooCommerce notices not shown on Safari with quic.cloud CDN
-
Hello,
I added a simple custom code to Basel theme to show a notification to the user when his review is pending for approval, but using Safari on desktop or Safari/Chrome on mobile the notification is not shown.
If I try to leave a review with the Safari web inspector opened the notification is shown, so it seems to me that the problem is cache-related.
The production site is under quic.cloud CDN so I have tried to add reviews on the staging site, without the CDN, and the notifications appear in all conditions.
I also tried to add the parameters “unapproved” and “moderation-hash” (from WooCommerce) to the “Do Not Cache Query Strings” option in Cache > Excludes with no luck.
Could someone help with this kind of problem?
The report num from the LS cache plugin is WKTIPMYW, and the following is the code for the notification:
\add_action( 'comment_post', __NAMESPACE__ . '\add_unapproved_notice', 10, 1 ); function add_unapproved_notice( $comment_id ) : void { $comment = \get_comment( $comment_id ); if ( $comment && !(bool)$comment->comment_approved ) { \wc_add_notice( \esc_html__( 'unapproved text', 'textdomain' ), 'success' ); } }
Thanks ??
- The topic ‘Custom WooCommerce notices not shown on Safari with quic.cloud CDN’ is closed to new replies.