$status){ $order_status = str_replace("wc-","",$status_id); add_action( 'woocommerce_order_status_'.$order_status, array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); } // add_action( 'woocommerce_order_status_completed', array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); // add_action( 'woocommerce_order_status_processing', array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); // add_action( 'woocommerce_order_status_refunded', array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); // add_action( 'woocommerce_order_status_cancelled', array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); // add_action( 'woocommerce_order_status_on-hold', array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); // add_action( 'woocommerce_order_status_failed', array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); // add_action( 'woocommerce_order_status_pending', array( $this, 'appmaker_wc_order_status_changed' ), 10, 1 ); add_action( 'woocommerce_loaded', array( $this, 'load_persistent_cart' ), 10, 1 ); $this->options = get_option('appmaker_wc_settings'); if (empty( $this->options['project_id']) && !(isset($_POST['appmaker_wc_settings']) && !empty($_POST['appmaker_wc_settings']['project_id'])) && $_GET['page'] != 'appmaker-wc-admin') { add_action( 'admin_notices', array( $this, 'show_settings_admin_message' ) ); } //woocommerce all in one currency converter if ( class_exists( 'WooCommerce_All_in_One_Currency_Converter_Frontend' ) ) { add_action('init',array($this,'Currency_converter') , 0); } } public function Currency_converter(){ $_POST['wcaiocc_change_currency_code'] = $_REQUEST['currency']; } function show_settings_admin_message() { ?>

Configure app to continue

Take me there !
'; $output .= "\njQuery(function() {"; $output .= " jQuery('#wrapper').html(jQuery('#main').html())\n"; $output .= " jQuery('body').css('margin-left','20px')\n"; $output .= " jQuery('body').css('margin-bottom','300px')\n"; $output .= "});\n"; $output .= "\n"; echo $output; }*/ public function appmaker_wc_hide_header_and_footer(){ $output = '\n"; $output .=''; echo $output; } /** * Order change callback function * * @param int $order_id order id. */ public function appmaker_wc_order_status_changed( $order_id ) { $fcm_key = APPMAKER_WC::$api->get_settings( 'fcm_server_key' ); $order = new WC_Order( $order_id ); if ( ! empty( $fcm_key ) && APPMAKER_WC::$api->get_settings( 'enable_order_push', true ) ) { $fcm = new Appmaker_WC_FCM_Helper( $fcm_key ); $user_id = self::get_property($order,'user_id'); $show_order_number = APPMAKER_WC::$api->get_settings( 'show_order_number', false ); if ( class_exists( 'WC_Seq_Order_Number' ) ) { $display_order_id = self::get_property($order,'order_number'); } else if($show_order_number) { $display_order_id = $order->get_order_number(); } else { $display_order_id = self::get_id($order); } if ( ! empty( $user_id ) && get_user_meta( $user_id, 'appmaker_wc_user_login_from_app' ) ) { sprintf( __( 'Order updated #%s', 'appmaker-woocommerce-mobile-app-manager' ), $display_order_id ); $fcm->setTopic( "user-$user_id" ) ->setMessage( sprintf( __( 'Order updated #%s', 'appmaker-woocommerce-mobile-app-manager' ), $display_order_id ), sprintf( __( 'Order status changed to %s', 'appmaker-woocommerce-mobile-app-manager' ), $order->get_status() )) ->setAction( array( 'type' => 'OPEN_ORDER', 'params' => array( 'orderId' => $order_id, ), ) ) ->send(); } } } public function hook_stripe_enable_headers() { $output = ' '; echo $output; } public function hook_payment_footer() { $gateway = isset( $_GET['payment_gateway'] ) ? $_GET['payment_gateway'] : ''; $output = ' '; echo $output; } /** * Load the persistent cart make cart sync with app * * @return void|bool */ public function load_persistent_cart() { global $current_user; if ( ! $current_user ) { return false; } $saved_cart = get_user_meta( $current_user->ID, '_woocommerce_persistent_cart', true ); if ( $saved_cart && is_array( $saved_cart ) && isset( $saved_cart['cart'] ) ) { WC()->session->set( 'cart', $saved_cart['cart'] ); } return true; } public static function get_id( $object ) { if ( method_exists( $object, 'get_id' ) ) { return $object->get_id(); } else { return $object->id; } } static function get_property( $object, $property ) { if ( method_exists( $object, 'get_'.$property ) ) { return call_user_func(array($object, 'get_'.$property)); } else { return $object->{$property}; } } } new APPMAKER_WC_General_hooks();