woo-checkout-field-editor-pro
Last commit date
assets
6 years ago
classes
6 years ago
languages
6 years ago
checkout-form-designer.php
6 years ago
readme.txt
6 years ago
checkout-form-designer.php
502 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Checkout Field Editor for WooCommerce |
| 4 | * Description: Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields). |
| 5 | * Author: ThemeHiGH |
| 6 | * Version: 1.3.5 |
| 7 | * Author URI: https://www.themehigh.com |
| 8 | * Plugin URI: https://www.themehigh.com |
| 9 | * Text Domain: woo-checkout-field-editor-pro |
| 10 | * Domain Path: /languages |
| 11 | * WC requires at least: 3.0.0 |
| 12 | * WC tested up to: 3.7.0 |
| 13 | */ |
| 14 | |
| 15 | if(!defined( 'ABSPATH' )) exit; |
| 16 | |
| 17 | if (!function_exists('is_woocommerce_active')){ |
| 18 | function is_woocommerce_active(){ |
| 19 | $active_plugins = (array) get_option('active_plugins', array()); |
| 20 | if(is_multisite()){ |
| 21 | $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array())); |
| 22 | } |
| 23 | return in_array('woocommerce/woocommerce.php', $active_plugins) || array_key_exists('woocommerce/woocommerce.php', $active_plugins); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | if(is_woocommerce_active()) { |
| 28 | function thwcfd_load_plugin_textdomain(){ |
| 29 | $locale = apply_filters('plugin_locale', get_locale(), 'woo-checkout-field-editor-pro'); |
| 30 | |
| 31 | load_textdomain('woo-checkout-field-editor-pro', WP_LANG_DIR.'/woo-checkout-field-editor-pro/woo-checkout-field-editor-pro-'.$locale.'.mo'); |
| 32 | load_plugin_textdomain('woo-checkout-field-editor-pro', false, dirname(TH_WCFD_BASE_NAME) . '/languages/'); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * woocommerce_init_checkout_field_editor function. |
| 37 | */ |
| 38 | function thwcfd_init_checkout_field_editor_lite() { |
| 39 | global $supress_field_modification; |
| 40 | $supress_field_modification = false; |
| 41 | |
| 42 | define('TH_WCFD_VERSION', '1.3.5'); |
| 43 | !defined('TH_WCFD_BASE_NAME') && define('TH_WCFD_BASE_NAME', plugin_basename( __FILE__ )); |
| 44 | !defined('TH_WCFD_URL') && define('TH_WCFD_URL', plugins_url( '/', __FILE__ )); |
| 45 | !defined('TH_WCFD_ASSETS_URL') && define('TH_WCFD_ASSETS_URL', TH_WCFD_URL . 'assets/'); |
| 46 | |
| 47 | thwcfd_load_plugin_textdomain(); |
| 48 | |
| 49 | if(!class_exists('WC_Checkout_Field_Editor')){ |
| 50 | require_once('classes/class-wc-checkout-field-editor.php'); |
| 51 | } |
| 52 | |
| 53 | $GLOBALS['WC_Checkout_Field_Editor'] = new WC_Checkout_Field_Editor(); |
| 54 | } |
| 55 | add_action('init', 'thwcfd_init_checkout_field_editor_lite'); |
| 56 | |
| 57 | function thwcfd_is_locale_field( $field_name ){ |
| 58 | if(!empty($field_name) && in_array($field_name, array( |
| 59 | 'billing_address_1', 'billing_address_2', 'billing_state', 'billing_postcode', 'billing_city', |
| 60 | 'shipping_address_1', 'shipping_address_2', 'shipping_state', 'shipping_postcode', 'shipping_city', |
| 61 | ))){ |
| 62 | return true; |
| 63 | } |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | function thwcfd_woocommerce_version_check( $version = '3.0' ) { |
| 68 | if(function_exists( 'is_woocommerce_active' ) && is_woocommerce_active() ) { |
| 69 | global $woocommerce; |
| 70 | if( version_compare( $woocommerce->version, $version, ">=" ) ) { |
| 71 | return true; |
| 72 | } |
| 73 | } |
| 74 | return false; |
| 75 | } |
| 76 | |
| 77 | function thwcfd_enqueue_scripts(){ |
| 78 | global $wp_scripts; |
| 79 | |
| 80 | if(is_checkout()){ |
| 81 | $in_footer = apply_filters( 'thwcfd_enqueue_script_in_footer', true ); |
| 82 | |
| 83 | wp_register_script('thwcfd-field-editor-script', TH_WCFD_ASSETS_URL.'js/thwcfd-checkout-field-editor-frontend.js', |
| 84 | array('jquery', 'select2'), TH_WCFD_VERSION, $in_footer); |
| 85 | |
| 86 | wp_enqueue_script('thwcfd-field-editor-script'); |
| 87 | } |
| 88 | } |
| 89 | add_action('wp_enqueue_scripts', 'thwcfd_enqueue_scripts'); |
| 90 | |
| 91 | /** |
| 92 | * Hide Additional Fields title if no fields available. |
| 93 | * |
| 94 | * @param mixed $old |
| 95 | */ |
| 96 | function thwcfd_enable_order_notes_field() { |
| 97 | global $supress_field_modification; |
| 98 | |
| 99 | if($supress_field_modification){ |
| 100 | return $fields; |
| 101 | } |
| 102 | |
| 103 | $additional_fields = get_option('wc_fields_additional'); |
| 104 | if(is_array($additional_fields)){ |
| 105 | $enabled = 0; |
| 106 | foreach($additional_fields as $field){ |
| 107 | if($field['enabled']){ |
| 108 | $enabled++; |
| 109 | } |
| 110 | } |
| 111 | return $enabled > 0 ? true : false; |
| 112 | } |
| 113 | return true; |
| 114 | } |
| 115 | add_filter('woocommerce_enable_order_notes_field', 'thwcfd_enable_order_notes_field', 1000); |
| 116 | |
| 117 | function thwcfd_woo_default_address_fields( $fields ) { |
| 118 | $sname = apply_filters('thwcfd_address_field_override_with', 'billing'); |
| 119 | |
| 120 | if($sname === 'billing' || $sname === 'shipping'){ |
| 121 | $address_fields = get_option('wc_fields_'.$sname); |
| 122 | |
| 123 | if(is_array($address_fields) && !empty($address_fields) && !empty($fields)){ |
| 124 | $override_required = apply_filters( 'thwcfd_address_field_override_required', true ); |
| 125 | |
| 126 | foreach($fields as $name => $field) { |
| 127 | $fname = $sname.'_'.$name; |
| 128 | |
| 129 | if(thwcfd_is_locale_field($fname) && $override_required){ |
| 130 | $custom_field = isset($address_fields[$fname]) ? $address_fields[$fname] : false; |
| 131 | |
| 132 | if($custom_field && !( isset($custom_field['enabled']) && $custom_field['enabled'] == false )){ |
| 133 | $fields[$name]['required'] = isset($custom_field['required']) && $custom_field['required'] ? true : false; |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | return $fields; |
| 141 | } |
| 142 | add_filter('woocommerce_default_address_fields' , 'thwcfd_woo_default_address_fields', apply_filters('thwcfd_default_address_fields_priority', 1000) ); |
| 143 | |
| 144 | function thwcfd_prepare_country_locale($fields) { |
| 145 | if(is_array($fields)){ |
| 146 | $sname = apply_filters('thwcfd_address_field_override_with', 'billing'); |
| 147 | $address_fields = get_option('wc_fields_'.$sname); |
| 148 | |
| 149 | foreach($fields as $key => $props){ |
| 150 | $override_ph = apply_filters('thwcfd_address_field_override_placeholder', true); |
| 151 | $override_label = apply_filters('thwcfd_address_field_override_label', true); |
| 152 | $override_required = apply_filters('thwcfd_address_field_override_required', false); |
| 153 | $override_priority = apply_filters('thwcfd_address_field_override_priority', true); |
| 154 | |
| 155 | if($override_ph && isset($props['placeholder'])){ |
| 156 | unset($fields[$key]['placeholder']); |
| 157 | } |
| 158 | if($override_label && isset($props['label'])){ |
| 159 | unset($fields[$key]['label']); |
| 160 | } |
| 161 | if($override_required && isset($props['required'])){ |
| 162 | $fkey = $sname.'_'.$key; |
| 163 | if(is_array($address_fields) && isset($address_fields[$fkey])){ |
| 164 | $cf_props = $address_fields[$fkey]; |
| 165 | if(is_array($cf_props) && isset($cf_props['required'])){ |
| 166 | $fields[$key]['required'] = $cf_props['required'] ? true : false; |
| 167 | } |
| 168 | } |
| 169 | //unset($fields[$key]['required']); |
| 170 | } |
| 171 | |
| 172 | if($override_priority && isset($props['priority'])){ |
| 173 | unset($fields[$key]['priority']); |
| 174 | //unset($fields[$key]['order']); |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | return $fields; |
| 179 | } |
| 180 | add_filter('woocommerce_get_country_locale_default', 'thwcfd_prepare_country_locale'); |
| 181 | add_filter('woocommerce_get_country_locale_base', 'thwcfd_prepare_country_locale'); |
| 182 | |
| 183 | function thwcfd_woo_get_country_locale($locale) { |
| 184 | if(is_array($locale)){ |
| 185 | foreach($locale as $country => $fields){ |
| 186 | $locale[$country] = thwcfd_prepare_country_locale($fields); |
| 187 | } |
| 188 | } |
| 189 | return $locale; |
| 190 | } |
| 191 | add_filter('woocommerce_get_country_locale', 'thwcfd_woo_get_country_locale'); |
| 192 | |
| 193 | /** |
| 194 | * wc_checkout_fields_modify_billing_fields function. |
| 195 | * |
| 196 | * @param mixed $fields |
| 197 | */ |
| 198 | function thwcfd_billing_fields_lite($fields, $country){ |
| 199 | global $supress_field_modification; |
| 200 | |
| 201 | if($supress_field_modification){ |
| 202 | return $fields; |
| 203 | } |
| 204 | if(is_wc_endpoint_url('edit-address')){ |
| 205 | return $fields; |
| 206 | }else{ |
| 207 | return thwcfd_prepare_address_fields(get_option('wc_fields_billing'), $fields, 'billing', $country); |
| 208 | } |
| 209 | } |
| 210 | add_filter('woocommerce_billing_fields', 'thwcfd_billing_fields_lite', apply_filters('thwcfd_billing_fields_priority', 1000), 2); |
| 211 | |
| 212 | /** |
| 213 | * wc_checkout_fields_modify_shipping_fields function. |
| 214 | * |
| 215 | * @param mixed $old |
| 216 | */ |
| 217 | function thwcfd_shipping_fields_lite($fields, $country){ |
| 218 | global $supress_field_modification; |
| 219 | |
| 220 | if ($supress_field_modification){ |
| 221 | return $fields; |
| 222 | } |
| 223 | if(is_wc_endpoint_url('edit-address')){ |
| 224 | return $fields; |
| 225 | }else{ |
| 226 | return thwcfd_prepare_address_fields(get_option('wc_fields_shipping'), $fields, 'shipping', $country); |
| 227 | } |
| 228 | } |
| 229 | add_filter('woocommerce_shipping_fields', 'thwcfd_shipping_fields_lite', apply_filters('thwcfd_shipping_fields_priority', 1000), 2); |
| 230 | |
| 231 | /** |
| 232 | * wc_checkout_fields_modify_shipping_fields function. |
| 233 | * |
| 234 | * @param mixed $old |
| 235 | */ |
| 236 | function thwcfd_checkout_fields_lite( $fields ) { |
| 237 | global $supress_field_modification; |
| 238 | |
| 239 | if($supress_field_modification){ |
| 240 | return $fields; |
| 241 | } |
| 242 | |
| 243 | if($additional_fields = get_option('wc_fields_additional')){ |
| 244 | if( isset($fields['order']) && is_array($fields['order']) ){ |
| 245 | $fields['order'] = $additional_fields + $fields['order']; |
| 246 | } |
| 247 | |
| 248 | // check if order_comments is enabled/disabled |
| 249 | if(is_array($additional_fields) && !$additional_fields['order_comments']['enabled']){ |
| 250 | unset($fields['order']['order_comments']); |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | if(isset($fields['order']) && is_array($fields['order'])){ |
| 255 | $fields['order'] = thwcfd_prepare_checkout_fields_lite($fields['order'], false); |
| 256 | } |
| 257 | |
| 258 | if(isset($fields['order']) && !is_array($fields['order'])){ |
| 259 | unset($fields['order']); |
| 260 | } |
| 261 | |
| 262 | return $fields; |
| 263 | } |
| 264 | add_filter('woocommerce_checkout_fields', 'thwcfd_checkout_fields_lite', apply_filters('thwcfd_checkout_fields_priority', 1000)); |
| 265 | |
| 266 | /** |
| 267 | * |
| 268 | */ |
| 269 | function thwcfd_prepare_address_fields($fieldset, $original_fieldset = false, $sname = 'billing', $country){ |
| 270 | if(is_array($fieldset) && !empty($fieldset)) { |
| 271 | $locale = WC()->countries->get_country_locale(); |
| 272 | if(isset($locale[ $country ]) && is_array($locale[ $country ])) { |
| 273 | foreach($locale[ $country ] as $key => $value){ |
| 274 | if(is_array($value) && isset($fieldset[$sname.'_'.$key])){ |
| 275 | if(isset($value['required'])){ |
| 276 | $fieldset[$sname.'_'.$key]['required'] = $value['required']; |
| 277 | } |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | $fieldset = thwcfd_prepare_checkout_fields_lite($fieldset, $original_fieldset); |
| 282 | return $fieldset; |
| 283 | }else { |
| 284 | return $original_fieldset; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * checkout_fields_modify_fields function. |
| 290 | * |
| 291 | * @param mixed $data |
| 292 | * @param mixed $old |
| 293 | */ |
| 294 | function thwcfd_prepare_checkout_fields_lite($fields, $original_fields) { |
| 295 | if(is_array($fields) && !empty($fields)) { |
| 296 | foreach($fields as $name => $field) { |
| 297 | if(isset($field['enabled']) && $field['enabled'] == false ) { |
| 298 | unset($fields[$name]); |
| 299 | }else{ |
| 300 | $new_field = false; |
| 301 | $allow_override = apply_filters('thwcfd_allow_default_field_override_'.$name, false); |
| 302 | |
| 303 | if($original_fields && isset($original_fields[$name]) && !$allow_override){ |
| 304 | $new_field = $original_fields[$name]; |
| 305 | |
| 306 | $new_field['label'] = isset($field['label']) ? $field['label'] : ''; |
| 307 | $new_field['placeholder'] = isset($field['placeholder']) ? $field['placeholder'] : ''; |
| 308 | |
| 309 | $new_field['class'] = isset($field['class']) && is_array($field['class']) ? $field['class'] : array(); |
| 310 | $new_field['label_class'] = isset($field['label_class']) && is_array($field['label_class']) ? $field['label_class'] : array(); |
| 311 | $new_field['validate'] = isset($field['validate']) && is_array($field['validate']) ? $field['validate'] : array(); |
| 312 | |
| 313 | /*if(!thwcfd_is_locale_field($name)){ |
| 314 | $new_field['required'] = isset($field['required']) ? $field['required'] : 0; |
| 315 | }*/ |
| 316 | $new_field['required'] = isset($field['required']) ? $field['required'] : 0; |
| 317 | $new_field['clear'] = isset($field['clear']) ? $field['clear'] : 0; |
| 318 | }else{ |
| 319 | $new_field = $field; |
| 320 | } |
| 321 | |
| 322 | if(isset($new_field['type']) && $new_field['type'] === 'select'){ |
| 323 | if(apply_filters('thwcfd_enable_select2_for_select_fields', true)){ |
| 324 | $new_field['input_class'][] = 'thwcfd-enhanced-select'; |
| 325 | } |
| 326 | |
| 327 | if(isset($new_field['options']) && is_array($new_field['options'])){ |
| 328 | $options = array(); |
| 329 | foreach($new_field['options'] as $key => $value) { |
| 330 | $options[$key] = __($value, 'woo-checkout-field-editor-pro'); |
| 331 | } |
| 332 | $new_field['options'] = $options; |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | $new_field['order'] = isset($field['order']) && is_numeric($field['order']) ? $field['order'] : 0; |
| 337 | if(isset($new_field['order']) && is_numeric($new_field['order'])){ |
| 338 | $priority = ($new_field['order']+1)*10; |
| 339 | $new_field['priority'] = $priority; |
| 340 | //$new_field['priority'] = $new_field['order']; |
| 341 | } |
| 342 | |
| 343 | if(isset($new_field['label'])){ |
| 344 | $new_field['label'] = thwcfd__t($new_field['label']); //__($new_field['label'], 'woocommerce'); |
| 345 | } |
| 346 | if(isset($new_field['placeholder'])){ |
| 347 | $new_field['placeholder'] = thwcfd__t($new_field['placeholder']); //__($new_field['placeholder'], 'woocommerce'); |
| 348 | } |
| 349 | |
| 350 | $fields[$name] = $new_field; |
| 351 | } |
| 352 | } |
| 353 | return $fields; |
| 354 | }else { |
| 355 | return $original_fields; |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | /***************************************** |
| 360 | ----- Display Field Values - START ------ |
| 361 | *****************************************/ |
| 362 | |
| 363 | /** |
| 364 | * Display custom fields in emails |
| 365 | * |
| 366 | * @param array $keys |
| 367 | * @return array |
| 368 | */ |
| 369 | function thwcfd_display_custom_fields_in_emails_lite($ofields, $sent_to_admin, $order){ |
| 370 | $custom_fields = array(); |
| 371 | $fields = array_merge(WC_Checkout_Field_Editor::get_fields('billing'), WC_Checkout_Field_Editor::get_fields('shipping'), |
| 372 | WC_Checkout_Field_Editor::get_fields('additional')); |
| 373 | |
| 374 | // Loop through all custom fields to see if it should be added |
| 375 | foreach( $fields as $key => $options ) { |
| 376 | if(isset($options['show_in_email']) && $options['show_in_email']){ |
| 377 | $value = ''; |
| 378 | if(thwcfd_woo_version_check()){ |
| 379 | $value = get_post_meta( $order->get_id(), $key, true ); |
| 380 | }else{ |
| 381 | $value = get_post_meta( $order->id, $key, true ); |
| 382 | } |
| 383 | |
| 384 | if(!empty($value)){ |
| 385 | $label = isset($options['label']) && $options['label'] ? $options['label'] : $key; |
| 386 | $label = esc_attr($label); |
| 387 | |
| 388 | $custom_field = array(); |
| 389 | $custom_field['label'] = thwcfd__t($label); |
| 390 | $custom_field['value'] = $value; |
| 391 | |
| 392 | $custom_fields[$key] = $custom_field; |
| 393 | } |
| 394 | } |
| 395 | } |
| 396 | |
| 397 | return array_merge($ofields, $custom_fields); |
| 398 | } |
| 399 | add_filter('woocommerce_email_order_meta_fields', 'thwcfd_display_custom_fields_in_emails_lite', 10, 3); |
| 400 | |
| 401 | /** |
| 402 | * Display custom checkout fields on view order pages |
| 403 | * |
| 404 | * @param object $order |
| 405 | */ |
| 406 | function thwcfd_order_details_after_customer_details_lite($order){ |
| 407 | if(thwcfd_woocommerce_version_check()){ |
| 408 | $order_id = $order->get_id(); |
| 409 | }else{ |
| 410 | $order_id = $order->id; |
| 411 | } |
| 412 | |
| 413 | $fields = array(); |
| 414 | if(!wc_ship_to_billing_address_only() && $order->needs_shipping_address()){ |
| 415 | $fields = array_merge(WC_Checkout_Field_Editor::get_fields('billing'), WC_Checkout_Field_Editor::get_fields('shipping'), |
| 416 | WC_Checkout_Field_Editor::get_fields('additional')); |
| 417 | }else{ |
| 418 | $fields = array_merge(WC_Checkout_Field_Editor::get_fields('billing'), WC_Checkout_Field_Editor::get_fields('additional')); |
| 419 | } |
| 420 | |
| 421 | if(is_array($fields) && !empty($fields)){ |
| 422 | $fields_html = ''; |
| 423 | // Loop through all custom fields to see if it should be added |
| 424 | foreach($fields as $name => $options){ |
| 425 | $enabled = (isset($options['enabled']) && $options['enabled'] == false) ? false : true; |
| 426 | $is_custom_field = (isset($options['custom']) && $options['custom'] == true) ? true : false; |
| 427 | |
| 428 | if(isset($options['show_in_order']) && $options['show_in_order'] && $enabled && $is_custom_field){ |
| 429 | $value = get_post_meta($order_id, $name, true); |
| 430 | |
| 431 | if(!empty($value)){ |
| 432 | $label = isset($options['label']) && !empty($options['label']) ? __( $options['label'], 'woo-checkout-field-editor-pro' ) : $name; |
| 433 | |
| 434 | if(is_account_page()){ |
| 435 | if(apply_filters( 'thwcfd_view_order_customer_details_table_view', true )){ |
| 436 | $fields_html .= '<tr><th>'. esc_attr($label) .':</th><td>'. wptexturize($value) .'</td></tr>'; |
| 437 | }else{ |
| 438 | $fields_html .= '<br/><dt>'. esc_attr($label) .':</dt><dd>'. wptexturize($value) .'</dd>'; |
| 439 | } |
| 440 | }else{ |
| 441 | if(apply_filters( 'thwcfd_thankyou_customer_details_table_view', true )){ |
| 442 | $fields_html .= '<tr><th>'. esc_attr($label) .':</th><td>'. wptexturize($value) .'</td></tr>'; |
| 443 | }else{ |
| 444 | $fields_html .= '<br/><dt>'. esc_attr($label) .':</dt><dd>'. wptexturize($value) .'</dd>'; |
| 445 | } |
| 446 | } |
| 447 | } |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | if($fields_html){ |
| 452 | do_action( 'thwcfd_order_details_before_custom_fields_table', $order ); |
| 453 | ?> |
| 454 | <table class="woocommerce-table woocommerce-table--custom-fields shop_table custom-fields"> |
| 455 | <?php |
| 456 | echo $fields_html; |
| 457 | ?> |
| 458 | </table> |
| 459 | <?php |
| 460 | do_action( 'thwcfd_order_details_after_custom_fields_table', $order ); |
| 461 | } |
| 462 | } |
| 463 | } |
| 464 | add_action('woocommerce_order_details_after_order_table', 'thwcfd_order_details_after_customer_details_lite', 20, 1); |
| 465 | |
| 466 | /***************************************** |
| 467 | ----- Display Field Values - END -------- |
| 468 | *****************************************/ |
| 469 | |
| 470 | function thwcfd__t($text){ |
| 471 | if(!empty($text)){ |
| 472 | $otext = $text; |
| 473 | $text = __($text, 'woo-checkout-field-editor-pro'); |
| 474 | if($text === $otext){ |
| 475 | $text = __($text, 'woocommerce'); |
| 476 | } |
| 477 | } |
| 478 | return $text; |
| 479 | } |
| 480 | function thwcfd_et($text){ |
| 481 | if(!empty($text)){ |
| 482 | $otext = $text; |
| 483 | $text = __($text, 'woo-checkout-field-editor-pro'); |
| 484 | if($text === $otext){ |
| 485 | $text = __($text, 'woocommerce'); |
| 486 | } |
| 487 | } |
| 488 | echo $text; |
| 489 | } |
| 490 | |
| 491 | function thwcfd_woo_version_check( $version = '3.0' ) { |
| 492 | if(function_exists( 'is_woocommerce_active' ) && is_woocommerce_active() ) { |
| 493 | global $woocommerce; |
| 494 | if( version_compare( $woocommerce->version, $version, ">=" ) ) { |
| 495 | return true; |
| 496 | } |
| 497 | } |
| 498 | return false; |
| 499 | } |
| 500 | |
| 501 | } |
| 502 |