protected function get_product_id( $posted, $action = 'create' ) {
        if ( ! empty( $posted['sku'] ) ) {
            $product_id = (int) wc_get_product_id_by_sku( $posted['sku'] );
        } elseif ( ! empty( $posted['product_id'] ) && empty( $posted['variation_id'] ) ) {
            $product_id = (int) $posted['product_id'];