Plugin Support
qtwrk
(@qtwrk)
add_action( 'litespeed_init', function() {
if ( isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], 'xxx') !== false ) {
do_action( 'litespeed_conf_force', 'esi', 0 );
}
else {
do_action( 'litespeed_conf_force', 'esi', 1 );
}
} );
not sure if this works or not , but doesn’t hurt to try , please update the xxx to the URL that matches your target page
Plugin Support
qtwrk
(@qtwrk)
partial match also works , for simplicity sake, you can just put order-received
just order-received? In your previous message, you said to change xxx to the URL that matches the target page. Does it need to be a full URL or just the endpoint order-received ?
Plugin Support
qtwrk
(@qtwrk)
partial match also works , by that saying, order-received is enough , no other page would use this URL
-
This reply was modified 1 month, 1 week ago by
qtwrk.
Got it, thank you, I’ll give it a try!
I’m not sure that the snippet works as the orders coming in still indicate that the facebook pixel on the purchase summary page wasn’t fired. Is there a way to check if ESI is disabled on the purchase summary page so I can at least see if the snippet works or doesn’t work?
I think the following snippet is working. Pixel helper extension is showing both pageview and purchase, and I get the green check mark in the orders list after visiting those order summary pages, so I think it’s fixed!
add_action('wp', function() {
if (is_wc_endpoint_url('order-received')) {
// Disable all caching for this page
do_action('litespeed_control_set_nocache', 'woocommerce order received');
// Disable ESI processing specifically
add_filter('litespeed_esi_status', '__return_false');
}
}, 1);