Guest User

Untitled

a guest
Jul 16th, 2020
14
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class WooCommerceCustomBilling
  15. {
  16. /**
  17. * _econstruct
  18. */
  19. public function __construct()
  20. {
  21. if (defined('VERSION')) {
  22. $this->version = VERSION;
  23. }
  24. else {
  25. $this->version = '1.4.4';
  26. }
  27.  
  28. $this->plugin_name = 'woocommerce-custom-billing';
  29. add_filter('woocommerce_billing_fields', [$this, 'wpadami_billing_fields'], 2, 1);
  30. add_action('woocommerce_checkout_process', [$this, 'wpadami_select_field_checkout_process'], 10, 1);
  31. add_action('woocommerce_checkout_process', [$this, 'wpadami_tc_kimlik_no_dogrula'], 10, 2);
  32. add_action('woocommerce_admin_order_data_after_billing_address', [$this, 'showAlanlariOrderPage'], 10, 1);
  33. add_action('woocommerce_order_data_after_billing_address', [$this, 'showAlanlariOrderPage'], 10, 1);
  34. add_action('woocommerce_order_details_after_customer_details', [$this, 'showAlanlariOrderPage'], 10, 1);
  35. add_action('wp_footer', [$this, 'wpadami_add_custom_styles']);
  36. add_action('woocommerce_email_after_order_table', [$this, 'wpadami_email_table_fields']);
  37. add_filter('woocommerce_settings_tabs_array', 'WooCommerceCustomBilling::add_settings_tab');
  38. add_action('woocommerce_settings_tabs_tr_cbl', [$this, 'settings_tab']);
  39. add_action('woocommerce_update_options_tr_cbl', [$this, 'update_settings']);
  40. add_action('wp_head', [$this, 'license_control']);
  41. }
  42.  
  43. /**
  44. * Fonksiyon wpadami_billing_fields($fields)
  45. * Array halinde $fields
  46. */
  47. public function wpadami_billing_fields($fields)
  48. {
  49. unset($fields['billing_company']);
  50. $fields['billing_company_or_indivudial_select'] = [
  51. 'label' => __('Faturalandırma Türü', 'woocommerce'),
  52. 'required' => true,
  53. 'clear' => true,
  54. 'type' => 'select',
  55. 'class' => ['form-row-wide', 'select2'],
  56. 'select2' => true,
  57. 'options' => ['blank' => __('Fatura türü seçiniz', 'woocommerce'), 'individual' => __('Bireysel', 'woocommerce'), 'company' => __('Kurumsal', 'woocommerce')],
  58. 'priority' => 9
  59. ];
  60. $fields['billing_tc_kimlik_no'] = [
  61. 'label' => __('TC Kimlik No', 'woocommerce'),
  62. 'placeholder' => _x('TC Kimlik No', 'placeholder', 'woocommerce'),
  63. 'required' => false,
  64. 'clear' => true,
  65. 'type' => 'text',
  66. 'class' => ['form-row-wide', 'hidden'],
  67. 'priority' => 21
  68. ];
  69. $fields['billing_company_name'] = [
  70. 'label' => __('Firma Adı', 'woocommerce'),
  71. 'placeholder' => _x('Firma Adı', 'placeholder', 'woocommerce'),
  72. 'required' => false,
  73. 'clear' => true,
  74. 'type' => 'text',
  75. 'class' => ['form-row-wide', 'hidden'],
  76. 'priority' => 21
  77. ];
  78. $fields['billing_vergi_dairesi'] = [
  79. 'label' => __('Vergi Dairesi', 'woocommerce'),
  80. 'placeholder' => _x('Vergi Dairesini Yazınız', 'placeholder', 'woocommerce'),
  81. 'required' => false,
  82. 'clear' => true,
  83. 'type' => 'text',
  84. 'class' => ['form-row-first', 'hidden'],
  85. 'priority' => 22
  86. ];
  87. $fields['billing_vergi_no'] = [
  88. 'label' => __('Vergi Numarası', 'woocommerce'),
  89. ................................................................
  90. .................................
  91. ...........
RAW Paste Data