<?php
namespace SabaiApps\Directories\Component\PaymentGateway\FieldWidget;

use SabaiApps\Directories\Component\Entity\FieldWidget\ReferenceFieldWidget;
use SabaiApps\Directories\Component\Field\IField;
use SabaiApps\Directories\Component\Entity\Type\IEntity;

class PlanDiscountFieldWidget extends ReferenceFieldWidget {
	public function fieldWidgetForm( IField $field, array $settings, $value = null, ?IEntity $entity = null, array $parents = array(), $language = null ) {
		if ( ! $form = parent::fieldWidgetForm( $field, $settings, $value, $entity, $parents, $language ) ) {
			return;
		}
		$form['#description'] = __( 'Apply a discount to this payment plan by default. Users can still enter other discount codes at checkout if applicable.', 'directories-pro' );
		return $form;
	}
}
