PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.84
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.84
51.1.86 51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 All 40 releases
king-addons / includes / widgets / Woo_My_Account_Address / Woo_My_Account_Address.php

Woo_My_Account_Address.php in King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder 51.1.84, at includes/widgets/Woo_My_Account_Address/Woo_My_Account_Address.php

93 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 * Woo My Account Address widget.
4 *
5 * @package King_Addons
6 */
7
8 namespace King_Addons;
9
10 use Elementor\Group_Control_Typography;
11
12 if (!defined('ABSPATH')) {
13 exit;
14 }
15
16 /**
17 * Renders address management form.
18 */
19 class Woo_My_Account_Address extends Abstract_My_Account_Widget
20 {
21 public function get_name(): string
22 {
23 return 'woo_my_account_address';
24 }
25
26 public function get_title(): string
27 {
28 return esc_html__('My Account Address', 'king-addons');
29 }
30
31 public function get_icon(): string
32 {
33 return 'king-addons-icon king-addons-woo-my-account-address';
34 }
35
36 public function get_categories(): array
37 {
38 return ['king-addons-woo-builder'];
39 }
40
41 public function get_style_depends(): array
42 {
43 return [KING_ADDONS_ASSETS_UNIQUE_KEY . '-woo-my-account-address-style'];
44 }
45
46 protected function register_controls(): void
47 {
48 $this->start_controls_section(
49 'section_style',
50 [
51 'label' => esc_html__('Style', 'king-addons'),
52 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
53 ]
54 );
55
56 $this->add_group_control(
57 Group_Control_Typography::get_type(),
58 [
59 'name' => 'text_typography',
60 'selector' => '{{WRAPPER}} .ka-woo-my-account-address',
61 ]
62 );
63
64 $this->end_controls_section();
65 }
66
67 protected function render(): void
68 {
69 if (!$this->should_render()) {
70 $this->render_missing_account_notice();
71 return;
72 }
73
74 if (!$this->is_current_endpoint('edit-address')) {
75 return;
76 }
77
78 if ($this->maybe_render_login_form()) {
79 return;
80 }
81
82 echo '<div class="ka-woo-my-account-address">';
83 wc_get_template('myaccount/my-address.php', ['customer_id' => get_current_user_id()]);
84 echo '</div>';
85 }
86 }
87
88
89
90
91
92
93