/var/www/html_fr/wp-content/plugins/yaymail/src/Elements/BillingAddress.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
namespace YayMail\Elements;

use 
YayMail\Abstracts\BaseElement;
use 
YayMail\Utils\SingletonTrait;

/**
 * Billing Address Elements
 */
class BillingAddress extends BaseElement {

    use 
SingletonTrait;

    protected static 
$type 'billing_address';

    public 
$available_email_ids = [ YAYMAIL_WITH_ORDER_EMAILS ];

    public static function 
get_data$attributes = [] ) {
        
self::$icon '<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 20 20">
  <path d="M17.5,2.5v15H2.5V2.5h15M18.5,1H1.5c-.28,0-.5.22-.5.5v17c0,.28.22.5.5.5h17c.28,0,.5-.22.5-.5V1.5c0-.28-.22-.5-.5-.5h0Z"/>
  <path d="M6.79,7.33c.57,0,1.04.47,1.04,1.04s-.47,1.04-1.04,1.04-1.04-.47-1.04-1.04.47-1.04,1.04-1.04M6.79,5.83c-1.4,0-2.54,1.14-2.54,2.54s1.14,2.54,2.54,2.54,2.54-1.14,2.54-2.54-1.14-2.54-2.54-2.54h0Z"/>
  <path d="M10.75,13.46h-1.5c0-1.25-1.01-2.26-2.26-2.26s-2.26,1.01-2.26,2.26h-1.5c0-2.07,1.69-3.76,3.76-3.76s3.76,1.69,3.76,3.76Z"/>
  <rect x="12.24" y="7.5" width="2.94" height="1.5"/>
  <rect x="12.24" y="10.87" width="4.62" height="1.5"/>
</svg>'
;

        return [
            
'id'        => uniqid(),
            
'type'      => self::$type,
            
'name'      => __'Billing Address''woocommerce' ),
            
'icon'      => self::$icon,
            
'group'     => 'woocommerce',
            
'available' => true,
            
'position'  => 170,
            
'data'      => [
                
'padding'          => ElementsHelper::get_spacing$attributes ),
                
'background_color' => ElementsHelper::get_color$attributes, [ 'default_value' => '#fff' ] ),
                
'title_color'      => ElementsHelper::get_color(
                    
$attributes,
                    [
                        
'value_path'    => 'title_color',
                        
'title'         => __'Title color''yaymail' ),
                        
'default_value' => YAYMAIL_COLOR_WC_DEFAULT,
                    ]
                ),

                
'text_color'       => ElementsHelper::get_color(
                    
$attributes,
                    [
                        
'value_path'    => 'text_color',
                        
'title'         => __'Text color''yaymail' ),
                        
'default_value' => YAYMAIL_COLOR_TEXT_DEFAULT,
                    ]
                ),

                
'border_color'     => ElementsHelper::get_color(
                    
$attributes,
                    [
                        
'value_path'    => 'border_color',
                        
'title'         => __'Border color''yaymail' ),
                        
'default_value' => YAYMAIL_COLOR_BORDER_DEFAULT,
                    ]
                ),
                
'font_family'      => ElementsHelper::get_font_family_selector$attributes ),
                
'title'            => ElementsHelper::get_rich_text(
                    
$attributes,
                    [
                        
'value_path'    => 'title',
                        
'title'         => __'Billing title''yaymail' ),
                        
'default_value' => '<span style="font-size: 20px;font-weight:600;">' __'Billing Address''woocommerce' ) . '</span>',
                    ]
                ),
                
'rich_text'        => [
                    
'value_path'    => 'rich_text',
                    
'component'     => '',
                    
'title'         => __'Content''yaymail' ),
                    
'default_value' => '[yaymail_billing_address]',
                    
'type'          => 'content',
                ],
            ],
        ];
    }
}