• Resolved michelle

    (@speedlife)


    Please tell me the variable to get the total amount purchased in the script placed in the Thanks page (thakyou.php) of WOOCOMMERCE with only numbers (no comma or units).

    • This topic was modified 1 year, 2 months ago by michelle.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @speedlife

    Can you tell us more about what would you like to achieve?

    Thank you!

    Thread Starter michelle

    (@speedlife)

    Thank You Darla

    Script to insert in thankyou.php
    For measurement of conversion of INSTAGRAM linked apps

    <script type="text/javascript" src="/tracking.js"></script
    <script type="text/javascript">
    (function() {
        var params = { userid: "data-userid", totalprice: "product total_variable"←←←←←←←←Here };
        Tracking.Conversion(params);
    })();
    </script>

    purchased at that time in WOOCOMMERCE with no comma and no units.
    I want to include a variable for the purchase amount.

    Thank You

    Thread Starter michelle

    (@speedlife)

    Thank You Darla @aguinaldodarla

    Script to insert in thankyou.php
    For measurement of conversion of INSTAGRAM linked apps

    <script type="text/javascript" src="/tracking.js"></script
    <script type="text/javascript">
    (function() {
        var params = { userid: "data-userid", totalprice: "product total_variable"←←←←←←←←Here };
        Tracking.Conversion(params);
    })();
    </script>

    purchased at that time in WOOCOMMERCE with no comma and no units.
    I want to include a variable for the purchase amount.

    Thank You

    Plugin Support nicw.a11n

    (@nicw)

    Hi @speedlife

    Variables can be added to WordPress pages by various means, but the data you’re looking for is not immediately available in the thankyou.php page without some custom coding.

    Specifically, the woocommerce_thankyou action provides a means of adding the information you are looking for to the page as a JavaScript variable, so that it can be picked up by your script.

    An rough example is shown in the documentation here.

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thread Starter michelle

    (@speedlife)

    Thank You

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘total amount purchased’ is closed to new replies.