Problem with AJAX request displaying 0

I’m working on a posts filter via AJAX. All works well but I’ve an “0” inserted at the end of my response. Similar questions says to use die(); at the end of the callback. It works but causes a problem with the final rendering. Inside my functions.php : add_action(‘wp_ajax_mon_action’, ‘mon_action’); add_action(‘wp_ajax_nopriv_mon_action’, ‘mon_action’); function mon_action() {…

Problem with AJAX request displaying 0

I’m working on a posts filter via AJAX. All works well but I’ve an “0” inserted at the end of my response. Similar questions says to use die(); at the end of the callback. It works but causes a problem with the final rendering. Inside my functions.php : add_action(‘wp_ajax_mon_action’, ‘mon_action’); add_action(‘wp_ajax_nopriv_mon_action’, ‘mon_action’); function mon_action() {…

Get adress data of Order

This used to work in commerce 1: within a for loop of craft.orders.all(). No longer in Commerce 2. If I use this syntax I get Impossible to access an attribute (“firstName”) on a null variable. But when I do: then I see the firstName and it is clearly not null: object(craft\commerce\models\Address)#2512 (35) { … [“firstName”]=>…