PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / frm-fields / front-end / product-single.php

product-single.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More trunk, at classes/views/frm-fields/front-end/product-single.php

36 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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