1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace WC_POS\Admin\Settings;
13
14 use WC_Payment_Gateway;
15
16 class Gateways extends Page {
17
18
19
20
21 22 23
24 public function __construct($gateway_id) {
25 $this->id = 'gateway_'.$gateway_id;
26 $this->defaults = array(
27 'icon' => true
28 );
29 }
30
31 32 33
34 public function merge_settings(WC_Payment_Gateway $gateway) {
35 $data = $this->get();
36 if(isset($data['title'])){
37 $gateway->title = $data['title'];
38 }
39 if(isset($data['description'])){
40 $gateway->description = $data['description'];
41 }
42 $gateway->has_icon = $gateway->get_icon() != '';
43 $gateway->show_icon = isset($data['icon']) ? $data['icon']: true ;
44 }
45
46 }