WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Pass Order Variable Post Submit

[Resolved] Pass Order Variable Post Submit

  • I’m attempting to make a page that comes up instead of order details, featuring a specific plugin I’ve created that puts information up based on the order.

    My issue is as follows:

    Based on everything I’ve seen, the cart is emptied after payment processing, however I’d like to hook into the Order (as order details itself does), and use the array from get_items, to get the product ID purchased, and suggest another product ID based on that.

    My issue is that when using it in a plugin, outside of woocommerce itself, I seem to be completely unable to access the order.

    So basically: does anyone know how to access the Order information outside of the Woocommerce loop?

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 2 replies - 1 through 2 (of 2 total)
  • global $post;
        $order = new WC_Order( $post->ID );

    Although i am using WooCommerce Beta 🙂

    Awesome Samuel, super simple but for some reason I just couldn’t figure it out.

    That worked like a charm (if this were Stackoverflow I’d give you a huge upvote).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Pass Order Variable Post Submit’ is closed to new replies.