Backorders.

Namespace \PlusBusinessSoftware\WooCommerce
Bestand: BackOrders.php

				
									/**
				 * Tab title for Backorders on the My Account page
				 *
				 * @filter plus_backorders_my_account_title
				 * @param string The title for the Backorders tab
				 * @return string The title for the Backorders tab
				 */
				$my_account_items['king-backorders'] = apply_filters('plus_backorders_my_account_title', __('Backorders', 'plus-king-woocommerce') );

				
			
				
							/**
		 * Allow manipulation of backorders array ( in case we get info from somewhere else )
		 *
		 * @filter plus_backorders_after_get_backorders_from_king
		 * @param array $backorders An array of backorders
		 * @param string $debtor_number The King debtor number
		 * @param int $user_id The logged in user ID
		 * @return array An array of backorders
		 */
		$backorders = apply_filters( 'plus_backorders_after_get_backorders_from_king', $backorders, $debtor_number, $user_id );

				
			
				
									/**
				 * In case the data came from somewhere else, we need an option to override the required properties.
				 *
				 * @filter plus_get_assigned_backorder_qty_properties
				 * @param object $backorder An object containing backorder data
				 * @return object An object containing backorder data
				 */
				$backorder = apply_filters( 'plus_get_assigned_backorder_qty_properties', $backorder );

				
			
				
									/**
				 * In case the data came from somewhere else, we need an option to override the required properties.
				 *
				 * @filter plus_get_assigned_backorder_value_properties
				 * @param object $backorder An object containing backorder data
				 * @param int $inc_tax An integer telling us if prices are incl or excl VAT
				 * @return object An object containing backorder data
				 */
				$backorder = apply_filters( 'plus_get_assigned_backorder_value_properties', $backorder, $inc_tax );

				
			
				
								/**
			 * Allow overriding of the message.
			 *
			 * @filter plus_backorders_no_backorders_notice
			 * @param string $no_backorders_notice The message to show when there are no backorders
			 * @return string The message to show when there are no backorders
			 */
			echo esc_attr( apply_filters( 'plus_backorders_no_backorders_notice', $no_backorders_notice ) );

				
			
				
							/**
		 * Allow manipulation of columns in the backorders table.
		 *
		 * @filter plus_backorders_table_columns
		 * @param array $backorder_columns An array of columns to show.
		 * @param string $debtor_number The King debtor number.
		 * @param int $user_id The logged in users ID.
		 * @return array An array of columns to show.
		 */
		$backorder_columns = apply_filters( 'plus_backorders_table_columns', $backorder_columns, $debtor_number, $user_id );

				
			
				
									/**
				 * Allow manipulation of columns content in the backorders table.
				 *
				 * @filter show_plus_backorders_column
				 * @param mixed $value The value to show for the column.
				 * @param string $column_key The key for the column.
				 * @param string $column_title The column title.
				 * @param object $backorder A backorder object.
				 * @param string $sku The SKU of the article in backorder.
				 * @param int $_product_id The product ID of the article in WooCommerce.
				 * @param WC_Product $_product A WC_Product instance (if the product exists in WooCommerce).
				 * @param string $debtor_number The King debtor number
				 * @param int $user_id The logged in users ID.
				 * @return mixed The value to show for the column.
				 */
				$column_contents = apply_filters( 'show_plus_backorders_column', $value, $column_key, $column_title, $backorder, $sku, $_product_id, $_product, $debtor_number, $user_id );

				
			
				
									/**
				 * Allow manipulation of columns content in the backorders table.
				 *
				 * @filter plus_backorder_columns
				 * @param array $backorder_columns An array of backorder columns
				 * @param array $backorder_json Array of backorder objects.
				 * @return array An array of backorder columns
				 */				
				$backorder_columns = apply_filters( 'plus_backorder_columns', $backorder_columns, $backorder_json );

				
			
				
							/**
		 * Title for backorder totals in cart and checkout
		 *
		 * @filter plus_order_totals_reserve_title_head
		 * @param string The title for the backorder total
		 * @return string The title for the backorder total
		 */
		echo '<th>' . apply_filters( 'plus_order_totals_reserve_title_head', esc_attr( 'Reserveringen', 'plus-king-woocommerce' ) ) . '</th>';

				
			
				
							/**
		 * Title for backorder totals in cart and checkout
		 *
		 * @filter plus_order_totals_reserve_title
		 * @param string The title for the backorder total
		 * @return string The title for the backorder total
		 */
		echo '<td data-title="' . apply_filters( 'plus_order_totals_reserve_title', esc_attr( 'Reserveringen', 'plus-king-woocommerce' ) ) . '">' . $cart_subtotal . '</td>';

				
			
				
									/**
				 * Title to show (including the semicolon)
				 *
				 * @filter plus_backorders_text_semicolon
				 * @param string The text to show for backorders
				 * @return string The text to show for backorders
				 */
				$reserveren_text = apply_filters( 'plus_backorders_text_semicolon', esc_html__( 'Nu te reserveren: ', 'plus-king-woocommerce' ) );

				
			
				
							/**
		 * Show the available amount if the amount is zero.
		 *
		 * @filter plus_backorder_cart_item_data_show_available_qty_when_zero
		 * @param int Wether or not to show the amount of 0. ( 1 = yes, 0 is no )
		 * @return int Wether or not to show the amount of 0. ( 1 = yes, 0 is no )
		 */
		$show_available_qty_in_cart_when_zero = apply_filters( 'plus_backorder_cart_item_data_show_available_qty_when_zero', 1 );

				
			
				
							/**
		 * Show the available amount.
		 *
		 * @filter plus_backorder_cart_item_data_show_available_qty
		 * @param int Wether or not to show the available amount. ( 1 = yes, 0 is no )
		 * @return int Wether or not to show the available amount. ( 1 = yes, 0 is no )
		 */
		$show_available_qty_in_cart = apply_filters( 'plus_backorder_cart_item_data_show_available_qty', 1 );

				
			
				
									/**
				 * Allow value overriding.
				 *
				 * @filter plus_backorder_cart_item_data_override_available_qty
				 * @param int Available quantity.
				 * @param array Cart item data
				 * @return int Available quantity.
				 */
				$available_qty = apply_filters( 'plus_backorder_cart_item_data_override_available_qty', $cart_item_data['available_qty'], $cart_item_data );

				
			
				
									/**
				 * Allow value overriding for display.
				 *
				 * @filter plus_backorder_cart_item_data_available_qty
				 * @param string Cleaned up available quantity.
				 * @param array Cart item data
				 * @return string Available quantity for display.
				 */
				$value_for_display = apply_filters( 'plus_backorder_cart_item_data_available_qty', wc_clean( $available_qty ), $cart_item_data );

				
			
				
							/**
		 * Show ordered quantity in cart.
		 *
		 * @filter plus_backorder_cart_item_data_show_ordered_qty
		 * @param int Wether or not to show the ordered quantity. ( 0 = no, 1 = yes )
		 * @return int Wether or not to show the ordered quantity. ( 0 = no, 1 = yes )
		 */
		$show_ordered_qty_in_cart = apply_filters( 'plus_backorder_cart_item_data_show_ordered_qty', 1 );

				
			
				
								/**
			 * Override the ordered quantity in cart.
			 *
			 * @filter plus_backorder_cart_item_data_ordered_qty
			 * @param string The ordered quantity
			 * @param array Cart item data
			 * @return string The ordered quantity
			 */
			$ordered_quantity = apply_filters( 'plus_backorder_cart_item_data_ordered_qty', wc_clean( $cart_item_data['ordered_qty']  ), $cart_item_data )
			$item_data[] = array(
				'key'   => __( 'Besteld aantal', 'plus-king-woocommerce' ),
				'value' => wc_clean( $cart_item_data['ordered_qty']  ),
				'display' => $ordered_quantity,
			);
				
			
				
							/**
		 * Show the rest amount in cart.
		 *
		 * @filter plus_backorder_cart_item_data_show_rest_quantity
		 * @param int Wether or not to show the rest quantity. ( 0 = no, 1 = yes )
		 * @return int Wether or not to show the rest quantity. ( 0 = no, 1 = yes )
		 */
		$show_rest_qty_in_cart = apply_filters( 'plus_backorder_cart_item_data_show_rest_quantity', 1 );

				
			
				
								/**
			 * Override the rest quantity text cart.
			 *
			 * @filter plus_backorders_text
			 * @param string The text to show for backorders
			 * @return string The text to show for backorders
			 */
			$reserveren_text = apply_filters( 'plus_backorders_text', __( 'Nu te reserveren', 'plus-king-woocommerce' ) );

				
			
				
									/**
				 * Override the rest quantity in cart.
				 *
				 * @filter plus_backorder_cart_item_data_rest_quantity
				 * @param string The rest quantity
				 * @param array Cart item data
				 * @return string The rest quantity
				 */
				$rest_quantity = apply_filters( 'plus_backorder_cart_item_data_rest_quantity', wc_clean( $cart_item_data['rest_quantity']  ), $cart_item_data );