Site logo

Archived topic

GP Elements displayed on the Woocommerce confirmation page

3 replies · Started by Zuzana on July 20, 2020

Viewing posts 1–4 of 4

Hello,

I am trying to add the Facebook pixel code on the website using the GP elements. The problem is, however, that I need to add this code only to the Confirmation page, which the Woocommerce is automatically generating after the successful purchase of the product. Since this is Woocommerce generated page, it does not appear in the WP dashboard list of pages and therefore I am not able to select it in the GP elements Display settings. Is there a way how to apply a GP element to the Woocommerce confirmation page, please? The endpoint checkout URL of the page seems to be: objednavka-prijata

Thank you in advance for your help.
Zuzana

Hi there,

try wrapping this PHP Conditional around the FB Pixel in your Hook element

<?php if( is_wc_endpoint_url( 'order-received' ) ) {?>

 // Add FB Pixel code to order received page 

<?php } ?>

Thank you very much David, it worked! :)

Glad to be of help.

This archived topic is closed to new replies.