/** * Fired after an order is saved. It checks that the order currency has been * stored against the post, adding it if it's missing. This method is needed * because, for some reason, WooCommerce does not store the order currency when * an order is created from the backend. * * @param int post_id The post (order) ID. * @param WC_Order The order that has just been saved. */ public function woocommerce_process_shop_order_meta($post_id, $post) { $order = new Aelia_Order($post_id); // Check if order currency is saved. If not, set it to currently selected currency $order_currency = $order->get_order_currency(); if (empty($order_currency)) { $order->set_order_currency($this->get_selected_currency()); } }