Order_Summary::get_data()

Summary

No summary available.

Return

(array)


Source

File: src/BigCommerce/Templates/Order_Summary.php

	public function get_data() {
		$order    = $this->options[ 'order' ];
		$image_id = $this->get_image_id( $order[ 'products' ] );
		$image    = $image_id ? wp_get_attachment_image( $image_id, $this->options[ self::THUMBNAIL_SIZE ] ) : $this->get_fallback_image( $this->options[ self::THUMBNAIL_SIZE ] );

		/**
		 * Filters order included tax subtotal.
		 *
		 * @param bool  $bool  True or false, default false.
		 * @param array $order Order.
		 */
		if ( apply_filters( 'bigcommerce/order/include_tax_in_subtotal', false, $order ) ) {
			$subtotal = $order[ 'subtotal_inc_tax' ];
		} else {
			$subtotal = $order[ 'subtotal_ex_tax' ];
		}

		return [
			self::ORDER_ID         => $order[ 'id' ],
			self::SHIPPING         => $this->format_currency( $order[ 'base_shipping_cost' ], false ),
			self::TAX              => $this->format_currency( $order[ 'total_tax' ], false ),
			self::DISCOUNT         => $this->format_currency( $order[ 'discount_amount' ], false ),
			self::COUPON           => $this->format_currency( $order[ 'coupon_discount' ], false ),
			self::SUBTOTAL         => $this->format_currency( $subtotal ),
			self::TOTAL_EX_TAX     => $this->format_currency( max( $order[ 'total_ex_tax' ], 0 ) ),
			self::TOTAL            => $this->format_currency( $order[ 'total_inc_tax' ], null ),
			self::COUNT            => $order[ 'items_total' ],
			self::PAYMENT_METHOD   => $this->get_payment_method( $order[ 'payment_method' ] ),
			self::CREATED          => $this->format_gmt_date( $order[ 'date_created' ] ),
			self::UPDATED          => $this->format_gmt_date( $order[ 'date_modified' ] ),
			self::SHIPPED          => $this->format_gmt_date( $order[ 'date_shipped' ] ),
			self::STATUS           => $order[ 'custom_status' ],
			self::IMAGE_ID         => $image_id,
			self::IMAGE            => $image,
			self::DESCRIPTION      => $this->options[ self::DESCRIPTION ] ?: $this->build_description( $order ),
			self::DETAILS_URL      => $this->order_details_url( $order[ 'id' ] ),
			self::STORE_CREDIT     => $this->format_currency( $order[ 'store_credit_amount' ], false ),
			self::GIFT_CERTIFICATE => $this->format_currency( $order[ 'gift_certificate_amount' ], false ),
			self::SUPPORT_EMAIL    => $this->get_support_email(),
		];
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.