PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
tier-pricing-table / views / admin / components / regular-pricing-form.php

regular-pricing-form.php in Tiered Pricing Table for WooCommerce 8.0.2, at views/admin/components/regular-pricing-form.php

161 lines 6.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use TierPricingTable\Forms\Form;
4
5 if ( ! defined( 'WPINC' ) ) {
6 die;
7 }
8 /**
9 * Available variables
10 *
11 * @var float $regular_price
12 * @var float $sale_price
13 * @var float $discount
14 * @var float $discount_type
15 * @var string $pricing_type
16 *
17 * @var string $role
18 * @var string $loop
19 */
20
21 ?>
22
23 <div class="tpt_regular_pricing_form <?php echo esc_attr( ! is_null( $loop ) ? 'form-row' : '' ); ?>">
24
25 <p class="form-field">
26
27 <label for="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>">
28 <?php esc_attr_e( 'Pricing type', 'tier-pricing-table' ); ?>
29 </label>
30 <?php if ( ! is_null( $loop ) ) : ?>
31 <select name="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>"
32 id="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>"
33 data-tiered-price-pricing-type-selector>
34 <option value="flat" <?php selected( 'flat', $pricing_type ); ?>>
35 <?php esc_attr_e( 'Flat prices', 'tier-pricing-table' ); ?>
36 </option>
37 <option value="percentage" <?php selected( 'percentage', $pricing_type ); ?>>
38 <?php esc_attr_e( 'Percentage discount', 'tier-pricing-table' ); ?>
39 </option>
40 </select>
41 <?php else : ?>
42 <label for="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>-flat"
43 style="padding: 0; float: none; width: auto; margin: 0;">
44 <input type="radio"
45 data-tiered-price-pricing-type-selector
46 style="margin-right: 3px;"
47 value="flat"
48 <?php checked( 'flat', $pricing_type ); ?>
49 name="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>"
50 id="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>-flat"
51 >
52 <?php esc_attr_e( 'Flat prices', 'tier-pricing-table' ); ?>
53 </label>
54
55 <label for="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>-percentage"
56 style="padding: 0; float: none; width: auto; margin: 0 5px 0 20px;">
57 <input type="radio"
58 data-tiered-price-pricing-type-selector
59 value="percentage"
60 style="margin-right: 3px;"
61 <?php checked( 'percentage', $pricing_type ); ?>
62 name="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>"
63 id="<?php echo esc_attr( Form::getFieldName( 'pricing_type', $role, $loop ) ); ?>-percentage"
64 >
65 <?php esc_attr_e( 'Percentage discount', 'tier-pricing-table' ); ?>
66 </label>
67 <?php endif; ?>
68 </p>
69
70 <p class="form-field tiered_pricing_discount_field <?php echo 'flat' === $pricing_type ? 'hidden' : ''; ?>"
71 data-tiered-price-pricing-type
72 data-tiered-price-pricing-type-percentage>
73
74 <label for="<?php echo esc_attr( Form::getFieldName( 'discount', $role, $loop ) ); ?>">
75 <?php esc_attr_e( 'Discount (%)', 'tier-pricing-table' ); ?>
76 </label>
77
78 <input <?php echo ! tpt_fs()->can_use_premium_code() ? 'disabled' : ''; ?>
79 type="number"
80 min="0"
81 max="100"
82 step="any"
83 value="<?php echo esc_attr( $discount ); ?>"
84 placeholder="<?php esc_attr_e( 'Leave blank to not apply any', 'tier-pricing-table' ); ?>"
85 id="<?php echo esc_attr( Form::getFieldName( 'discount', $role, $loop ) ); ?>"
86 name="<?php echo esc_attr( Form::getFieldName( 'discount', $role, $loop ) ); ?>">
87 </p>
88
89 <p class="form-field tiered_pricing_discount_type_field <?php echo 'flat' === $pricing_type ? 'hidden' : ''; ?>"
90 data-tiered-price-pricing-type
91 data-tiered-price-pricing-type-percentage>
92
93 <label for="<?php echo esc_attr( Form::getFieldName( 'discount_type', $role, $loop ) ); ?>">
94 <?php esc_attr_e( 'Set discounted price as', 'tier-pricing-table' ); ?>
95 </label>
96
97 <label for="<?php echo esc_attr( Form::getFieldName( 'discount_type', $role, $loop ) ); ?>-sale_price"
98 style="padding: 0; float: none; width: auto; margin: 0;">
99 <input type="radio"
100 style="margin-right: 3px;"
101 value="sale_price"
102 <?php checked( 'sale_price', $discount_type ); ?>
103 name="<?php echo esc_attr( Form::getFieldName( 'discount_type', $role, $loop ) ); ?>"
104 id="<?php echo esc_attr( Form::getFieldName( 'discount_type', $role, $loop ) ); ?>-sale_price"
105 >
106 <?php esc_attr_e( 'Sale price', 'tier-pricing-table' ); ?>
107 </label>
108
109
110 <label for="<?php echo esc_attr( Form::getFieldName( 'discount_type', $role, $loop ) ); ?>-regular_price"
111 style="padding: 0; float: none; width: auto; margin: 0 5px 0 20px;">
112 <input type="radio"
113 value="regular_price"
114 style="margin-right: 3px;"
115 <?php checked( 'regular_price', $discount_type ); ?>
116 name="<?php echo esc_attr( Form::getFieldName( 'discount_type', $role, $loop ) ); ?>"
117 id="<?php echo esc_attr( Form::getFieldName( 'discount_type', $role, $loop ) ); ?>-regular_price"
118 >
119 <?php esc_attr_e( 'Regular price', 'tier-pricing-table' ); ?>
120 </label>
121 </p>
122
123 <p class="form-field <?php echo 'percentage' === $pricing_type ? 'hidden' : ''; ?>"
124 data-tiered-price-pricing-type
125 data-tiered-price-pricing-type-flat>
126
127 <label for="<?php echo esc_attr( Form::getFieldName( 'regular_price', $role, $loop ) ); ?>">
128 <?php
129 echo esc_attr( __( 'Regular price',
130 'tier-pricing-table' ) . ' (' . get_woocommerce_currency_symbol() . ')' );
131 ?>
132 </label>
133
134 <input <?php echo ! tpt_fs()->can_use_premium_code() ? 'disabled' : ''; ?>
135 type="text"
136 value="<?php echo esc_attr( wc_format_localized_price( $regular_price ) ); ?>"
137 placeholder="<?php esc_attr_e( 'Leave blank to keep unchanged', 'tier-pricing-table' ); ?>"
138 class="wc_input_price"
139 name="<?php echo esc_attr( Form::getFieldName( 'regular_price', $role, $loop ) ); ?>"
140 id="<?php echo esc_attr( Form::getFieldName( 'regular_price', $role, $loop ) ); ?>">
141 </p>
142
143 <p class="form-field <?php echo 'percentage' === $pricing_type ? 'hidden' : ''; ?>"
144 data-tiered-price-pricing-type
145 data-tiered-price-pricing-type-flat>
146 <label for="<?php echo esc_attr( Form::getFieldName( 'sale_price', $role, $loop ) ); ?>">
147 <?php
148 echo esc_attr( __( 'Sale price', 'tier-pricing-table' ) . ' (' . get_woocommerce_currency_symbol() . ')' );
149 ?>
150 </label>
151
152 <input <?php echo ! tpt_fs()->can_use_premium_code() ? 'disabled' : ''; ?>
153 type="text"
154 value="<?php echo esc_attr( wc_format_localized_price( $sale_price ) ); ?>"
155 placeholder="<?php esc_attr_e( 'Leave blank to keep unchanged', 'tier-pricing-table' ); ?>"
156 class="wc_input_price"
157 id="<?php echo esc_attr( Form::getFieldName( 'sale_price', $role, $loop ) ); ?>"
158 name="<?php echo esc_attr( Form::getFieldName( 'sale_price', $role, $loop ) ); ?>">
159 </p>
160 </div>
161