# sellkit/1.1.4/includes/dynamic-keywords/keywords/order-items-count.php

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

- Page: https://pluginprobe.com/plugins/sellkit/1.1.4/code/includes/dynamic-keywords/keywords/order-items-count.php
- Raw: https://pluginprobe.com/plugins/sellkit/1.1.4/raw/includes/dynamic-keywords/keywords/order-items-count.php
- Modified: 2022-04-14T05:16:22+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.1.4/code/includes/dynamic-keywords/keywords/order-items-count.php#L10-L20`.

```php
<?php

class Order_Items_Count extends Tag_Base {

	// phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod
	public function __construct() {
		parent::__construct();
	}

	/**
	 * Get class id.
	 *
	 * @return string
	 */
	public function get_id() {
		return '_order_items_count';
	}

	/**
	 * Get class title.
	 *
	 * @return string
	 */
	public function get_title() {
		return esc_html__( 'Order Item Count', 'sellkit' );
	}

	/**
	 * Render true content.
	 *
	 * @return string
	 */
	public function render_content() {
		if ( empty( self::$order ) ) {
			$this->get_data();
		}

		$order_data = $this->get_order_item_count_data( self::$order );

		return $order_data['quantity'];
	}

	/**
	 * Get order item count data.
	 *
	 * @since 1.1.0
	 * @param object $order object of order parameters.
	 * @return array
	 */
	public function get_order_item_count_data( $order ) {
		foreach ( $order->get_items() as $item ) {
			$order_data = $item->get_data();
		}

		return $order_data;
	}
}

```
