[Resolved] Insert JavaScript with Hooks – Cart Recovery

Home Forums Support Insert JavaScript with Hooks – Cart Recovery

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1299125
    David

    Hello GP Team!

    I’m trying to insert a JS Code for a Tidio Cart Recovery with a Hooks element.

    The official instructions (link here) are:

    “The chat needs to know where is the cart on your site and where starts the checkout area. In order to point out to the app where the visitor proceeds from the cart, you’ll need to use this code and specify the cart page as the ‘start’ point, and the checkout page as the ‘end’ point. The code needs to be added after the chat’s installation script.”

    I see the option “Customized hook”. Do yo have any guide to work with this?

    Thank you 🙂

    #1299486
    Leo
    Staff
    Customer Support

    Hi there,

    That instruction isn’t very clear unfortunately.

    The theme itself doesn’t deal with cart or checkout page functionality as that’s all handled by WooCommerce.

    Can you ask the code author how to add it if you are using a twenty series WP theme?

    The method should be exactly the same when using GP.

    Let me know 🙂

    #1300408
    David

    Hi Leo!

    Thanks for you reply.

    Here the answer from Tidio:

    ***
    On WordPress, the Tidio installation code ought to be placed in the Theme Footer file, it’s usually called footer.php — and the script needs to be at the end, directly above the closing </body> tag. If you have a child theme and parent/main theme separately, make sure to place the script in the parent/main theme.
    ***

    I think we can do this with hooks…yes? 🙂

    #1300451
    David
    Staff
    Customer Support

    Hi there,

    you can use the WP_footer hook and set the Priority to 999

    #1312562
    David

    It works David. Thank you 🙂

    #1313120
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.