• Resolved ArtistScope

    (@artistscope)


    I need to provide some code for our client to add to his success page that will send some data to our server to create a DRM token. I have installed WooCommerce for WordPress and it looks like line #65 on /templates/order/order-details.php may be useful.

    What I need is the data pertinent to the transaction:

    • invoice id
    • item id
    • item name
    • item description

    Can I use $order, $item_id, $item, $product in our code that we add to send those details? If not what do you recommend?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ArtistScope

    (@artistscope)

    What I need is a list of the variables that can be retrieved from the thanks/receipt page. For example:

    $invoiceid = WP invoice number
    $itemid = product id
    $itemname = Title of the product
    etc

    • This reply was modified 1 year, 3 months ago by ArtistScope.
    Saif

    (@babylon1999)

    Hello @artistscope,

    Thank you for reaching out!

    I need to provide some code for our client to add to his success page that will send some data to our server to create a DRM token. I have installed WooCommerce for WordPress and it looks like line #65 on /templates/order/order-details.php may be useful.

    Just to make sure we’re on the same page, you’re trying to send the order data to your server when someone lands on the “order-received” page, correct?

    It might be easier to achieve this with the built-in WooCommerce order.received webhook.

    It will send all the order data to a delivery URL of your choice in JSON. For more context, please check https://woocommerce.com/document/webhooks/.


    You can use webhook.site to easily test the payload before configuring your own server.

    Let us know if you have any other questions.

    Thread Starter ArtistScope

    (@artistscope)

    Thanks for your reply. Woo support team sent me a link that has been most useful… https://wpdavies.dev/how-to-get-all-product-info-in-woocommerce/

    Hi @artistscope

    That’s good to know! Please don’t hesitate to start a new topic if you have any more questions down the line.

    Have a fantastic day!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding code to success page’ is closed to new replies.