-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathSettings.php
152 lines (122 loc) · 3.36 KB
/
Settings.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<?php
/**
* Mailchimp for Craft Commerce
*
* @link https://ethercreative.co.uk
* @copyright Copyright (c) 2019 Ether Creative
*/
namespace ether\mc\models;
use Craft;
use craft\base\Model;
/**
* Class Settings
*
* @author Ether Creative
* @package ether\mc\models
*/
class Settings extends Model
{
// Properties
// =========================================================================
/**
* @var bool If true, all syncing will be disabled (useful for staging environments)
*/
public $disableSyncing = false;
// Mailchimp
// -------------------------------------------------------------------------
/**
* @var string Your Mailchimp API key
* @see https://mailchimp.com/help/about-api-keys/
*/
public $apiKey;
/**
* @var string A unique store ID
* @internal Set by the plugin on install, DO NOT MODIFY
*/
public $storeId;
/**
* @var string The Mailchimp list ID the store is set to
* @internal Set on initial sync, DO NOT MODIFY.
*/
public $listId;
/**
* @var string The UID of the field to use for opt-in. MUST be a lightswitch.
*/
public $optInField;
// Commerce
// -------------------------------------------------------------------------
/**
* @var string The handle of the status meaning the order has been shipped
*/
public $shippedStatusHandle = 'shipped';
/**
* @var string The transform UID to use when transforming thumbnails
*/
public $thumbnailTransform;
/**
* @var string The transform UID to use when transforming images
*/
public $imageTransform;
/**
* @var string The URL to use for promo redemption's, i.e.
* `/cart?discount={code}`, defaults to site index.
*/
public $promoRedemptionUrl;
/**
* @var string The URL to redirect to after restoring an abandoned cart.
*/
public $abandonedCartRestoreUrl;
/**
* @var string The error notice sent when an abandoned cart has expired.
*/
public $expiredCartError = 'Your cart has expired!';
/**
* @var string The error notice sent when an abandoned cart that has
* already been completed is attempted to be restored.
*/
public $completedCartError = 'You\'ve already completed this order!';
/**
* @var string The success notice sent when an abandoned cart is restored.
*/
public $cartRestoredNotice = 'Your cart has been restored!';
// Products
// -------------------------------------------------------------------------
/**
* @var array An array of [productTypeUid => vendorFieldUid]
*/
public $productVendorFields = [];
/**
* @var array An array of [productTypeUid => descriptionFieldUid]
*/
public $productDescriptionFields = [];
/**
* @var array An array of [productTypeUid => thumbnailFieldUid]
*/
public $productThumbnailFields = [];
/**
* @var array An array of [productTypeUid => imageFieldUid]
*/
public $productImageFields = [];
/**
* @var array An array of [productTypeUid => thumbnailFieldUid]
*/
public $variantThumbnailFields = [];
/**
* @var array An array of [productTypeUid => imageFieldUid]
*/
public $variantImageFields = [];
// Methods
// =========================================================================
/**
* Gets the data center from the api key
*
* @return string|null
*/
public function getDataCenter ()
{
if (!$this->apiKey)
return null;
$parts = explode('-', Craft::parseEnv($this->apiKey));
return end($parts);
}
}