Woo Thank You Page Nextmove Lite Shortcodes

Below, you’ll find a detailed guide on how to add the Woo Thank You Page Nextmove Lite Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Woo Thank You Page Nextmove Lite Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the Woo Thank You Page Nextmove Lite Plugin and the shortcodes it provides:

Plugin Icon
NextMove Lite – Thank You Page for WooCommerce

"NextMove Lite – Thank You Page for WooCommerce is a plugin designed to enhance your WooCommerce store's thank you page, making post-purchase interactions more effective and engaging."

★★★★☆ (121) Active Installs: 20000+ Tested with: 6.2.3 PHP Version: 7.3
Included Shortcodes:
  • [xlwcty_jilt_post_registration_html]
  • [xlwcty_load]
  • [display_component_shortcode_view]
  • [xlwcty_multiple_comp_html]
  • [xlwcty_current_time]
  • [xlwcty_current_date]
  • [xlwcty_today]
  • [xlwcty_current_day]
  • [xlwcty_xlwcty_countdown_timer_admin]
  • [xlwcty_order_meta]

Woo Thank You Page Nextmove Lite [xlwcty_jilt_post_registration_html] Shortcode

The NextMove Lite plugin shortcode, ‘xlwcty_jilt_post_registration_html’, is used to display messages related to Jilt registration on the WooCommerce thank you page. This shortcode checks if the WooCommerce order exists and if the WC_Jilt_Frontend class is available. If both conditions are met, it prompts the user to create a Jilt account. If not, it displays error messages.

Shortcode: [xlwcty_jilt_post_registration_html]

Examples and Usage

Basic example – Display a simple thank you message after order completion.

[xlwcty_jilt_post_registration_html]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_jilt_post_registration_html] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_jilt_post_registration_html', array( $this, 'xlwcty_jilt_post_registration' ) );

Shortcode PHP function:

function xlwcty_jilt_post_registration() {
		$order = XLWCTY_Core()->data->get_order();
		if ( ! $order instanceof WC_Order ) {
			echo __( 'WooCommerce order not found', 'thank-you-page-for-woocommerce-nextmove' );
		}
		if ( ! class_exists( 'WC_Jilt_Frontend' ) ) {
			echo __( 'Jilt Frontend class doesn\'t exist.', 'thank-you-page-for-woocommerce-nextmove' );
		}

		$jilt_frontend_object = new WC_Jilt_Frontend();
		echo $jilt_registration_message = $jilt_frontend_object->maybe_render_account_prompt( '', $order );

	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/compatibilities/class-xlwcty-jilt.php

Woo Thank You Page Nextmove Lite [xlwcty_load] Shortcode

The NextMove Lite shortcode ‘xlwcty_load’ is designed to render specific elements on the webpage. This shortcode checks if the user is an admin. If true, it returns an empty string. If false, it calls the function ‘maybe_render_elements’ from the XLWCTY_Core class, which is responsible for rendering elements on the webpage.

Shortcode: [xlwcty_load]

Examples and Usage

Basic example – A basic example of using the shortcode would be to simply call the shortcode without any parameters. This will render the elements as defined in the “maybe_render_elements” function.

[xlwcty_load /]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_load] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_load', array( __CLASS__, 'maybe_render_elements' ) );

Shortcode PHP function:

function maybe_render_elements() {
		if ( is_admin() ) {
			return __return_empty_string();
		}

		return XLWCTY_Core()->public->maybe_render_elements();
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/includes/xlwcty-common.php

Woo Thank You Page Nextmove Lite [display_component_shortcode_view] Shortcode

The NextMove Lite plugin shortcode is a tool that displays a specific component view in a structured format. It uses the ‘display_component_shortcode_view’ function to output the view within a div container.

Shortcode: [display_component_shortcode_view]

Examples and Usage

Basic example – A simple usage of the shortcode to display a component view. The shortcode will generate a div with a class of ‘xlwcty_wrap xlwcty_shortcode’ and a data-component attribute that matches the slug of the component.

[display_component slug="my-component" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [display_component_shortcode_view] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( $slug, array( $this, 'display_component_shortcode_view' ) );

Shortcode PHP function:

function display_component_shortcode_view() {
		ob_start();
		echo '<div class="xlwcty_wrap xlwcty_shortcode" data-component="' . $this->get_slug() . '">';
		$this->get_view();
		echo '</div>';

		return ob_get_clean();
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/includes/xlwcty-component.php

Woo Thank You Page Nextmove Lite [xlwcty_multiple_comp_html] Shortcode

The NextMove Lite shortcode is a critical tool for customizing your WooCommerce thank you page. It allows you to add multiple components to your page, such as upsells, related products, or social proof. This shortcode checks if the component is enabled, and if so, it starts output buffering, wraps the component view in a div, and returns the buffered output. This allows you to place any component anywhere on your thank you page.

Shortcode: [xlwcty_multiple_comp_html]

Examples and Usage

Basic example – The following shortcode is used to display a specific component on the thank you page. The slug of the component is passed as an argument.

[xlwcty_multiple_comp slug="component_slug" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_multiple_comp_html] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( $this->slug, array( $this, 'xlwcty_multiple_comp_html' ) );

Shortcode PHP function:

function xlwcty_multiple_comp_html() {
		$multiple_comp = XLWCTY_Component::get_multiple_components( $this->page_id );
		if ( empty( $multiple_comp ) ) {
			return '';
		}
		if ( ! isset( $multiple_comp[ $this->slug ] ) ) {
			return;
		}

		$component_class = XLWCTY_Components::get_components( $multiple_comp[ $this->slug ]['component'] );

		$component_class->current_index = $this->current_index;
		if ( $component_class->is_enable( $component_class->current_index ) ) {
			ob_start();
			echo '<div class="xlwcty_wrap xlwcty_shortcode" data-component="' . $multiple_comp[ $this->slug ]['slug'] . '">';
			echo $component_class->get_view();
			echo '</div>';

			return ob_get_clean();

		}
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/includes/xlwcty-dynamic-component.php

Woo Thank You Page Nextmove Lite [xlwcty_current_time] Shortcode

The NextMove Lite shortcode ‘xlwcty_current_time’ displays the current time on your WooCommerce thank you page. It uses the WordPress date and time format, and allows for time adjustments.

Shortcode: [xlwcty_current_time]

Parameters

Here is a list of all possible xlwcty_current_time shortcode parameters and attributes:

  • format – Defines the format in which the time will be displayed.
  • adjustment – Allows for manual changes to the displayed time.

Examples and Usage

Basic example – The shortcode displays the current time, using the default format set in your WordPress settings. No additional parameters are required for the basic usage.

[xlwcty_current_time /]

Advanced examples

Displaying the current time in a specific format. In this example, the format parameter is set to ‘g:i A’ which will display the time in a 12-hour format, including AM or PM.

[xlwcty_current_time format='g:i A' /]

Adjusting the current time. In this example, the ‘adjustment’ parameter is used to modify the current time. The ‘+2 hours’ value will display the time as it will be 2 hours from now.

[xlwcty_current_time adjustment='+2 hours' /]

Combining both parameters. You can use both the ‘format’ and ‘adjustment’ parameters together to display the time in a specific format and adjust it. In this example, the time will be displayed in a 12-hour format and it will show the time as it will be 2 hours from now.

[xlwcty_current_time format='g:i A' adjustment='+2 hours' /]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_current_time] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_current_time', array( __CLASS__, 'process_time' ) );

Shortcode PHP function:

function process_time( $shortcode_attrs ) {
		$default_f = XLWCTY_Common::xlwcty_get_time_format();
		$atts      = shortcode_atts( array(
			'format'     => $default_f, //has to be user friendly , user will not understand 12:45 PM (g:i A) (https://codex.wordpress.org/Formatting_Date_and_Time)
			'adjustment' => '',
		), $shortcode_attrs );

		$date_obj = new DateTime();
		$date_obj->setTimezone( new DateTimeZone( XLWCTY_Common::wc_timezone_string() ) );
		if ( $atts['adjustment'] !== '' ) {
			$date_obj->modify( $atts['adjustment'] );
		}

		return date_i18n( $atts['format'], $date_obj->getTimestamp() );
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/merge-tags/xlwcty-shortcode-merge-tags.php

Woo Thank You Page Nextmove Lite [xlwcty_current_date] Shortcode

The NextMove Lite plugin shortcode, ‘xlwcty_current_date’, displays the current date. It allows adjustments for time, cut-off times, and exclusion of specific days or dates. The shortcode uses the ‘process_date’ function, which applies the WordPress date format. It creates a DateTime object for the current time and timezone. If a cut-off time is specified, the function checks if the current time is past this cut-off. If so, it advances the date by one day. The function also checks for any excluded days or dates. If the current date matches these, it advances the date by one day. Finally, if an adjustment is specified, this is applied to the date. The function returns the final date, formatted according to the specified or default format.

Shortcode: [xlwcty_current_date]

Parameters

Here is a list of all possible xlwcty_current_date shortcode parameters and attributes:

  • format – sets the date format to be displayed
  • adjustment – modifies the date by the specified value
  • cutoff – sets a cutoff time beyond which the date changes
  • exclude_days – specifies days to be excluded from the date
  • exclude_dates – specifies specific dates to be excluded

Examples and Usage

Basic example – Display the current date with default format.

[xlwcty_current_date]

Advanced examples

Display the current date with a specific format.

[xlwcty_current_date format="F j, Y"]

Display the current date with a specific format and an adjustment of 2 days.

[xlwcty_current_date format="F j, Y" adjustment="+2 days"]

Display the current date with a specific format, an adjustment of 2 days, and a cutoff time of 15:00.

[xlwcty_current_date format="F j, Y" adjustment="+2 days" cutoff="15:00"]

Display the current date with a specific format, an adjustment of 2 days, a cutoff time of 15:00, and excluding Sundays (0) and Saturdays (6).

[xlwcty_current_date format="F j, Y" adjustment="+2 days" cutoff="15:00" exclude_days="0,6"]

Display the current date with a specific format, an adjustment of 2 days, a cutoff time of 15:00, excluding Sundays (0) and Saturdays (6), and excluding specific dates (2022-12-25, 2022-12-31).

[xlwcty_current_date format="F j, Y" adjustment="+2 days" cutoff="15:00" exclude_days="0,6" exclude_dates="2022-12-25,2022-12-31"]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_current_date] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_current_date', array( __CLASS__, 'process_date' ) );

Shortcode PHP function:

function process_date( $shortcode_attrs ) {
		$default_f = XLWCTY_Common::xlwcty_get_date_format();
		$atts      = shortcode_atts( array(
			'format'        => $default_f, //has to be user friendly , user will not understand 12:45 PM (g:i A) (https://codex.wordpress.org/Formatting_Date_and_Time)
			'adjustment'    => '',
			'cutoff'        => '',
			'exclude_days'  => '',
			'exclude_dates' => '',
		), $shortcode_attrs );

		$date_obj = new DateTime( 'now', new DateTimeZone( XLWCTY_Common::wc_timezone_string() ) );

		/** cutoff functionality starts */
		if ( $atts['cutoff'] !== '' ) {
			$date_obj_cutoff = new DateTime();
			$parsed_date     = date_parse( $atts['cutoff'] );
			$date_defaults   = array(
				'year'   => $date_obj_cutoff->format( 'Y' ),
				'month'  => $date_obj_cutoff->format( 'm' ),
				'day'    => $date_obj_cutoff->format( 'd' ),
				'hour'   => $date_obj_cutoff->format( 'H' ),
				'minute' => $date_obj_cutoff->format( 'i' ),
				'second' => '00',
			);
			foreach ( $parsed_date as $attrs => &$date_elements ) {
				if ( $date_elements === false && isset( $date_defaults[ $attrs ] ) ) {
					$parsed_date[ $attrs ] = $date_defaults[ $attrs ];
				}
			}
			$parsed_date = wp_parse_args( $parsed_date, $date_defaults );
			$date_obj_cutoff->setTimezone( new DateTimeZone( XLWCTY_Common::wc_timezone_string() ) );
			$date_obj_cutoff->setDate( $parsed_date['year'], $parsed_date['month'], $parsed_date['day'] );
			$date_obj_cutoff->setTime( $parsed_date['hour'], $parsed_date['minute'], $parsed_date['second'] );
			if ( $date_obj->getTimestamp() > $date_obj_cutoff->getTimestamp() ) {
				$date_obj->modify( '+1 days' );
			}
		}

		/**
		 * Pre check
		 */
		$itr = 0;
		while ( $itr < self::$threshold_to_date && ( ( ( $atts['exclude_dates'] !== '' ) && ( self::is_not_excluded_date( $date_obj, $atts['exclude_dates'] ) === false ) ) || ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_day( $date_obj, $atts['exclude_days'] ) === false ) ) ) ) {
			$date_obj->modify( '+1 day' );
			$itr ++;
		}

		/** Cut-Off functionality Ends */
		if ( $atts['adjustment'] !== '' ) {
			$date_obj->modify( trim( $atts['adjustment'] ) );
		}

		/**
		 * After check
		 */
		$itr = 0;
		while ( $itr < self::$threshold_to_date && ( ( ( $atts['exclude_dates'] !== '' ) && ( self::is_not_excluded_date( $date_obj, $atts['exclude_dates'] ) === false ) ) || ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_day( $date_obj, $atts['exclude_days'] ) === false ) ) ) ) {

			$date_obj->modify( '+1 day' );
			$itr ++;
		}

		return date_i18n( $atts['format'], $date_obj->getTimestamp() );
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/merge-tags/xlwcty-shortcode-merge-tags.php

Woo Thank You Page Nextmove Lite [xlwcty_today] Shortcode

The NextMove Lite shortcode ‘xlwcty_today’ is designed to manipulate dates based on specific attributes. It allows setting a ‘cutoff’ time, excluding specific days or dates. If the current time surpasses the ‘cutoff’, it returns ‘tomorrow’. If not, it checks for ‘exclude_days’ or ‘exclude_dates’. If the current date is excluded, it returns the next valid day. If not, it returns ‘today’.

Shortcode: [xlwcty_today]

Parameters

Here is a list of all possible xlwcty_today shortcode parameters and attributes:

  • cutoff – defines the cutoff time of the day
  • exclude_days – specifies days to be excluded from the date calculation
  • exclude_dates – sets specific dates to be omitted from the date calculation

Examples and Usage

Basic example – A simple usage of the ‘xlwcty_today’ shortcode without any parameters.

[xlwcty_today /]

Advanced examples

Using the ‘xlwcty_today’ shortcode with the ‘cutoff’ parameter. This will display the day of the week, considering the cutoff time. If the current time is past the cutoff, it will display the next day.

[xlwcty_today cutoff="17:00:00" /]

Using the ‘xlwcty_today’ shortcode with the ‘exclude_days’ parameter. This will display the next day that is not in the excluded list. For example, if we exclude Sunday (0) and Saturday (6), it will display the next weekday.

[xlwcty_today exclude_days="0,6" /]

Using the ‘xlwcty_today’ shortcode with the ‘exclude_dates’ parameter. This will display the next day that is not in the excluded dates list. The dates should be in the format ‘Y-m-d’.

[xlwcty_today exclude_dates="2022-12-25,2023-01-01" /]

Using the ‘xlwcty_today’ shortcode with all parameters. This will display the next day that is not in the excluded list or dates and is after the cutoff time.

[xlwcty_today cutoff="17:00:00" exclude_days="0,6" exclude_dates="2022-12-25,2023-01-01" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_today] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_today', array( __CLASS__, 'process_today' ) );

Shortcode PHP function:

function process_today( $shortcode_attrs ) {
		$atts     = shortcode_atts( array(
			'cutoff'        => '',
			'exclude_days'  => '',
			'exclude_dates' => '',
		), $shortcode_attrs );
		$date_obj = new DateTime();
		$date_obj->setTimezone( new DateTimeZone( XLWCTY_Common::wc_timezone_string() ) );
		$date_obj_cutoff = new DateTime();
		/** cutoff functionlity starts */
		if ( $atts['cutoff'] !== '' ) {
			$parsed_date   = date_parse( $atts['cutoff'] );
			$date_defaults = array(
				'year'   => $date_obj_cutoff->format( 'Y' ),
				'month'  => $date_obj_cutoff->format( 'm' ),
				'day'    => $date_obj_cutoff->format( 'd' ),
				'hour'   => $date_obj_cutoff->format( 'H' ),
				'minute' => $date_obj_cutoff->format( 'i' ),
				'second' => '00',
			);
			foreach ( $parsed_date as $attrs => &$date_elements ) {
				if ( $date_elements === false && isset( $date_defaults[ $attrs ] ) ) {
					$parsed_date[ $attrs ] = $date_defaults[ $attrs ];
				}
			}
			$parsed_date = wp_parse_args( $parsed_date, $date_defaults );
			$date_obj_cutoff->setTimezone( new DateTimeZone( XLWCTY_Common::wc_timezone_string() ) );
			$date_obj_cutoff->setDate( $parsed_date['year'], $parsed_date['month'], $parsed_date['day'] );
			$date_obj_cutoff->setTime( $parsed_date['hour'], $parsed_date['minute'], $parsed_date['second'] );
		}

		if ( $date_obj->getTimestamp() > $date_obj_cutoff->getTimestamp() ) {

			$date_obj->modify( '+1 days' );
			$is_excluded = false;

			/**
			 * iterating all over the recursive check for a valid date
			 */
			$itr = 0;
			while ( $itr < self::$threshold_to_date && ( ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_date( $date_obj, $atts['exclude_dates'] ) === false ) ) || ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_day( $date_obj, $atts['exclude_days'] ) === false ) ) ) ) {
				;
				$date_obj->modify( '+1 day' );
				$itr ++;
				$is_excluded = true;
			}

			if ( $is_excluded ) {
				return date_i18n( 'l', $date_obj->getTimestamp() );
			} else {
				return __( 'tomorrow', 'woo-thank-you-page-nextmove-lite' );
			}
		} else {
			$is_excluded = false;
			/**
			 * iterating all over the recursive check for a valid date
			 */
			$itr = 0;
			while ( $itr < self::$threshold_to_date && ( ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_date( $date_obj, $atts['exclude_dates'] ) === false ) ) || ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_day( $date_obj, $atts['exclude_days'] ) === false ) ) ) ) {
				$date_obj->modify( '+1 day' );
				$is_excluded = true;
				$itr ++;
			}
			if ( $is_excluded ) {
				return date_i18n( 'l', $date_obj->getTimestamp() );
			} else {
				return __( 'today', 'woo-thank-you-page-nextmove-lite' );
			}
		}
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/merge-tags/xlwcty-shortcode-merge-tags.php

Woo Thank You Page Nextmove Lite [xlwcty_current_day] Shortcode

The ‘xlwcty_current_day’ shortcode from NextMove Lite is designed to process and display the current day. This shortcode takes into account various factors such as timezone, cutoff times, excluded days and dates, and adjustments. It works by first setting the timezone and then checking if a cutoff time has been set. If the current time is past the cutoff, it moves to the next day. It then checks for any excluded days or dates and skips these. Lastly, it applies any adjustments specified.

Shortcode: [xlwcty_current_day]

Parameters

Here is a list of all possible xlwcty_current_day shortcode parameters and attributes:

  • adjustment – alters the current date by a specified duration
  • cutoff – sets a specific time after which the date is moved to the next day
  • exclude_days – specifies the days to be excluded from the date calculation
  • exclude_dates – defines particular dates to be omitted from the date calculation

Examples and Usage

Basic example – Displaying the current day without any adjustments or exclusions.

[xlwcty_current_day]

Advanced examples

Adjusting the current day by adding two days and excluding Sundays and Saturdays.

[xlwcty_current_day adjustment="+2 days" exclude_days="Sunday,Saturday"]

Setting a cutoff time at 15:00 (3 PM) and excluding specific dates (2022-12-25 and 2023-01-01).

[xlwcty_current_day cutoff="15:00" exclude_dates="2022-12-25,2023-01-01"]

Combining all parameters: adjusting the current day by adding one day, setting a cutoff time at 18:00 (6 PM), excluding Sundays and specific dates (2022-12-25 and 2023-01-01).

[xlwcty_current_day adjustment="+1 day" cutoff="18:00" exclude_days="Sunday" exclude_dates="2022-12-25,2023-01-01"]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_current_day] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_current_day', array( __CLASS__, 'process_day' ) );

Shortcode PHP function:

function process_day( $shortcode_attrs ) {
		$default_f = XLWCTY_Common::xlwcty_get_date_format();
		$atts      = shortcode_atts( array(
			'adjustment'    => '',
			'cutoff'        => '',
			'exclude_days'  => '',
			'exclude_dates' => '',
		), $shortcode_attrs );
		$date_obj  = new DateTime();
		$date_obj->setTimezone( new DateTimeZone( XLWCTY_Common::wc_timezone_string() ) );

		/** cutoff functionality starts */
		if ( $atts['cutoff'] !== '' ) {
			$date_obj_cutoff = new DateTime();
			$parsed_date     = date_parse( $atts['cutoff'] );
			$date_defaults   = array(
				'year'   => $date_obj_cutoff->format( 'Y' ),
				'month'  => $date_obj_cutoff->format( 'm' ),
				'day'    => $date_obj_cutoff->format( 'd' ),
				'hour'   => $date_obj_cutoff->format( 'H' ),
				'minute' => $date_obj_cutoff->format( 'i' ),
				'second' => '00',
			);
			foreach ( $parsed_date as $attrs => &$date_elements ) {
				if ( $date_elements === false && isset( $date_defaults[ $attrs ] ) ) {
					$parsed_date[ $attrs ] = $date_defaults[ $attrs ];
				}
			}
			$parsed_date = wp_parse_args( $parsed_date, $date_defaults );

			$date_obj_cutoff->setTimezone( new DateTimeZone( XLWCTY_Common::wc_timezone_string() ) );

			$date_obj_cutoff->setDate( $parsed_date['year'], $parsed_date['month'], $parsed_date['day'] );
			$date_obj_cutoff->setTime( $parsed_date['hour'], $parsed_date['minute'], $parsed_date['second'] );

			if ( $date_obj->getTimestamp() > $date_obj_cutoff->getTimestamp() ) {
				$date_obj->modify( '+1 days' );
			}
		}

		//pre check
		$itr = 0;
		/**
		 * iterating all over the recursive check for a valid date
		 */
		while ( $itr < self::$threshold_to_date && ( ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_date( $date_obj, $atts['exclude_dates'] ) === false ) ) || ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_day( $date_obj, $atts['exclude_days'] ) === false ) ) ) ) {
			$date_obj->modify( '+1 day' );
			$itr ++;
		}
		/** Cut-Off functionality Ends */
		if ( $atts['adjustment'] !== '' ) {
			$date_obj->modify( $atts['adjustment'] );
		}
		$itr = 0;
		/**
		 * iterating all over the recursive check for a valid date
		 */
		while ( $itr < self::$threshold_to_date && ( ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_date( $date_obj, $atts['exclude_dates'] ) === false ) ) || ( ( $atts['exclude_days'] !== '' ) && ( self::is_not_excluded_day( $date_obj, $atts['exclude_days'] ) === false ) ) ) ) {
			$date_obj->modify( '+1 day' );
			$itr ++;
		}

		return date_i18n( 'l', $date_obj->getTimestamp() );
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/merge-tags/xlwcty-shortcode-merge-tags.php

Woo Thank You Page Nextmove Lite [xlwcty_xlwcty_countdown_timer_admin] Shortcode

The NextMove Lite plugin shortcode, ‘xlwcty_xlwcty_countdown_timer_admin’, is designed to display a countdown timer on your admin page. This shortcode generates a countdown timer set to 3600 seconds (1 hour). It’s wrapped in a div class for easy styling.

Shortcode: [xlwcty_xlwcty_countdown_timer_admin]

Examples and Usage

Basic example – The following shortcode will add a countdown timer with a default time of 3600 seconds (1 hour).

[xlwcty_xlwcty_countdown_timer_admin]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_xlwcty_countdown_timer_admin] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_xlwcty_countdown_timer_admin', array( __CLASS__, 'countdown_timer_admin' ) );

Shortcode PHP function:

function countdown_timer_admin( $shortcode_attrs ) {
		return '<div class="xlwcty_countdown_timer_admin" data-timer="3600"></div>';
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/merge-tags/xlwcty-shortcode-merge-tags.php

Woo Thank You Page Nextmove Lite [xlwcty_order_meta] Shortcode

The NextMove Lite shortcode, ‘xlwcty_order_meta’, fetches specific order meta-data. It accepts ‘key’ and ‘label’ as attributes. If the ‘key’ is valid and exists in the order, it returns the value.

Shortcode: [xlwcty_order_meta]

Parameters

Here is a list of all possible xlwcty_order_meta shortcode parameters and attributes:

  • key – Specifies the order meta data to be displayed
  • label – Sets a custom label for the selected order meta data

Examples and Usage

Basic example – This shortcode is utilized to display the order meta data by referencing the key parameter. The label parameter is optional and can be used to provide a custom label for the data.

[xlwcty_order_meta key="order_total" /]

Advanced examples

Using the shortcode to display the order meta data with a custom label. The label will be displayed before the data.

[xlwcty_order_meta key="order_total" label="Total Amount: " /]

Using the shortcode to display the order meta data by referencing both key and label. The label will be displayed before the data. If there’s no data for the specified key, nothing will be displayed.

[xlwcty_order_meta key="customer_note" label="Customer Note: " /]

PHP Function Code

In case you have difficulties debugging what causing issues with [xlwcty_order_meta] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( 'xlwcty_order_meta', array( __CLASS__, 'xlwcty_order_meta' ) );

Shortcode PHP function:

function xlwcty_order_meta( $shortcode_attrs ) {
		$atts = shortcode_atts( array(
			'key'   => '', //has to be user friendly , user will not understand 12:45 PM (g:i A) (https://codex.wordpress.org/Formatting_Date_and_Time)
			'label' => '',
		), $shortcode_attrs );

		if ( $atts['key'] === '' ) {
			return __return_empty_string();
		}

		$order = XLWCTY_Core()->data->get_order();
		if ( ! $order instanceof WC_Order ) {
			return __return_empty_string();
		}

		$get_key_value = XLWCTY_Compatibility::get_order_data( $order, $atts['key'] );

		if ( $get_key_value == '' || $get_key_value == false || $get_key_value == null ) {
			return __return_empty_string();
		}

		return sprintf( '%s%s', '<span class="xlwcty_order_meta_label">' . $atts['label'] . '</span>', $get_key_value );
	}

Code file location:

woo-thank-you-page-nextmove-lite/woo-thank-you-page-nextmove-lite/merge-tags/xlwcty-shortcode-merge-tags.php

Conclusion

Now that you’ve learned how to embed the Woo Thank You Page Nextmove Lite Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *