pmoignard
Forum Replies Created
-
That did it. Thank you Patrick. The form is now working.
Thanks Nithin,
The form export file is linked below:
https://drive.google.com/file/d/1vfJQzjxGj_R00bNgiF72PuO7FEbr5VkZ/view?usp=sharing
Thank you in advance for your help!
Forum: Developing with WordPress
In reply to: Help with WP_User_Query user meta field search and filterThanks @bcworkz.
I discovered the issue. There were a bunch of null values being passed into the query, and that was messing up the search. The solution was to conditionally add new meta_query arrays to the $args only if the value from the $_POST existed, which ensures that there are never any null values.
I had read that when searching a field that contains a serialized array, that “LIKE” is the best operator for that. Is there a better approach for that situation?Forum: Developing with WordPress
In reply to: Ajax Call Failing – Error 400Thanks Ryan. I’ll try those things and see if I can resolve this “data acquirement” problem, and make another post focussed more on that if I continue to experience issues.
It is my intention to include a nonce, just wanted to get the data sending first. Thanks for mentioning that!Forum: Developing with WordPress
In reply to: Ajax Call Failing – Error 400The error message is simply the output from the “error” part of my Ajax call. I get my “Ajax Not Sent” message. So the code is working, but the data isn’t being received.
To your note, I changed the dataType to ‘html’, and got a successful send. So it was that.
Only thing that is happening now is that my callback function isn’t actually grabbing the sent data from the Ajax post? Should I be doing something other that serializing the data from the form?My jQuery is returning the data as a string as a result of being serialized like this:
mediator_search=value&designation=value®ion=value&language=valueForum: Developing with WordPress
In reply to: Ajax Call Failing – Error 400Thanks Ryan, moving the actions and the callback function into the shortcode file resolved the 400 error from admin-ajax.php; thanks!
However, my Ajax still isn’t sending the data. I’m getting my error message in the Console. Am I perhaps enqueuing my jQuery in the wrong place as well?
@duda That was it. A javascript conflict in the theme. Thankfully the theme devs had a new version of the theme out that fixed the problem when I updated to it. Appreciate your help!
Sure. It’s cmfhear.com
Forum: Fixing WordPress
In reply to: WooCommerce: Displaying Custom Feild value in “Orders” Admin ListWorking!
Forum: Fixing WordPress
In reply to: WooCommerce: Displaying Custom Feild value in “Orders” Admin ListThe final code:
// Add Course Dates to new column function add_order_coursedates($column_info, $order_id) { if($column_info == 'order_course_dates') { $order_info = wc_get_order( $order_id ); $order_items = $order_info->get_items(); foreach ( $order_items as $order_item ) { $the_product_id = $order_item->get_product_id(); } $date_field = 'wccaf_gLUNQXKdWIcO'; $course_dates = get_post_meta($the_product_id, $date_field, true); //var_dump($folders); echo $course_dates; } } add_action('manage_shop_order_posts_custom_column', 'add_order_coursedates', 99, 2);
Forum: Fixing WordPress
In reply to: WooCommerce: Displaying Custom Feild value in “Orders” Admin ListAH. That works. Thanks so much for your guidance @threadi!
Forum: Fixing WordPress
In reply to: WooCommerce: Displaying Custom Feild value in “Orders” Admin ListOk, when I var_dump() on $the_product_id, I get (for example) “int(5798)” which is the ID of the order, not the ID of the associated product. I need the post ID of the associated WooCommerce product.
Forum: Fixing WordPress
In reply to: WooCommerce: Displaying Custom Feild value in “Orders” Admin ListAh. Ok… I did that, but I still don’t get any values returned in my column?
This is what I’ve got now:
// Add Course Dates to new column function add_order_coursedates($column_info, $the_product_id) { if($column_info == 'order_course_dates') { $date_field = 'wccaf_gLUNQXKdWIcO'; $course_dates = get_post_meta($the_product_id, $date_field, true); echo $course_dates; } } add_action('manage_shop_order_posts_custom_column', 'add_order_coursedates', 99, 2);
- This reply was modified 2 years, 3 months ago by pmoignard.
Forum: Fixing WordPress
In reply to: WooCommerce: Displaying Custom Feild value in “Orders” Admin List@threadi Thanks so much for your response. A bit confused at how to implement that. Do you mind giving me a quick example? I tried:
function add_order_coursedates($column_info, $the_product_id) { if($column_info == 'order_course_dates') { $date_field = 'wccaf_gLUNQXKdWIcO'; $course_dates = get_post_meta($the_product_id, $date_field, true); echo $course_dates; } } add_action('manage_shop_order_posts_custom_column', 'add_order_coursedates', 99);
And it just gave me a fatal error?