PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.7.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.7.0
2.7.0 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 All 43 releases
sellkit / includes / dynamic-keywords / keywords / order-billing-address.php

order-billing-address.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 2.7.0, at includes/dynamic-keywords/keywords/order-billing-address.php

51 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Order_Billing_Address extends Tag_Base {
4 /**
5 * Get class id.
6 *
7 * @return string
8 */
9 public function get_id() {
10 return '_order_billing_address';
11 }
12
13 /**
14 * Get class title.
15 *
16 * @return string
17 */
18 public function get_title() {
19 return esc_html__( 'Order Billing Address', 'sellkit' );
20 }
21
22 /**
23 * Render true content.
24 *
25 * @param array $atts array of shortcode arguments.
26 * @return string
27 */
28 public function render_content( $atts ) {
29 $this->get_data();
30
31 if ( empty( self::$order ) ) {
32 return $this->shortcode_content( $atts );
33 }
34
35 $order_data = self::$order->get_data();
36
37 $adresses = [];
38
39 $adress_1 = isset( $order_data['billing']['address_1'] ) ? $order_data['billing']['address_1'] : '';
40 $adress_2 = isset( $order_data['billing']['address_2'] ) ? $order_data['billing']['address_2'] : '';
41
42 $adresses = [ $adress_1, $adress_2 ];
43
44 if ( empty( $adress_1 ) && empty( $adress_2 ) ) {
45 return $this->shortcode_content( $atts );
46 }
47
48 return implode( ' ', $adresses );
49 }
50 }
51