PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / trunk
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster vtrunk
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / compatibility / wpml / modules / checkout-billing.php

checkout-billing.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster trunk, at includes/compatibility/wpml/modules/checkout-billing.php

92 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sellkit\Compatibility\Wpml\Modules;
4
5 defined( 'ABSPATH' ) || die();
6
7 /**
8 * Class Checkout_Billing
9 *
10 * This class handles the compatibility of the fields in Sellkit
11 * with WPML for translation within Elementor modules.
12 *
13 * @since 2.3.2
14 */
15 class Checkout_Billing extends \WPML_Elementor_Module_With_Items {
16 /**
17 * Retrieves the field name that holds the items.
18 *
19 * @since 2.3.2
20 *
21 * @return string The name of the field that contains the items.
22 */
23 public function get_items_field() {
24 return 'billing_list';
25 }
26
27 /**
28 * Retrieves the fields that are translatable.
29 *
30 * @since 2.3.2
31 *
32 * @return array List of fields that support translations.
33 */
34 public function get_fields() {
35 return [
36 'billing_list_placeholder',
37 'billing_custom_value',
38 'billing_custom_options',
39 ];
40 }
41
42 /**
43 * Retrieves the translation title for each field.
44 *
45 * @since 2.3.2
46 *
47 * @param string $field The field name.
48 *
49 * @return string The title for the translation of the field.
50 */
51 protected function get_title( $field ) {
52 switch ( $field ) {
53 case 'billing_list_placeholder':
54 return esc_html__( 'Sellkit Checkout: Billing Fields Field Label', 'sellkit' );
55
56 case 'billing_custom_value':
57 return esc_html__( 'Sellkit Checkout: Billing Fields Default Value', 'sellkit' );
58
59 case 'billing_custom_options':
60 return esc_html__( 'Sellkit Checkout: Billing Fields Options', 'sellkit' );
61
62 default:
63 return '';
64 }
65 }
66
67 /**
68 * Retrieves the editor type for each field.
69 *
70 * @since 2.3.2
71 *
72 * @param string $field The field name.
73 *
74 * @return string The editor type for the translation.
75 */
76 protected function get_editor_type( $field ) {
77 switch ( $field ) {
78 case 'billing_list_placeholder':
79 return 'LINE';
80
81 case 'billing_custom_value':
82 return 'LINE';
83
84 case 'billing_custom_options':
85 return 'AREA';
86
87 default:
88 return '';
89 }
90 }
91 }
92