← All changes
|
app/Elementor/Widgets/Controls/CheckoutPaymentSettings.php
+117
-286
2.1.11
→
1.1.4
View file →
| @@ -1,286 +1,117 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Main ProductDescription class. | |
| 4 | - * | |
| 5 | - * @package RadiusTheme\SB | |
| 6 | - */ | |
| 7 | - | |
| 8 | -namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | - | |
| 10 | -// Do not allow directly accessing this file. | |
| 11 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | - exit( 'This script cannot be accessed directly.' ); | |
| 13 | -} | |
| 14 | - | |
| 15 | -/** | |
| 16 | - * Product Description class | |
| 17 | - */ | |
| 18 | -class CheckoutPaymentSettings { | |
| 19 | - | |
| 20 | - /** | |
| 21 | - * Widget Field | |
| 22 | - * | |
| 23 | - * @return array | |
| 24 | - */ | |
| 25 | - public static function widget_fields( $widget ) { | |
| 26 | - return self::general_settings( $widget ) + ButtonSettings::style_settings( $widget ); | |
| 27 | - } | |
| 28 | - | |
| 29 | - /** | |
| 30 | - * Widget Field | |
| 31 | - * | |
| 32 | - * @return array | |
| 33 | - */ | |
| 34 | - public static function general_settings( $widget ) { | |
| 35 | - $selector = $widget->selectors; | |
| 36 | - return [ | |
| 37 | - 'payment_method_start' => [ | |
| 38 | - 'mode' => 'section_start', | |
| 39 | - 'label' => esc_html__( 'Payment Method', 'shopbuilder' ), | |
| 40 | - 'tab' => 'style', | |
| 41 | - ], | |
| 42 | - | |
| 43 | - 'payment_method_wrapper' => [ | |
| 44 | - 'type' => 'html', | |
| 45 | - 'raw' => sprintf( | |
| 46 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 47 | - esc_html__( 'Wrapper', 'shopbuilder' ) | |
| 48 | - ), | |
| 49 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 50 | - ], | |
| 51 | - 'payment_method_wrapper_bg_color' => [ | |
| 52 | - 'label' => esc_html__( 'Wrapper Background Color', 'shopbuilder' ), | |
| 53 | - 'type' => 'color', | |
| 54 | - | |
| 55 | - 'selectors' => [ | |
| 56 | - $selector['payment_method_wrapper_bg_color'] => 'background-color: {{VALUE}};', | |
| 57 | - ], | |
| 58 | - ], | |
| 59 | - 'payment_tabs_start' => [ | |
| 60 | - 'mode' => 'tabs_start', | |
| 61 | - ], | |
| 62 | - 'payment_normal' => [ | |
| 63 | - 'mode' => 'tab_start', | |
| 64 | - 'label' => esc_html__( 'Normal', 'shopbuilder' ), | |
| 65 | - ], | |
| 66 | - | |
| 67 | - 'payment_link_color' => [ | |
| 68 | - 'label' => esc_html__( 'Link Color', 'shopbuilder' ), | |
| 69 | - 'type' => 'color', | |
| 70 | - 'selectors' => [ | |
| 71 | - $selector['payment_link_color'] => 'color: {{VALUE}};', | |
| 72 | - ], | |
| 73 | - ], | |
| 74 | - 'payment_normal_end' => [ | |
| 75 | - 'mode' => 'tab_end', | |
| 76 | - ], | |
| 77 | - 'payment_hover' => [ | |
| 78 | - 'mode' => 'tab_start', | |
| 79 | - 'label' => esc_html__( 'Hover', 'shopbuilder' ), | |
| 80 | - ], | |
| 81 | - | |
| 82 | - 'payment_link_hover_color' => [ | |
| 83 | - 'label' => esc_html__( 'Link Color', 'shopbuilder' ), | |
| 84 | - 'type' => 'color', | |
| 85 | - 'selectors' => [ | |
| 86 | - $selector['payment_link_hover_color'] => 'color: {{VALUE}};', | |
| 87 | - ], | |
| 88 | - ], | |
| 89 | - 'payment_hover_end' => [ | |
| 90 | - 'mode' => 'tab_end', | |
| 91 | - ], | |
| 92 | - 'payment_tabs_end' => [ | |
| 93 | - 'mode' => 'tabs_end', | |
| 94 | - ], | |
| 95 | - | |
| 96 | - 'payment_label_heading' => [ | |
| 97 | - 'type' => 'html', | |
| 98 | - 'raw' => sprintf( | |
| 99 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 100 | - esc_html__( 'Payment Label Text', 'shopbuilder' ) | |
| 101 | - ), | |
| 102 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 103 | - ], | |
| 104 | - | |
| 105 | - 'payment_label_typography' => [ | |
| 106 | - 'mode' => 'group', | |
| 107 | - 'type' => 'typography', | |
| 108 | - 'label' => esc_html__( 'Label Typography', 'shopbuilder' ), | |
| 109 | - 'selector' => $selector['payment_label_typography'], | |
| 110 | - ], | |
| 111 | - 'payment_label_color' => [ | |
| 112 | - 'label' => esc_html__( 'Label Color', 'shopbuilder' ), | |
| 113 | - 'type' => 'color', | |
| 114 | - 'selectors' => [ | |
| 115 | - $selector['payment_label_color'] => 'color: {{VALUE}};', | |
| 116 | - ], | |
| 117 | - ], | |
| 118 | - 'payment_label_active_hover_color' => [ | |
| 119 | - 'label' => esc_html__( 'Label Active/Hover Color', 'shopbuilder' ), | |
| 120 | - 'type' => 'color', | |
| 121 | - 'selectors' => [ | |
| 122 | - $selector['payment_label_active_hover_color'] => 'color: {{VALUE}};', | |
| 123 | - ], | |
| 124 | - ], | |
| 125 | - // 'payment_label_bg_color' => [ | |
| 126 | - // 'label' => esc_html__( 'Label Background Color', 'shopbuilder' ), | |
| 127 | - // 'type' => 'color', | |
| 128 | - // | |
| 129 | - // 'selectors' => [ | |
| 130 | - // $selector['payment_label_bg_color'] => 'background-color: {{VALUE}};', | |
| 131 | - // ], | |
| 132 | - // ], | |
| 133 | - 'payment_method_space_between' => [ | |
| 134 | - 'label' => esc_html__( 'Space Between (px)', 'shopbuilder' ), | |
| 135 | - 'type' => 'slider', | |
| 136 | - 'size_units' => [ 'px' ], | |
| 137 | - 'range' => [ | |
| 138 | - 'px' => [ | |
| 139 | - 'min' => 0, | |
| 140 | - 'max' => 100, | |
| 141 | - 'step' => 1, | |
| 142 | - ], | |
| 143 | - ], | |
| 144 | - 'selectors' => [ | |
| 145 | - $selector['payment_method_space_between'] => 'margin-right: {{SIZE}}{{UNIT}} !important', | |
| 146 | - ], | |
| 147 | - ], | |
| 148 | - 'payment_method_bacs_padding' => [ | |
| 149 | - 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), | |
| 150 | - 'mode' => 'responsive', | |
| 151 | - 'type' => 'dimensions', | |
| 152 | - 'size_units' => [ 'px' ], | |
| 153 | - 'selectors' => [ | |
| 154 | - $selector['payment_method_bacs_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 155 | - ], | |
| 156 | - ], | |
| 157 | - 'payment_method_wrap_padding' => [ | |
| 158 | - 'label' => esc_html__( 'Wrapper Padding (px)', 'shopbuilder' ), | |
| 159 | - 'mode' => 'responsive', | |
| 160 | - 'type' => 'dimensions', | |
| 161 | - 'size_units' => [ 'px' ], | |
| 162 | - 'selectors' => [ | |
| 163 | - $selector['payment_method_wrap_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', | |
| 164 | - ], | |
| 165 | - ], | |
| 166 | - 'payment_method_bacs_margin' => [ | |
| 167 | - 'label' => esc_html__( 'Margin (px)', 'shopbuilder' ), | |
| 168 | - 'mode' => 'responsive', | |
| 169 | - 'type' => 'dimensions', | |
| 170 | - 'size_units' => [ 'px' ], | |
| 171 | - 'selectors' => [ | |
| 172 | - $selector['payment_method_bacs_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 173 | - ], | |
| 174 | - ], | |
| 175 | - | |
| 176 | - 'payment_description_heading' => [ | |
| 177 | - 'type' => 'html', | |
| 178 | - 'raw' => sprintf( | |
| 179 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 180 | - esc_html__( 'Payment Description', 'shopbuilder' ) | |
| 181 | - ), | |
| 182 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 183 | - ], | |
| 184 | - 'payment_description_typography' => [ | |
| 185 | - 'mode' => 'group', | |
| 186 | - 'type' => 'typography', | |
| 187 | - 'separator' => 'before', | |
| 188 | - 'label' => esc_html__( 'Description Typography', 'shopbuilder' ), | |
| 189 | - 'selector' => $selector['payment_description_typography'], | |
| 190 | - ], | |
| 191 | - 'payment_description_text_color' => [ | |
| 192 | - 'label' => esc_html__( 'Description Text Color', 'shopbuilder' ), | |
| 193 | - 'type' => 'color', | |
| 194 | - 'selectors' => [ | |
| 195 | - $selector['payment_description_text_color'] => 'color: {{VALUE}};', | |
| 196 | - ], | |
| 197 | - ], | |
| 198 | - 'payment_description_bg_color' => [ | |
| 199 | - 'label' => esc_html__( 'Description Background Color', 'shopbuilder' ), | |
| 200 | - 'type' => 'color', | |
| 201 | - | |
| 202 | - 'selectors' => [ | |
| 203 | - $selector['payment_description_bg_color'] => 'background-color: {{VALUE}};', | |
| 204 | - $selector['payment_description_bg_color'] . ':before' => 'border-bottom-color: {{VALUE}};', | |
| 205 | - ], | |
| 206 | - ], | |
| 207 | - 'payment_description_border' => [ | |
| 208 | - 'mode' => 'group', | |
| 209 | - 'type' => 'border', | |
| 210 | - 'label' => esc_html__( 'Border', 'shopbuilder' ), | |
| 211 | - 'selector' => $selector['payment_description_border'], | |
| 212 | - 'size_units' => [ 'px' ], | |
| 213 | - ], | |
| 214 | - 'payment_method_desc_padding' => [ | |
| 215 | - 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), | |
| 216 | - 'mode' => 'responsive', | |
| 217 | - 'type' => 'dimensions', | |
| 218 | - 'size_units' => [ 'px' ], | |
| 219 | - 'selectors' => [ | |
| 220 | - $selector['payment_method_desc_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 221 | - ], | |
| 222 | - ], | |
| 223 | - 'payment_method_desc_margin' => [ | |
| 224 | - 'label' => esc_html__( 'Margin (px)', 'shopbuilder' ), | |
| 225 | - 'mode' => 'responsive', | |
| 226 | - 'type' => 'dimensions', | |
| 227 | - 'size_units' => [ 'px' ], | |
| 228 | - 'selectors' => [ | |
| 229 | - $selector['payment_method_desc_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 230 | - ], | |
| 231 | - ], | |
| 232 | - 'payment_button_area' => [ | |
| 233 | - 'type' => 'html', | |
| 234 | - 'raw' => sprintf( | |
| 235 | - '<h3 class="rtsb-elementor-group-heading">%s</h3>', | |
| 236 | - esc_html__( 'Payment Button Area', 'shopbuilder' ) | |
| 237 | - ), | |
| 238 | - 'content_classes' => 'elementor-panel-heading-title', | |
| 239 | - ], | |
| 240 | - 'payment_button_description_typography' => [ | |
| 241 | - 'mode' => 'group', | |
| 242 | - 'type' => 'typography', | |
| 243 | - 'separator' => 'before', | |
| 244 | - 'label' => esc_html__( 'Description Typography', 'shopbuilder' ), | |
| 245 | - 'selector' => $selector['payment_button_description_typography'], | |
| 246 | - ], | |
| 247 | - 'payment_button_description_text_color' => [ | |
| 248 | - 'label' => esc_html__( 'Description Text Color', 'shopbuilder' ), | |
| 249 | - 'type' => 'color', | |
| 250 | - 'selectors' => [ | |
| 251 | - $selector['payment_button_description_text_color'] => 'color: {{VALUE}};', | |
| 252 | - ], | |
| 253 | - ], | |
| 254 | - 'payment_button_description_bg_color' => [ | |
| 255 | - 'label' => esc_html__( 'Description Background Color', 'shopbuilder' ), | |
| 256 | - 'type' => 'color', | |
| 257 | - | |
| 258 | - 'selectors' => [ | |
| 259 | - $selector['payment_button_description_bg_color'] => 'background-color: {{VALUE}};', | |
| 260 | - ], | |
| 261 | - ], | |
| 262 | - 'payment_button_wrapper_padding' => [ | |
| 263 | - 'label' => esc_html__( 'Padding (px)', 'shopbuilder' ), | |
| 264 | - 'mode' => 'responsive', | |
| 265 | - 'type' => 'dimensions', | |
| 266 | - 'size_units' => [ 'px' ], | |
| 267 | - 'selectors' => [ | |
| 268 | - $selector['payment_button_wrapper_padding'] => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 269 | - ], | |
| 270 | - ], | |
| 271 | - 'payment_button_wrapper_margin' => [ | |
| 272 | - 'label' => esc_html__( 'Margin (px)', 'shopbuilder' ), | |
| 273 | - 'mode' => 'responsive', | |
| 274 | - 'type' => 'dimensions', | |
| 275 | - 'size_units' => [ 'px' ], | |
| 276 | - 'selectors' => [ | |
| 277 | - $selector['payment_button_wrapper_margin'] => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 278 | - ], | |
| 279 | - ], | |
| 280 | - | |
| 281 | - 'paymeny_method_end' => [ | |
| 282 | - 'mode' => 'section_end', | |
| 283 | - ], | |
| 284 | - ]; | |
| 285 | - } | |
| 286 | -} | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Main ProductDescription class. | |
| 4 | + * | |
| 5 | + * @package RadiusTheme\SB | |
| 6 | + */ | |
| 7 | + | |
| 8 | +namespace RadiusTheme\SB\Elementor\Widgets\Controls; | |
| 9 | + | |
| 10 | +// Do not allow directly accessing this file. | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit( 'This script cannot be accessed directly.' ); | |
| 13 | +} | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * Product Description class | |
| 17 | + */ | |
| 18 | +class CheckoutPaymentSettings { | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * Widget Field | |
| 22 | + * | |
| 23 | + * @return array | |
| 24 | + */ | |
| 25 | + public static function widget_fields( $widget ) { | |
| 26 | + return self::general_settings( $widget ) + ButtonSettings::style_settings( $widget ); | |
| 27 | + } | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * Widget Field | |
| 31 | + * | |
| 32 | + * @return array | |
| 33 | + */ | |
| 34 | + public static function general_settings( $widget ){ | |
| 35 | + $selector = $widget->selectors; | |
| 36 | + return [ | |
| 37 | + 'payment_method_start' => [ | |
| 38 | + 'mode' => 'section_start', | |
| 39 | + 'label' => esc_html__( 'Payment Method', 'shopbuilder' ), | |
| 40 | + 'tab' => 'style', | |
| 41 | + ], | |
| 42 | + 'payment_label_typography' => [ | |
| 43 | + 'mode' => 'group', | |
| 44 | + 'type' => 'typography', | |
| 45 | + 'label' => esc_html__( 'Label Typography', 'shopbuilder' ), | |
| 46 | + 'selector' => $selector['payment_label_typography'], | |
| 47 | + ], | |
| 48 | + 'payment_description_typography' => [ | |
| 49 | + 'mode' => 'group', | |
| 50 | + 'type' => 'typography', | |
| 51 | + 'separator' => 'before', | |
| 52 | + 'label' => esc_html__( 'Description Typography', 'shopbuilder' ), | |
| 53 | + 'selector' => $selector['payment_description_typography'], | |
| 54 | + ], | |
| 55 | + | |
| 56 | + 'payment_tabs_start' => [ | |
| 57 | + 'mode' => 'tabs_start', | |
| 58 | + ], | |
| 59 | + 'payment_normal' => [ | |
| 60 | + 'mode' => 'tab_start', | |
| 61 | + 'label' => esc_html__('Normal', 'shopbuilder'), | |
| 62 | + ], | |
| 63 | + 'payment_label_color' => [ | |
| 64 | + 'label' => esc_html__( 'Label Color', 'shopbuilder' ), | |
| 65 | + 'type' => 'color', | |
| 66 | + 'separator' => 'default', | |
| 67 | + 'selectors' => [ | |
| 68 | + $selector['payment_label_color'] => 'color: {{VALUE}};', | |
| 69 | + ], | |
| 70 | + ], | |
| 71 | + 'payment_link_color' => [ | |
| 72 | + 'label' => esc_html__( 'Link Color', 'shopbuilder' ), | |
| 73 | + 'type' => 'color', | |
| 74 | + 'selectors' => [ | |
| 75 | + $selector['payment_link_color'] => 'color: {{VALUE}};', | |
| 76 | + ], | |
| 77 | + ], | |
| 78 | + 'payment_normal_end' => [ | |
| 79 | + 'mode' => 'tab_end', | |
| 80 | + ], | |
| 81 | + 'payment_hover' => [ | |
| 82 | + 'mode' => 'tab_start', | |
| 83 | + 'label' => esc_html__('Hover', 'shopbuilder'), | |
| 84 | + ], | |
| 85 | + 'payment_label_hover_color' => [ | |
| 86 | + 'label' => esc_html__( 'Label Color', 'shopbuilder' ), | |
| 87 | + 'type' => 'color', | |
| 88 | + 'separator' => 'default', | |
| 89 | + 'selectors' => [ | |
| 90 | + $selector['payment_label_hover_color'] => 'color: {{VALUE}};', | |
| 91 | + ], | |
| 92 | + ], | |
| 93 | + 'payment_link_hover_color' => [ | |
| 94 | + 'label' => esc_html__( 'Link Color', 'shopbuilder' ), | |
| 95 | + 'type' => 'color', | |
| 96 | + 'selectors' => [ | |
| 97 | + $selector['payment_link_hover_color'] => 'color: {{VALUE}};', | |
| 98 | + ], | |
| 99 | + ], | |
| 100 | + 'payment_hover_end' => [ | |
| 101 | + 'mode' => 'tab_end', | |
| 102 | + ], | |
| 103 | + 'payment_tabs_end' => [ | |
| 104 | + 'mode' => 'tabs_end', | |
| 105 | + ], | |
| 106 | + | |
| 107 | + 'paymeny_method_end' => [ | |
| 108 | + 'mode' => 'section_end', | |
| 109 | + ], | |
| 110 | + ]; | |
| 111 | + } | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | +} | |
| 116 | + | |
| 117 | + | |