I have this code to set WooCommerce variables
// Defining User set variables
$this->title = $this->get_option( 'title' );
$this->description = $this->get_option( 'description' );
$this->instructions = $this->get_option( 'instructions' );
but how to get $this->instructions
in thankyou.php
WooCommerce template?
I already tried using $order->instructions
but then an errors appear
Notice: instructions was called incorrectly. Order properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), include('/themes/startup-company/page.php'), the_content, apply_filters('the_content'), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, WC_Shortcodes::checkout, WC_Shortcodes::shortcode_wrapper, WC_Shortcode_Checkout::output, WC_Shortcode_Checkout::order_received, wc_get_template, include('/plugins/woocommerce/templates/checkout/thankyou.php'), WC_Abstract_Legacy_Order->__get, wc_doing_it_wrong Please see Debugging in WordPress for more information. (This message was added in version 3.0.)
So I tried to see what inside $order
, and then I see a long vars that doesn't have the text that I set for $this->instructions
in WooCommerce Payment Gateway Plugin that I built myself.