Inventory_Presser_Options::callback_price_display()

callback_price_display


Description Description

Outputs a dropdown select control for the Price Display setting


Top ↑

Return Return

(void)


Top ↑

Source Source

File: includes/class-dealership-options.php

	function callback_price_display()
	{
		$price_display_options = apply_filters( 'invp_price_display_options', array(
			'default'          => '${Price}',
			'msrp'             => '${MSRP}',
			'full_or_down'     => '${Price} / ${Down Payment} Down',
			'down_only'        => '${Down Payment} Down',
			'was_now_discount' => 'Retail ${MSRP} Now ${Price} You Save ${MSRP}-{Price}',
			'payment_only'     => '${Payment} {Frequency}',
			'down_and_payment' => '${Down payment} / ${Payment} {Frequency}',
			'call_for_price'   => __( 'Call For Price', 'inventory-presser' ),			
		) );

		$selected_val = null;
		if ( isset( $this->option['price_display'] ) )
		{
			$selected_val = $this->option['price_display'];
		}

		printf(
			'<select name="%s[price_display]" id="price_display">',
			INVP::OPTION_NAME
		);
		foreach( $price_display_options as $val => $name )
		{
			printf(
				'<option value="%s"%s>%s</option>',
				$val,
				selected( $val, $selected_val, false ),
				$name
			);
		}
		printf(
			'</select><p class="description" id="%s[price_display]-description">&quot;%s&quot; %s.</p>',
			INVP::OPTION_NAME,
			__( 'Call for Price', 'inventory-presser' ),
			__( 'will display for any price that is zero', 'inventory-presser' )
		);
	}