Jake Vanderwerf
23 hours ago f4be611c51473359e6d41780f0313c446079e9d3
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
<?php
namespace JVBase\managers\SEO\render\Traits\_Properties;
 
use JVBase\managers\SEO\render\Traits\_Helpers\arrayHelper;
 
if (!defined('ABSPATH')) {
    exit;
}
trait currenciesAcceptedTrait {
    use arrayHelper;
    /**
     * @var string|array The currency accepted.
     *
     * Use standard formats: ISO 4217 currency format, e.g. "USD"; Ticker symbol for cryptocurrencies, e.g. "BTC"; well known names for Local Exchange Trading Systems (LETS) and other currency types, e.g. "Ithaca HOUR".
     */
    protected string|array $currenciesAccepted;
 
    public function getCurrenciesAccepted():string|array|null
    {
        return $this->currenciesAccepted??null;
    }
    public function setCurrenciesAccepted(string|array $currenciesAccepted):void
    {
        if (is_array($currenciesAccepted)) {
            $currenciesAccepted = $this->stringArray('currenciesAccepted', $currenciesAccepted);
        }
        $this->currenciesAccepted = $currenciesAccepted;
    }
 
    public function getCurrenciesAcceptedFieldConfig():array
    {
        return [
            'type'  => 'text',
            'label' => 'Currencies Accepted',
            'hint'  => 'A comma separated list of currencies (ex: CAD, USD)',
            'default' => 'CAD'
        ];
    }
}