| 1 |
<?php |
| 2 |
/** |
| 3 |
* Show the product field as radio button or checkbox on the front-end. |
| 4 |
* Extra line breaks show as space on the front-end when |
| 5 |
* the form is double filtered and not minimized. |
| 6 |
* |
| 7 |
* @since 6.30 This is copied from the Formidable Pro plugin. |
| 8 |
* |
| 9 |
* @package Formidable |
| 10 |
* |
| 11 |
* @var bool $hide_label |
| 12 |
*/ |
| 13 |
|
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
die( 'You are not allowed to call this page directly.' ); |
| 16 |
} |
| 17 |
|
| 18 |
foreach ( $field['options'] as $opt_key => $opt ) { |
| 19 |
$field_val = FrmFieldsHelper::get_value_from_array( $opt, $opt_key, $field ); |
| 20 |
$price = FrmFieldProduct::get_price_from_array( $opt, $opt_key, $field ); |
| 21 |
$opt = FrmFieldsHelper::get_label_from_array( $opt, $opt_key, $field ); |
| 22 |
?> |
| 23 |
<p class="frm_single_product_label"> |
| 24 |
<?php |
| 25 |
echo esc_html( $opt ); |
| 26 |
echo ': '; |
| 27 |
echo esc_html( FrmCurrencyHelper::format_price( $price ) ); |
| 28 |
?> |
| 29 |
</p> |
| 30 |
|
| 31 |
<input type="hidden" name="<?php echo esc_attr( $field_name ); ?>" id="<?php echo esc_attr( $html_id ); ?>" value="<?php echo esc_attr( $field_val ); ?>" data-frmprice="<?php echo esc_attr( $price ); ?>" <?php do_action( 'frm_field_input_html', $field ); ?> /> |
| 32 |
<?php |
| 33 |
// We want just the first. |
| 34 |
break; |
| 35 |
} |
| 36 |
|