is_order_completed($data['orderId']); if($isCompleted){ $response['status'] = 'SUCCESS'; } return $response; } add_action( 'woocommerce_product_options_advanced', 'add_7star_custom_fields' ); add_action( 'woocommerce_process_product_meta', 'add_7star_save_custom_fields' ); function add_7star_save_custom_fields( $post_id ){ $starpay_giveaway_rate = $_POST["starpay_giveaway_rate"]; update_post_meta( $post_id, 'starpay_giveaway_rate', esc_html( $starpay_giveaway_rate ) ); $starpay_tax_rate = $_POST["starpay_tax_rate"]; update_post_meta( $post_id, 'starpay_tax_rate', esc_html( $starpay_tax_rate ) ); $starpay_locked_days = $_POST["starpay_locked_days"]; update_post_meta( $post_id, 'starpay_locked_days', esc_html( $starpay_locked_days ) ); } function add_7star_custom_fields() { $starpay_giveaway_rate = get_post_meta( get_the_ID(), 'starpay_giveaway_rate', true ); woocommerce_wp_text_input( array( 'id' => 'starpay_giveaway_rate', 'value' => $starpay_giveaway_rate, 'label' => __( 'Giveaway rate', 'woocommerce' ), 'placeholder' => '', 'desc_tip' => true, 'description' => __( "Giveaway rate for 7StarPay.", 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array( 'step' => 'any', 'min' => '0' ) ) ); woocommerce_wp_text_input( array( 'id' => 'starpay_tax_rate', 'value' => get_post_meta( get_the_ID(), 'starpay_tax_rate', true ), 'label' => __( 'Tax rate', 'woocommerce' ), 'placeholder' => '', 'desc_tip' => true, 'description' => __( "Tax rate for 7StarPay.", 'woocommerce' ), 'type' => 'number', 'custom_attributes' => array( 'step' => 'any', 'min' => '0' ) ) ); woocommerce_wp_select( array( 'id' => 'starpay_locked_days', 'value' => get_post_meta( get_the_ID(), 'starpay_locked_days', true ), 'label' => 'Locked days', 'desc_tip' => true, 'description' => __( "Locked days for 7StarPay.", 'woocommerce' ), 'options' => array( '' => 'Please select', '90' => '90', '366' => '366'), ) ); } ?>