Enter script code inside and just after BODY tag

This topic has 5 replies, 3 voices, and was last updated 2 weeks, 6 days ago ago by Andrew Mitchell

  • Avatar: Bas_Kling
    Bas Kling
    Participant
    November 2, 2024 at 23:51

    Hi,

    in order to add a klarna-placement shortcode to the woocommerce cart page and have it actually visually appear, Klarna documentation states that I need to add a script to our website, just after the opening BODY tag. How do I best do this? Where can I find the option to add code?

    Please, contact administrator
    for this information.
    4 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    November 3, 2024 at 15:23

    Hi @Bas Kling,

    Please try adding the following code under functions.php file locates in your child theme:

    
    add_action('wp_body_open', 'n2t_wp_body_open');
    function n2t_wp_body_open(){
    ?>
    <script
          async
          data-environment="production"
          src="https://js.klarna.com/web-sdk/v1/klarna.js"
          data-client-id=""
        ></script>
    <?php
    }
    

    Hope it helps!

    Avatar: Bas_Kling
    Bas Kling
    Participant
    November 3, 2024 at 17:48

    URGENT: read info in private

    Please contact administrator
    for this information.
    Avatar: Justin
    Luca Rossi
    Support staff
    November 4, 2024 at 04:20

    Hi @Bas Kling,

    We’ve removed the key per your request!

    Best Regards,
    The 8Theme Team.

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    November 4, 2024 at 13:06

    Dear Bas Kling,

    We trust our theme is enhancing your experience. Taking a brief moment to rate it with a glowing 5 stars on ThemeForest would be immensely appreciated. Your feedback holds significant value for us.

    Click here to rate now: https://themeforest.net/downloads

    Thank you sincerely for your ongoing support!

    Best Regards,
    The 8Theme Team

  • Viewing 5 results - 1 through 5 (of 5 total)

The issue related to '‘Enter script code inside and just after BODY tag’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.