action_args | Controller action arguments parameterizer for Rails | Model View Controller library
kandi X-RAY | action_args Summary
kandi X-RAY | action_args Summary
action_args is a Rails plugin that extends your controller action methods to allow you to specify arguments of interest in the method definition for any action. - in short, this makes your Rails controller Merb-ish.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of action_args
action_args Key Features
action_args Examples and Code Snippets
Community Discussions
Trending Discussions on action_args
QUESTION
I am trying to extract order meta data of a custom field that I added to my WooCommerce checkout form. I am doing this in a PHP file that is used to add a custom section to the order confirmation email sent to the customer by WooCommerce (i.e. the very last stage of order processing).
In order to do this, I am trying to use WC_Order class with following code:
$my_var = get_post_meta( $order_id, 'custom_field_meta_key', true );
However, this approach doesn't work. I realised that the "order_id" variable is not available in the PHP page. I used the following code to confirm this:
print_r(array_keys(get_defined_vars()));
Below is the output that I get:
Array ( [0] => template_name [1] => args [2] => template_path [3] => default_path [4] => cache_key [5] => template [6] => filter_template [7] => action_args [8] => title [9] => delivery_date [10] => email )
Can somebody please help me with the best way to get the expected outcome?
...ANSWER
Answered 2019-Sep-07 at 23:44As $email
variable seems to be defined, you can normally get the WC_Order
Object instance using:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install action_args
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page