# sellkit/1.5.4/includes/funnel/steps/decision.php

SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster, version 1.5.4. 58 lines.

- Page: https://pluginprobe.com/plugins/sellkit/1.5.4/code/includes/funnel/steps/decision.php
- Raw: https://pluginprobe.com/plugins/sellkit/1.5.4/raw/includes/funnel/steps/decision.php
- Modified: 2023-01-05T10:11:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sellkit/1.5.4/code/includes/funnel/steps/decision.php#L10-L20`.

```php
<?php

namespace Sellkit\Funnel\Steps;

use Sellkit_Funnel;

defined( 'ABSPATH' ) || die();

/**
 * Class Decision.
 *
 * @since 1.5.0
 */
class Decision {

	/**
	 * Decision constructor.
	 *
	 * @since 1.5.0
	 */
	public function __construct() {
		$this->funnel = Sellkit_Funnel::get_instance();

	}

	/**
	 * Upsell actions.
	 *
	 * @since 1.1.0
	 * @SuppressWarnings(PHPMD.NPathComplexity)
	 */
	public function do_actions() {
		$conditions = ! empty( $this->funnel->current_step_data['data']['conditions'] ) ? $this->funnel->current_step_data['data']['conditions'] : [];

		$is_valid = sellkit_conditions_validation( $conditions );

		$args = [];

		if ( ! empty( $_GET['order-key'] ) ) { // phpcs:ignore
			$args['order-key'] = $_GET['order-key']; // phpcs:ignore
		}

		if ( $is_valid && ! empty( $this->funnel->next_step_data['page_id'] ) ) {
			wp_safe_redirect( add_query_arg( $args, get_permalink( $this->funnel->next_step_data['page_id'] ) ) );
			return;
		}

		if ( ! $is_valid && ! empty( $this->funnel->next_no_step_data['page_id'] ) ) {
			wp_safe_redirect( add_query_arg( $args, get_permalink( $this->funnel->next_no_step_data['page_id'] ) ) );
			return;
		}

		if ( ! empty( $this->funnel->end_node_step_data['page_id'] ) ) {
			wp_safe_redirect( add_query_arg( $args, get_permalink( $this->funnel->end_node_step_data['page_id'] ) ) );
		}
	}
}

```
