WC_GZD_Settings_Germanized

Adds Settings Interface to WooCommerce Settings Tabs.

Defined (1)

The class is defined in the following location(s).

/includes/admin/settings/class-wc-gzd-settings-germanized.php  
  1. class WC_GZD_Settings_Germanized extends WC_Settings_Page { 
  2.  
  3. public $premium_sections = array(); 
  4.  
  5. /** 
  6. * Adds Hooks to output and save settings 
  7. */ 
  8. public function __construct() { 
  9. $this->id = 'germanized'; 
  10. $this->label = __( 'Germanized', 'woocommerce-germanized' ); 
  11.  
  12. add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_page' ), 20 ); 
  13. add_action( 'woocommerce_sections_' . $this->id, array( $this, 'output_sections' ) ); 
  14. add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) ); 
  15. add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) ); 
  16. add_filter( 'woocommerce_gzd_get_settings_display', array( $this, 'get_display_settings' ) ); 
  17. add_filter( 'woocommerce_gzd_get_settings_email', array( $this, 'get_email_settings' ) ); 
  18. add_action( 'woocommerce_gzd_before_save_section_', array( $this, 'before_save' ), 0, 1 ); 
  19. add_action( 'woocommerce_gzd_after_save_section_', array( $this, 'after_save' ), 0, 1 ); 
  20. add_action( 'woocommerce_admin_field_image', array( $this, 'image_field' ), 0, 1 ); 
  21. add_action( 'woocommerce_admin_field_html', array( $this, 'html_field' ), 0, 1 ); 
  22. add_action( 'woocommerce_admin_field_hidden', array( $this, 'hidden_field' ), 0, 1 ); 
  23. add_action( 'woocommerce_gzd_before_section_output', array( $this, 'init_tour_data' ), 0, 1 ); 
  24.  
  25. if ( ! WC_Germanized()->is_pro() ) { 
  26. // Premium sections 
  27. $this->premium_sections = array( 
  28. 'invoices' => sprintf( __( 'Invoices & Packing Slips %s', 'woocommerce-germanized' ), '<span class="wc-gzd-premium-section-tab">pro</span>' ),  
  29. 'pdf' => sprintf( __( 'PDF %s', 'woocommerce-germanized' ), '<span class="wc-gzd-premium-section-tab">pro</span>' ),  
  30. 'checkout' => sprintf( __( 'Multistep Checkout %s', 'woocommerce-germanized' ), '<span class="wc-gzd-premium-section-tab">pro</span>' ),  
  31. 'agbs' => sprintf( __( 'Terms & Conditions generator %s', 'woocommerce-germanized' ), '<span class="wc-gzd-premium-section-tab">pro</span>' ),  
  32. 'widerruf' => sprintf( __( 'Revocation generator %s', 'woocommerce-germanized' ), '<span class="wc-gzd-premium-section-tab">pro</span>' ),  
  33. ); 
  34.  
  35. add_filter( 'woocommerce_gzd_settings_sections', array( $this, 'set_premium_sections' ), 4 ); 
  36.  
  37. foreach ( $this->premium_sections as $key => $section ) { 
  38. add_filter( 'woocommerce_gzd_get_settings_' . $key, array( $this, 'get_premium_settings' ), 0 ); 
  39. add_filter( 'wc_germanized_settings_section_before_' . $key, array( $this, 'output_premium_section' ), 0 ); 
  40. add_filter( 'woocommerce_gzd_get_sidebar_' . $key, array( $this, 'get_premium_sidebar' ), 0 ); 
  41.  
  42. public function image_field( $value ) { 
  43. ?> 
  44. <tr valign="top"> 
  45. <th class="forminp forminp-image" colspan="2" id="<?php echo $value[ 'id' ]; ?>"> 
  46. <a href="<?php echo $value[ 'href' ]; ?>" target="_blank"><img src="<?php echo $value[ 'img' ]; ?>" /></a> 
  47. </th> 
  48. </tr> 
  49. <?php 
  50.  
  51. public function html_field( $value ) { 
  52. ?> 
  53. <tr valign="top"> 
  54. <th class="forminp forminp-html" id="<?php echo $value[ 'id' ]; ?>"><?php echo $value[ 'title' ]; ?></th> 
  55. <td class="forminp"><?php echo $value[ 'html' ]; ?></td> 
  56. </tr> 
  57. <?php 
  58.  
  59. public function hidden_field( $value ) { 
  60. $option_value = WC_Admin_Settings::get_option( $value[ 'id' ], $value[ 'default' ] ); 
  61. ?> 
  62. <tr valign="top" style="display: none"> 
  63. <th class="forminp forminp-image"> 
  64. <input type="hidden" id="<?php echo esc_attr( $value['id'] ); ?>" value="<?php echo esc_attr( $option_value ); ?>" name="<?php echo esc_attr( $value['id'] ); ?>" /> 
  65. </th> 
  66. </tr> 
  67. <?php 
  68.  
  69. /** 
  70. * Gets setting sections 
  71. */ 
  72. public function get_sections() { 
  73. $sections = apply_filters( 'woocommerce_gzd_settings_sections', array( 
  74. '' => __( 'General Options', 'woocommerce-germanized' ),  
  75. 'display' => __( 'Display Options', 'woocommerce-germanized' ),  
  76. 'email' => __( 'Email Options', 'woocommerce-germanized' ),  
  77. ) ); 
  78. return $sections; 
  79.  
  80. public function init_tour_data( $section = 'general' ) { 
  81.  
  82. if ( empty( $section ) ) 
  83. $section = 'general'; 
  84.  
  85. if ( ! WC_GZD_Admin::instance()->is_tour_enabled( $section ) ) 
  86. return; 
  87.  
  88. $tour = WC_germanized()->plugin_path() . '/includes/admin/views/html-tour-' . $section . '.php'; 
  89.  
  90. if ( file_exists( $tour ) ) 
  91. include( $tour ); 
  92.  
  93.  
  94. /** 
  95. * Get settings array 
  96. * @return array 
  97. */ 
  98. public function get_settings() { 
  99.  
  100. $delivery_terms = array( '' => __( 'None', 'woocommerce-germanized' ) ); 
  101. $terms = get_terms( 'product_delivery_time', array('fields' => 'id=>name', 'hide_empty' => false) ); 
  102.  
  103. if ( ! is_wp_error( $terms ) ) 
  104. $delivery_terms = $delivery_terms + $terms; 
  105.  
  106. $labels = array_merge( array( '' => __( 'None', 'woocommerce-germanized' ) ), WC_Germanized()->price_labels->get_labels() ); 
  107.  
  108. $is_complaints_shortcode_inserted = WC_GZD_Admin::instance()->is_complaints_shortcode_inserted(); 
  109.  
  110. $settings = array( 
  111.  
  112. array( 'title' => __( 'General', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'general_options' ),  
  113.  
  114. array( 
  115. 'title' => __( 'Small-Enterprise-Regulation', 'woocommerce-germanized' ),  
  116. 'desc' => __( 'VAT based on §19 UStG', 'woocommerce-germanized' ),  
  117. 'id' => 'woocommerce_gzd_small_enterprise',  
  118. 'default' => 'no',  
  119. 'type' => 'checkbox',  
  120. 'desc_tip' => sprintf( __( 'set this Option if you have chosen <a href="%s" target="_blank">§19 UStG</a>', 'woocommerce-germanized' ), esc_url( 'http://www.gesetze-im-internet.de/ustg_1980/__19.html' ) ) 
  121. ),  
  122.  
  123. array( 
  124. 'title' => __( 'Show no VAT notice', 'woocommerce-germanized' ),  
  125. 'desc' => __( 'Show no VAT §19 UStG notice on single product', 'woocommerce-germanized' ),  
  126. 'id' => 'woocommerce_gzd_display_product_detail_small_enterprise',  
  127. 'type' => 'checkbox',  
  128. 'default' => 'no',  
  129. ),  
  130.  
  131. array( 
  132. 'title' => __( 'Submit Order Button Text', 'woocommerce-germanized' ),  
  133. 'desc' => __( 'This text serves as Button text for the Order Submit Button.', 'woocommerce-germanized' ),  
  134. 'desc_tip' => true,  
  135. 'id' => 'woocommerce_gzd_order_submit_btn_text',  
  136. 'type' => 'text',  
  137. 'css' => 'min-width:300px;',  
  138. 'default' => __( 'Buy Now', 'woocommerce-germanized' ),  
  139. ),  
  140.  
  141. array( 
  142. 'title' => __( 'Phone as required field', 'woocommerce-germanized' ),  
  143. 'desc' => __( 'Should phone number be a required field within checkout?', 'woocommerce-germanized' ),  
  144. 'id' => 'woocommerce_gzd_checkout_phone_required',  
  145. 'type' => 'checkbox',  
  146. 'default' => 'no',  
  147. ),  
  148.  
  149. array( 
  150. 'title' => __( 'Add title field', 'woocommerce-germanized' ),  
  151. 'desc' => __( 'Add a title field to the address within checkout?', 'woocommerce-germanized' ),  
  152. 'id' => 'woocommerce_gzd_checkout_address_field',  
  153. 'type' => 'checkbox',  
  154. 'default' => 'yes',  
  155. ),  
  156.  
  157. array( 
  158. 'title' => __( 'Disallow cancellations', 'woocommerce-germanized' ),  
  159. 'desc' => __( 'Don*t allow customers to manually cancel orders.', 'woocommerce-germanized' ),  
  160. 'desc_tip' => __( 'By default payment methods like PayPal allow order cancellation by clicking the abort link. This option will stop customers from manually cancel orders.', 'woocommerce-germanized' ),  
  161. 'id' => 'woocommerce_gzd_checkout_stop_order_cancellation',  
  162. 'type' => 'checkbox',  
  163. 'default' => 'yes',  
  164. ),  
  165.  
  166. array( 'type' => 'sectionend', 'id' => 'general_options' ),  
  167.  
  168. array( 'title' => __( 'Contract', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'contract_options', 'desc' => '<div class="notice inline notice-warning"><p>' . sprintf( __( '%sUpgrade to %spro%s%s to unlock this feature and get premium support.', 'woocommerce-germanized' ), '<a href="https://vendidero.de/woocommerce-germanized" class="button">', '<span class="wc-gzd-pro">', '</span>', '</a>' ) . '</p></div>' ),  
  169.  
  170. array( 
  171. 'title' => '',  
  172. 'id' => 'woocommerce_gzdp_contract_after_confirmation',  
  173. 'img' => WC_Germanized()->plugin_url() . '/assets/images/pro/settings-inline-contract.png',  
  174. 'href' => 'https://vendidero.de/woocommerce-germanized#contract',  
  175. 'type' => 'image',  
  176. ),  
  177.  
  178. array( 'type' => 'sectionend', 'id' => 'contract_options' ),  
  179.  
  180. array( 'title' => __( 'Legal Pages', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'legal_pages_options' ),  
  181.  
  182. array( 
  183. 'title' => __( 'Terms & Conditions', 'woocommerce-germanized' ),  
  184. 'desc_tip' => __( 'This page should contain your terms & conditions.', 'woocommerce-germanized' ),  
  185. 'id' => 'woocommerce_terms_page_id',  
  186. 'type' => 'single_select_page',  
  187. 'default' => '',  
  188. 'class' => 'chosen_select_nostd',  
  189. 'css' => 'min-width:300px;',  
  190. 'desc' => ( ! get_option( 'woocommerce_terms_page_id' ) ? sprintf( __( 'Don\'t have terms & conditions yet? <a href="%s">Generate now</a>!', 'woocommerce-germanized' ), admin_url( 'admin.php?page=wc-settings&tab=germanized§ion=agbs' ) ) : '' ),  
  191. ),  
  192.  
  193. array( 
  194. 'title' => __( 'Power of Revocation', 'woocommerce-germanized' ),  
  195. 'desc_tip' => __( 'This page should contain information regarding your customer\'s Right of Revocation.', 'woocommerce-germanized' ),  
  196. 'id' => 'woocommerce_revocation_page_id',  
  197. 'type' => 'single_select_page',  
  198. 'default' => '',  
  199. 'class' => 'chosen_select_nostd',  
  200. 'css' => 'min-width:300px;',  
  201. 'desc' => ( ! get_option( 'woocommerce_revocation_page_id' ) ? sprintf( __( 'Don\'t have a revocation page yet? <a href="%s">Generate now</a>!', 'woocommerce-germanized' ), admin_url( 'admin.php?page=wc-settings&tab=germanized§ion=widerruf' ) ) : '' ),  
  202. ),  
  203.  
  204. array( 
  205. 'title' => __( 'Imprint', 'woocommerce-germanized' ),  
  206. 'desc' => __( 'This page should contain an imprint with your company\'s information.', 'woocommerce-germanized' ),  
  207. 'id' => 'woocommerce_imprint_page_id',  
  208. 'type' => 'single_select_page',  
  209. 'default' => '',  
  210. 'class' => 'chosen_select_nostd',  
  211. 'css' => 'min-width:300px;',  
  212. 'desc_tip' => true,  
  213. ),  
  214.  
  215. array( 
  216. 'title' => __( 'Data Security Statement', 'woocommerce-germanized' ),  
  217. 'desc' => __( 'This page should contain information regarding your data security policy.', 'woocommerce-germanized' ),  
  218. 'id' => 'woocommerce_data_security_page_id',  
  219. 'type' => 'single_select_page',  
  220. 'default' => '',  
  221. 'class' => 'chosen_select_nostd',  
  222. 'css' => 'min-width:300px;',  
  223. 'desc_tip' => true,  
  224. ),  
  225.  
  226. array( 
  227. 'title' => __( 'Payment Methods', 'woocommerce-germanized' ),  
  228. 'desc' => __( 'This page should contain information regarding the Payment Methods that are chooseable during checkout.', 'woocommerce-germanized' ),  
  229. 'id' => 'woocommerce_payment_methods_page_id',  
  230. 'type' => 'single_select_page',  
  231. 'default' => '',  
  232. 'class' => 'chosen_select_nostd',  
  233. 'css' => 'min-width:300px;',  
  234. 'desc_tip' => true,  
  235. ),  
  236.  
  237. array( 
  238. 'title' => __( 'Shipping Methods', 'woocommerce-germanized' ),  
  239. 'desc' => __( 'This page should contain information regarding shipping methods that are chooseable during checkout.', 'woocommerce-germanized' ),  
  240. 'id' => 'woocommerce_shipping_costs_page_id',  
  241. 'type' => 'single_select_page',  
  242. 'default' => '',  
  243. 'class' => 'chosen_select_nostd',  
  244. 'css' => 'min-width:300px;',  
  245. 'desc_tip' => true,  
  246. ),  
  247.  
  248. array( 'type' => 'sectionend', 'id' => 'legal_pages_options' ),  
  249.  
  250. array( 'title' => __( 'Complaints', 'woocommerce-germanized' ), 'type' => 'title', 'desc' => sprintf( __( 'Options regarding new EU online dispute resolution platform (OS). Read more about this topic <a href="%s" target="_blank">here</a>.', 'woocommerce-germanized' ), 'http://shop.trustedshops.com/de/rechtstipps/jetzt-handeln-link-auf-eu-online-schlichtungs-plattform-ab-9.1.2016' ), 'id' => 'complaints_options' ),  
  251.  
  252. array( 
  253. 'title' => __( 'Complaints Procedure Text', 'woocommerce-germanized' ),  
  254. 'desc' => __( 'Customize the text produced by the shortcode [gzd_complaints] to your needs. This text is to be meant to inform your customer about the existance of a platform for dispute settlement provided by the EU. You may place this shortcode within your imprint.', 'woocommerce-germanized' ),  
  255. 'desc_tip' => true,  
  256. 'default' => __( 'Online dispute resolution in accordance with Art. 14 (1) ODR-VO: The european commission provides a platform for online dispute resolution (OS) which is accessible at http://ec.europa.eu/consumers/odr/.', 'woocommerce-germanized' ),  
  257. 'css' => 'width:100%; height: 65px;',  
  258. 'id' => 'woocommerce_gzd_complaints_procedure_text',  
  259. 'type' => 'textarea',  
  260. ),  
  261.  
  262. array( 
  263. 'title' => __( 'Shortcode Status', 'woocommerce-germanized' ),  
  264. 'id' => 'woocommerce_gzd_complaints_procedure_status',  
  265. 'type' => 'html',  
  266. 'html' => '<p>' . ( wc_get_page_id( 'imprint' ) == -1 ? '<span class="wc-gzd-status-text wc-gzd-text-red">' . __( 'Please choose a page as your imprint first.', 'woocommerce-germanized' ) . '</span>' : '<span class="wc-gzd-status-text wc-gzd-text-' . ( $is_complaints_shortcode_inserted ? 'green' : 'red' ) . '"> ' . ( $is_complaints_shortcode_inserted ? __( 'Found', 'woocommerce-germanized' ) : __( 'Not found within your imprint', 'woocommerce-germanized' ) ) . '</span> ' . ( ! $is_complaints_shortcode_inserted ? '<a class="button button-secondary" style="margin-left: 1em" href="' . wp_nonce_url( add_query_arg( array( 'complaints' => 'add' ) ), 'append-complaints-shortcode' ). '" target="_blank">' . __( 'Append it now', 'woocommerce-germanized' ) . '</a></p>' : '' ) ),  
  267. ),  
  268.  
  269. array( 'type' => 'sectionend', 'id' => 'complaints_options' ),  
  270.  
  271. array( 'title' => __( 'Delivery Times', 'woocommerce-germanized' ), 'type' => 'title', 'desc' => '', 'id' => 'delivery_times_options' ),  
  272.  
  273. array( 
  274. 'title' => __( 'Default Delivery Time', 'woocommerce-germanized' ),  
  275. 'desc_tip' => __( 'This delivery time will be added to every product if no delivery time has been chosen individually', 'woocommerce-germanized' ),  
  276. 'id' => 'woocommerce_gzd_default_delivery_time',  
  277. 'css' => 'min-width:250px;',  
  278. 'default' => '',  
  279. 'type' => 'select',  
  280. 'class' => 'chosen_select',  
  281. 'options' => $delivery_terms,  
  282. 'desc' => '<a href="' . admin_url( 'edit-tags.php?taxonomy=product_delivery_time&post_type=product' ) . '">' . __( 'Manage Delivery Times', 'woocommerce-germanized' ) . '</a>',  
  283. ),  
  284.  
  285. array( 
  286. 'title' => __( 'Delivery Time Text', 'woocommerce-germanized' ),  
  287. 'desc' => __( 'This text will be used to indicate delivery time for products. Use {delivery_time} as placeholder.', 'woocommerce-germanized' ),  
  288. 'desc_tip' => true,  
  289. 'id' => 'woocommerce_gzd_delivery_time_text',  
  290. 'type' => 'text',  
  291. 'css' => 'min-width:300px;',  
  292. 'default' => __( 'Delivery time: {delivery_time}', 'woocommerce-germanized' ),  
  293. ),  
  294.  
  295. array( 'type' => 'sectionend', 'id' => 'delivery_times_options' ),  
  296.  
  297. array( 'title' => __( 'Sale Price Labels', 'woocommerce-germanized' ), 'type' => 'title', 'desc' => '', 'id' => 'sale_price_labels_options' ),  
  298.  
  299. array( 
  300. 'title' => __( 'Default Sale Label', 'woocommerce-germanized' ),  
  301. 'desc_tip' => __( 'Choose whether you would like to have a default sale price label to inform the customer about the regular price (e.g. Recommended Retail Price).', 'woocommerce-germanized' ),  
  302. 'id' => 'woocommerce_gzd_default_sale_price_label',  
  303. 'css' => 'min-width:250px;',  
  304. 'default' => '',  
  305. 'type' => 'select',  
  306. 'class' => 'chosen_select',  
  307. 'options' => $labels,  
  308. 'desc' => '<a href="' . admin_url( 'edit-tags.php?taxonomy=product_price_label&post_type=product' ) . '">' . __( 'Manage Price Labels', 'woocommerce-germanized' ) . '</a>',  
  309. ),  
  310.  
  311. array( 
  312. 'title' => __( 'Default Sale Regular Label', 'woocommerce-germanized' ),  
  313. 'desc_tip' => __( 'Choose whether you would like to have a default sale price regular label to inform the customer about the sale price (e.g. New Price).', 'woocommerce-germanized' ),  
  314. 'id' => 'woocommerce_gzd_default_sale_price_regular_label',  
  315. 'css' => 'min-width:250px;',  
  316. 'default' => '',  
  317. 'type' => 'select',  
  318. 'class' => 'chosen_select',  
  319. 'options' => $labels,  
  320. 'desc' => '<a href="' . admin_url( 'edit-tags.php?taxonomy=product_price_label&post_type=product' ) . '">' . __( 'Manage Price Labels', 'woocommerce-germanized' ) . '</a>',  
  321. ),  
  322.  
  323. array( 'type' => 'sectionend', 'id' => 'delivery_times_options' ),  
  324.  
  325.  
  326. array( 'title' => __( 'Shipping Costs', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'shipping_costs_options' ),  
  327.  
  328. array( 
  329. 'title' => __( 'Shipping Costs Text', 'woocommerce-germanized' ),  
  330. 'desc' => __( 'This text will be used to inform the customer about shipping costs. Use {link}{/link} to insert link to shipping costs page.', 'woocommerce-germanized' ),  
  331. 'desc_tip' => true,  
  332. 'id' => 'woocommerce_gzd_shipping_costs_text',  
  333. 'type' => 'text',  
  334. 'css' => 'min-width:300px;',  
  335. 'default' => __( 'plus {link}Shipping Costs{/link}', 'woocommerce-germanized' ),  
  336. ),  
  337.  
  338. array( 
  339. 'title' => __( 'Free Shipping Text', 'woocommerce-germanized' ),  
  340. 'desc' => __( 'This text will be used to inform the customer about free shipping. Leave empty to disable notice. Use {link}{/link} to insert link to shipping costs page.', 'woocommerce-germanized' ),  
  341. 'desc_tip' => true,  
  342. 'id' => 'woocommerce_gzd_free_shipping_text',  
  343. 'type' => 'text',  
  344. 'css' => 'min-width:300px;',  
  345. 'default' => '',  
  346. ),  
  347.  
  348. array( 
  349. 'title' => __( 'Shipping Costs Tax', 'woocommerce-germanized' ),  
  350. 'desc' => __( 'Enable better taxation for shpping costs?', 'woocommerce-germanized' ),  
  351. 'id' => 'woocommerce_gzd_shipping_tax',  
  352. 'default' => 'yes',  
  353. 'type' => 'checkbox',  
  354. 'desc_tip' => sprintf( __( 'By choosing this option shipping cost taxation will be calculated based on tax rates within cart. Imagine the following example. Further information can be found <a href="%s" target="_blank">here</a>. %s', 'woocommerce-germanized' ), 'http://www.it-recht-kanzlei.de/umsatzsteuer-versandkosten-mehrwertsteuer.html', '<table class="wc-gzd-tax-example"><thead><tr><th>Produkt</th><th>Preis</th><th>MwSt.-Satz</th><th>Anteil</th><th>MwSt.</th></tr></thead><tbody><tr><td>Buch</td><td>' . wc_price( 40 ) . '</td><td>7%</td><td>40%</td><td>' . wc_price( 2.62 ) . '</td></tr><tr><td>DVD</td><td>' . wc_price( 60 ) . '</td><td>19%</td><td>60%</td><td>' . wc_price( 9.58 ) . '</td></tr><tr><td>Versand</td><td>' . wc_price( 5 ) . '</td><td>7% |19%</td><td>40% |60%</td><td>' . wc_price( 0.13 ) . ' |' . wc_price( 0.48 ) . '</td></tr></tbody></table>' ),  
  355. ),  
  356.  
  357. array( 
  358. 'title' => __( 'Force Tax Calculation', 'woocommerce-germanized' ),  
  359. 'desc' => __( 'Force shipping costs tax calculation for every method?', 'woocommerce-germanized' ),  
  360. 'id' => 'woocommerce_gzd_shipping_tax_force',  
  361. 'default' => 'yes',  
  362. 'type' => 'checkbox',  
  363. 'desc_tip' => __( 'This option will overwrite settings for each individual shipping method to force tax calculation (instead of only calculating tax for those methods which are taxeable).', 'woocommerce-germanized' ),  
  364. ),  
  365.  
  366. array( 'type' => 'sectionend', 'id' => 'shipping_costs_options' ),  
  367.  
  368. array( 'title' => __( 'Fees', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'fees_options' ),  
  369.  
  370. array( 
  371. 'title' => __( 'Fee Tax', 'woocommerce-germanized' ),  
  372. 'desc' => __( 'Enable better taxation for fees?', 'woocommerce-germanized' ),  
  373. 'id' => 'woocommerce_gzd_fee_tax',  
  374. 'default' => 'yes',  
  375. 'type' => 'checkbox',  
  376. 'desc_tip' => __( 'By choosing this option fee taxation will be calculated based on tax rates within cart. See shipping costs taxation for more information.', 'woocommerce-germanized' ),  
  377. ),  
  378.  
  379. array( 
  380. 'title' => __( 'Force Tax Calculation', 'woocommerce-germanized' ),  
  381. 'desc' => __( 'Force fee tax calculation for every fee?', 'woocommerce-germanized' ),  
  382. 'id' => 'woocommerce_gzd_fee_tax_force',  
  383. 'default' => 'yes',  
  384. 'type' => 'checkbox',  
  385. 'desc_tip' => __( 'This option will overwrite settings for each individual fee to force tax calculation (instead of only calculating tax for those fees which are taxeable).', 'woocommerce-germanized' ),  
  386. ),  
  387.  
  388. array( 'type' => 'sectionend', 'id' => 'fees_options' ),  
  389.  
  390. array( 'title' => __( 'Customers', 'woocommerce-germanized' ), 'type' => 'title', 'desc' => '', 'id' => 'customer_options' ),  
  391.  
  392. array( 
  393. 'title' => __( 'Checkbox', 'woocommerce-germanized' ),  
  394. 'desc' => __( 'Add a checkbox to customer registration form.', 'woocommerce-germanized' ),  
  395. 'id' => 'woocommerce_gzd_customer_account_checkbox',  
  396. 'type' => 'checkbox',  
  397. 'default' => 'yes',  
  398. ),  
  399.  
  400. array( 
  401. 'title' => __( 'Checkbox text', 'woocommerce-germanized' ),  
  402. 'desc' => __( 'Choose a Plain Text which will be shown as checkbox text for customer account creation. Use {term_link}{/term_link}, {data_security_link}{/data_security_link}, {revocation_link}{/revocation_link} as Placeholders for the links to legal pages.', 'woocommerce-germanized' ),  
  403. 'desc_tip' => true,  
  404. 'default' => __( 'Yes, I*d like create a new account and have read and understood the {data_security_link}data privacy statement{/data_security_link}.', 'woocommerce-germanized' ),  
  405. 'css' => 'width:100%; height: 65px;',  
  406. 'id' => 'woocommerce_gzd_customer_account_text',  
  407. 'type' => 'textarea',  
  408. ),  
  409.  
  410. array( 
  411. 'title' => __( 'Checkout', 'woocommerce-germanized' ),  
  412. 'desc' => __( 'Replace default WooCommerce text regarding account creation during checkout.', 'woocommerce-germanized' ),  
  413. 'desc_tip' => __( 'Use the text from above instead of the default WooCommerce text regarding account creation during checkout. This checkbox is only show if you have activated guest accounts.', 'woocommerce-germanized' ),  
  414. 'id' => 'woocommerce_gzd_customer_account_checkout_checkbox',  
  415. 'type' => 'checkbox',  
  416. 'default' => 'yes',  
  417. ),  
  418.  
  419. array( 
  420. 'title' => __( 'Customer Double Opt In', 'woocommerce-germanized' ),  
  421. 'desc' => __( 'Enable customer double opt in on registration?', 'woocommerce-germanized' ),  
  422. 'desc_tip' => sprintf( __( 'If customer chooses to create a customer account an email with an activation link will be sent by mail. Customer account will be marked as activated if user clicks on the link within the email. More information on this topic can be found <a href="%s" target="_blank">here</a>.', 'woocommerce-germanized' ), 'http://t3n.de/news/urteil-anmeldebestatigungen-double-opt-in-pflicht-592304/' ),  
  423. 'id' => 'woocommerce_gzd_customer_activation',  
  424. 'default' => 'yes',  
  425. 'type' => 'checkbox',  
  426. ),  
  427.  
  428. array( 
  429. 'title' => __( 'Disable Login and Checkout', 'woocommerce-germanized' ),  
  430. 'desc' => __( 'Disable login and checkout for unactivated customers.', 'woocommerce-germanized' ),  
  431. 'desc_tip' => __( 'Customers that did not click on the activation link will not be able to complete checkout nor login to their account.', 'woocommerce-germanized' ),  
  432. 'id' => 'woocommerce_gzd_customer_activation_login_disabled',  
  433. 'default' => 'no',  
  434. 'type' => 'checkbox',  
  435. ),  
  436.  
  437. array( 
  438. 'title' => __( 'Delete Unactivated After', 'woocommerce-germanized' ),  
  439. 'desc_tip' => __( 'This will make sure unactivated customer accounts will be deleted after X days. Set to 0 if you don\'t want to automatically delete unactivated customers.', 'woocommerce-germanized' ),  
  440. 'desc' => __( 'days', 'woocommerce-germanized' ),  
  441. 'id' => 'woocommerce_gzd_customer_cleanup_interval',  
  442. 'type' => 'number',  
  443. 'custom_attributes' => array( 'min' => 0, 'step' => 1 ),  
  444. 'default' => 7,  
  445. ),  
  446.  
  447. array( 'type' => 'sectionend', 'id' => 'customer_options' ),  
  448.  
  449. array( 'title' => __( 'Right of Recission', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'recission_options' ),  
  450.  
  451. array( 
  452. 'title' => __( 'Revocation Address', 'woocommerce-germanized' ),  
  453. 'desc' => __( 'Type in an address, telephone/telefax number, email address which is to be used as revocation address', 'woocommerce-germanized' ),  
  454. 'desc_tip' => true,  
  455. 'css' => 'width:100%; height: 65px;',  
  456. 'id' => 'woocommerce_gzd_revocation_address',  
  457. 'type' => 'textarea',  
  458. ),  
  459.  
  460. array( 'type' => 'sectionend', 'id' => 'recission_options' ),  
  461.  
  462. array( 'title' => __( 'Virtual VAT', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'virtual_vat_options' ),  
  463.  
  464. array( 
  465. 'title' => __( 'Enable Virtual VAT', 'woocommerce-germanized' ),  
  466. 'desc' => __( 'Enable if you want to charge your customer\'s countries\' VAT for virtual products.', 'woocommerce-germanized' ),  
  467. 'id' => 'woocommerce_gzd_enable_virtual_vat',  
  468. 'default' => 'no',  
  469. 'type' => 'checkbox',  
  470. 'desc_tip' => sprintf( __( 'New EU VAT rule applies on 01.01.2015. Make sure that every digital or virtual product has chosen the right tax class (Virtual Rate or Virtual Reduced Rate). Gross prices will not differ from the prices you have chosen for affected products. In fact the net price will differ depending on the VAT rate of your customers\' country. Shop settings will be adjusted to show prices including tax. More information can be found <a href="%s" target="_blank">here</a>.', 'woocommerce-germanized' ), 'http://ec.europa.eu/taxation_customs/taxation/vat/how_vat_works/telecom/index_de.htm#new_rules' ),  
  471. ),  
  472.  
  473. array( 'type' => 'sectionend', 'id' => 'virtual_vat_options' ),  
  474.  
  475. array( 'title' => _x( 'Invoices', 'invoices', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'invoice_options', 'desc' => '<div class="notice inline notice-warning"><p>' . sprintf( __( '%sUpgrade to %spro%s%s to unlock this feature and get premium support.', 'woocommerce-germanized' ), '<a href="https://vendidero.de/woocommerce-germanized" class="button">', '<span class="wc-gzd-pro">', '</span>', '</a>' ) . '</p></div>' ),  
  476.  
  477. array( 
  478. 'title' => '',  
  479. 'id' => 'woocommerce_gzdp_invoice_enable',  
  480. 'img' => WC_Germanized()->plugin_url() . '/assets/images/pro/settings-inline-invoices.png',  
  481. 'href' => 'https://vendidero.de/woocommerce-germanized#accounting',  
  482. 'type' => 'image',  
  483. ),  
  484.  
  485. array( 'type' => 'sectionend', 'id' => 'invoice_options' ),  
  486.  
  487. array( 'title' => __( 'VAT', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'vat_options', 'desc' => '<div class="notice inline notice-warning"><p>' . sprintf( __( '%sUpgrade to %spro%s%s to unlock this feature and get premium support.', 'woocommerce-germanized' ), '<a href="https://vendidero.de/woocommerce-germanized" class="button">', '<span class="wc-gzd-pro">', '</span>', '</a>' ) . '</p></div>' ),  
  488.  
  489. array( 
  490. 'title' => '',  
  491. 'id' => 'woocommerce_gzdp_enable_vat_check',  
  492. 'img' => WC_Germanized()->plugin_url() . '/assets/images/pro/settings-inline-vat.png',  
  493. 'href' => 'https://vendidero.de/woocommerce-germanized#vat',  
  494. 'type' => 'image',  
  495. ),  
  496.  
  497. array( 'type' => 'sectionend', 'id' => 'vat_options' ),  
  498.  
  499. ); // End general settings 
  500.  
  501. return apply_filters( 'woocommerce_germanized_settings', $settings ); 
  502.  
  503.  
  504. public function get_email_settings() { 
  505.  
  506. $mailer = WC()->mailer(); 
  507. $email_templates = $mailer->get_emails(); 
  508. $email_select = array(); 
  509.  
  510. foreach ( $email_templates as $email ) 
  511. $email_select[ $email->id ] = empty( $email->title ) ? ucfirst( $email->id ) : ucfirst( $email->title ); 
  512.  
  513. $email_order = wc_gzd_get_email_attachment_order(); 
  514.  
  515. $email_settings = array(); 
  516.  
  517. foreach ( $email_order as $key => $order ) { 
  518.  
  519. array_push( $email_settings, array( 
  520.  
  521. 'title' => sprintf( __( 'Attach %s', 'woocommerce-germanized' ), $order ),  
  522. 'desc' => sprintf( __( 'Attach %s to the following email templates', 'woocommerce-germanized' ), $order ),  
  523. 'id' => 'woocommerce_gzd_mail_attach_' . $key,  
  524. 'type' => 'multiselect',  
  525. 'class' => 'chosen_select',  
  526. 'desc_tip' => true,  
  527. 'options' => $email_select,  
  528.  
  529. ) ); 
  530.  
  531.  
  532. $settings = array( 
  533.  
  534. array( 'title' => __( 'E-Mails', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'email_options', 'desc' => __( 'Use drag & drop to customize attachment order. Don\'t forget to save your changes.', 'woocommerce-germanized' ) ),  
  535.  
  536. array( 
  537. 'title' => '',  
  538. 'id' => 'woocommerce_gzd_mail_attach_order',  
  539. 'type' => 'hidden',  
  540. 'default' => 'terms, revocation, data_security, imprint',  
  541. ),  
  542.  
  543. ); 
  544.  
  545. $settings = array_merge( $settings, $email_settings ); 
  546.  
  547. $settings = array_merge( $settings, array( 
  548.  
  549. array( 'type' => 'sectionend', 'id' => 'email_options' ),  
  550.  
  551. array( 'title' => __( 'Email Attachment Options', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'email_attachment_options', 'desc' => '<div class="notice inline notice-warning"><p>' . sprintf( __( 'Want to attach automatically generated PDF files to emails instead of plain text? %sUpgrade to %spro%s%s', 'woocommerce-germanized' ), '<a style="margin-left: 1em" href="https://vendidero.de/woocommerce-germanized" class="button">', '<span class="wc-gzd-pro">', '</span>', '</a>' ) . '</p></div>' ),  
  552.  
  553. array( 
  554. 'title' => '',  
  555. 'id' => 'woocommerce_gzdp_legal_page_terms_enabled',  
  556. 'img' => WC_Germanized()->plugin_url() . '/assets/images/pro/settings-inline-emails.png',  
  557. 'href' => 'https://vendidero.de/woocommerce-germanized#legal-page',  
  558. 'type' => 'image',  
  559. ),  
  560.  
  561. array( 'type' => 'sectionend', 'id' => 'email_attachment_options' ),  
  562.  
  563. ) ); 
  564.  
  565. return apply_filters( 'woocommerce_germanized_settings_email', $settings ); 
  566.  
  567.  
  568. public function get_display_settings() { 
  569.  
  570. $product_types = wc_get_product_types(); 
  571.  
  572. $digital_type_options = array_merge( array( 
  573. 'downloadable' => __( 'Downloadable Product', 'woocommerce-germanized' ),  
  574. 'virtual' => __( 'Virtual Product', 'woocommerce-germanized' ),  
  575. ), $product_types ); 
  576.  
  577. $settings = array( 
  578.  
  579. array( 'title' => __( 'General', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'general_options' ),  
  580.  
  581. array( 
  582. 'title' => __( 'Add to Cart', 'woocommerce-germanized' ),  
  583. 'desc' => __( 'Show add to cart button on listings?', 'woocommerce-germanized' ),  
  584. 'id' => 'woocommerce_gzd_display_listings_add_to_cart',  
  585. 'default' => 'yes',  
  586. 'type' => 'checkbox',  
  587. 'desc_tip' => __( 'unset this option if you don\'t want to show the add to cart button within the product listings', 'woocommerce-germanized' ),  
  588. ),  
  589.  
  590. array( 
  591. 'title' => __( 'Link to Details', 'woocommerce-germanized' ),  
  592. 'desc' => __( 'Want to link to product details page instead of add to cart within listings?', 'woocommerce-germanized' ),  
  593. 'id' => 'woocommerce_gzd_display_listings_link_details',  
  594. 'default' => 'no',  
  595. 'type' => 'checkbox',  
  596. 'desc_tip' => __( 'Decide whether you like to link to your product\'s details page instead of displaying an add to cart button within product listings.', 'woocommerce-germanized' ),  
  597. ),  
  598.  
  599. array( 
  600. 'title' => __( 'Product Details Text', 'woocommerce-germanized' ),  
  601. 'id' => 'woocommerce_gzd_display_listings_link_details_text',  
  602. 'default' => __( 'Details', 'woocommerce-germanized' ),  
  603. 'type' => 'text',  
  604. 'desc_tip' => __( 'If you have chosen to link to product details page instead of add to cart URL you may want to change the button text.', 'woocommerce-germanized' ),  
  605. 'css' => 'min-width:300px;',  
  606. ),  
  607.  
  608. array( 
  609. 'title' => __( 'Digital Delivery Time Text', 'woocommerce-germanized' ),  
  610. 'id' => 'woocommerce_gzd_display_digital_delivery_time_text',  
  611. 'default' => '',  
  612. 'type' => 'text',  
  613. 'desc_tip' => __( 'Enter a text which will be shown as digital delivery time text (replacement for default digital time on digital products).', 'woocommerce-germanized' ),  
  614. 'css' => 'min-width:300px;',  
  615. ),  
  616.  
  617. array( 
  618. 'title' => __( 'Notice Footer', 'woocommerce-germanized' ),  
  619. 'desc' => __( 'Show a global VAT notice within footer', 'woocommerce-germanized' ),  
  620. 'id' => 'woocommerce_gzd_display_footer_vat_notice',  
  621. 'default' => 'no',  
  622. 'type' => 'checkbox',  
  623. 'checkboxgroup' => 'start' 
  624. ),  
  625.  
  626. array( 
  627. 'desc' => __( 'Show a global sale price notice within footer', 'woocommerce-germanized' ),  
  628. 'id' => 'woocommerce_gzd_display_footer_sale_price_notice',  
  629. 'type' => 'checkbox',  
  630. 'default' => 'no',  
  631. 'checkboxgroup' => 'end',  
  632. ),  
  633.  
  634. array( 'type' => 'sectionend', 'id' => 'general_options' ),  
  635.  
  636. array( 'title' => __( 'Products', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'product_options' ),  
  637.  
  638. array( 
  639. 'title' => __( 'Show within Product Listings', 'woocommerce-germanized' ),  
  640. 'desc' => __( 'Shipping Costs notice', 'woocommerce-germanized' ),  
  641. 'id' => 'woocommerce_gzd_display_listings_shipping_costs',  
  642. 'type' => 'checkbox',  
  643. 'default' => 'yes',  
  644. 'checkboxgroup' => 'start',  
  645. ),  
  646.  
  647. array( 
  648. 'desc' => __( 'Tax Info', 'woocommerce-germanized' ),  
  649. 'id' => 'woocommerce_gzd_display_listings_tax_info',  
  650. 'type' => 'checkbox',  
  651. 'default' => 'yes',  
  652. 'checkboxgroup' => '',  
  653. ),  
  654.  
  655. array( 
  656. 'desc' => __( 'Base Price', 'woocommerce-germanized' ),  
  657. 'id' => 'woocommerce_gzd_display_listings_unit_price',  
  658. 'type' => 'checkbox',  
  659. 'default' => 'yes',  
  660. 'checkboxgroup' => '',  
  661. ),  
  662.  
  663. array( 
  664. 'desc' => __( 'Product Units', 'woocommerce-germanized' ),  
  665. 'id' => 'woocommerce_gzd_display_listings_product_units',  
  666. 'type' => 'checkbox',  
  667. 'default' => 'no',  
  668. 'checkboxgroup' => '',  
  669. ),  
  670.  
  671. array( 
  672. 'desc' => __( 'Delivery Time Notice', 'woocommerce-germanized' ),  
  673. 'id' => 'woocommerce_gzd_display_listings_delivery_time',  
  674. 'type' => 'checkbox',  
  675. 'default' => 'yes',  
  676. 'checkboxgroup' => '',  
  677. ),  
  678.  
  679. array( 
  680. 'desc' => __( 'Price Labels', 'woocommerce-germanized' ),  
  681. 'id' => 'woocommerce_gzd_display_listings_sale_price_labels',  
  682. 'default' => 'yes',  
  683. 'type' => 'checkbox',  
  684. 'checkboxgroup' => 'end',  
  685. ),  
  686.  
  687. array( 
  688. 'title' => __( 'Show on Product Detail Page', 'woocommerce-germanized' ),  
  689. 'desc' => __( 'Shipping Costs notice', 'woocommerce-germanized' ),  
  690. 'id' => 'woocommerce_gzd_display_product_detail_shipping_costs',  
  691. 'type' => 'checkbox',  
  692. 'default' => 'yes',  
  693. 'checkboxgroup' => 'start',  
  694. ),  
  695.  
  696. array( 
  697. 'desc' => __( 'Tax Info', 'woocommerce-germanized' ),  
  698. 'id' => 'woocommerce_gzd_display_product_detail_tax_info',  
  699. 'type' => 'checkbox',  
  700. 'default' => 'yes',  
  701. 'checkboxgroup' => '',  
  702. ),  
  703.  
  704. array( 
  705. 'desc' => __( 'Base Price', 'woocommerce-germanized' ),  
  706. 'id' => 'woocommerce_gzd_display_product_detail_unit_price',  
  707. 'type' => 'checkbox',  
  708. 'default' => 'yes',  
  709. 'checkboxgroup' => '',  
  710. ),  
  711.  
  712. array( 
  713. 'desc' => __( 'Product Units', 'woocommerce-germanized' ),  
  714. 'id' => 'woocommerce_gzd_display_product_detail_product_units',  
  715. 'type' => 'checkbox',  
  716. 'default' => 'no',  
  717. 'checkboxgroup' => '',  
  718. ),  
  719.  
  720. array( 
  721. 'desc' => __( 'Delivery Time Notice', 'woocommerce-germanized' ),  
  722. 'id' => 'woocommerce_gzd_display_product_detail_delivery_time',  
  723. 'type' => 'checkbox',  
  724. 'default' => 'yes',  
  725. 'checkboxgroup' => '',  
  726. ),  
  727.  
  728. array( 
  729. 'desc' => __( 'Price Labels', 'woocommerce-germanized' ),  
  730. 'id' => 'woocommerce_gzd_display_product_detail_sale_price_labels',  
  731. 'default' => 'yes',  
  732. 'type' => 'checkbox',  
  733. 'checkboxgroup' => 'end',  
  734. ),  
  735.  
  736. array( 
  737. 'title' => __( 'Hide Shipping Costs Notice', 'woocommerce-germanized' ),  
  738. 'desc' => __( 'Select product types for which you might want to disable the shipping costs notice.', 'woocommerce-germanized' ),  
  739. 'desc_tip' => true,  
  740. 'id' => 'woocommerce_gzd_display_shipping_costs_hidden_types',  
  741. 'class' => 'chosen_select',  
  742. 'type' => 'multiselect',  
  743. 'options' => $digital_type_options,  
  744. 'default' => array( 'downloadable', 'external', 'virtual' ),  
  745. ),  
  746.  
  747. array( 
  748. 'title' => __( 'Hide Delivery Time Notice', 'woocommerce-germanized' ),  
  749. 'desc' => __( 'Select product types for which you might want to disable the delivery time notice.', 'woocommerce-germanized' ),  
  750. 'desc_tip' => true,  
  751. 'id' => 'woocommerce_gzd_display_delivery_time_hidden_types',  
  752. 'class' => 'chosen_select',  
  753. 'type' => 'multiselect',  
  754. 'options' => $digital_type_options,  
  755. 'default' => array( 'external', 'virtual' ),  
  756. ),  
  757.  
  758. array( 'type' => 'sectionend', 'id' => 'product_options' ),  
  759.  
  760. array( 'title' => __( 'Base Price', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'unit_price_options' ),  
  761.  
  762. array( 
  763. 'title' => __( 'Base Price Text', 'woocommerce-germanized' ),  
  764. 'desc' => __( 'This text will be used to display the base price. Use {price} to insert the price. If you want to specifically format base price output use {base}, {unit} and {base_price} as placeholders.', 'woocommerce-germanized' ),  
  765. 'desc_tip' => true,  
  766. 'id' => 'woocommerce_gzd_unit_price_text',  
  767. 'type' => 'text',  
  768. 'css' => 'min-width:300px;',  
  769. 'default' => __( '{price}', 'woocommerce-germanized' ),  
  770. ),  
  771.  
  772. array( 
  773. 'title' => __( 'Variable Base Price', 'woocommerce-germanized' ),  
  774. 'desc' => __( 'Enable price range base prices for variable products.', 'woocommerce-germanized' ),  
  775. 'id' => 'woocommerce_gzd_unit_price_enable_variable',  
  776. 'default' => 'yes',  
  777. 'type' => 'checkbox',  
  778. ),  
  779.  
  780. array( 
  781. 'title' => __( 'Product Units Text', 'woocommerce-germanized' ),  
  782. 'desc' => __( 'This text will be used to display the product units. Use {product_units} to insert the amount of product units. Use {unit} to insert the unit. Optionally display the formatted unit price with {unit_price}.', 'woocommerce-germanized' ),  
  783. 'desc_tip' => true,  
  784. 'id' => 'woocommerce_gzd_product_units_text',  
  785. 'type' => 'text',  
  786. 'css' => 'min-width:300px;',  
  787. 'default' => __( 'Product contains: {product_units} {unit}', 'woocommerce-germanized' ),  
  788. ),  
  789.  
  790. array( 'type' => 'sectionend', 'id' => 'unit_price_options' ),  
  791.  
  792. array( 'title' => __( 'Checkout & Cart', 'woocommerce-germanized' ), 'type' => 'title', 'id' => 'checkout_options' ),  
  793.  
  794. array( 
  795. 'title' => __( 'Fallback Mode', 'woocommerce-germanized' ),  
  796. 'desc' => __( 'Enable to make sure default checkout template is not being overriden by theme.', 'woocommerce-germanized' ),  
  797. 'id' => 'woocommerce_gzd_display_checkout_fallback',  
  798. 'default' => 'no',  
  799. 'type' => 'checkbox',  
  800. 'desc_tip' => __( 'If you are facing problems within your checkout e.g. legally relevant data is not showing (terms, delivery time, unit price etc.) your theme seems to be incompatible (not using default WooCommerce hooks and filters). As a workaround you may use this fallback which ensures default review-order.php and form-checkout.php is used.', 'woocommerce-germanized' ),  
  801. ),  
  802.  
  803. array( 
  804. 'title' => __( 'Force free shipping', 'woocommerce-germanized' ),  
  805. 'desc' => __( 'Force free shipping method if available?', 'woocommerce-germanized' ),  
  806. 'id' => 'woocommerce_gzd_display_checkout_free_shipping_select',  
  807. 'default' => 'no',  
  808. 'type' => 'checkbox',  
  809. 'desc_tip' => __( 'By default WooCommerce will let customers choose other shipping methods than free shipping (if available). This option will force free shipping if available.', 'woocommerce-germanized' ),  
  810. ),  
  811.  
  812. array( 
  813. 'title' => __( 'Hide taxes estimated', 'woocommerce-germanized' ),  
  814. 'desc' => __( 'Do you want to hide the "taxes and shipping estimated" text from your cart?', 'woocommerce-germanized' ),  
  815. 'id' => 'woocommerce_gzd_display_hide_cart_tax_estimated',  
  816. 'default' => 'yes',  
  817. 'type' => 'checkbox',  
  818. 'desc_tip' => __( 'By default WooCommerce adds a "taxes and shipping estimated" text to your cart. This might puzzle your customers and may not meet german law.', 'woocommerce-germanized' ),  
  819. ),  
  820.  
  821. array( 
  822. 'title' => __( 'Show Thumbnails', 'woocommerce-germanized' ),  
  823. 'desc' => __( 'Show product thumbnails on checkout page?', 'woocommerce-germanized' ),  
  824. 'id' => 'woocommerce_gzd_display_checkout_thumbnails',  
  825. 'default' => 'yes',  
  826. 'type' => 'checkbox',  
  827. 'desc_tip' => __( 'Uncheck if you don\'t want to show your product thumbnails within checkout table.', 'woocommerce-germanized' ),  
  828. ),  
  829.  
  830. array( 
  831. 'title' => __( 'Hide Shipping Select', 'woocommerce-germanized' ),  
  832. 'desc' => __( 'Hide shipping rate selection from checkout?', 'woocommerce-germanized' ),  
  833. 'id' => 'woocommerce_gzd_display_checkout_shipping_rate_select',  
  834. 'default' => 'yes',  
  835. 'type' => 'checkbox',  
  836. 'desc_tip' => __( 'This option will hide shipping rate selection from checkout. By then customers will only be able to change their shipping rate on cart page.', 'woocommerce-germanized' ),  
  837. ),  
  838.  
  839. array( 
  840. 'title' => __( 'Show back to cart button', 'woocommerce-germanized' ),  
  841. 'desc' => __( 'Show back to cart button within your checkout table?', 'woocommerce-germanized' ),  
  842. 'id' => 'woocommerce_gzd_display_checkout_back_to_cart_button',  
  843. 'default' => 'no',  
  844. 'type' => 'checkbox',  
  845. 'desc_tip' => __( 'This button may let your customer edit their order before submitting. Some people state that this button should be hidden to avoid legal problems.', 'woocommerce-germanized' ),  
  846. ),  
  847.  
  848. array( 
  849. 'title' => __( 'Show edit data notice', 'woocommerce-germanized' ),  
  850. 'desc' => __( 'Show a "check-your-entries" notice to the user?', 'woocommerce-germanized' ),  
  851. 'id' => 'woocommerce_gzd_display_checkout_edit_data_notice',  
  852. 'default' => 'no',  
  853. 'type' => 'checkbox',  
  854. 'desc_tip' => __( 'This notice will be added right before the order comments field.', 'woocommerce-germanized' ),  
  855. ),  
  856.  
  857. array( 
  858. 'title' => __( 'Checkout Table Color', 'woocommerce-germanized' ),  
  859. 'id' => 'woocommerce_gzd_display_checkout_table_color',  
  860. 'desc_tip' => __( 'Choose the color of your checkout product table. This table should be highlighted within your checkout page.', 'woocommerce-germanized' ),  
  861. 'default' => '#eeeeee',  
  862. 'type' => 'color',  
  863. ),  
  864.  
  865. array( 
  866. 'title' => __( 'Checkout Legal Display', 'woocommerce-germanized' ),  
  867. 'desc' => __( 'Use Text without Checkbox', 'woocommerce-germanized' ),  
  868. 'id' => 'woocommerce_gzd_display_checkout_legal_no_checkbox',  
  869. 'desc_tip' => __( 'This version will remove checkboxes from Checkout and display a text instead. This seems to be legally compliant (Zalando & Co are using this option).', 'woocommerce-germanized' ),  
  870. 'default' => 'no',  
  871. 'type' => 'checkbox',  
  872. ),  
  873.  
  874. array( 
  875. 'title' => __( 'Legal Text', 'woocommerce-germanized' ),  
  876. 'desc' => __( 'Choose a Plain Text which will be shown right above checkout submit button. Use {term_link}{/term_link}, {data_security_link}{/data_security_link}, {revocation_link}{/revocation_link} as Placeholders for the links to legal pages.', 'woocommerce-germanized' ),  
  877. 'desc_tip' => true,  
  878. 'default' => __( 'With your order, you agree to have read and understood our {term_link}Terms and Conditions{/term_link} and your {revocation_link}Right of Recission{/revocation_link}.', 'woocommerce-germanized' ),  
  879. 'css' => 'width:100%; height: 65px;',  
  880. 'id' => 'woocommerce_gzd_checkout_legal_text',  
  881. 'type' => 'textarea',  
  882. ),  
  883.  
  884. array( 
  885. 'title' => __( 'Legal Text Error', 'woocommerce-germanized' ),  
  886. 'desc' => __( 'If you have chosen to use checkbox validation please choose a error message which will be shown if the user doesn\'t check checkbox. Use {term_link}{/term_link}, {data_security_link}{/data_security_link}, {revocation_link}{/revocation_link} as Placeholders for the links to legal pages.', 'woocommerce-germanized' ),  
  887. 'desc_tip' => true,  
  888. 'default' => __( 'To finish the order you have to accept to our {term_link}Terms and Conditions{/term_link} and {revocation_link}Right of Recission{/revocation_link}.', 'woocommerce-germanized' ),  
  889. 'css' => 'width:100%; height: 65px;',  
  890. 'id' => 'woocommerce_gzd_checkout_legal_text_error',  
  891. 'type' => 'textarea',  
  892. ),  
  893.  
  894. array( 
  895. 'title' => __( 'Show digital notice', 'woocommerce-germanized' ),  
  896. 'desc' => __( 'Show checkbox for digital products.', 'woocommerce-germanized' ),  
  897. 'desc_tip' => __( 'Disable this option if you want your customers to obtain their right of recission even if digital products are being bought.', 'woocommerce-germanized' ),  
  898. 'id' => 'woocommerce_gzd_checkout_legal_digital_checkbox',  
  899. 'default' => 'yes',  
  900. 'type' => 'checkbox',  
  901. ),  
  902.  
  903. array( 
  904. 'title' => __( 'Digital Product types', 'woocommerce-germanized' ),  
  905. 'desc' => __( 'Select product types for which the loss of recission notice is shown. Product types like "simple product" may be redudant because they include virtual and downloadable products.', 'woocommerce-germanized' ),  
  906. 'desc_tip' => true,  
  907. 'id' => 'woocommerce_gzd_checkout_legal_digital_types',  
  908. 'default' => array( 'downloadable' ),  
  909. 'class' => 'chosen_select',  
  910. 'options' => $digital_type_options,  
  911. 'type' => 'multiselect',  
  912. ),  
  913.  
  914. array( 
  915. 'title' => __( 'Legal Digital Text', 'woocommerce-germanized' ),  
  916. 'desc' => __( 'Choose a Plain Text which will be shown right above checkout submit button if a user has picked a digital product. See legal text option for possible placeholders.', 'woocommerce-germanized' ),  
  917. 'desc_tip' => true,  
  918. 'default' => __( 'For digital products: I strongly agree that the execution of the agreement starts before the revocation period has expired. I am aware that my right of withdrawal ceases with the beginning of the agreement.', 'woocommerce-germanized' ),  
  919. 'css' => 'width:100%; height: 65px;',  
  920. 'id' => 'woocommerce_gzd_checkout_legal_text_digital',  
  921. 'type' => 'textarea',  
  922. ),  
  923.  
  924. array( 
  925. 'title' => __( 'Legal Digital Error', 'woocommerce-germanized' ),  
  926. 'desc' => __( 'This text will be shown as error message if customer has not checked the corresponding checkbox. See legal text option for possible placeholders.', 'woocommerce-germanized' ),  
  927. 'desc_tip' => true,  
  928. 'default' => __( 'To retrieve direct access to digital content you have to agree to the loss of your right of withdrawal.', 'woocommerce-germanized' ),  
  929. 'css' => 'width:100%; height: 65px;',  
  930. 'id' => 'woocommerce_gzd_checkout_legal_text_digital_error',  
  931. 'type' => 'textarea',  
  932. ),  
  933.  
  934. array( 
  935. 'title' => __( 'Digital Confirmation Notice', 'woocommerce-germanized' ),  
  936. 'desc' => __( 'This text will be appended to your order processing email if the order contains digital products. Use placeholders {link}{/link} to insert link to right of withdrawal page.', 'woocommerce-germanized' ),  
  937. 'desc_tip' => true,  
  938. 'id' => 'woocommerce_gzd_order_confirmation_legal_digital_notice',  
  939. 'default' => __( 'Furthermore you have expressly agreed to start the performance of the contract for digital items (e.g. downloads) before expiry of the withdrawal period. I have noted to lose my {link}right of withdrawal{/link} with the beginning of the performance of the contract.', 'woocommerce-germanized' ),  
  940. 'type' => 'textarea',  
  941. 'css' => 'width:100%; height: 65px;',  
  942. ),  
  943.  
  944. array( 
  945. 'title' => __( 'Show service notice', 'woocommerce-germanized' ),  
  946. 'desc' => __( 'Show checkbox for service products.', 'woocommerce-germanized' ),  
  947. 'desc_tip' => __( 'Disable this option if you want your customers to obtain their right of recission even if service products are being bought.', 'woocommerce-germanized' ),  
  948. 'id' => 'woocommerce_gzd_checkout_legal_service_checkbox',  
  949. 'default' => 'yes',  
  950. 'type' => 'checkbox',  
  951. ),  
  952.  
  953. array( 
  954. 'title' => __( 'Legal Service Text', 'woocommerce-germanized' ),  
  955. 'desc' => __( 'Choose a Plain Text which will be shown right above checkout submit button if a user has picked a service product. See legal text option for possible placeholders.', 'woocommerce-germanized' ),  
  956. 'desc_tip' => true,  
  957. 'default' => __( 'For services: I demand and acknowledge the immediate performance of the service before the expiration of the withdrawal period. I acknowledge that thereby I lose my right to cancel once the service has begun.', 'woocommerce-germanized' ),  
  958. 'css' => 'width:100%; height: 65px;',  
  959. 'id' => 'woocommerce_gzd_checkout_legal_text_service',  
  960. 'type' => 'textarea',  
  961. ),  
  962.  
  963. array( 
  964. 'title' => __( 'Legal Service Error', 'woocommerce-germanized' ),  
  965. 'desc' => __( 'This text will be shown as error message if customer has not checked the corresponding checkbox. See legal text option for possible placeholders.', 'woocommerce-germanized' ),  
  966. 'desc_tip' => true,  
  967. 'default' => __( 'To allow the immediate performance of the services you have to agree to the loss of your right of withdrawal.', 'woocommerce-germanized' ),  
  968. 'css' => 'width:100%; height: 65px;',  
  969. 'id' => 'woocommerce_gzd_checkout_legal_text_service_error',  
  970. 'type' => 'textarea',  
  971. ),  
  972.  
  973. array( 
  974. 'title' => __( 'Service Confirmation Notice', 'woocommerce-germanized' ),  
  975. 'desc' => __( 'This text will be appended to your order processing email if the order contains service products. Use placeholders {link}{/link} to insert link to right of withdrawal page.', 'woocommerce-germanized' ),  
  976. 'desc_tip' => true,  
  977. 'id' => 'woocommerce_gzd_order_confirmation_legal_service_notice',  
  978. 'default' => __( 'Furthermore you have expressly agreed to start the performance of the contract for services before expiry of the withdrawal period. I have noted to lose my {link}right of withdrawal{/link} with the beginning of the performance of the contract.', 'woocommerce-germanized' ),  
  979. 'type' => 'textarea',  
  980. 'css' => 'width:100%; height: 65px;',  
  981. ),  
  982.  
  983. array( 
  984. 'title' => __( 'Pay now Button', 'woocommerce-germanized' ),  
  985. 'desc' => __( 'Add a pay now button to emails and order success page.', 'woocommerce-germanized' ),  
  986. 'desc_tip' => __( 'Add a pay now button to order confirmation email and order success page if the order awaits payment (PayPal etc).', 'woocommerce-germanized' ),  
  987. 'id' => 'woocommerce_gzd_order_pay_now_button',  
  988. 'type' => 'checkbox',  
  989. 'default' => 'yes',  
  990. ),  
  991.  
  992. array( 
  993. 'title' => __( 'Order Success Text', 'woocommerce-germanized' ),  
  994. 'desc' => __( 'Choose a custom text to display on order success page.', 'woocommerce-germanized' ),  
  995. 'desc_tip' => true,  
  996. 'css' => 'width:100%; height: 65px;',  
  997. 'id' => 'woocommerce_gzd_order_success_text',  
  998. 'type' => 'textarea',  
  999. ),  
  1000.  
  1001. array( 
  1002. 'title' => __( 'Order Success Data', 'woocommerce-germanized' ),  
  1003. 'desc' => __( 'Hide product table and customer data on order success page', 'woocommerce-germanized' ),  
  1004. 'id' => 'woocommerce_gzd_hide_order_success_details',  
  1005. 'type' => 'checkbox',  
  1006. 'default' => 'no',  
  1007. ),  
  1008.  
  1009. array( 'type' => 'sectionend', 'id' => 'checkout_options' ),  
  1010.  
  1011. ); 
  1012.  
  1013. return apply_filters( 'woocommerce_germanized_settings_display', $settings ); 
  1014.  
  1015.  
  1016. public function output() { 
  1017.  
  1018. global $current_section; 
  1019. $settings = $this->get_settings(); 
  1020. $sidebar = $this->get_sidebar(); 
  1021.  
  1022. if ( $this->get_sections() ) { 
  1023. foreach ( $this->get_sections() as $section => $name ) { 
  1024. if ( $section == $current_section ) { 
  1025. $settings = apply_filters( 'woocommerce_gzd_get_settings_' . $section, $this->get_settings() ); 
  1026. $sidebar = apply_filters( 'woocommerce_gzd_get_sidebar_' . $section, $sidebar ); 
  1027.  
  1028. do_action( 'woocommerce_gzd_before_section_output', $current_section ); 
  1029.  
  1030. include_once( WC_Germanized()->plugin_path() . '/includes/admin/views/html-settings-section.php' ); 
  1031.  
  1032. public function get_sidebar() { 
  1033. ob_start(); 
  1034. include_once( WC_Germanized()->plugin_path() . '/includes/admin/views/html-settings-sidebar.php' ); 
  1035. $content = ob_get_clean(); 
  1036. return $content; 
  1037.  
  1038. /** 
  1039. * Save settings 
  1040. */ 
  1041. public function save() { 
  1042.  
  1043. global $current_section; 
  1044.  
  1045. $settings = array(); 
  1046.  
  1047. if ( $this->get_sections() ) { 
  1048. foreach ( $this->get_sections() as $section => $name ) { 
  1049. if ( $section == $current_section ) { 
  1050. $settings = apply_filters( 'woocommerce_gzd_get_settings_' . $section, $this->get_settings() ); 
  1051. if ( empty( $settings ) ) 
  1052. return; 
  1053.  
  1054. do_action( 'woocommerce_gzd_before_save_section_' . $current_section, $settings ); 
  1055.  
  1056. if ( apply_filters( 'wc_germanized_show_settings_' . $current_section, true ) ) 
  1057. WC_Admin_Settings::save_fields( $settings ); 
  1058.  
  1059. do_action( 'woocommerce_gzd_after_save_section_' . $current_section, $settings ); 
  1060.  
  1061. public function before_save( $settings ) { 
  1062. if ( !empty( $settings ) ) { 
  1063. foreach ( $settings as $setting ) { 
  1064. if ( $setting[ 'id' ] == 'woocommerce_gzd_small_enterprise' ) { 
  1065. if ( get_option('woocommerce_gzd_small_enterprise') == 'no' && !empty( $_POST['woocommerce_gzd_small_enterprise'] ) ) { 
  1066. // Update woocommerce options to not show tax 
  1067. update_option( 'woocommerce_calc_taxes', 'no' ); 
  1068. update_option( 'woocommerce_prices_include_tax', 'yes' ); 
  1069. update_option( 'woocommerce_tax_display_shop', 'incl' ); 
  1070. update_option( 'woocommerce_tax_display_cart', 'incl' ); 
  1071. update_option( 'woocommerce_price_display_suffix', '' ); 
  1072. } elseif ( get_option('woocommerce_gzd_small_enterprise') == 'yes' && ! isset( $_POST['woocommerce_gzd_small_enterprise'] ) ) { 
  1073. // Update woocommerce options to show tax 
  1074. update_option( 'woocommerce_calc_taxes', 'yes' ); 
  1075. update_option( 'woocommerce_prices_include_tax', 'yes' ); 
  1076. } else if ( $setting[ 'id' ] == 'woocommerce_gzd_enable_virtual_vat' ) { 
  1077. if ( get_option( 'woocommerce_gzd_enable_virtual_vat' ) != 'yes' && ! empty( $_POST[ 'woocommerce_gzd_enable_virtual_vat' ] ) ) { 
  1078. if ( ! empty( $_POST[ 'woocommerce_gzd_small_enterprise' ] ) ) 
  1079. continue; 
  1080. // Update WooCommerce options to show prices including taxes 
  1081. // Check if is small business 
  1082. update_option( 'woocommerce_prices_include_tax', 'yes' ); 
  1083. update_option( 'woocommerce_tax_display_shop', 'incl' ); 
  1084. update_option( 'woocommerce_tax_display_cart', 'incl' ); 
  1085. update_option( 'woocommerce_tax_total_display', 'itemized' ); 
  1086.  
  1087. public function after_save( $settings ) { 
  1088. if ( ! empty( $_POST[ 'woocommerce_gzd_small_enterprise' ] ) ) { 
  1089. update_option( 'woocommerce_gzd_shipping_tax', 'no' ); 
  1090. update_option( 'woocommerce_gzd_shipping_tax_force', 'no' ); 
  1091. update_option( 'woocommerce_gzd_fee_tax', 'no' ); 
  1092. update_option( 'woocommerce_gzd_fee_tax_force', 'no' ); 
  1093. if ( ! empty( $_POST[ 'woocommerce_gzd_enable_virtual_vat' ] ) ) { 
  1094. update_option( 'woocommerce_gzd_enable_virtual_vat', 'no' ); 
  1095. WC_Admin_Settings::add_error( __( 'Sorry, but the new Virtual VAT rules cannot be applied to small business.', 'woocommerce-germanized' ) ); 
  1096. if ( 'yes' === get_option( 'woocommerce_gzd_enable_virtual_vat' ) ) { 
  1097. // Make sure that tax based location is set to billing address 
  1098. if ( 'base' === get_option( 'woocommerce_tax_based_on' ) ) 
  1099. update_option( 'woocommerce_tax_based_on', 'billing' ); 
  1100.  
  1101. public function output_premium_section() { 
  1102. global $current_section; 
  1103. if ( ! isset( $this->premium_sections[ $current_section ] ) ) 
  1104. return; 
  1105. $GLOBALS[ 'hide_save_button' ] = true; 
  1106. $section_title = $this->premium_sections[ $current_section ]; 
  1107. include_once( WC_Germanized()->plugin_path() . '/includes/admin/views/html-settings-pro.php' ); 
  1108.  
  1109. public function set_premium_sections( $sections ) { 
  1110. return $sections + $this->premium_sections; 
  1111.  
  1112. public function get_premium_settings() { 
  1113. return array(); 
  1114.  
  1115. public function get_premium_sidebar() { 
  1116. return ''; 
  1117.