Version Description
No Upgrade required at this time.
Download this release
Release Info
Developer | digitalchild |
Plugin | WC Vendors |
Version | 1.6.1 |
Comparing to | |
See all releases |
Code changes from version 1.5.0 to 1.6.1
- WCVendors/classes/admin/settings/assets/js/select2/select2.min.css +0 -440
- WCVendors/classes/admin/settings/assets/js/select2/spinner.gif +0 -0
- WCVendors/languages/default.pot +0 -1451
- WCVendors/languages/wc_vendors-de_DE.mo +0 -0
- WCVendors/languages/wc_vendors-de_DE.po +0 -1439
- WCVendors/languages/wc_vendors-en_US.mo +0 -0
- WCVendors/languages/wc_vendors-en_US.po +0 -1199
- WCVendors/languages/wc_vendors-fr_FR.mo +0 -0
- WCVendors/languages/wc_vendors-fr_FR.po +0 -1286
- WCVendors/languages/wc_vendors-it_IT.mo +0 -0
- WCVendors/languages/wc_vendors-it_IT.po +0 -1288
- WCVendors/views/front/vendor-list.php +0 -18
- {WCVendors/assets → assets}/css/wcv-frontend.css +543 -543
- {WCVendors/assets → assets}/images/icons/truck.png +0 -0
- {WCVendors/assets → assets}/js/front-orders.js +8 -8
- {WCVendors/assets → assets}/js/wcv-admin-quick-edit.js +0 -0
- changelog.txt +17 -0
- class-wc-vendors.php +83 -7
- {WCVendors/classes → classes}/admin/class-admin-page.php +590 -590
- {WCVendors/classes → classes}/admin/class-admin-reports.php +398 -398
- {WCVendors/classes → classes}/admin/class-admin-users.php +411 -411
- {WCVendors/classes → classes}/admin/class-product-meta.php +265 -265
- {WCVendors/classes → classes}/admin/class-vendor-applicants.php +101 -101
- {WCVendors/classes → classes}/admin/class-vendor-reports.php +121 -121
- {WCVendors/classes → classes}/admin/emails/class-emails.php +131 -131
- {WCVendors/classes → classes}/admin/emails/class-wc-approve-vendor.php +165 -165
- {WCVendors/classes → classes}/admin/emails/class-wc-notify-admin.php +173 -173
- {WCVendors/classes → classes}/admin/emails/class-wc-notify-shipped.php +198 -198
- {WCVendors/classes → classes}/admin/emails/class-wc-notify-vendor.php +265 -265
- {WCVendors/classes → classes}/admin/settings/README.md +126 -126
- {WCVendors/classes → classes}/admin/settings/assets/css/sf-styles.css +167 -167
- {WCVendors/classes → classes}/admin/settings/assets/img/tip.png +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/bootstrap-tooltip.js +125 -125
- {WCVendors/classes → classes}/admin/settings/assets/js/js.iml +10 -10
- {WCVendors/classes → classes}/admin/settings/assets/js/select2/select2-bootstrap.css +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/select2/select2-spinner.gif +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.css +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.js +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.min.js +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.png +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/select2/select2x2.png +0 -0
- {WCVendors/classes → classes}/admin/settings/assets/js/sf-jquery.js +22 -22
- {WCVendors/classes → classes}/admin/settings/classes/sf-class-format-options.php +347 -347
- {WCVendors/classes → classes}/admin/settings/classes/sf-class-sanitize.php +160 -160
- {WCVendors/classes → classes}/admin/settings/classes/sf-class-settings.php +913 -913
- {WCVendors/classes → classes}/admin/settings/sf-options.php +315 -315
- {WCVendors/classes → classes}/class-commission.php +341 -341
- {WCVendors/classes → classes}/class-cron.php +165 -165
- {WCVendors/classes → classes}/class-install.php +245 -245
- {WCVendors/classes → classes}/class-queries.php +278 -278
- {WCVendors/classes → classes}/class-shipping.php +249 -249
- {WCVendors/classes → classes}/class-vendors.php +418 -414
- {WCVendors/classes → classes}/front/class-vendor-cart.php +63 -63
- {WCVendors/classes → classes}/front/class-vendor-shop.php +266 -266
- {WCVendors/classes → classes}/front/dashboard/class-vendor-dashboard.php +378 -378
- {WCVendors/classes → classes}/front/orders/class-export-csv.php +77 -77
- {WCVendors/classes → classes}/front/orders/class-orders.php +293 -293
- {WCVendors/classes → classes}/front/orders/class-submit-comment.php +81 -81
- {WCVendors/classes → classes}/front/signup/class-vendor-signup.php +0 -0
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/assets/icons/index.php +0 -0
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/assets/icons/paypalap.png +0 -0
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/assets/index.php +0 -0
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/ChangeLog.txt +32 -32
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/LICENSE.txt +41 -41
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/README.md +57 -57
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/build.xml +24 -24
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/config/cert_key.pem +31 -31
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/config/sdk_config.ini +26 -26
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/IPPCredential.php +52 -52
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPAPIService.php +62 -62
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPAuthenticationManager.php +90 -90
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPBaseService.php +88 -88
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPCertificateCredential.php +71 -71
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPConfigManager.php +124 -124
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPConnectionManager.php +48 -48
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPCredentialManager.php +116 -116
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPHttpConnection.php +184 -184
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPLoggingManager.php +83 -83
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPObjectTransformer.php +33 -33
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPSignatureCredential.php +49 -49
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPUtils.php +273 -273
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/auth/AuthUtil.php +83 -83
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/auth/PPAuth.php +1073 -1073
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/cacert.pem +171 -171
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/exceptions/PPConfigurationException.php +8 -8
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/exceptions/PPConnectionException.php +19 -19
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/exceptions/PPInvalidCredentialException.php +21 -21
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/exceptions/PPMissingCredentialException.php +21 -21
- {WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/exceptions/PPTransformerException.php +19 -19
- {WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/services/AdaptivePayments/AdaptivePayments.php +0 -3462
WCVendors/classes/admin/settings/assets/js/select2/select2.min.css
DELETED
@@ -1,440 +0,0 @@
|
|
1 |
-
.select2-container {
|
2 |
-
position: relative;
|
3 |
-
zoom: 1;
|
4 |
-
display: inline;
|
5 |
-
vertical-align: top;
|
6 |
-
}
|
7 |
-
|
8 |
-
.select2-container, .select2-drop, .select2-search, .select2-search input {
|
9 |
-
-moz-box-sizing: border-box;
|
10 |
-
-ms-box-sizing: border-box;
|
11 |
-
-webkit-box-sizing: border-box;
|
12 |
-
-khtml-box-sizing: border-box;
|
13 |
-
box-sizing: border-box;
|
14 |
-
}
|
15 |
-
|
16 |
-
.select2-container .select2-choice {
|
17 |
-
background-color: #fff;
|
18 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
|
19 |
-
background-image: linear-gradient(top, #eeeeee0%, #ffffff50%);
|
20 |
-
-webkit-border-radius: 4px;
|
21 |
-
-moz-border-radius: 4px;
|
22 |
-
border-radius: 4px;
|
23 |
-
-moz-background-clip: padding;
|
24 |
-
-webkit-background-clip: padding-box;
|
25 |
-
background-clip: padding-box;
|
26 |
-
border: 1px solid #aaa;
|
27 |
-
display: block;
|
28 |
-
overflow: hidden;
|
29 |
-
white-space: nowrap;
|
30 |
-
position: relative;
|
31 |
-
height: 26px;
|
32 |
-
line-height: 26px;
|
33 |
-
color: #444;
|
34 |
-
text-decoration: none;
|
35 |
-
padding: 0 0 0 8px;
|
36 |
-
}
|
37 |
-
|
38 |
-
.select2-container.select2-drop-above .select2-choice {
|
39 |
-
border-bottom-color: #aaa;
|
40 |
-
-webkit-border-radius: 0 0 4px 4px;
|
41 |
-
-moz-border-radius: 0 0 4px 4px;
|
42 |
-
border-radius: 0 0 4px 4px;
|
43 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0);
|
44 |
-
background-image: linear-gradient(top, #eeeeee0%, #ffffff90%);
|
45 |
-
}
|
46 |
-
|
47 |
-
.select2-container .select2-choice span {
|
48 |
-
margin-right: 26px;
|
49 |
-
display: block;
|
50 |
-
overflow: hidden;
|
51 |
-
white-space: nowrap;
|
52 |
-
-o-text-overflow: ellipsis;
|
53 |
-
-ms-text-overflow: ellipsis;
|
54 |
-
text-overflow: ellipsis;
|
55 |
-
}
|
56 |
-
|
57 |
-
.select2-container .select2-choice abbr {
|
58 |
-
display: block;
|
59 |
-
position: absolute;
|
60 |
-
right: 26px;
|
61 |
-
top: 8px;
|
62 |
-
width: 12px;
|
63 |
-
height: 12px;
|
64 |
-
font-size: 1px;
|
65 |
-
background: url(select2.png) right top no-repeat;
|
66 |
-
cursor: pointer;
|
67 |
-
text-decoration: none;
|
68 |
-
border: 0;
|
69 |
-
outline: 0;
|
70 |
-
}
|
71 |
-
|
72 |
-
.select2-container .select2-choice abbr:hover {
|
73 |
-
background-position: right -11px;
|
74 |
-
cursor: pointer;
|
75 |
-
}
|
76 |
-
|
77 |
-
.select2-drop {
|
78 |
-
background: #fff;
|
79 |
-
color: #000;
|
80 |
-
border: 1px solid #aaa;
|
81 |
-
border-top: 0;
|
82 |
-
position: absolute;
|
83 |
-
top: 100%;
|
84 |
-
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
85 |
-
-moz-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
86 |
-
-o-box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
87 |
-
box-shadow: 0 4px 5px rgba(0, 0, 0, .15);
|
88 |
-
z-index: 9999;
|
89 |
-
width: 100%;
|
90 |
-
margin-top: -1px;
|
91 |
-
-webkit-border-radius: 0 0 4px 4px;
|
92 |
-
-moz-border-radius: 0 0 4px 4px;
|
93 |
-
border-radius: 0 0 4px 4px;
|
94 |
-
}
|
95 |
-
|
96 |
-
.select2-drop.select2-drop-above {
|
97 |
-
-webkit-border-radius: 4px 4px 0 0;
|
98 |
-
-moz-border-radius: 4px 4px 0 0;
|
99 |
-
border-radius: 4px 4px 0 0;
|
100 |
-
margin-top: 1px;
|
101 |
-
border-top: 1px solid #aaa;
|
102 |
-
border-bottom: 0;
|
103 |
-
-webkit-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
104 |
-
-moz-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
105 |
-
-o-box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
106 |
-
box-shadow: 0 -4px 5px rgba(0, 0, 0, .15);
|
107 |
-
}
|
108 |
-
|
109 |
-
.select2-container .select2-choice div {
|
110 |
-
-webkit-border-radius: 0 4px 4px 0;
|
111 |
-
-moz-border-radius: 0 4px 4px 0;
|
112 |
-
border-radius: 0 4px 4px 0;
|
113 |
-
-moz-background-clip: padding;
|
114 |
-
-webkit-background-clip: padding-box;
|
115 |
-
background-clip: padding-box;
|
116 |
-
background: #ccc;
|
117 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#cccccc', endColorstr='#eeeeee', GradientType=0);
|
118 |
-
background-image: linear-gradient(top, #cccccc0%, #eeeeee60%);
|
119 |
-
border-left: 1px solid #aaa;
|
120 |
-
position: absolute;
|
121 |
-
right: 0;
|
122 |
-
top: 0;
|
123 |
-
display: block;
|
124 |
-
height: 100%;
|
125 |
-
width: 18px;
|
126 |
-
}
|
127 |
-
|
128 |
-
.select2-container .select2-choice div b {
|
129 |
-
background: url(select2.png) no-repeat 0 1px;
|
130 |
-
display: block;
|
131 |
-
width: 100%;
|
132 |
-
height: 100%;
|
133 |
-
}
|
134 |
-
|
135 |
-
.select2-search {
|
136 |
-
display: inline-block;
|
137 |
-
white-space: nowrap;
|
138 |
-
z-index: 10000;
|
139 |
-
position: relative;
|
140 |
-
min-height: 26px;
|
141 |
-
width: 100%;
|
142 |
-
padding-left: 4px;
|
143 |
-
padding-right: 4px;
|
144 |
-
margin: 0;
|
145 |
-
}
|
146 |
-
|
147 |
-
.select2-search-hidden {
|
148 |
-
display: block;
|
149 |
-
position: absolute;
|
150 |
-
left: -10000px;
|
151 |
-
}
|
152 |
-
|
153 |
-
.select2-search input {
|
154 |
-
background: url(select2.png) no-repeat 100% -22px linear-gradient(top, #ffffff85%, #eeeeee99%);
|
155 |
-
outline: 0;
|
156 |
-
border: 1px solid #aaa;
|
157 |
-
font-family: sans-serif;
|
158 |
-
font-size: 1em;
|
159 |
-
width: 100%;
|
160 |
-
height: auto !important;
|
161 |
-
min-height: 26px;
|
162 |
-
-webkit-box-shadow: none;
|
163 |
-
-moz-box-shadow: none;
|
164 |
-
box-shadow: none;
|
165 |
-
border-radius: 0;
|
166 |
-
-moz-border-radius: 0;
|
167 |
-
-webkit-border-radius: 0;
|
168 |
-
margin: 0;
|
169 |
-
padding: 4px 20px 4px 5px;
|
170 |
-
}
|
171 |
-
|
172 |
-
.select2-drop.select2-drop-above .select2-search input {
|
173 |
-
margin-top: 4px;
|
174 |
-
}
|
175 |
-
|
176 |
-
.select2-search input.select2-active {
|
177 |
-
background: url(spinner.gif) no-repeat 100% linear-gradient(top, #ffffff85%, #eeeeee99%);
|
178 |
-
}
|
179 |
-
|
180 |
-
.select2-dropdown-open .select2-choice {
|
181 |
-
border: 1px solid #aaa;
|
182 |
-
border-bottom-color: transparent;
|
183 |
-
-webkit-box-shadow: 0 1px 0 #fff inset;
|
184 |
-
-moz-box-shadow: 0 1px 0 #fff inset;
|
185 |
-
-o-box-shadow: 0 1px 0 #fff inset;
|
186 |
-
box-shadow: 0 1px 0 #fff inset;
|
187 |
-
background-color: #eee;
|
188 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
|
189 |
-
background-image: linear-gradient(top, #ffffff0%, #eeeeee50%);
|
190 |
-
-webkit-border-bottom-left-radius: 0;
|
191 |
-
-webkit-border-bottom-right-radius: 0;
|
192 |
-
-moz-border-radius-bottomleft: 0;
|
193 |
-
-moz-border-radius-bottomright: 0;
|
194 |
-
border-bottom-left-radius: 0;
|
195 |
-
border-bottom-right-radius: 0;
|
196 |
-
}
|
197 |
-
|
198 |
-
.select2-dropdown-open .select2-choice div {
|
199 |
-
background: transparent;
|
200 |
-
border-left: none;
|
201 |
-
}
|
202 |
-
|
203 |
-
.select2-dropdown-open .select2-choice div b {
|
204 |
-
background-position: -18px 1px;
|
205 |
-
}
|
206 |
-
|
207 |
-
.select2-results {
|
208 |
-
position: relative;
|
209 |
-
overflow-x: hidden;
|
210 |
-
overflow-y: auto;
|
211 |
-
max-height: 200px;
|
212 |
-
margin: 4px 4px 4px 0;
|
213 |
-
padding: 0 0 0 4px;
|
214 |
-
}
|
215 |
-
|
216 |
-
.select2-results ul.select2-result-sub {
|
217 |
-
margin: 0;
|
218 |
-
}
|
219 |
-
|
220 |
-
.select2-results ul.select2-result-sub > li .select2-result-label {
|
221 |
-
padding-left: 20px;
|
222 |
-
}
|
223 |
-
|
224 |
-
.select2-results ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
|
225 |
-
padding-left: 40px;
|
226 |
-
}
|
227 |
-
|
228 |
-
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
|
229 |
-
padding-left: 60px;
|
230 |
-
}
|
231 |
-
|
232 |
-
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
|
233 |
-
padding-left: 80px;
|
234 |
-
}
|
235 |
-
|
236 |
-
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
|
237 |
-
padding-left: 100px;
|
238 |
-
}
|
239 |
-
|
240 |
-
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
|
241 |
-
padding-left: 110px;
|
242 |
-
}
|
243 |
-
|
244 |
-
.select2-results ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub ul.select2-result-sub > li .select2-result-label {
|
245 |
-
padding-left: 120px;
|
246 |
-
}
|
247 |
-
|
248 |
-
.select2-results li {
|
249 |
-
list-style: none;
|
250 |
-
display: list-item;
|
251 |
-
}
|
252 |
-
|
253 |
-
.select2-results li.select2-result-with-children > .select2-result-label {
|
254 |
-
font-weight: 700;
|
255 |
-
}
|
256 |
-
|
257 |
-
.select2-results .select2-result-label {
|
258 |
-
cursor: pointer;
|
259 |
-
margin: 0;
|
260 |
-
padding: 3px 7px 4px;
|
261 |
-
}
|
262 |
-
|
263 |
-
.select2-results .select2-highlighted {
|
264 |
-
background: #3875d7;
|
265 |
-
color: #fff;
|
266 |
-
}
|
267 |
-
|
268 |
-
.select2-results li em {
|
269 |
-
background: #feffde;
|
270 |
-
font-style: normal;
|
271 |
-
}
|
272 |
-
|
273 |
-
.select2-results .select2-highlighted em {
|
274 |
-
background: transparent;
|
275 |
-
}
|
276 |
-
|
277 |
-
.select2-more-results.select2-active {
|
278 |
-
background: #f4f4f4 url(spinner.gif) no-repeat 100%;
|
279 |
-
}
|
280 |
-
|
281 |
-
.select2-container.select2-container-disabled .select2-choice div {
|
282 |
-
background-color: #f4f4f4;
|
283 |
-
background-image: none;
|
284 |
-
border-left: 0;
|
285 |
-
}
|
286 |
-
|
287 |
-
.select2-container-multi .select2-choices {
|
288 |
-
background-color: #fff;
|
289 |
-
background-image: linear-gradient(top, #eeeeee1%, #ffffff15%);
|
290 |
-
border: 1px solid #aaa;
|
291 |
-
cursor: text;
|
292 |
-
overflow: hidden;
|
293 |
-
height: auto !important;
|
294 |
-
position: relative;
|
295 |
-
min-height: 26px;
|
296 |
-
margin: 0;
|
297 |
-
padding: 0;
|
298 |
-
}
|
299 |
-
|
300 |
-
.select2-container-multi .select2-choices li {
|
301 |
-
float: left;
|
302 |
-
list-style: none;
|
303 |
-
}
|
304 |
-
|
305 |
-
.select2-container-multi .select2-choices .select2-search-field {
|
306 |
-
white-space: nowrap;
|
307 |
-
margin: 0;
|
308 |
-
padding: 0;
|
309 |
-
}
|
310 |
-
|
311 |
-
.select2-container-multi .select2-choices .select2-search-field input {
|
312 |
-
color: #666;
|
313 |
-
background: transparent !important;
|
314 |
-
font-family: sans-serif;
|
315 |
-
font-size: 100%;
|
316 |
-
height: 15px;
|
317 |
-
outline: 0;
|
318 |
-
border: 0;
|
319 |
-
-webkit-box-shadow: none;
|
320 |
-
-moz-box-shadow: none;
|
321 |
-
-o-box-shadow: none;
|
322 |
-
box-shadow: none;
|
323 |
-
margin: 1px 0;
|
324 |
-
padding: 5px;
|
325 |
-
}
|
326 |
-
|
327 |
-
.select2-container-multi .select2-choices .select2-search-field input.select2-active {
|
328 |
-
background: #fff url(spinner.gif) no-repeat 100% !important;
|
329 |
-
}
|
330 |
-
|
331 |
-
.select2-default {
|
332 |
-
color: #999 !important;
|
333 |
-
}
|
334 |
-
|
335 |
-
.select2-container-multi .select2-choices .select2-search-choice {
|
336 |
-
-webkit-border-radius: 3px;
|
337 |
-
-moz-border-radius: 3px;
|
338 |
-
border-radius: 3px;
|
339 |
-
-moz-background-clip: padding;
|
340 |
-
-webkit-background-clip: padding-box;
|
341 |
-
background-clip: padding-box;
|
342 |
-
background-color: #e4e4e4;
|
343 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f4f4f4', endColorstr='#eeeeee', GradientType=0);
|
344 |
-
background-image: linear-gradient(top, #f4f4f420%, #f0f0f050%, #e8e8e852%, #eeeeee100%);
|
345 |
-
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
346 |
-
-moz-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
347 |
-
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
348 |
-
color: #333;
|
349 |
-
border: 1px solid #aaa;
|
350 |
-
line-height: 13px;
|
351 |
-
position: relative;
|
352 |
-
cursor: default;
|
353 |
-
margin: 3px 0 3px 5px;
|
354 |
-
padding: 3px 5px 3px 18px;
|
355 |
-
}
|
356 |
-
|
357 |
-
.select2-container-multi .select2-choices .select2-search-choice span {
|
358 |
-
cursor: default;
|
359 |
-
}
|
360 |
-
|
361 |
-
.select2-container-multi .select2-choices .select2-search-choice-focus {
|
362 |
-
background: #d4d4d4;
|
363 |
-
}
|
364 |
-
|
365 |
-
.select2-search-choice-close {
|
366 |
-
display: block;
|
367 |
-
position: absolute;
|
368 |
-
right: 3px;
|
369 |
-
top: 4px;
|
370 |
-
width: 12px;
|
371 |
-
height: 13px;
|
372 |
-
font-size: 1px;
|
373 |
-
background: url(select2.png) right top no-repeat;
|
374 |
-
outline: none;
|
375 |
-
}
|
376 |
-
|
377 |
-
.select2-container-multi .select2-search-choice-close {
|
378 |
-
left: 3px;
|
379 |
-
}
|
380 |
-
|
381 |
-
.select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice {
|
382 |
-
background-image: none;
|
383 |
-
background-color: #f4f4f4;
|
384 |
-
border: 1px solid #ddd;
|
385 |
-
padding: 3px 5px;
|
386 |
-
}
|
387 |
-
|
388 |
-
.select2-result-selectable .select2-match, .select2-result-unselectable .select2-result-selectable .select2-match {
|
389 |
-
text-decoration: underline;
|
390 |
-
}
|
391 |
-
|
392 |
-
.select2-result-unselectable .select2-match {
|
393 |
-
text-decoration: none;
|
394 |
-
}
|
395 |
-
|
396 |
-
.select2-offscreen {
|
397 |
-
position: absolute;
|
398 |
-
left: -10000px;
|
399 |
-
}
|
400 |
-
|
401 |
-
.select2-container-active .select2-choice, .select2-container-active .select2-choices, .select2-container-multi.select2-container-active .select2-choices {
|
402 |
-
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
403 |
-
-moz-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
404 |
-
-o-box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
405 |
-
box-shadow: 0 0 5px rgba(0, 0, 0, .3);
|
406 |
-
border: 1px solid #5897fb;
|
407 |
-
outline: none;
|
408 |
-
}
|
409 |
-
|
410 |
-
.select2-results .select2-no-results, .select2-results .select2-searching, .select2-results .select2-selection-limit, .select2-more-results {
|
411 |
-
background: #f4f4f4;
|
412 |
-
display: list-item;
|
413 |
-
}
|
414 |
-
|
415 |
-
.select2-results .select2-disabled, .select2-container.select2-container-disabled .select2-choice abbr, .select2-container-multi.select2-container-disabled .select2-choices .select2-search-choice .select2-search-choice-close {
|
416 |
-
display: none;
|
417 |
-
}
|
418 |
-
|
419 |
-
.select2-container.select2-container-disabled .select2-choice, .select2-container-multi.select2-container-disabled .select2-choices {
|
420 |
-
background-color: #f4f4f4;
|
421 |
-
background-image: none;
|
422 |
-
border: 1px solid #ddd;
|
423 |
-
cursor: default;
|
424 |
-
}
|
425 |
-
|
426 |
-
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover, .select2-container-multi .select2-choices .select2-search-choice-focus .select2-search-choice-close {
|
427 |
-
background-position: right -11px;
|
428 |
-
}
|
429 |
-
|
430 |
-
@media only screen and -webkit-min-device-pixel-ratio 15 {
|
431 |
-
.select2-search input, .select2-search-choice-close, .select2-container .select2-choice abbr, .select2-container .select2-choice div b {
|
432 |
-
background-image: url(select2x2.png) !important;
|
433 |
-
background-repeat: no-repeat !important;
|
434 |
-
background-size: 60px 40px !important;
|
435 |
-
}
|
436 |
-
|
437 |
-
.select2-search input {
|
438 |
-
background-position: 100% -21px !important;
|
439 |
-
}
|
440 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WCVendors/classes/admin/settings/assets/js/select2/spinner.gif
DELETED
Binary file
|
WCVendors/languages/default.pot
DELETED
@@ -1,1451 +0,0 @@
|
|
1 |
-
msgid ""
|
2 |
-
msgstr ""
|
3 |
-
"Project-Id-Version: WC Vendors\n"
|
4 |
-
"POT-Creation-Date: 2015-01-08 14:31+1000\n"
|
5 |
-
"PO-Revision-Date: 2015-01-08 14:31+1000\n"
|
6 |
-
"Last-Translator: \n"
|
7 |
-
"Language-Team: WC Vendors <support@wcvendors.com>\n"
|
8 |
-
"Language: en\n"
|
9 |
-
"MIME-Version: 1.0\n"
|
10 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
-
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"X-Generator: Poedit 1.7.1\n"
|
13 |
-
"X-Poedit-Basepath: .\n"
|
14 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
15 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
-
"X-Poedit-KeywordsList: __;_e\n"
|
17 |
-
"X-Poedit-SearchPath-0: .\n"
|
18 |
-
"X-Poedit-SearchPath-1: ..\n"
|
19 |
-
|
20 |
-
#: ../classes/admin/class-admin-page.php:28
|
21 |
-
msgid "Vendors shipped"
|
22 |
-
msgstr ""
|
23 |
-
|
24 |
-
#: ../classes/admin/class-admin-page.php:51
|
25 |
-
msgid "Vendors Shipped"
|
26 |
-
msgstr ""
|
27 |
-
|
28 |
-
#: ../classes/admin/class-admin-page.php:73
|
29 |
-
#: ../classes/admin/class-admin-page.php:133
|
30 |
-
#: ../classes/admin/class-admin-reports.php:345
|
31 |
-
#: ../classes/admin/class-product-meta.php:148
|
32 |
-
#: ../classes/admin/class-product-meta.php:164
|
33 |
-
#: ../views/dashboard/reports.php:19
|
34 |
-
msgid "Commission"
|
35 |
-
msgstr ""
|
36 |
-
|
37 |
-
#: ../classes/admin/class-admin-page.php:252
|
38 |
-
#: ../classes/admin/class-admin-reports.php:175
|
39 |
-
#: ../views/dashboard/reports.php:17 ../views/emails/admin-new-order.php:22
|
40 |
-
#: ../views/emails/notify-vendor-shipped.php:22
|
41 |
-
msgid "Product"
|
42 |
-
msgstr ""
|
43 |
-
|
44 |
-
#: ../classes/admin/class-admin-page.php:253
|
45 |
-
msgid "Order ID"
|
46 |
-
msgstr ""
|
47 |
-
|
48 |
-
#: ../classes/admin/class-admin-page.php:254
|
49 |
-
#: ../classes/admin/class-admin-reports.php:176
|
50 |
-
#: ../classes/admin/class-product-meta.php:44
|
51 |
-
#: ../classes/admin/class-product-meta.php:184
|
52 |
-
#: ../classes/admin/class-product-meta.php:220
|
53 |
-
msgid "Vendor"
|
54 |
-
msgstr ""
|
55 |
-
|
56 |
-
#: ../classes/admin/class-admin-page.php:255
|
57 |
-
#: ../classes/admin/class-admin-reports.php:177
|
58 |
-
#: ../classes/admin/class-admin-reports.php:350
|
59 |
-
#: ../classes/admin/class-admin-reports.php:374
|
60 |
-
#: ../views/dashboard/orders.php:25
|
61 |
-
msgid "Total"
|
62 |
-
msgstr ""
|
63 |
-
|
64 |
-
#: ../classes/admin/class-admin-page.php:256
|
65 |
-
#: ../classes/admin/class-admin-reports.php:179
|
66 |
-
msgid "Status"
|
67 |
-
msgstr ""
|
68 |
-
|
69 |
-
#: ../classes/admin/class-admin-page.php:257
|
70 |
-
#: ../classes/front/orders/class-orders.php:216
|
71 |
-
#: ../views/dashboard/orders.php:26
|
72 |
-
msgid "Date"
|
73 |
-
msgstr ""
|
74 |
-
|
75 |
-
#: ../classes/admin/class-admin-page.php:294
|
76 |
-
msgid "Mark paid"
|
77 |
-
msgstr ""
|
78 |
-
|
79 |
-
#: ../classes/admin/class-admin-page.php:295
|
80 |
-
msgid "Mark due"
|
81 |
-
msgstr ""
|
82 |
-
|
83 |
-
#: ../classes/admin/class-admin-page.php:296
|
84 |
-
msgid "Mark reversed"
|
85 |
-
msgstr ""
|
86 |
-
|
87 |
-
#: ../classes/admin/class-admin-page.php:313
|
88 |
-
msgid "Filter"
|
89 |
-
msgstr ""
|
90 |
-
|
91 |
-
#: ../classes/admin/class-admin-page.php:347
|
92 |
-
msgid "Show all dates"
|
93 |
-
msgstr ""
|
94 |
-
|
95 |
-
#: ../classes/admin/class-admin-page.php:360
|
96 |
-
#, php-format
|
97 |
-
msgid "%1$s %2$d"
|
98 |
-
msgstr ""
|
99 |
-
|
100 |
-
#: ../classes/admin/class-admin-page.php:386
|
101 |
-
msgid "Commission marked paid."
|
102 |
-
msgstr ""
|
103 |
-
|
104 |
-
#: ../classes/admin/class-admin-page.php:393
|
105 |
-
msgid "Commission marked due."
|
106 |
-
msgstr ""
|
107 |
-
|
108 |
-
#: ../classes/admin/class-admin-page.php:400
|
109 |
-
msgid "Commission marked reversed."
|
110 |
-
msgstr ""
|
111 |
-
|
112 |
-
#: ../classes/admin/class-admin-reports.php:41
|
113 |
-
#: ../classes/admin/class-admin-users.php:349
|
114 |
-
msgid "WC Vendors"
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
#: ../classes/admin/class-admin-reports.php:44
|
118 |
-
msgid "Overview"
|
119 |
-
msgstr ""
|
120 |
-
|
121 |
-
#: ../classes/admin/class-admin-reports.php:50
|
122 |
-
msgid "Commission by vendor"
|
123 |
-
msgstr ""
|
124 |
-
|
125 |
-
#: ../classes/admin/class-admin-reports.php:56
|
126 |
-
msgid "Commission by product"
|
127 |
-
msgstr ""
|
128 |
-
|
129 |
-
#: ../classes/admin/class-admin-reports.php:115
|
130 |
-
#: ../views/dashboard/date-picker.php:3
|
131 |
-
msgid "From:"
|
132 |
-
msgstr ""
|
133 |
-
|
134 |
-
#: ../classes/admin/class-admin-reports.php:119
|
135 |
-
#: ../views/dashboard/date-picker.php:7
|
136 |
-
msgid "To:"
|
137 |
-
msgstr ""
|
138 |
-
|
139 |
-
#: ../classes/admin/class-admin-reports.php:122
|
140 |
-
#: ../classes/admin/class-admin-reports.php:283
|
141 |
-
#: ../views/dashboard/date-picker.php:12
|
142 |
-
msgid "Show"
|
143 |
-
msgstr ""
|
144 |
-
|
145 |
-
#: ../classes/admin/class-admin-reports.php:133
|
146 |
-
msgid "Total paid in range"
|
147 |
-
msgstr ""
|
148 |
-
|
149 |
-
#: ../classes/admin/class-admin-reports.php:136
|
150 |
-
#: ../classes/admin/class-admin-reports.php:143
|
151 |
-
#: ../classes/admin/class-admin-reports.php:150
|
152 |
-
msgid "n/a"
|
153 |
-
msgstr ""
|
154 |
-
|
155 |
-
#: ../classes/admin/class-admin-reports.php:140
|
156 |
-
msgid "Total due in range"
|
157 |
-
msgstr ""
|
158 |
-
|
159 |
-
#: ../classes/admin/class-admin-reports.php:147
|
160 |
-
msgid "Total reversed in range"
|
161 |
-
msgstr ""
|
162 |
-
|
163 |
-
#: ../classes/admin/class-admin-reports.php:157
|
164 |
-
msgid "Recent Commission"
|
165 |
-
msgstr ""
|
166 |
-
|
167 |
-
#: ../classes/admin/class-admin-reports.php:174
|
168 |
-
#: ../classes/front/orders/class-orders.php:208
|
169 |
-
#: ../views/dashboard/orders.php:23
|
170 |
-
msgid "Order"
|
171 |
-
msgstr ""
|
172 |
-
|
173 |
-
#: ../classes/admin/class-admin-reports.php:178
|
174 |
-
msgid "Date & Time"
|
175 |
-
msgstr ""
|
176 |
-
|
177 |
-
#: ../classes/admin/class-admin-reports.php:187
|
178 |
-
msgid "N/A"
|
179 |
-
msgstr ""
|
180 |
-
|
181 |
-
#: ../classes/admin/class-admin-reports.php:192
|
182 |
-
msgid "D j M Y \\a\\t h:ia"
|
183 |
-
msgstr ""
|
184 |
-
|
185 |
-
#: ../classes/admin/class-admin-reports.php:201
|
186 |
-
msgid "No commission yet"
|
187 |
-
msgstr ""
|
188 |
-
|
189 |
-
#: ../classes/admin/class-admin-reports.php:232
|
190 |
-
msgid "Show:"
|
191 |
-
msgstr ""
|
192 |
-
|
193 |
-
#: ../classes/admin/class-admin-reports.php:243
|
194 |
-
msgid "Year"
|
195 |
-
msgstr ""
|
196 |
-
|
197 |
-
#: ../classes/admin/class-admin-reports.php:276
|
198 |
-
msgid "Select a vendor…"
|
199 |
-
msgstr ""
|
200 |
-
|
201 |
-
#: ../classes/admin/class-admin-reports.php:344
|
202 |
-
msgid "Month"
|
203 |
-
msgstr ""
|
204 |
-
|
205 |
-
#: ../classes/admin/class-admin-reports.php:346
|
206 |
-
msgid "Tax"
|
207 |
-
msgstr ""
|
208 |
-
|
209 |
-
#: ../classes/admin/class-admin-reports.php:347
|
210 |
-
#: ../views/dashboard/orders.php:24 ../views/orders/orders.php:113
|
211 |
-
msgid "Shipping"
|
212 |
-
msgstr ""
|
213 |
-
|
214 |
-
#: ../classes/admin/class-admin-reports.php:348
|
215 |
-
msgid "Reversed"
|
216 |
-
msgstr ""
|
217 |
-
|
218 |
-
#: ../classes/admin/class-admin-reports.php:349
|
219 |
-
msgid "Paid"
|
220 |
-
msgstr ""
|
221 |
-
|
222 |
-
#: ../classes/admin/class-admin-users.php:359
|
223 |
-
msgid "Enable HTML for the shop description"
|
224 |
-
msgstr ""
|
225 |
-
|
226 |
-
#: ../classes/admin/class-admin-users.php:365
|
227 |
-
msgid "Shop name"
|
228 |
-
msgstr ""
|
229 |
-
|
230 |
-
#: ../classes/admin/class-admin-users.php:372
|
231 |
-
msgid "PayPal E-mail"
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
#: ../classes/admin/class-admin-users.php:373
|
235 |
-
msgid "required"
|
236 |
-
msgstr ""
|
237 |
-
|
238 |
-
#: ../classes/admin/class-admin-users.php:380
|
239 |
-
msgid "Commission rate"
|
240 |
-
msgstr ""
|
241 |
-
|
242 |
-
#: ../classes/admin/class-admin-users.php:381
|
243 |
-
#: ../classes/admin/class-product-meta.php:171
|
244 |
-
msgid "Leave blank for default"
|
245 |
-
msgstr ""
|
246 |
-
|
247 |
-
#: ../classes/admin/class-admin-users.php:387
|
248 |
-
#: ../classes/front/class-vendor-shop.php:103
|
249 |
-
#: ../views/dashboard/settings/seller-info.php:3
|
250 |
-
msgid "Seller info"
|
251 |
-
msgstr ""
|
252 |
-
|
253 |
-
#: ../classes/admin/class-admin-users.php:392
|
254 |
-
msgid "Shop description"
|
255 |
-
msgstr ""
|
256 |
-
|
257 |
-
#: ../classes/admin/class-vendor-applicants.php:26
|
258 |
-
msgid "Approve"
|
259 |
-
msgstr ""
|
260 |
-
|
261 |
-
#: ../classes/admin/class-vendor-applicants.php:27
|
262 |
-
msgid "Deny"
|
263 |
-
msgstr ""
|
264 |
-
|
265 |
-
#: ../classes/admin/class-vendor-applicants.php:71
|
266 |
-
msgid "Vendor has been <b>denied</b>."
|
267 |
-
msgstr ""
|
268 |
-
|
269 |
-
#: ../classes/admin/class-vendor-applicants.php:82
|
270 |
-
msgid "Vendor has been <b>approved</b>."
|
271 |
-
msgstr ""
|
272 |
-
|
273 |
-
#: ../classes/admin/class-vendor-applicants.php:96
|
274 |
-
msgid "Pending Vendors"
|
275 |
-
msgstr ""
|
276 |
-
|
277 |
-
#: ../classes/admin/emails/class-emails.php:55
|
278 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:70
|
279 |
-
msgid "pending"
|
280 |
-
msgstr ""
|
281 |
-
|
282 |
-
#: ../classes/admin/emails/class-emails.php:57
|
283 |
-
msgid "approved"
|
284 |
-
msgstr ""
|
285 |
-
|
286 |
-
#: ../classes/admin/emails/class-emails.php:59
|
287 |
-
msgid "denied"
|
288 |
-
msgstr ""
|
289 |
-
|
290 |
-
#: ../classes/admin/emails/class-emails.php:87
|
291 |
-
#: ../classes/front/class-vendor-cart.php:60
|
292 |
-
#: ../classes/front/class-vendor-shop.php:178
|
293 |
-
msgid "Sold by: "
|
294 |
-
msgstr ""
|
295 |
-
|
296 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:28
|
297 |
-
msgid "Vendor Application"
|
298 |
-
msgstr ""
|
299 |
-
|
300 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:29
|
301 |
-
msgid "Vendor application will either be approved, denied, or pending."
|
302 |
-
msgstr ""
|
303 |
-
|
304 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:31
|
305 |
-
msgid "Application {status}"
|
306 |
-
msgstr ""
|
307 |
-
|
308 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:32
|
309 |
-
msgid "[{blogname}] Your vendor application has been {status}"
|
310 |
-
msgstr ""
|
311 |
-
|
312 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:123
|
313 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:129
|
314 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:163
|
315 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:230
|
316 |
-
msgid "Enable/Disable"
|
317 |
-
msgstr ""
|
318 |
-
|
319 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:125
|
320 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:131
|
321 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:165
|
322 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:232
|
323 |
-
msgid "Enable this email notification"
|
324 |
-
msgstr ""
|
325 |
-
|
326 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:129
|
327 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:135
|
328 |
-
msgid "Recipient(s)"
|
329 |
-
msgstr ""
|
330 |
-
|
331 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:131
|
332 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:137
|
333 |
-
#, php-format
|
334 |
-
msgid ""
|
335 |
-
"Enter recipients (comma separated) for this email. Defaults to <code>%s</"
|
336 |
-
"code>."
|
337 |
-
msgstr ""
|
338 |
-
|
339 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:136
|
340 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:142
|
341 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:169
|
342 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:236
|
343 |
-
msgid "Subject"
|
344 |
-
msgstr ""
|
345 |
-
|
346 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:138
|
347 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:144
|
348 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:171
|
349 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:238
|
350 |
-
#, php-format
|
351 |
-
msgid ""
|
352 |
-
"This controls the email subject line. Leave blank to use the default "
|
353 |
-
"subject: <code>%s</code>."
|
354 |
-
msgstr ""
|
355 |
-
|
356 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:143
|
357 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:149
|
358 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:176
|
359 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:243
|
360 |
-
msgid "Email Heading"
|
361 |
-
msgstr ""
|
362 |
-
|
363 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:145
|
364 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:151
|
365 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:178
|
366 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:245
|
367 |
-
#, php-format
|
368 |
-
msgid ""
|
369 |
-
"This controls the main heading contained within the email notification. "
|
370 |
-
"Leave blank to use the default heading: <code>%s</code>."
|
371 |
-
msgstr ""
|
372 |
-
|
373 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:150
|
374 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:156
|
375 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:183
|
376 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:250
|
377 |
-
msgid "Email type"
|
378 |
-
msgstr ""
|
379 |
-
|
380 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:152
|
381 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:158
|
382 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:185
|
383 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:252
|
384 |
-
msgid "Choose which format of email to send."
|
385 |
-
msgstr ""
|
386 |
-
|
387 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:156
|
388 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:162
|
389 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:189
|
390 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:256
|
391 |
-
msgid "Plain text"
|
392 |
-
msgstr ""
|
393 |
-
|
394 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:157
|
395 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:163
|
396 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:190
|
397 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:257
|
398 |
-
msgid "HTML"
|
399 |
-
msgstr ""
|
400 |
-
|
401 |
-
#: ../classes/admin/emails/class-wc-approve-vendor.php:158
|
402 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:164
|
403 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:191
|
404 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:258
|
405 |
-
msgid "Multipart"
|
406 |
-
msgstr ""
|
407 |
-
|
408 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:28
|
409 |
-
msgid "New Vendor Product"
|
410 |
-
msgstr ""
|
411 |
-
|
412 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:29
|
413 |
-
msgid "New order emails are sent when a new product is submitted by a vendor"
|
414 |
-
msgstr ""
|
415 |
-
|
416 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:31
|
417 |
-
msgid "New product submitted: {product_name}"
|
418 |
-
msgstr ""
|
419 |
-
|
420 |
-
#: ../classes/admin/emails/class-wc-notify-admin.php:32
|
421 |
-
msgid "[{blogname}] New product submitted by {vendor_name} - {product_name}"
|
422 |
-
msgstr ""
|
423 |
-
|
424 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:28
|
425 |
-
msgid "Vendor has shipped"
|
426 |
-
msgstr ""
|
427 |
-
|
428 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:29
|
429 |
-
msgid ""
|
430 |
-
"An email is sent when a vendor has marked one of their orders as shipped."
|
431 |
-
msgstr ""
|
432 |
-
|
433 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:31
|
434 |
-
msgid "Your order has been shipped"
|
435 |
-
msgstr ""
|
436 |
-
|
437 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:32
|
438 |
-
msgid ""
|
439 |
-
"[{blogname}] Your order has been shipped ({order_number}) - {order_date}"
|
440 |
-
msgstr ""
|
441 |
-
|
442 |
-
#: ../classes/admin/emails/class-wc-notify-shipped.php:112
|
443 |
-
msgid "Subtotal:"
|
444 |
-
msgstr ""
|
445 |
-
|
446 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:27
|
447 |
-
msgid "Notify vendors"
|
448 |
-
msgstr ""
|
449 |
-
|
450 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:28
|
451 |
-
msgid "New order emails are sent when an order is received/paid by a customer."
|
452 |
-
msgstr ""
|
453 |
-
|
454 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:30
|
455 |
-
msgid "New customer order"
|
456 |
-
msgstr ""
|
457 |
-
|
458 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:31
|
459 |
-
msgid "[{blogname}] New customer order ({order_number}) - {order_date}"
|
460 |
-
msgstr ""
|
461 |
-
|
462 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:103
|
463 |
-
msgid "Commission Subtotal:"
|
464 |
-
msgstr ""
|
465 |
-
|
466 |
-
#: ../classes/admin/emails/class-wc-notify-vendor.php:110
|
467 |
-
msgid "Shipping Subtotal:"
|
468 |
-
msgstr ""
|
469 |
-
|
470 |
-
#: ../classes/admin/settings/classes/sf-class-format-options.php:211
|
471 |
-
#: ../classes/admin/settings/classes/sf-class-settings.php:773
|
472 |
-
msgid "Select a page..."
|
473 |
-
msgstr ""
|
474 |
-
|
475 |
-
#: ../classes/admin/settings/classes/sf-class-settings.php:153
|
476 |
-
#: ../views/dashboard/settings/settings.php:1
|
477 |
-
msgid "Settings"
|
478 |
-
msgstr ""
|
479 |
-
|
480 |
-
#: ../classes/admin/settings/classes/sf-class-settings.php:297
|
481 |
-
msgid "Could not load settings at: "
|
482 |
-
msgstr ""
|
483 |
-
|
484 |
-
#: ../classes/admin/settings/classes/sf-class-settings.php:297
|
485 |
-
msgid "Error - WP Settings Framework"
|
486 |
-
msgstr ""
|
487 |
-
|
488 |
-
#: ../classes/admin/settings/classes/sf-class-settings.php:363
|
489 |
-
#: ../classes/front/dashboard/class-vendor-dashboard.php:96
|
490 |
-
msgid "Settings saved."
|
491 |
-
msgstr ""
|
492 |
-
|
493 |
-
#: ../classes/admin/settings/classes/sf-class-settings.php:479
|
494 |
-
#, php-format
|
495 |
-
msgid "Save %s changes"
|
496 |
-
msgstr ""
|
497 |
-
|
498 |
-
#: ../classes/admin/settings/sf-options.php:4
|
499 |
-
msgid "General"
|
500 |
-
msgstr ""
|
501 |
-
|
502 |
-
#: ../classes/admin/settings/sf-options.php:5
|
503 |
-
msgid "General options"
|
504 |
-
msgstr ""
|
505 |
-
|
506 |
-
#: ../classes/admin/settings/sf-options.php:5
|
507 |
-
#: ../classes/admin/settings/sf-options.php:45
|
508 |
-
#: ../classes/admin/settings/sf-options.php:223
|
509 |
-
msgid " "
|
510 |
-
msgstr ""
|
511 |
-
|
512 |
-
#: ../classes/admin/settings/sf-options.php:8
|
513 |
-
msgid "Default commission (%)"
|
514 |
-
msgstr ""
|
515 |
-
|
516 |
-
#: ../classes/admin/settings/sf-options.php:9
|
517 |
-
msgid ""
|
518 |
-
"The default rate the vendor receives for each product. If a product has a "
|
519 |
-
"commission rate already set, this value will be ignored for that product."
|
520 |
-
msgstr ""
|
521 |
-
|
522 |
-
#: ../classes/admin/settings/sf-options.php:20
|
523 |
-
msgid "Registration"
|
524 |
-
msgstr ""
|
525 |
-
|
526 |
-
#: ../classes/admin/settings/sf-options.php:21
|
527 |
-
msgid "Allow users or guests to apply to become a vendor"
|
528 |
-
msgstr ""
|
529 |
-
|
530 |
-
#: ../classes/admin/settings/sf-options.php:22
|
531 |
-
msgid ""
|
532 |
-
"This will show a checkbox on the My Account page's registration form asking "
|
533 |
-
"if the user would like to apply to be a vendor. Also, on the Vendor "
|
534 |
-
"Dashboard, users can apply to become a vendor."
|
535 |
-
msgstr ""
|
536 |
-
|
537 |
-
#: ../classes/admin/settings/sf-options.php:29
|
538 |
-
msgid "Approve vendor applications manually"
|
539 |
-
msgstr ""
|
540 |
-
|
541 |
-
#: ../classes/admin/settings/sf-options.php:30
|
542 |
-
msgid ""
|
543 |
-
"With this unchecked, all vendor applications are automatically accepted. "
|
544 |
-
"Otherwise, you must approve each manually."
|
545 |
-
msgstr ""
|
546 |
-
|
547 |
-
#: ../classes/admin/settings/sf-options.php:37
|
548 |
-
msgid "Taxes"
|
549 |
-
msgstr ""
|
550 |
-
|
551 |
-
#: ../classes/admin/settings/sf-options.php:38
|
552 |
-
msgid "Give vendors any tax collected per-product"
|
553 |
-
msgstr ""
|
554 |
-
|
555 |
-
#: ../classes/admin/settings/sf-options.php:39
|
556 |
-
msgid ""
|
557 |
-
"The tax collected on a vendor's product will be given to him in its entirety"
|
558 |
-
msgstr ""
|
559 |
-
|
560 |
-
#: ../classes/admin/settings/sf-options.php:45
|
561 |
-
msgid "Shop options"
|
562 |
-
msgstr ""
|
563 |
-
|
564 |
-
#: ../classes/admin/settings/sf-options.php:48
|
565 |
-
msgid "Shop HTML"
|
566 |
-
msgstr ""
|
567 |
-
|
568 |
-
#: ../classes/admin/settings/sf-options.php:49
|
569 |
-
msgid "Enable HTML for a vendor's shop description by default"
|
570 |
-
msgstr ""
|
571 |
-
|
572 |
-
#: ../classes/admin/settings/sf-options.php:56
|
573 |
-
msgid "Vendor shop page"
|
574 |
-
msgstr ""
|
575 |
-
|
576 |
-
#: ../classes/admin/settings/sf-options.php:57
|
577 |
-
msgid "Eg: <code>yoursite.com/[your_setting_here]/[vendor_name_here]</code>"
|
578 |
-
msgstr ""
|
579 |
-
|
580 |
-
#: ../classes/admin/settings/sf-options.php:64
|
581 |
-
msgid "Shop Headers"
|
582 |
-
msgstr ""
|
583 |
-
|
584 |
-
#: ../classes/admin/settings/sf-options.php:65
|
585 |
-
msgid "Enable vendor shop headers"
|
586 |
-
msgstr ""
|
587 |
-
|
588 |
-
#: ../classes/admin/settings/sf-options.php:66
|
589 |
-
msgid ""
|
590 |
-
"This will override the HTML Shop description output on product-archive pages."
|
591 |
-
msgstr ""
|
592 |
-
|
593 |
-
#: ../classes/admin/settings/sf-options.php:72
|
594 |
-
#: ../classes/admin/settings/sf-options.php:198
|
595 |
-
msgid "Products"
|
596 |
-
msgstr ""
|
597 |
-
|
598 |
-
#: ../classes/admin/settings/sf-options.php:73
|
599 |
-
msgid "Product Add Page"
|
600 |
-
msgstr ""
|
601 |
-
|
602 |
-
#: ../classes/admin/settings/sf-options.php:73
|
603 |
-
msgid "Configure what to hide from all vendors when adding a product"
|
604 |
-
msgstr ""
|
605 |
-
|
606 |
-
#: ../classes/admin/settings/sf-options.php:76
|
607 |
-
msgid "Left side panel"
|
608 |
-
msgstr ""
|
609 |
-
|
610 |
-
#: ../classes/admin/settings/sf-options.php:77
|
611 |
-
msgid "Hide these areas of the add product page for vendors"
|
612 |
-
msgstr ""
|
613 |
-
|
614 |
-
#: ../classes/admin/settings/sf-options.php:91
|
615 |
-
msgid "Types"
|
616 |
-
msgstr ""
|
617 |
-
|
618 |
-
#: ../classes/admin/settings/sf-options.php:92
|
619 |
-
msgid "Hide these product types from the vendor"
|
620 |
-
msgstr ""
|
621 |
-
|
622 |
-
#: ../classes/admin/settings/sf-options.php:105
|
623 |
-
msgid "Type options"
|
624 |
-
msgstr ""
|
625 |
-
|
626 |
-
#: ../classes/admin/settings/sf-options.php:106
|
627 |
-
msgid "Hide these product options from the vendor"
|
628 |
-
msgstr ""
|
629 |
-
|
630 |
-
#: ../classes/admin/settings/sf-options.php:117
|
631 |
-
msgid "Miscellaneous"
|
632 |
-
msgstr ""
|
633 |
-
|
634 |
-
#: ../classes/admin/settings/sf-options.php:129
|
635 |
-
msgid "Stylesheet"
|
636 |
-
msgstr ""
|
637 |
-
|
638 |
-
#: ../classes/admin/settings/sf-options.php:130
|
639 |
-
msgid ""
|
640 |
-
"You can add CSS in this textarea, which will be loaded on the product add/"
|
641 |
-
"edit page for vendors."
|
642 |
-
msgstr ""
|
643 |
-
|
644 |
-
#: ../classes/admin/settings/sf-options.php:136
|
645 |
-
msgid "Capabilities"
|
646 |
-
msgstr ""
|
647 |
-
|
648 |
-
#: ../classes/admin/settings/sf-options.php:137
|
649 |
-
msgid "Permissions"
|
650 |
-
msgstr ""
|
651 |
-
|
652 |
-
#: ../classes/admin/settings/sf-options.php:137
|
653 |
-
msgid "General permissions used around the shop"
|
654 |
-
msgstr ""
|
655 |
-
|
656 |
-
#: ../classes/admin/settings/sf-options.php:140
|
657 |
-
#: ../classes/class-install.php:205 ../views/dashboard/orders.php:18
|
658 |
-
msgid "Orders"
|
659 |
-
msgstr ""
|
660 |
-
|
661 |
-
#: ../classes/admin/settings/sf-options.php:141
|
662 |
-
msgid "View orders"
|
663 |
-
msgstr ""
|
664 |
-
|
665 |
-
#: ../classes/admin/settings/sf-options.php:142
|
666 |
-
msgid "Show customer details such as email, address, name, etc, for each order"
|
667 |
-
msgstr ""
|
668 |
-
|
669 |
-
#: ../classes/admin/settings/sf-options.php:149
|
670 |
-
msgid "View comments"
|
671 |
-
msgstr ""
|
672 |
-
|
673 |
-
#: ../classes/admin/settings/sf-options.php:150
|
674 |
-
msgid "View all vendor comments for an order on the frontend"
|
675 |
-
msgstr ""
|
676 |
-
|
677 |
-
#: ../classes/admin/settings/sf-options.php:157
|
678 |
-
msgid "Submit comments"
|
679 |
-
msgstr ""
|
680 |
-
|
681 |
-
#: ../classes/admin/settings/sf-options.php:158
|
682 |
-
msgid ""
|
683 |
-
"Submit comments for an order on the frontend. Eg, tracking ID for a product"
|
684 |
-
msgstr ""
|
685 |
-
|
686 |
-
#: ../classes/admin/settings/sf-options.php:165
|
687 |
-
msgid "View email addresses"
|
688 |
-
msgstr ""
|
689 |
-
|
690 |
-
#: ../classes/admin/settings/sf-options.php:166
|
691 |
-
msgid ""
|
692 |
-
"While viewing order details on the frontend, you can disable or enable email "
|
693 |
-
"addresses"
|
694 |
-
msgstr ""
|
695 |
-
|
696 |
-
#: ../classes/admin/settings/sf-options.php:173
|
697 |
-
msgid "Export a CSV file of orders for a product"
|
698 |
-
msgstr ""
|
699 |
-
|
700 |
-
#: ../classes/admin/settings/sf-options.php:174
|
701 |
-
msgid "Vendors could export orders for a product on the frontend"
|
702 |
-
msgstr ""
|
703 |
-
|
704 |
-
#: ../classes/admin/settings/sf-options.php:181
|
705 |
-
msgid "Reports"
|
706 |
-
msgstr ""
|
707 |
-
|
708 |
-
#: ../classes/admin/settings/sf-options.php:182
|
709 |
-
msgid "View backend sales reports"
|
710 |
-
msgstr ""
|
711 |
-
|
712 |
-
#: ../classes/admin/settings/sf-options.php:183
|
713 |
-
msgid ""
|
714 |
-
"Graphs and tables via the Reports page in backend. The reports will only "
|
715 |
-
"display sales data that pertain to their products"
|
716 |
-
msgstr ""
|
717 |
-
|
718 |
-
#: ../classes/admin/settings/sf-options.php:190
|
719 |
-
msgid "View Frontend sales reports"
|
720 |
-
msgstr ""
|
721 |
-
|
722 |
-
#: ../classes/admin/settings/sf-options.php:191
|
723 |
-
msgid ""
|
724 |
-
"Sales table on the frontend on the My Account page. The table will only "
|
725 |
-
"display sales data that pertain to their products"
|
726 |
-
msgstr ""
|
727 |
-
|
728 |
-
#: ../classes/admin/settings/sf-options.php:199
|
729 |
-
msgid "Submit products"
|
730 |
-
msgstr ""
|
731 |
-
|
732 |
-
#: ../classes/admin/settings/sf-options.php:200
|
733 |
-
msgid ""
|
734 |
-
"Vendors could submit a product through the backend, and an admin would "
|
735 |
-
"approve or deny it"
|
736 |
-
msgstr ""
|
737 |
-
|
738 |
-
#: ../classes/admin/settings/sf-options.php:207
|
739 |
-
msgid "Edit live products"
|
740 |
-
msgstr ""
|
741 |
-
|
742 |
-
#: ../classes/admin/settings/sf-options.php:208
|
743 |
-
msgid ""
|
744 |
-
"Vendors could edit an approved product after it has already gone live. There "
|
745 |
-
"is no approval or review after editing a live product. This could be "
|
746 |
-
"dangerous with malicious vendors, so take caution."
|
747 |
-
msgstr ""
|
748 |
-
|
749 |
-
#: ../classes/admin/settings/sf-options.php:215
|
750 |
-
msgid "Submit products live without requiring approval"
|
751 |
-
msgstr ""
|
752 |
-
|
753 |
-
#: ../classes/admin/settings/sf-options.php:216
|
754 |
-
msgid ""
|
755 |
-
"Vendors can submit products without review or approval from a shop admin. "
|
756 |
-
"This could be dangerous with malicious vendors, so take caution."
|
757 |
-
msgstr ""
|
758 |
-
|
759 |
-
#: ../classes/admin/settings/sf-options.php:222
|
760 |
-
msgid "Pages"
|
761 |
-
msgstr ""
|
762 |
-
|
763 |
-
#: ../classes/admin/settings/sf-options.php:223
|
764 |
-
msgid "Page configuration"
|
765 |
-
msgstr ""
|
766 |
-
|
767 |
-
#: ../classes/admin/settings/sf-options.php:226
|
768 |
-
msgid "Vendor dashboard"
|
769 |
-
msgstr ""
|
770 |
-
|
771 |
-
#: ../classes/admin/settings/sf-options.php:227
|
772 |
-
msgid ""
|
773 |
-
"Choose the page that has the shortcode <code>[wcv_vendor_dashboard]</"
|
774 |
-
"code><br/>By default, My Account > Vendor Dashboard should have the "
|
775 |
-
"shortcode."
|
776 |
-
msgstr ""
|
777 |
-
|
778 |
-
#: ../classes/admin/settings/sf-options.php:234
|
779 |
-
msgid "Shop settings"
|
780 |
-
msgstr ""
|
781 |
-
|
782 |
-
#: ../classes/admin/settings/sf-options.php:235
|
783 |
-
msgid ""
|
784 |
-
"Choose the page that has the shortcode <code>[wcv_shop_settings]</code><br/"
|
785 |
-
">These are the shop settings a vendor can configure."
|
786 |
-
msgstr ""
|
787 |
-
|
788 |
-
#: ../classes/admin/settings/sf-options.php:242
|
789 |
-
msgid "Orders page"
|
790 |
-
msgstr ""
|
791 |
-
|
792 |
-
#: ../classes/admin/settings/sf-options.php:243
|
793 |
-
msgid ""
|
794 |
-
"Choose the page that has the shortcode <code>[wcv_orders]</code><br/>By "
|
795 |
-
"default, My Account > Orders should have the shortcode."
|
796 |
-
msgstr ""
|
797 |
-
|
798 |
-
#: ../classes/admin/settings/sf-options.php:250
|
799 |
-
msgid "Vendor terms"
|
800 |
-
msgstr ""
|
801 |
-
|
802 |
-
#: ../classes/admin/settings/sf-options.php:251
|
803 |
-
msgid ""
|
804 |
-
"These terms are shown to a user when submitting an application to become a "
|
805 |
-
"vendor.<br/>If left blank, no terms will be shown to the applicant."
|
806 |
-
msgstr ""
|
807 |
-
|
808 |
-
#: ../classes/admin/settings/sf-options.php:269
|
809 |
-
msgid "Payments"
|
810 |
-
msgstr ""
|
811 |
-
|
812 |
-
#: ../classes/admin/settings/sf-options.php:271
|
813 |
-
msgid "User payments"
|
814 |
-
msgstr ""
|
815 |
-
|
816 |
-
#: ../classes/admin/settings/sf-options.php:272
|
817 |
-
#, php-format
|
818 |
-
msgid "Total commission currently due: %s. <a href=\"%s\">View details</a>."
|
819 |
-
msgstr ""
|
820 |
-
|
821 |
-
#: ../classes/admin/settings/sf-options.php:273
|
822 |
-
#, php-format
|
823 |
-
msgid ""
|
824 |
-
"Make sure you update your PayPal Adaptive Payments settings <a href=\"%s"
|
825 |
-
"\">here</a>."
|
826 |
-
msgstr ""
|
827 |
-
|
828 |
-
#: ../classes/admin/settings/sf-options.php:277
|
829 |
-
msgid "Instant pay"
|
830 |
-
msgstr ""
|
831 |
-
|
832 |
-
#: ../classes/admin/settings/sf-options.php:278
|
833 |
-
msgid "Instantly pay vendors their commission when an order is made"
|
834 |
-
msgstr ""
|
835 |
-
|
836 |
-
#: ../classes/admin/settings/sf-options.php:279
|
837 |
-
msgid ""
|
838 |
-
"For this to work, customers must checkout with the PayPal Adaptive Payments "
|
839 |
-
"gateway. Using other gateways will not pay vendors instantly"
|
840 |
-
msgstr ""
|
841 |
-
|
842 |
-
#: ../classes/admin/settings/sf-options.php:286
|
843 |
-
msgid "Payment schedule"
|
844 |
-
msgstr ""
|
845 |
-
|
846 |
-
#: ../classes/admin/settings/sf-options.php:287
|
847 |
-
msgid "Note: Schedule will only work if instant pay is unchecked"
|
848 |
-
msgstr ""
|
849 |
-
|
850 |
-
#: ../classes/admin/settings/sf-options.php:292
|
851 |
-
msgid "Weekly"
|
852 |
-
msgstr ""
|
853 |
-
|
854 |
-
#: ../classes/admin/settings/sf-options.php:293
|
855 |
-
msgid "Biweekly"
|
856 |
-
msgstr ""
|
857 |
-
|
858 |
-
#: ../classes/admin/settings/sf-options.php:294
|
859 |
-
msgid "Monthly"
|
860 |
-
msgstr ""
|
861 |
-
|
862 |
-
#: ../classes/admin/settings/sf-options.php:295
|
863 |
-
msgid "Manual"
|
864 |
-
msgstr ""
|
865 |
-
|
866 |
-
#: ../classes/admin/settings/sf-options.php:296
|
867 |
-
msgid "Now"
|
868 |
-
msgstr ""
|
869 |
-
|
870 |
-
#: ../classes/admin/settings/sf-options.php:301
|
871 |
-
msgid "Email notification"
|
872 |
-
msgstr ""
|
873 |
-
|
874 |
-
#: ../classes/admin/settings/sf-options.php:302
|
875 |
-
msgid ""
|
876 |
-
"Send the WooCommerce admin an email each time a payment has been made via "
|
877 |
-
"the payment schedule options above"
|
878 |
-
msgstr ""
|
879 |
-
|
880 |
-
#: ../classes/class-cron.php:87
|
881 |
-
#, php-format
|
882 |
-
msgid "Payment total: %s"
|
883 |
-
msgstr ""
|
884 |
-
|
885 |
-
#: ../classes/class-cron.php:148
|
886 |
-
msgid "Once Weekly"
|
887 |
-
msgstr ""
|
888 |
-
|
889 |
-
#: ../classes/class-cron.php:153
|
890 |
-
msgid "Once every two weeks"
|
891 |
-
msgstr ""
|
892 |
-
|
893 |
-
#: ../classes/class-cron.php:158
|
894 |
-
msgid "Once a month"
|
895 |
-
msgstr ""
|
896 |
-
|
897 |
-
#: ../classes/class-install.php:99 ../classes/class-install.php:253
|
898 |
-
msgid "Pending Vendor"
|
899 |
-
msgstr ""
|
900 |
-
|
901 |
-
#: ../classes/class-install.php:204
|
902 |
-
msgid "Vendor Dashboard"
|
903 |
-
msgstr ""
|
904 |
-
|
905 |
-
#: ../classes/class-install.php:206
|
906 |
-
msgid "Shop Settings"
|
907 |
-
msgstr ""
|
908 |
-
|
909 |
-
#: ../classes/front/class-vendor-cart.php:41
|
910 |
-
#: ../classes/front/class-vendor-shop.php:255
|
911 |
-
msgid "Sold by"
|
912 |
-
msgstr ""
|
913 |
-
|
914 |
-
#: ../classes/front/dashboard/class-vendor-dashboard.php:41
|
915 |
-
msgid "Order unmarked shipped."
|
916 |
-
msgstr ""
|
917 |
-
|
918 |
-
#: ../classes/front/dashboard/class-vendor-dashboard.php:51
|
919 |
-
msgid "Order marked shipped."
|
920 |
-
msgstr ""
|
921 |
-
|
922 |
-
#: ../classes/front/dashboard/class-vendor-dashboard.php:69
|
923 |
-
msgid "Your PayPal address is not a valid email address."
|
924 |
-
msgstr ""
|
925 |
-
|
926 |
-
#: ../classes/front/dashboard/class-vendor-dashboard.php:78
|
927 |
-
msgid "That shop name is already taken. Your shop name must be unique."
|
928 |
-
msgstr ""
|
929 |
-
|
930 |
-
#: ../classes/front/orders/class-export-csv.php:37
|
931 |
-
msgid "Extra data"
|
932 |
-
msgstr ""
|
933 |
-
|
934 |
-
#: ../classes/front/orders/class-export-csv.php:38
|
935 |
-
#: ../views/dashboard/reports.php:18 ../views/emails/admin-new-order.php:23
|
936 |
-
#: ../views/emails/notify-vendor-shipped.php:23
|
937 |
-
msgid "Quantity"
|
938 |
-
msgstr ""
|
939 |
-
|
940 |
-
#: ../classes/front/orders/class-orders.php:107
|
941 |
-
msgid ""
|
942 |
-
"You haven't selected a product's orders to view! Please go back to the "
|
943 |
-
"Vendor Dashboard and click Show Orders on the product you'd like to view."
|
944 |
-
msgstr ""
|
945 |
-
|
946 |
-
#: ../classes/front/orders/class-orders.php:111
|
947 |
-
msgid "No orders."
|
948 |
-
msgstr ""
|
949 |
-
|
950 |
-
#: ../classes/front/orders/class-orders.php:144
|
951 |
-
#: ../classes/front/orders/class-orders.php:145
|
952 |
-
msgid "Tracking number"
|
953 |
-
msgstr ""
|
954 |
-
|
955 |
-
#: ../classes/front/orders/class-orders.php:147
|
956 |
-
msgid "Success. Your tracking number has been updated."
|
957 |
-
msgstr ""
|
958 |
-
|
959 |
-
#: ../classes/front/orders/class-orders.php:209
|
960 |
-
msgid "Product Title"
|
961 |
-
msgstr ""
|
962 |
-
|
963 |
-
#: ../classes/front/orders/class-orders.php:210
|
964 |
-
msgid "Full name"
|
965 |
-
msgstr ""
|
966 |
-
|
967 |
-
#: ../classes/front/orders/class-orders.php:211
|
968 |
-
msgid "Address"
|
969 |
-
msgstr ""
|
970 |
-
|
971 |
-
#: ../classes/front/orders/class-orders.php:212
|
972 |
-
msgid "City"
|
973 |
-
msgstr ""
|
974 |
-
|
975 |
-
#: ../classes/front/orders/class-orders.php:213
|
976 |
-
msgid "State"
|
977 |
-
msgstr ""
|
978 |
-
|
979 |
-
#: ../classes/front/orders/class-orders.php:214
|
980 |
-
msgid "Zip"
|
981 |
-
msgstr ""
|
982 |
-
|
983 |
-
#: ../classes/front/orders/class-orders.php:215
|
984 |
-
msgid "Email address"
|
985 |
-
msgstr ""
|
986 |
-
|
987 |
-
#: ../classes/front/orders/class-submit-comment.php:41
|
988 |
-
msgid "You've left the comment field empty!"
|
989 |
-
msgstr ""
|
990 |
-
|
991 |
-
#: ../classes/front/orders/class-submit-comment.php:63
|
992 |
-
msgid "Success. The customer has been notified of your comment."
|
993 |
-
msgstr ""
|
994 |
-
|
995 |
-
#: ../classes/front/signup/class-vendor-signup.php:44
|
996 |
-
#: ../views/dashboard/denied.php:22
|
997 |
-
msgid "Apply to become a vendor? "
|
998 |
-
msgstr ""
|
999 |
-
|
1000 |
-
#: ../classes/front/signup/class-vendor-signup.php:53
|
1001 |
-
#: ../views/dashboard/denied.php:33
|
1002 |
-
#, php-format
|
1003 |
-
msgid "I have read and accepted the <a href=\"%s\">terms and conditions</a>"
|
1004 |
-
msgstr ""
|
1005 |
-
|
1006 |
-
#: ../classes/front/signup/class-vendor-signup.php:87
|
1007 |
-
msgid "Application denied. You are an administrator."
|
1008 |
-
msgstr ""
|
1009 |
-
|
1010 |
-
#: ../classes/front/signup/class-vendor-signup.php:89
|
1011 |
-
msgid "Your application has been submitted."
|
1012 |
-
msgstr ""
|
1013 |
-
|
1014 |
-
#: ../classes/front/signup/class-vendor-signup.php:125
|
1015 |
-
msgid "You must accept the terms and conditions to become a vendor."
|
1016 |
-
msgstr ""
|
1017 |
-
|
1018 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:43
|
1019 |
-
msgid "PayPal Adaptive Payments"
|
1020 |
-
msgstr ""
|
1021 |
-
|
1022 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:119
|
1023 |
-
#, php-format
|
1024 |
-
msgid ""
|
1025 |
-
"Something went wrong. Response from PayPal invalidated this order. Status: "
|
1026 |
-
"%s."
|
1027 |
-
msgstr ""
|
1028 |
-
|
1029 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:124
|
1030 |
-
msgid "IPN payment completed"
|
1031 |
-
msgstr ""
|
1032 |
-
|
1033 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:146
|
1034 |
-
msgid "Enable PayPal Adaptive Payments"
|
1035 |
-
msgstr ""
|
1036 |
-
|
1037 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:152
|
1038 |
-
msgid "Method Title"
|
1039 |
-
msgstr ""
|
1040 |
-
|
1041 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:153
|
1042 |
-
msgid "This controls the title which the user sees during checkout."
|
1043 |
-
msgstr ""
|
1044 |
-
|
1045 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:154
|
1046 |
-
msgid "PayPal"
|
1047 |
-
msgstr ""
|
1048 |
-
|
1049 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:159
|
1050 |
-
msgid "Description"
|
1051 |
-
msgstr ""
|
1052 |
-
|
1053 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:160
|
1054 |
-
msgid "This controls the description which the user sees during checkout."
|
1055 |
-
msgstr ""
|
1056 |
-
|
1057 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:161
|
1058 |
-
msgid "Pay via PayPal!"
|
1059 |
-
msgstr ""
|
1060 |
-
|
1061 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:172
|
1062 |
-
msgid "Live Credentials"
|
1063 |
-
msgstr ""
|
1064 |
-
|
1065 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:174
|
1066 |
-
#, php-format
|
1067 |
-
msgid ""
|
1068 |
-
"You must have an <a href=\"%s\">Application ID</a> to process live "
|
1069 |
-
"transactions. You do not need one for testing in Sandbox mode."
|
1070 |
-
msgstr ""
|
1071 |
-
|
1072 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:179
|
1073 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:213
|
1074 |
-
msgid "PayPal Email"
|
1075 |
-
msgstr ""
|
1076 |
-
|
1077 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:180
|
1078 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:214
|
1079 |
-
msgid "The email address main payments should go to."
|
1080 |
-
msgstr ""
|
1081 |
-
|
1082 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:185
|
1083 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:219
|
1084 |
-
msgid "API Username"
|
1085 |
-
msgstr ""
|
1086 |
-
|
1087 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:190
|
1088 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:224
|
1089 |
-
msgid "API Password"
|
1090 |
-
msgstr ""
|
1091 |
-
|
1092 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:195
|
1093 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:229
|
1094 |
-
msgid "API Signature"
|
1095 |
-
msgstr ""
|
1096 |
-
|
1097 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:200
|
1098 |
-
msgid "Application ID"
|
1099 |
-
msgstr ""
|
1100 |
-
|
1101 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:202
|
1102 |
-
msgid "Only required when doing live transactions."
|
1103 |
-
msgstr ""
|
1104 |
-
|
1105 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:206
|
1106 |
-
msgid "Sandbox Credentials"
|
1107 |
-
msgstr ""
|
1108 |
-
|
1109 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:208
|
1110 |
-
#, php-format
|
1111 |
-
msgid ""
|
1112 |
-
"You can signup for a sandbox developer account <a href=\"%s\">here</a>. You "
|
1113 |
-
"need a developer account if you want to enable Sandbox mode for testing."
|
1114 |
-
msgstr ""
|
1115 |
-
|
1116 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:240
|
1117 |
-
msgid "Misc. Settings"
|
1118 |
-
msgstr ""
|
1119 |
-
|
1120 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:245
|
1121 |
-
msgid "Enable PayPal Sandbox mode"
|
1122 |
-
msgstr ""
|
1123 |
-
|
1124 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:251
|
1125 |
-
msgid "Enable logging"
|
1126 |
-
msgstr ""
|
1127 |
-
|
1128 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:269
|
1129 |
-
msgid ""
|
1130 |
-
"The PayPal Adaptive Payments gateway can instantly pay your vendors their "
|
1131 |
-
"due commission (if enabled). Also used to mass pay vendors on a schedule / "
|
1132 |
-
"manual method (if enabled)."
|
1133 |
-
msgstr ""
|
1134 |
-
|
1135 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:280
|
1136 |
-
msgid "Gateway Disabled"
|
1137 |
-
msgstr ""
|
1138 |
-
|
1139 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:280
|
1140 |
-
#, php-format
|
1141 |
-
msgid "%s does not support your store currency."
|
1142 |
-
msgstr ""
|
1143 |
-
|
1144 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:369
|
1145 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:483
|
1146 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:150
|
1147 |
-
#, php-format
|
1148 |
-
msgid "Error: %s"
|
1149 |
-
msgstr ""
|
1150 |
-
|
1151 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:378
|
1152 |
-
#: ../classes/gateways/PayPal_AdvPayments/paypal_ap.php:379
|
1153 |
-
#, php-format
|
1154 |
-
msgid "Error ID: %s. %s"
|
1155 |
-
msgstr ""
|
1156 |
-
|
1157 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:115
|
1158 |
-
msgid "No vendors found to pay. Maybe they haven't set a PayPal address?"
|
1159 |
-
msgstr ""
|
1160 |
-
|
1161 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:164
|
1162 |
-
msgid "All due commission has been paid for."
|
1163 |
-
msgstr ""
|
1164 |
-
|
1165 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:170
|
1166 |
-
msgid ""
|
1167 |
-
"All due commission has been paid for, but I could not clear it from their "
|
1168 |
-
"profiles due to an internal error. Commission will still be listed as due. "
|
1169 |
-
"Please manually mark the commission as paid from the Commissions page."
|
1170 |
-
msgstr ""
|
1171 |
-
|
1172 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:205
|
1173 |
-
msgid "WooCommerce: Mass payments for vendors update"
|
1174 |
-
msgstr ""
|
1175 |
-
|
1176 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:207
|
1177 |
-
msgid ""
|
1178 |
-
"Hello! A payment was just triggered to mass pay all vendors their due "
|
1179 |
-
"commission."
|
1180 |
-
msgstr ""
|
1181 |
-
|
1182 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:208
|
1183 |
-
#, php-format
|
1184 |
-
msgid "Payment status: %s."
|
1185 |
-
msgstr ""
|
1186 |
-
|
1187 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:209
|
1188 |
-
#, php-format
|
1189 |
-
msgid "Payment message: %s."
|
1190 |
-
msgstr ""
|
1191 |
-
|
1192 |
-
#: ../classes/gateways/PayPal_Masspay/class-paypal-masspay.php:212
|
1193 |
-
#, php-format
|
1194 |
-
msgid "Payment total: %s."
|
1195 |
-
msgstr ""
|
1196 |
-
|
1197 |
-
#: ../views/dashboard/denied.php:8
|
1198 |
-
msgid ""
|
1199 |
-
"Your account has not yet been approved to become a vendor. When it is, you "
|
1200 |
-
"will receive an email telling you that your account is approved!"
|
1201 |
-
msgstr ""
|
1202 |
-
|
1203 |
-
#: ../views/dashboard/denied.php:12
|
1204 |
-
msgid ""
|
1205 |
-
"Your account is not setup as a vendor yet. If you would like to register, "
|
1206 |
-
"please complete this page!"
|
1207 |
-
msgstr ""
|
1208 |
-
|
1209 |
-
#: ../views/dashboard/denied.php:53
|
1210 |
-
msgid "Submit"
|
1211 |
-
msgstr ""
|
1212 |
-
|
1213 |
-
#: ../views/dashboard/links.php:1
|
1214 |
-
msgid "Control Center"
|
1215 |
-
msgstr ""
|
1216 |
-
|
1217 |
-
#: ../views/dashboard/links.php:3
|
1218 |
-
msgid "My shop"
|
1219 |
-
msgstr ""
|
1220 |
-
|
1221 |
-
#: ../views/dashboard/links.php:7
|
1222 |
-
msgid "My settings"
|
1223 |
-
msgstr ""
|
1224 |
-
|
1225 |
-
#: ../views/dashboard/links.php:13
|
1226 |
-
msgid "Submit a product"
|
1227 |
-
msgstr ""
|
1228 |
-
|
1229 |
-
#: ../views/dashboard/orders.php:7 ../views/dashboard/orders.php:10
|
1230 |
-
msgid "Hide items"
|
1231 |
-
msgstr ""
|
1232 |
-
|
1233 |
-
#: ../views/dashboard/orders.php:8 ../views/dashboard/orders.php:58
|
1234 |
-
msgid "View items"
|
1235 |
-
msgstr ""
|
1236 |
-
|
1237 |
-
#: ../views/dashboard/orders.php:27
|
1238 |
-
msgid "Links"
|
1239 |
-
msgstr ""
|
1240 |
-
|
1241 |
-
#: ../views/dashboard/orders.php:58
|
1242 |
-
msgid "Unmark shipped"
|
1243 |
-
msgstr ""
|
1244 |
-
|
1245 |
-
#: ../views/dashboard/orders.php:58
|
1246 |
-
msgid "Mark shipped"
|
1247 |
-
msgstr ""
|
1248 |
-
|
1249 |
-
#: ../views/dashboard/orders.php:90
|
1250 |
-
msgid "You have no orders during this period."
|
1251 |
-
msgstr ""
|
1252 |
-
|
1253 |
-
#: ../views/dashboard/reports.php:1
|
1254 |
-
msgid "Sales Report"
|
1255 |
-
msgstr ""
|
1256 |
-
|
1257 |
-
#: ../views/dashboard/reports.php:20
|
1258 |
-
msgid "Rate"
|
1259 |
-
msgstr ""
|
1260 |
-
|
1261 |
-
#: ../views/dashboard/reports.php:47
|
1262 |
-
msgid "Show Orders"
|
1263 |
-
msgstr ""
|
1264 |
-
|
1265 |
-
#: ../views/dashboard/reports.php:56
|
1266 |
-
msgid "Totals"
|
1267 |
-
msgstr ""
|
1268 |
-
|
1269 |
-
#: ../views/dashboard/reports.php:71
|
1270 |
-
msgid "You have no sales during this period."
|
1271 |
-
msgstr ""
|
1272 |
-
|
1273 |
-
#: ../views/dashboard/reports.php:82
|
1274 |
-
msgid "You haven't made any sales yet."
|
1275 |
-
msgstr ""
|
1276 |
-
|
1277 |
-
#: ../views/dashboard/settings/paypal-email-form.php:2
|
1278 |
-
msgid "PayPal Address"
|
1279 |
-
msgstr ""
|
1280 |
-
|
1281 |
-
#: ../views/dashboard/settings/paypal-email-form.php:3
|
1282 |
-
msgid "Your PayPal address is used to send you your commission."
|
1283 |
-
msgstr ""
|
1284 |
-
|
1285 |
-
#: ../views/dashboard/settings/seller-info.php:4
|
1286 |
-
msgid "This is displayed on each of your products."
|
1287 |
-
msgstr ""
|
1288 |
-
|
1289 |
-
#: ../views/dashboard/settings/settings.php:47
|
1290 |
-
msgid "Save"
|
1291 |
-
msgstr ""
|
1292 |
-
|
1293 |
-
#: ../views/dashboard/settings/shop-description.php:2
|
1294 |
-
msgid "Shop Description"
|
1295 |
-
msgstr ""
|
1296 |
-
|
1297 |
-
#: ../views/dashboard/settings/shop-description.php:3
|
1298 |
-
#, php-format
|
1299 |
-
msgid "This is displayed on your <a href=\"%s\">shop page</a>."
|
1300 |
-
msgstr ""
|
1301 |
-
|
1302 |
-
#: ../views/dashboard/settings/shop-name.php:2
|
1303 |
-
msgid "Shop Name"
|
1304 |
-
msgstr ""
|
1305 |
-
|
1306 |
-
#: ../views/dashboard/settings/shop-name.php:3
|
1307 |
-
msgid "Your shop name is public and must be unique."
|
1308 |
-
msgstr ""
|
1309 |
-
|
1310 |
-
#: ../views/emails/admin-new-order.php:13
|
1311 |
-
#, php-format
|
1312 |
-
msgid "You have received an order from %s. Their order is as follows:"
|
1313 |
-
msgstr ""
|
1314 |
-
|
1315 |
-
#: ../views/emails/admin-new-order.php:17
|
1316 |
-
#: ../views/emails/notify-vendor-shipped.php:17
|
1317 |
-
#, php-format
|
1318 |
-
msgid "Order: %s"
|
1319 |
-
msgstr ""
|
1320 |
-
|
1321 |
-
#: ../views/emails/admin-new-order.php:24
|
1322 |
-
#: ../views/emails/notify-vendor-shipped.php:24
|
1323 |
-
msgid "Price"
|
1324 |
-
msgstr ""
|
1325 |
-
|
1326 |
-
#: ../views/emails/admin-new-order.php:50
|
1327 |
-
#: ../views/emails/notify-vendor-shipped.php:50
|
1328 |
-
msgid "Customer details"
|
1329 |
-
msgstr ""
|
1330 |
-
|
1331 |
-
#: ../views/emails/admin-new-order.php:53
|
1332 |
-
#: ../views/emails/notify-vendor-shipped.php:53
|
1333 |
-
msgid "Email:"
|
1334 |
-
msgstr ""
|
1335 |
-
|
1336 |
-
#: ../views/emails/admin-new-order.php:56
|
1337 |
-
#: ../views/emails/notify-vendor-shipped.php:56
|
1338 |
-
msgid "Tel:"
|
1339 |
-
msgstr ""
|
1340 |
-
|
1341 |
-
#: ../views/emails/application-status.php:5
|
1342 |
-
#, php-format
|
1343 |
-
msgid "Hi there. This is a notification about a vendor application on %s."
|
1344 |
-
msgstr ""
|
1345 |
-
|
1346 |
-
#: ../views/emails/application-status.php:8
|
1347 |
-
#, php-format
|
1348 |
-
msgid "Application status: %s"
|
1349 |
-
msgstr ""
|
1350 |
-
|
1351 |
-
#: ../views/emails/application-status.php:9
|
1352 |
-
#, php-format
|
1353 |
-
msgid "Applicant username: %s"
|
1354 |
-
msgstr ""
|
1355 |
-
|
1356 |
-
#: ../views/emails/new-product.php:5
|
1357 |
-
#, php-format
|
1358 |
-
msgid "Hi there. This is a notification about a new product on %s."
|
1359 |
-
msgstr ""
|
1360 |
-
|
1361 |
-
#: ../views/emails/new-product.php:8
|
1362 |
-
#, php-format
|
1363 |
-
msgid "Product title: %s"
|
1364 |
-
msgstr ""
|
1365 |
-
|
1366 |
-
#: ../views/emails/new-product.php:9
|
1367 |
-
#, php-format
|
1368 |
-
msgid "Submitted by: %s"
|
1369 |
-
msgstr ""
|
1370 |
-
|
1371 |
-
#: ../views/emails/new-product.php:10
|
1372 |
-
#, php-format
|
1373 |
-
msgid "Edit product: %s"
|
1374 |
-
msgstr ""
|
1375 |
-
|
1376 |
-
#: ../views/emails/notify-vendor-shipped.php:13
|
1377 |
-
msgid ""
|
1378 |
-
"A vendor has marked part of your order as shipped. The items that are "
|
1379 |
-
"shipped are as follows:"
|
1380 |
-
msgstr ""
|
1381 |
-
|
1382 |
-
#: ../views/orders/comments/add-new-comment.php:11
|
1383 |
-
msgid "Add comment"
|
1384 |
-
msgstr ""
|
1385 |
-
|
1386 |
-
#: ../views/orders/comments/existing-comments.php:9
|
1387 |
-
#, php-format
|
1388 |
-
msgid "added %s ago"
|
1389 |
-
msgstr ""
|
1390 |
-
|
1391 |
-
#: ../views/orders/csv-export.php:6
|
1392 |
-
msgid "Export orders"
|
1393 |
-
msgstr ""
|
1394 |
-
|
1395 |
-
#: ../views/orders/customer-note/customer-note.php:4
|
1396 |
-
msgid "Customer note"
|
1397 |
-
msgstr ""
|
1398 |
-
|
1399 |
-
#: ../views/orders/customer-note/customer-note.php:8
|
1400 |
-
msgid "No customer note."
|
1401 |
-
msgstr ""
|
1402 |
-
|
1403 |
-
#: ../views/orders/orders.php:84
|
1404 |
-
#, php-format
|
1405 |
-
msgid "Comments (%s)"
|
1406 |
-
msgstr ""
|
1407 |
-
|
1408 |
-
#: ../views/orders/shipping/shipping-form.php:46
|
1409 |
-
msgid "Provider:"
|
1410 |
-
msgstr ""
|
1411 |
-
|
1412 |
-
#: ../views/orders/shipping/shipping-form.php:48
|
1413 |
-
msgid "Custom Provider"
|
1414 |
-
msgstr ""
|
1415 |
-
|
1416 |
-
#: ../views/orders/shipping/shipping-form.php:68
|
1417 |
-
msgid "Provider Name:"
|
1418 |
-
msgstr ""
|
1419 |
-
|
1420 |
-
#: ../views/orders/shipping/shipping-form.php:76
|
1421 |
-
msgid "Tracking number:"
|
1422 |
-
msgstr ""
|
1423 |
-
|
1424 |
-
#: ../views/orders/shipping/shipping-form.php:84
|
1425 |
-
msgid "Tracking link:"
|
1426 |
-
msgstr ""
|
1427 |
-
|
1428 |
-
#: ../views/orders/shipping/shipping-form.php:93
|
1429 |
-
msgid "Date shipped:"
|
1430 |
-
msgstr ""
|
1431 |
-
|
1432 |
-
#: ../views/orders/shipping/shipping-form.php:101
|
1433 |
-
msgid "Preview:"
|
1434 |
-
msgstr ""
|
1435 |
-
|
1436 |
-
#: ../views/orders/shipping/shipping-form.php:101
|
1437 |
-
msgid "Click here to track your shipment"
|
1438 |
-
msgstr ""
|
1439 |
-
|
1440 |
-
#: ../views/orders/shipping/shipping-form.php:110
|
1441 |
-
msgid "Update tracking number"
|
1442 |
-
msgstr ""
|
1443 |
-
|
1444 |
-
#: ../views/orders/shipping/shipping-form.php:112
|
1445 |
-
msgid "Mark as shipped"
|
1446 |
-
msgstr ""
|
1447 |
-
|
1448 |
-
#: ../views/orders/table-body.php:25
|
1449 |
-
#, php-format
|
1450 |
-
msgid "Quantity: %d"
|
1451 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WCVendors/languages/wc_vendors-de_DE.mo
DELETED
Binary file
|
WCVendors/languages/wc_vendors-de_DE.po
DELETED
@@ -1,1439 +0,0 @@
|
|
1 |
-
# WooCommerce translation strings
|
2 |
-
# Copyright (C) 2011-2012
|
3 |
-
# This file is distributed under the same license as the WooCommerce package.
|
4 |
-
# Last Updated: December 26, 2012.
|
5 |
-
msgid ""
|
6 |
-
msgstr ""
|
7 |
-
"Project-Id-Version: WooCommerce Product Vendor 1.4.1\n"
|
8 |
-
"Report-Msgid-Bugs-To: Matt Gates <info@mgates.me\n"
|
9 |
-
"POT-Creation-Date: 2013-02-24 16:07-0500\n"
|
10 |
-
"PO-Revision-Date: 2013-03-29 19:46+0100\n"
|
11 |
-
"Last-Translator: S. Hupe - www.3d-board.de <info@bryce-board.de>\n"
|
12 |
-
"Language-Team: 3D-Board - www.3d-board.de <info@bryce-board.de>\n"
|
13 |
-
"Language: Deutsch\n"
|
14 |
-
"MIME-Version: 1.0\n"
|
15 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
-
"Content-Transfer-Encoding: 8bit\n"
|
17 |
-
"X-Generator: Poedit 1.5.5\n"
|
18 |
-
|
19 |
-
#: class-product-vendor.php:57
|
20 |
-
#: productvendor\classes\admin\class-admin-users.php:241
|
21 |
-
msgid "Product Vendor"
|
22 |
-
msgstr "Produkt-Verkäufer"
|
23 |
-
|
24 |
-
#: class-product-vendor.php:82
|
25 |
-
msgid ""
|
26 |
-
"<b>Product Vendor is disabled</b>. Product Vendor requires WooCommerce "
|
27 |
-
"v2.0.1."
|
28 |
-
msgstr ""
|
29 |
-
"<b>Product Vendor is deaktiviert</b>. Product Vendor benötigt mind. "
|
30 |
-
"WooCommerce v2.0.1."
|
31 |
-
|
32 |
-
#: productvendor\classes\class-cron.php:86
|
33 |
-
#, php-format
|
34 |
-
msgid "Payment total: %s"
|
35 |
-
msgstr "Zahlungen insges.: %s"
|
36 |
-
|
37 |
-
#: productvendor\classes\class-cron.php:143
|
38 |
-
msgid "Once Weekly"
|
39 |
-
msgstr "Einmal wöchentlich"
|
40 |
-
|
41 |
-
#: productvendor\classes\class-cron.php:148
|
42 |
-
msgid "Once every two weeks"
|
43 |
-
msgstr "Alle zwei Wochen"
|
44 |
-
|
45 |
-
#: productvendor\classes\class-cron.php:153
|
46 |
-
msgid "Once a month"
|
47 |
-
msgstr "Einmal im Monat"
|
48 |
-
|
49 |
-
#: productvendor\classes\class-install.php:84
|
50 |
-
#: productvendor\classes\class-install.php:234
|
51 |
-
msgid "Pending Vendor"
|
52 |
-
msgstr "Freizuschaltender Verkäufer"
|
53 |
-
|
54 |
-
#: productvendor\classes\class-install.php:185
|
55 |
-
msgid "Vendor Dashboard"
|
56 |
-
msgstr "Verkäufer-Seite"
|
57 |
-
|
58 |
-
#: productvendor\classes\class-install.php:186
|
59 |
-
#: productvendor\classes\admin\settings\sf-options.php:119
|
60 |
-
msgid "Orders"
|
61 |
-
msgstr "Bestellungen"
|
62 |
-
|
63 |
-
#: productvendor\classes\class-install.php:187
|
64 |
-
msgid "Shop Settings"
|
65 |
-
msgstr "Shop-Einstellungen"
|
66 |
-
|
67 |
-
#: productvendor\classes\admin\class-admin-page.php:14
|
68 |
-
#: productvendor\classes\admin\class-admin-page.php:35
|
69 |
-
#: productvendor\classes\admin\class-product-meta.php:139
|
70 |
-
#: productvendor\classes\admin\class-product-meta.php:155
|
71 |
-
#: productvendor\views\dashboard\reports.php:16
|
72 |
-
msgid "Commission"
|
73 |
-
msgstr "Provisionen"
|
74 |
-
|
75 |
-
#: productvendor\classes\admin\class-admin-page.php:142
|
76 |
-
#: productvendor\classes\admin\class-admin-reports.php:164
|
77 |
-
#: productvendor\views\dashboard\reports.php:14
|
78 |
-
msgid "Product"
|
79 |
-
msgstr "Produkt"
|
80 |
-
|
81 |
-
#: productvendor\classes\admin\class-admin-page.php:143
|
82 |
-
msgid "Order ID"
|
83 |
-
msgstr "Bestell-Nr."
|
84 |
-
|
85 |
-
#: productvendor\classes\admin\class-admin-page.php:144
|
86 |
-
#: productvendor\classes\admin\class-admin-reports.php:165
|
87 |
-
#: productvendor\classes\admin\class-product-meta.php:38
|
88 |
-
msgid "Vendor"
|
89 |
-
msgstr "Verkäufer"
|
90 |
-
|
91 |
-
#: productvendor\classes\admin\class-admin-page.php:145
|
92 |
-
#: productvendor\classes\admin\class-admin-reports.php:166
|
93 |
-
#: productvendor\classes\admin\class-admin-reports.php:303
|
94 |
-
msgid "Total"
|
95 |
-
msgstr "Gesamt"
|
96 |
-
|
97 |
-
#: productvendor\classes\admin\class-admin-page.php:146
|
98 |
-
#: productvendor\classes\admin\class-admin-reports.php:168
|
99 |
-
msgid "Status"
|
100 |
-
msgstr "Status"
|
101 |
-
|
102 |
-
#: productvendor\classes\admin\class-admin-page.php:147
|
103 |
-
#: productvendor\classes\front\orders\class-orders.php:162
|
104 |
-
msgid "Date"
|
105 |
-
msgstr "Datum"
|
106 |
-
|
107 |
-
#: productvendor\classes\admin\class-admin-page.php:182
|
108 |
-
msgid "Mark paid"
|
109 |
-
msgstr "Als bezahlt kennzeichnen"
|
110 |
-
|
111 |
-
#: productvendor\classes\admin\class-admin-page.php:183
|
112 |
-
msgid "Mark due"
|
113 |
-
msgstr "Als ausstehend kennzeichnen"
|
114 |
-
|
115 |
-
#: productvendor\classes\admin\class-admin-page.php:184
|
116 |
-
msgid "Mark reversed"
|
117 |
-
msgstr "Als storniert kennzeichnen"
|
118 |
-
|
119 |
-
#: productvendor\classes\admin\class-admin-page.php:208
|
120 |
-
msgid "Commission marked paid."
|
121 |
-
msgstr "Provision als bezahlt gekennzeichnet."
|
122 |
-
|
123 |
-
#: productvendor\classes\admin\class-admin-page.php:215
|
124 |
-
msgid "Commission marked due."
|
125 |
-
msgstr "Provision als ausstehend gekennzeichnet."
|
126 |
-
|
127 |
-
#: productvendor\classes\admin\class-admin-page.php:222
|
128 |
-
msgid "Commission marked reversed."
|
129 |
-
msgstr "Provision als storniert gekennzeichnet."
|
130 |
-
|
131 |
-
#: productvendor\classes\admin\class-admin-reports.php:39
|
132 |
-
msgid "Product Vendors"
|
133 |
-
msgstr "Produkt-Verkäufer"
|
134 |
-
|
135 |
-
#: productvendor\classes\admin\class-admin-reports.php:42
|
136 |
-
msgid "Overview"
|
137 |
-
msgstr "Überblick"
|
138 |
-
|
139 |
-
#: productvendor\classes\admin\class-admin-reports.php:48
|
140 |
-
msgid "Commission by vendor"
|
141 |
-
msgstr "Provision nach Verkäufer"
|
142 |
-
|
143 |
-
#: productvendor\classes\admin\class-admin-reports.php:115
|
144 |
-
#: productvendor\views\dashboard\date-picker.php:3
|
145 |
-
msgid "From:"
|
146 |
-
msgstr "Von:"
|
147 |
-
|
148 |
-
#: productvendor\classes\admin\class-admin-reports.php:115
|
149 |
-
#: productvendor\views\dashboard\date-picker.php:6
|
150 |
-
msgid "To:"
|
151 |
-
msgstr "An:"
|
152 |
-
|
153 |
-
#: productvendor\classes\admin\class-admin-reports.php:115
|
154 |
-
#: productvendor\classes\admin\class-admin-reports.php:230
|
155 |
-
#: productvendor\views\dashboard\date-picker.php:9
|
156 |
-
msgid "Show"
|
157 |
-
msgstr "Zeige"
|
158 |
-
|
159 |
-
#: productvendor\classes\admin\class-admin-reports.php:126
|
160 |
-
msgid "Total paid in range"
|
161 |
-
msgstr "Gesamt ausgezahlt im Zeitraum"
|
162 |
-
|
163 |
-
#: productvendor\classes\admin\class-admin-reports.php:128
|
164 |
-
#: productvendor\classes\admin\class-admin-reports.php:134
|
165 |
-
#: productvendor\classes\admin\class-admin-reports.php:140
|
166 |
-
#: productvendor\classes\front\orders\class-export-csv.php:50
|
167 |
-
#: productvendor\views\orders\table-body-simple.php:13
|
168 |
-
msgid "n/a"
|
169 |
-
msgstr "n/a"
|
170 |
-
|
171 |
-
#: productvendor\classes\admin\class-admin-reports.php:132
|
172 |
-
msgid "Total due in range"
|
173 |
-
msgstr "Gesamt offen im Zeitraum"
|
174 |
-
|
175 |
-
#: productvendor\classes\admin\class-admin-reports.php:138
|
176 |
-
msgid "Total reversed in range"
|
177 |
-
msgstr "Gesamt storniert im Zeitraum"
|
178 |
-
|
179 |
-
#: productvendor\classes\admin\class-admin-reports.php:147
|
180 |
-
msgid "Recent Commission"
|
181 |
-
msgstr "Neueste Provision"
|
182 |
-
|
183 |
-
#: productvendor\classes\admin\class-admin-reports.php:163
|
184 |
-
#: productvendor\classes\front\orders\class-orders.php:155
|
185 |
-
msgid "Order"
|
186 |
-
msgstr "Bestellung"
|
187 |
-
|
188 |
-
#: productvendor\classes\admin\class-admin-reports.php:167
|
189 |
-
msgid "Date & Time"
|
190 |
-
msgstr "Datum & Uhrzeit"
|
191 |
-
|
192 |
-
#: productvendor\classes\admin\class-admin-reports.php:174
|
193 |
-
msgid "N/A"
|
194 |
-
msgstr "N/A"
|
195 |
-
|
196 |
-
#: productvendor\classes\admin\class-admin-reports.php:178
|
197 |
-
msgid "D j M Y \\a\\t h:ia"
|
198 |
-
msgstr "D, j.m.Y \\u\\m H:i \\U\\h\\r"
|
199 |
-
|
200 |
-
#: productvendor\classes\admin\class-admin-reports.php:187
|
201 |
-
msgid "No commission yet"
|
202 |
-
msgstr "Keine Provision fällig."
|
203 |
-
|
204 |
-
#: productvendor\classes\admin\class-admin-reports.php:217
|
205 |
-
msgid "Show:"
|
206 |
-
msgstr "Zeige:"
|
207 |
-
|
208 |
-
#: productvendor\classes\admin\class-admin-reports.php:278
|
209 |
-
msgid "Month"
|
210 |
-
msgstr "Monatlich"
|
211 |
-
|
212 |
-
#: productvendor\classes\admin\class-admin-reports.php:279
|
213 |
-
msgid "Total Due"
|
214 |
-
msgstr "Gesamt offen"
|
215 |
-
|
216 |
-
#: productvendor\classes\admin\class-admin-reports.php:279
|
217 |
-
msgid "This is the sum of the commission that hasn't been paid yet."
|
218 |
-
msgstr "Dies ist die Summer aller ausstehenden Provosionszahlungen."
|
219 |
-
|
220 |
-
#: productvendor\classes\admin\class-admin-reports.php:280
|
221 |
-
msgid "Total Paid"
|
222 |
-
msgstr "Gesamt gezahlt"
|
223 |
-
|
224 |
-
#: productvendor\classes\admin\class-admin-reports.php:280
|
225 |
-
msgid "This is the sum of the commission you've already paid."
|
226 |
-
msgstr ""
|
227 |
-
"Dies ist die Summe aller Provisionen, die Ihnen bereits ausgezahlt wurden."
|
228 |
-
|
229 |
-
#: productvendor\classes\admin\class-admin-reports.php:281
|
230 |
-
msgid "Total Reversed"
|
231 |
-
msgstr "Gesamt storniert"
|
232 |
-
|
233 |
-
#: productvendor\classes\admin\class-admin-reports.php:281
|
234 |
-
msgid ""
|
235 |
-
"This is the sum of the commssion where an order was reversed, thus so was "
|
236 |
-
"commission."
|
237 |
-
msgstr ""
|
238 |
-
"Dies ist die Summe der Provisionen aller stornierten Bestellungen, also die "
|
239 |
-
"stornierte Provision."
|
240 |
-
|
241 |
-
#: productvendor\classes\admin\class-admin-reports.php:282
|
242 |
-
msgid "Total Shipping"
|
243 |
-
msgstr "Versand gesamt"
|
244 |
-
|
245 |
-
#: productvendor\classes\admin\class-admin-reports.php:282
|
246 |
-
msgid "This is the sum of the shipping costs given to vendors."
|
247 |
-
msgstr ""
|
248 |
-
"Dies ist die Summer aller Versandkosten, die dem Verkäufer zugestanden "
|
249 |
-
"wurden."
|
250 |
-
|
251 |
-
#: productvendor\classes\admin\class-admin-users.php:249
|
252 |
-
msgid "Enable HTML for the shop description"
|
253 |
-
msgstr "HTML für die Shop-Beschreibung erlauben"
|
254 |
-
|
255 |
-
#: productvendor\classes\admin\class-admin-users.php:254
|
256 |
-
msgid "PayPal E-mail"
|
257 |
-
msgstr "PayPal E-Mail"
|
258 |
-
|
259 |
-
#: productvendor\classes\admin\class-admin-users.php:254
|
260 |
-
msgid "required"
|
261 |
-
msgstr "erforderlich"
|
262 |
-
|
263 |
-
#: productvendor\classes\admin\class-admin-users.php:258
|
264 |
-
msgid "Commission due"
|
265 |
-
msgstr "Ausstehende Provision"
|
266 |
-
|
267 |
-
#: productvendor\classes\admin\class-admin-users.php:275
|
268 |
-
msgid "Commission Due"
|
269 |
-
msgstr "Ausstehende Provision"
|
270 |
-
|
271 |
-
#: productvendor\classes\admin\class-product-meta.php:162
|
272 |
-
msgid "Leave blank for default"
|
273 |
-
msgstr "Leer lassen für Voreinstellung"
|
274 |
-
|
275 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:25
|
276 |
-
msgid "Approve"
|
277 |
-
msgstr "Freischalten"
|
278 |
-
|
279 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:26
|
280 |
-
msgid "Deny"
|
281 |
-
msgstr "Ablehnen"
|
282 |
-
|
283 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:70
|
284 |
-
msgid "Vendor has been <b>denied</b>."
|
285 |
-
msgstr "Verkäufer wurde <b>abgelehnt</b>."
|
286 |
-
|
287 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:81
|
288 |
-
msgid "Vendor has been <b>approved</b>."
|
289 |
-
msgstr "Verkäufer wurde <b>freigeschaltet</b>."
|
290 |
-
|
291 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:94
|
292 |
-
msgid "Pending Vendors"
|
293 |
-
msgstr "Freizuschaltende Verkäufer"
|
294 |
-
|
295 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:27
|
296 |
-
msgid "Vendor Application"
|
297 |
-
msgstr "Bewerbung als Verkäufer"
|
298 |
-
|
299 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:28
|
300 |
-
msgid "Vendor application will either be approved, denied, or pending."
|
301 |
-
msgstr ""
|
302 |
-
"Die Bewerbung als Verkäufer wird entweder genehmigt, abgelehnt oder auf "
|
303 |
-
"in Bearbeitung gesetzt."
|
304 |
-
|
305 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:30
|
306 |
-
msgid "Application {status}"
|
307 |
-
msgstr "Bewerbung {status}"
|
308 |
-
|
309 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:31
|
310 |
-
msgid "[{blogname}] Your vendor application has been {status}"
|
311 |
-
msgstr "[{blogname}] Ihre Bewerbung als Verkäufer wurde {status}"
|
312 |
-
|
313 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:115
|
314 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:224
|
315 |
-
msgid "Enable/Disable"
|
316 |
-
msgstr "Aktivieren/Deaktiveren"
|
317 |
-
|
318 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:117
|
319 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:226
|
320 |
-
msgid "Enable this email notification"
|
321 |
-
msgstr "E-Mail-Benachrichtigung aktivieren"
|
322 |
-
|
323 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:121
|
324 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:230
|
325 |
-
msgid "Subject"
|
326 |
-
msgstr "Betreff"
|
327 |
-
|
328 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:123
|
329 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:232
|
330 |
-
#, php-format
|
331 |
-
msgid ""
|
332 |
-
"This controls the email subject line. Leave blank to use the default "
|
333 |
-
"subject: <code>%s</code>."
|
334 |
-
msgstr ""
|
335 |
-
"Hier kann die E-Mail-Betreffzeile festgelegt werden. Leer lassen für "
|
336 |
-
"den Standard-Betreff: <code>%s</code>."
|
337 |
-
|
338 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:128
|
339 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:237
|
340 |
-
msgid "Email Heading"
|
341 |
-
msgstr "E-Mail-Header (Kopfzeile)"
|
342 |
-
|
343 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:130
|
344 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:239
|
345 |
-
#, php-format
|
346 |
-
msgid ""
|
347 |
-
"This controls the main heading contained within the email notification. "
|
348 |
-
"Leave blank to use the default heading: <code>%s</code>."
|
349 |
-
msgstr ""
|
350 |
-
"Dies bestimmt den Header-Abschnitt (Kopfzeile) der Benachrichtigungs-E-Mail. "
|
351 |
-
"Leer lassen für den Standard-Inhalt: <code>%s</code>."
|
352 |
-
|
353 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:135
|
354 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:244
|
355 |
-
msgid "Email type"
|
356 |
-
msgstr "E-Mail-Typ"
|
357 |
-
|
358 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:137
|
359 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:246
|
360 |
-
msgid "Choose which format of email to send."
|
361 |
-
msgstr "Wählen Sie, in welchem Format die E-Mail gesendet werden soll."
|
362 |
-
|
363 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:141
|
364 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:250
|
365 |
-
msgid "Plain text"
|
366 |
-
msgstr "Klartext"
|
367 |
-
|
368 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:142
|
369 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:251
|
370 |
-
msgid "HTML"
|
371 |
-
msgstr "HTML"
|
372 |
-
|
373 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:143
|
374 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:252
|
375 |
-
msgid "Multipart"
|
376 |
-
msgstr "Multipart"
|
377 |
-
|
378 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:27
|
379 |
-
msgid "Notify vendors"
|
380 |
-
msgstr "Verkäufer benachrichtigen"
|
381 |
-
|
382 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:28
|
383 |
-
msgid "New order emails are sent when an order is received/paid by a customer."
|
384 |
-
msgstr ""
|
385 |
-
"Neue Bestell-E-Mails wird gesendet, wenn eine Bestellung eingegangen ist / "
|
386 |
-
"von einem Kunden bezahlt wurde."
|
387 |
-
|
388 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:30
|
389 |
-
msgid "New customer order"
|
390 |
-
msgstr "Neue Bestellung"
|
391 |
-
|
392 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:31
|
393 |
-
msgid "[{blogname}] New customer order ({order_number}) - {order_date}"
|
394 |
-
msgstr "[{blogname}] Neue Kundenbestellung ({order_number}) - {order_date}"
|
395 |
-
|
396 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:102
|
397 |
-
msgid "Commission Subtotal:"
|
398 |
-
msgstr "Zwischensumme Provisionen:"
|
399 |
-
|
400 |
-
#: productvendor\classes\admin\settings\sf-options.php:4
|
401 |
-
msgid "General"
|
402 |
-
msgstr "Allgemein"
|
403 |
-
|
404 |
-
#: productvendor\classes\admin\settings\sf-options.php:5
|
405 |
-
msgid "General options"
|
406 |
-
msgstr "Allgemeine Optionen"
|
407 |
-
|
408 |
-
#: productvendor\classes\admin\settings\sf-options.php:8
|
409 |
-
msgid "Default commission (%)"
|
410 |
-
msgstr "Standard-Provision (in %)"
|
411 |
-
|
412 |
-
#: productvendor\classes\admin\settings\sf-options.php:9
|
413 |
-
msgid ""
|
414 |
-
"Choose the default rate for each product. If a product has a commission rate "
|
415 |
-
"already set, this value will be ignored for that product."
|
416 |
-
msgstr ""
|
417 |
-
"Wählen Sie eine Standard-Provisionsrate, die für alle Produkte "
|
418 |
-
"gültig ist. Wenn bei einem Produkt eine einzelne Provision eingestellt "
|
419 |
-
"ist oder wird, überschreibt der Einzelwert die Standardeinstellung und "
|
420 |
-
"der hier eingetragene Wert wird für das Einzel-Produkt ignoriert."
|
421 |
-
|
422 |
-
#: productvendor\classes\admin\settings\sf-options.php:20
|
423 |
-
msgid "Registration"
|
424 |
-
msgstr "Registration"
|
425 |
-
|
426 |
-
#: productvendor\classes\admin\settings\sf-options.php:21
|
427 |
-
msgid "Allow users or guests to apply to become a vendor"
|
428 |
-
msgstr ""
|
429 |
-
"Erlaube Benutzern oder Gästen sich als Verkäufer zu bewerben."
|
430 |
-
|
431 |
-
#: productvendor\classes\admin\settings\sf-options.php:22
|
432 |
-
msgid ""
|
433 |
-
"This will show a checkbox on the My Account page's registration form asking "
|
434 |
-
"if the user would like to apply to be a vendor. Also, on the Vendor "
|
435 |
-
"Dashboard, users can apply to become a vendor."
|
436 |
-
msgstr ""
|
437 |
-
"Ist dies aktiviert, wird eine Ckeckbox auf der bei der Registration als "
|
438 |
-
"neuer Benutzer angezeigt, mit der der Benutzer gefragt wird, ob er sich auch "
|
439 |
-
"als Verkäufer beqwerben möchte.. Bereits registrierte Benutzer "
|
440 |
-
"können sich auch nachträglich auf der Verkäufer-Seite als "
|
441 |
-
"Verkäufer bewerben."
|
442 |
-
|
443 |
-
#: productvendor\classes\admin\settings\sf-options.php:29
|
444 |
-
msgid "Shop HTML"
|
445 |
-
msgstr "Shop-HTML"
|
446 |
-
|
447 |
-
#: productvendor\classes\admin\settings\sf-options.php:30
|
448 |
-
msgid "Enable HTML for a vendor's shop description by default"
|
449 |
-
msgstr ""
|
450 |
-
"Erlaube HTML in der Shop-Beschreibung eines Verkäufers für alle "
|
451 |
-
"Verkäufer als Voreinstellung"
|
452 |
-
|
453 |
-
#: productvendor\classes\admin\settings\sf-options.php:37
|
454 |
-
msgid "Vendor shop page"
|
455 |
-
msgstr "Verkäufer-Seite"
|
456 |
-
|
457 |
-
#: productvendor\classes\admin\settings\sf-options.php:38
|
458 |
-
msgid "Eg: <code>yoursite.com/[your_setting_here]/[vendor_name_here]</code>"
|
459 |
-
msgstr ""
|
460 |
-
"Z.B.: <code>deineseite.de/[deine_einstellung_hier]/[verkäufer_name_hier]"
|
461 |
-
"</code>"
|
462 |
-
|
463 |
-
#: productvendor\classes\admin\settings\sf-options.php:45
|
464 |
-
msgid "Seller info tab"
|
465 |
-
msgstr "Verkäufer-Info-Tab"
|
466 |
-
|
467 |
-
#: productvendor\classes\admin\settings\sf-options.php:46
|
468 |
-
msgid "Choose what this custom tab on a vendor's product should say"
|
469 |
-
msgstr ""
|
470 |
-
"Wähle, was dieses Tab auf einer Produktseite des Verkäufers "
|
471 |
-
"enthalten soll"
|
472 |
-
|
473 |
-
#: productvendor\classes\admin\settings\sf-options.php:49
|
474 |
-
msgid "Seller Info"
|
475 |
-
msgstr "Verkäufer-Info"
|
476 |
-
|
477 |
-
#: productvendor\classes\admin\settings\sf-options.php:52
|
478 |
-
#: productvendor\classes\admin\settings\sf-options.php:177
|
479 |
-
msgid "Products"
|
480 |
-
msgstr "Produkte"
|
481 |
-
|
482 |
-
#: productvendor\classes\admin\settings\sf-options.php:53
|
483 |
-
msgid "Product Add Page"
|
484 |
-
msgstr "Produkt hinzufügen Seite"
|
485 |
-
|
486 |
-
#: productvendor\classes\admin\settings\sf-options.php:53
|
487 |
-
msgid "Configure what to hide from all vendors when adding a product"
|
488 |
-
msgstr ""
|
489 |
-
"Stelle ein, was der Verkäufer nicht sehen darf, wenn er ein Produkt "
|
490 |
-
"hinzufügt"
|
491 |
-
|
492 |
-
#: productvendor\classes\admin\settings\sf-options.php:56
|
493 |
-
msgid "Left side panel"
|
494 |
-
msgstr "Produktdaten (Feld auf der linken Seite)"
|
495 |
-
|
496 |
-
#: productvendor\classes\admin\settings\sf-options.php:57
|
497 |
-
msgid "Hide these areas of the add product page for vendors"
|
498 |
-
msgstr ""
|
499 |
-
"Verberge diese Bereiche der Seite Produkt hinzufügen für den "
|
500 |
-
"Verkäufer"
|
501 |
-
|
502 |
-
#: productvendor\classes\admin\settings\sf-options.php:71
|
503 |
-
msgid "Types"
|
504 |
-
msgstr "Produkttypen"
|
505 |
-
|
506 |
-
#: productvendor\classes\admin\settings\sf-options.php:72
|
507 |
-
msgid "Hide these product types from the vendor"
|
508 |
-
msgstr "Verberge diese Produktdaten für den Verkäufer"
|
509 |
-
|
510 |
-
#: productvendor\classes\admin\settings\sf-options.php:85
|
511 |
-
msgid "Type options"
|
512 |
-
msgstr "Produkttyp-Optionen"
|
513 |
-
|
514 |
-
#: productvendor\classes\admin\settings\sf-options.php:86
|
515 |
-
msgid "Hide these product options from the vendor"
|
516 |
-
msgstr "Verberge diese Produktoptionen für den Verkäufer"
|
517 |
-
|
518 |
-
#: productvendor\classes\admin\settings\sf-options.php:97
|
519 |
-
msgid "Miscellaneous"
|
520 |
-
msgstr "Diverses"
|
521 |
-
|
522 |
-
#: productvendor\classes\admin\settings\sf-options.php:108
|
523 |
-
msgid "Stylesheet"
|
524 |
-
msgstr "Stylesheet"
|
525 |
-
|
526 |
-
#: productvendor\classes\admin\settings\sf-options.php:109
|
527 |
-
msgid ""
|
528 |
-
"You can add CSS in this textarea, which will be loaded on the product add/"
|
529 |
-
"edit page for vendors."
|
530 |
-
msgstr ""
|
531 |
-
"Sie können CSS in diesem Textfeld eintragen, welches auf der Seite "
|
532 |
-
"Produkt hinzufügen/editieren für Verkäufer angezeigt wird."
|
533 |
-
|
534 |
-
#: productvendor\classes\admin\settings\sf-options.php:115
|
535 |
-
msgid "Capabilities"
|
536 |
-
msgstr "Verkäufer-Rechte"
|
537 |
-
|
538 |
-
#: productvendor\classes\admin\settings\sf-options.php:116
|
539 |
-
msgid "Permissions"
|
540 |
-
msgstr "Berechtigungen"
|
541 |
-
|
542 |
-
#: productvendor\classes\admin\settings\sf-options.php:116
|
543 |
-
msgid "General permissions used around the shop"
|
544 |
-
msgstr "Allgemeine Berechtigungen rund um den Shop"
|
545 |
-
|
546 |
-
#: productvendor\classes\admin\settings\sf-options.php:120
|
547 |
-
msgid "View orders"
|
548 |
-
msgstr "Bestellungen ansehen"
|
549 |
-
|
550 |
-
#: productvendor\classes\admin\settings\sf-options.php:121
|
551 |
-
msgid "Show customer details such as email, address, name, etc, for each order"
|
552 |
-
msgstr ""
|
553 |
-
"Zeige Käufer-Details für jede Bestellung, wie z.B. E-Mail-Adresse, "
|
554 |
-
"Name, etc."
|
555 |
-
|
556 |
-
#: productvendor\classes\admin\settings\sf-options.php:128
|
557 |
-
msgid "View comments"
|
558 |
-
msgstr "Bestell-Kommentare ansehen"
|
559 |
-
|
560 |
-
#: productvendor\classes\admin\settings\sf-options.php:129
|
561 |
-
msgid "View all vendor comments for an order on the frontend"
|
562 |
-
msgstr ""
|
563 |
-
"Zeige alle Verkäufer-Kommentare für eine Bestellung im Frontend."
|
564 |
-
|
565 |
-
#: productvendor\classes\admin\settings\sf-options.php:136
|
566 |
-
msgid "Submit comments"
|
567 |
-
msgstr "Bestell-Kommentare hinzufügen"
|
568 |
-
|
569 |
-
#: productvendor\classes\admin\settings\sf-options.php:137
|
570 |
-
msgid ""
|
571 |
-
"Submit comments for an order on the frontend. Eg, tracking ID for a product"
|
572 |
-
msgstr ""
|
573 |
-
"Kommentare zu einer Bestellung über das Frontend hinzufügen, z.B. "
|
574 |
-
"die Sendungsverfolgungs-Nr. für ein Produkt."
|
575 |
-
|
576 |
-
#: productvendor\classes\admin\settings\sf-options.php:144
|
577 |
-
msgid "View email addresses"
|
578 |
-
msgstr "E-Mail-Adressen ansehen"
|
579 |
-
|
580 |
-
#: productvendor\classes\admin\settings\sf-options.php:145
|
581 |
-
msgid ""
|
582 |
-
"While viewing order details on the frontend, you can disable or enable email "
|
583 |
-
"addresses"
|
584 |
-
msgstr ""
|
585 |
-
"Wenn der Verkäufer die Bestelldetails sehen darf, kann hiermit zusä"
|
586 |
-
"tzlich die Anzeige der eMail-Adressen der Käfer ermöglicht werden."
|
587 |
-
|
588 |
-
#: productvendor\classes\admin\settings\sf-options.php:152
|
589 |
-
msgid "Export a CSV file of orders for a product"
|
590 |
-
msgstr "Bestelldetails eines Produktes als CSV-Datei exportieren"
|
591 |
-
|
592 |
-
#: productvendor\classes\admin\settings\sf-options.php:153
|
593 |
-
msgid "Vendors could export orders for a product on the frontend"
|
594 |
-
msgstr ""
|
595 |
-
"Verkäufer kann Bestellungen eines Produktes im Frontend exportieren."
|
596 |
-
|
597 |
-
#: productvendor\classes\admin\settings\sf-options.php:160
|
598 |
-
msgid "Reports"
|
599 |
-
msgstr "Berichte"
|
600 |
-
|
601 |
-
#: productvendor\classes\admin\settings\sf-options.php:161
|
602 |
-
msgid "View backend sales reports"
|
603 |
-
msgstr "Backend Verkaufs-Übersicht ansehen"
|
604 |
-
|
605 |
-
#: productvendor\classes\admin\settings\sf-options.php:162
|
606 |
-
msgid ""
|
607 |
-
"Graphs and tables via the Reports page in backend. The reports will only "
|
608 |
-
"display sales data that pretain to their products"
|
609 |
-
msgstr ""
|
610 |
-
"Grafiken und Tabellen in den Übersichten im Backend. Die Übersicht "
|
611 |
-
"zeigt nur die Verkaufs-Daten, die zu den Produkten des jeweiligen Verkä"
|
612 |
-
"ufers gehören. "
|
613 |
-
|
614 |
-
#: productvendor\classes\admin\settings\sf-options.php:169
|
615 |
-
msgid "View Frontend sales reports"
|
616 |
-
msgstr "Frontend Verkaufs-Übersicht ansehen"
|
617 |
-
|
618 |
-
#: productvendor\classes\admin\settings\sf-options.php:170
|
619 |
-
msgid ""
|
620 |
-
"Sales table on the frontend on the My Account page. The table will only "
|
621 |
-
"display sales data that pretain to their products"
|
622 |
-
msgstr ""
|
623 |
-
"Verkaufs-Übersicht im Frontend auf der Mein Konto Seite. Die Ü"
|
624 |
-
"bersicht zeigt nur die Verkaufs-Daten, die zu den Produkten des jeweiligen "
|
625 |
-
"Verkäufers gehören."
|
626 |
-
|
627 |
-
#: productvendor\classes\admin\settings\sf-options.php:178
|
628 |
-
msgid "Submit products"
|
629 |
-
msgstr "Produkte hinzufügen"
|
630 |
-
|
631 |
-
#: productvendor\classes\admin\settings\sf-options.php:179
|
632 |
-
msgid ""
|
633 |
-
"Vendors could submit a product through the backend, and an admin would "
|
634 |
-
"approve or deny it"
|
635 |
-
msgstr ""
|
636 |
-
"Verkäufer können ein neues Produkt im Backend hinzufügen. Ein "
|
637 |
-
"Admin kann es dann freischalten oder ablehnen."
|
638 |
-
|
639 |
-
#: productvendor\classes\admin\settings\sf-options.php:186
|
640 |
-
msgid "Edit live products"
|
641 |
-
msgstr "Live-Produkte bearbeiten."
|
642 |
-
|
643 |
-
#: productvendor\classes\admin\settings\sf-options.php:187
|
644 |
-
msgid ""
|
645 |
-
"Vendors could edit an approved product after it has already gone live. There "
|
646 |
-
"is no approval or review after editing a live product. This could be "
|
647 |
-
"dangerous with malicious vendors, so take caution."
|
648 |
-
msgstr ""
|
649 |
-
"Ist dies aktiviert, können Verkäufer ein bereits freigeschaltetes "
|
650 |
-
"Product bearbeiten. Es gibt keine erneute Freischaltung der Bearbeitung, "
|
651 |
-
"also Vorsicht!"
|
652 |
-
|
653 |
-
#: productvendor\classes\admin\settings\sf-options.php:194
|
654 |
-
msgid "Submit products live without requiring approval"
|
655 |
-
msgstr ""
|
656 |
-
"Produkte hinzufügen, ohne dass eine Freischaltung durch den Admin "
|
657 |
-
"erforderlich ist"
|
658 |
-
|
659 |
-
#: productvendor\classes\admin\settings\sf-options.php:195
|
660 |
-
msgid ""
|
661 |
-
"Vendors can submit products without review or approval from a shop admin. "
|
662 |
-
"This could be dangerous with malicious vendors, so take caution."
|
663 |
-
msgstr ""
|
664 |
-
"Ist dies aktiviert, können Verkäufer neue Produkte hinzufü"
|
665 |
-
"gen, ohne dass eine vorherige Freischaltung durch den Admin erforderlich "
|
666 |
-
"ist. Dies könnte bei böswilligen Verkäufern gefährlich "
|
667 |
-
"sein, daher Vorsicht und mit Bedacht entscheiden!"
|
668 |
-
|
669 |
-
#: productvendor\classes\admin\settings\sf-options.php:201
|
670 |
-
msgid "Pages"
|
671 |
-
msgstr "Seiten"
|
672 |
-
|
673 |
-
#: productvendor\classes\admin\settings\sf-options.php:202
|
674 |
-
msgid "Page configuration"
|
675 |
-
msgstr "Seitenkonfiguration"
|
676 |
-
|
677 |
-
#: productvendor\classes\admin\settings\sf-options.php:205
|
678 |
-
msgid "Vendor dashboard"
|
679 |
-
msgstr "Verkäufer-Seite"
|
680 |
-
|
681 |
-
#: productvendor\classes\admin\settings\sf-options.php:206
|
682 |
-
msgid ""
|
683 |
-
"Choose the page that has the shortcode <code>[pv_vendor_dashboard]</code><br/"
|
684 |
-
">By default, My Account > Vendor Dashboard should have the shortcode."
|
685 |
-
msgstr ""
|
686 |
-
"Wähle die Seite, die den shortcode <code>[pv_vendor_dashboard]</"
|
687 |
-
"code><br/> enthält. Standardmäßig sollte dies Mein Konto > "
|
688 |
-
"Verkäufer-Seite sein."
|
689 |
-
|
690 |
-
#: productvendor\classes\admin\settings\sf-options.php:213
|
691 |
-
msgid "Shop settings"
|
692 |
-
msgstr "Shop-Einstellungen"
|
693 |
-
|
694 |
-
#: productvendor\classes\admin\settings\sf-options.php:214
|
695 |
-
msgid ""
|
696 |
-
"Choose the page that has the shortcode <code>[pv_shop_settings]</code><br/"
|
697 |
-
">These are the shop settings a vendor can configure."
|
698 |
-
msgstr ""
|
699 |
-
"Wähle die Seite, die den shortcode <code>[pv_shop_settings]</code><br/> "
|
700 |
-
"enthält. Dies sind die Shop-Einstellungen, die ein Verkäufer "
|
701 |
-
"vornehmen kann."
|
702 |
-
|
703 |
-
#: productvendor\classes\admin\settings\sf-options.php:221
|
704 |
-
msgid "Orders page"
|
705 |
-
msgstr "Bestellseite"
|
706 |
-
|
707 |
-
#: productvendor\classes\admin\settings\sf-options.php:222
|
708 |
-
msgid ""
|
709 |
-
"Choose the page that has the shortcode <code>[pv_orders]</code><br/>By "
|
710 |
-
"default, My Account > Orders should have the shortcode."
|
711 |
-
msgstr ""
|
712 |
-
"Wähle die Seite, die den shortcode <code>[pv_orders]</code><br/> "
|
713 |
-
"enthält. Standardmäßig sollte dies Mein Konto > Bestellungen "
|
714 |
-
"sein."
|
715 |
-
|
716 |
-
#: productvendor\classes\admin\settings\sf-options.php:229
|
717 |
-
msgid "Vendor terms"
|
718 |
-
msgstr "Verkäufer-Bedingungen"
|
719 |
-
|
720 |
-
#: productvendor\classes\admin\settings\sf-options.php:230
|
721 |
-
msgid ""
|
722 |
-
"These terms are shown to a user when submitting an application to become a "
|
723 |
-
"vendor.<br/>If left blank, no terms will be shown to the applicant."
|
724 |
-
msgstr ""
|
725 |
-
"Diese Bedingungen werden einem Benutzer angezeigt, wenn er sich als "
|
726 |
-
"Verkäufer bewirbt.<br/>Falls leer gelassen, werden dem Bewerber keine "
|
727 |
-
"Bedingungen angezeigt."
|
728 |
-
|
729 |
-
#: productvendor\classes\admin\settings\sf-options.php:248
|
730 |
-
msgid "Payments"
|
731 |
-
msgstr "Auszahlungen"
|
732 |
-
|
733 |
-
#: productvendor\classes\admin\settings\sf-options.php:249
|
734 |
-
msgid "User payments"
|
735 |
-
msgstr "Benutzer-Zahlungen"
|
736 |
-
|
737 |
-
#: productvendor\classes\admin\settings\sf-options.php:250
|
738 |
-
#, php-format
|
739 |
-
msgid "Total commission currently due: %s. <a href=\"%s\">View details</a>."
|
740 |
-
msgstr ""
|
741 |
-
"Gesamte derzeit ausstehende Provision: %s. <a href=\"%s\">Zeige Details</a>."
|
742 |
-
|
743 |
-
#: productvendor\classes\admin\settings\sf-options.php:251
|
744 |
-
#, php-format
|
745 |
-
msgid ""
|
746 |
-
"Make sure you update your PayPal Adaptive Payments settings <a href=\"%s"
|
747 |
-
"\">here</a>."
|
748 |
-
msgstr ""
|
749 |
-
"Stellen Sie sicher, dass die PayPal Adaptive Payments Einstellungen <a href="
|
750 |
-
"\"%s\">korrekt sind</a>."
|
751 |
-
|
752 |
-
#: productvendor\classes\admin\settings\sf-options.php:254
|
753 |
-
msgid "Instant pay"
|
754 |
-
msgstr "Sofortzahlung"
|
755 |
-
|
756 |
-
#: productvendor\classes\admin\settings\sf-options.php:255
|
757 |
-
msgid "Instantly pay vendors their commission when an order is made"
|
758 |
-
msgstr ""
|
759 |
-
"Zahlt dem Verkäufer seine Provision automatisch sofort, wenn eine "
|
760 |
-
"Bestellung eines seiner Produkte erfolgt ist."
|
761 |
-
|
762 |
-
#: productvendor\classes\admin\settings\sf-options.php:256
|
763 |
-
msgid ""
|
764 |
-
"For this to work, customers must checkout with the PayPal Adaptive Payments "
|
765 |
-
"gateway. Using other gateways will not pay vendors instantly"
|
766 |
-
msgstr ""
|
767 |
-
"For this to work, customers must checkout with the PayPal Adaptive Payments "
|
768 |
-
"gateway. Using other gateways will not pay vendors instantly"
|
769 |
-
|
770 |
-
#: productvendor\classes\admin\settings\sf-options.php:263
|
771 |
-
msgid "Payment schedule"
|
772 |
-
msgstr "Zeitplan für Zahlungen"
|
773 |
-
|
774 |
-
#: productvendor\classes\admin\settings\sf-options.php:264
|
775 |
-
msgid "Note: Schedule will only work if instant pay is unchecked"
|
776 |
-
msgstr ""
|
777 |
-
"Hinweis: Zeitplan funktioniert nur, wenn sofortige Zahlung deaktiviert ist."
|
778 |
-
|
779 |
-
#: productvendor\classes\admin\settings\sf-options.php:269
|
780 |
-
msgid "Weekly"
|
781 |
-
msgstr "Wöchentlich"
|
782 |
-
|
783 |
-
#: productvendor\classes\admin\settings\sf-options.php:270
|
784 |
-
msgid "Biweekly"
|
785 |
-
msgstr "Zweiwöchentlich"
|
786 |
-
|
787 |
-
#: productvendor\classes\admin\settings\sf-options.php:271
|
788 |
-
msgid "Monthly"
|
789 |
-
msgstr "Monatlich"
|
790 |
-
|
791 |
-
#: productvendor\classes\admin\settings\sf-options.php:272
|
792 |
-
msgid "Manual"
|
793 |
-
msgstr "Von Hand"
|
794 |
-
|
795 |
-
#: productvendor\classes\admin\settings\sf-options.php:273
|
796 |
-
msgid "Now"
|
797 |
-
msgstr "Jetzt"
|
798 |
-
|
799 |
-
#: productvendor\classes\admin\settings\sf-options.php:278
|
800 |
-
msgid "Email notification"
|
801 |
-
msgstr "E-Mail-Benachrichtigung"
|
802 |
-
|
803 |
-
#: productvendor\classes\admin\settings\sf-options.php:279
|
804 |
-
msgid ""
|
805 |
-
"Send the WooCommerce admin an email each time a payment has been made via "
|
806 |
-
"the payment schedule options above"
|
807 |
-
msgstr ""
|
808 |
-
"Sendet dem WooCommerce-Admin eine automtische E-Mail, wenn eine Zahlung "
|
809 |
-
"aufgrund des Zahlungsplans ausgeführt wurde."
|
810 |
-
|
811 |
-
#: productvendor\classes\admin\settings\classes\sf-class-format-options.php:201
|
812 |
-
#: productvendor\classes\admin\settings\classes\sf-class-format-options.php:205
|
813 |
-
msgid "Select a page..."
|
814 |
-
msgstr "Wähle eine Seite..."
|
815 |
-
|
816 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:149
|
817 |
-
#: productvendor\views\dashboard\settings\settings.php:1
|
818 |
-
msgid "Settings"
|
819 |
-
msgstr "Einstellungen"
|
820 |
-
|
821 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:279
|
822 |
-
msgid "Could not load settings at: "
|
823 |
-
msgstr "Einstellungen konnten nicht geladen werden für:"
|
824 |
-
|
825 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:279
|
826 |
-
msgid "Error - WP Settings Framework"
|
827 |
-
msgstr "Fehler - WP Settings Framework"
|
828 |
-
|
829 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:341
|
830 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:120
|
831 |
-
msgid "Settings saved."
|
832 |
-
msgstr "Einstellungen gespeichert."
|
833 |
-
|
834 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:454
|
835 |
-
#, php-format
|
836 |
-
msgid "Save %s changes"
|
837 |
-
msgstr "Änderungen %s speichern"
|
838 |
-
|
839 |
-
#: productvendor\classes\front\orders\class-export-csv.php:60
|
840 |
-
#: productvendor\views\dashboard\reports.php:15
|
841 |
-
msgid "Quantity"
|
842 |
-
msgstr "Anzahl"
|
843 |
-
|
844 |
-
#: productvendor\classes\front\orders\class-orders.php:97
|
845 |
-
msgid ""
|
846 |
-
"You haven't selected a product's orders to view! Please go back to the "
|
847 |
-
"Vendor Dashboard and click Show Orders on the product you'd like to view."
|
848 |
-
msgstr ""
|
849 |
-
"Sie haben keine Produkt-Bestellung ausgewählt, zu der Sie die Details "
|
850 |
-
"angezeigt haben wollen. Bitte gehen Sie zurück auf die Verkäufer-"
|
851 |
-
"Seite und klicken auf Bestellung anzeigen bei dem Produkt, zu dem Sie die "
|
852 |
-
"Bestell-Details ansehen wollen."
|
853 |
-
|
854 |
-
#: productvendor\classes\front\orders\class-orders.php:102
|
855 |
-
msgid "No orders."
|
856 |
-
msgstr "Keine Bestellungen."
|
857 |
-
|
858 |
-
#: productvendor\classes\front\orders\class-orders.php:156
|
859 |
-
msgid "Full name"
|
860 |
-
msgstr "Vollständiger Name"
|
861 |
-
|
862 |
-
#: productvendor\classes\front\orders\class-orders.php:157
|
863 |
-
msgid "Address"
|
864 |
-
msgstr "Adresse"
|
865 |
-
|
866 |
-
#: productvendor\classes\front\orders\class-orders.php:158
|
867 |
-
msgid "City"
|
868 |
-
msgstr "Stadt"
|
869 |
-
|
870 |
-
#: productvendor\classes\front\orders\class-orders.php:159
|
871 |
-
msgid "State"
|
872 |
-
msgstr "Bundesland"
|
873 |
-
|
874 |
-
#: productvendor\classes\front\orders\class-orders.php:160
|
875 |
-
msgid "Zip"
|
876 |
-
msgstr "PLZ"
|
877 |
-
|
878 |
-
#: productvendor\classes\front\orders\class-orders.php:161
|
879 |
-
msgid "Email address"
|
880 |
-
msgstr "E-Mail-Adresse"
|
881 |
-
|
882 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:38
|
883 |
-
#: productvendor\views\dashboard\denied.php:16
|
884 |
-
msgid "Apply to become a vendor?"
|
885 |
-
msgstr "Bewerben um ein Verkäufer zu werden?"
|
886 |
-
|
887 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:56
|
888 |
-
msgid "Your application has been submitted."
|
889 |
-
msgstr "Ihre Bewerbung wurde eingereicht."
|
890 |
-
|
891 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:72
|
892 |
-
msgid "You must accept the terms and conditions to become a vendor."
|
893 |
-
msgstr ""
|
894 |
-
"Sie müssen die Verkäufer-Bedingungen lesen und akzeptieren um ein "
|
895 |
-
"Verkäufer zu werden."
|
896 |
-
|
897 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:37
|
898 |
-
msgid "PayPal Adaptive Payments"
|
899 |
-
msgstr "PayPal Adaptive Payments"
|
900 |
-
|
901 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:112
|
902 |
-
#, php-format
|
903 |
-
msgid ""
|
904 |
-
"Something went wrong. Response from PayPal invalidated this order. Status: "
|
905 |
-
"%s."
|
906 |
-
msgstr ""
|
907 |
-
"Ein Fehler ist aufgetreten. Die Antwort von Paypal hat dieses Bestllung als "
|
908 |
-
"ungültig gekennzeichnet. Status: %s."
|
909 |
-
|
910 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:117
|
911 |
-
msgid "IPN payment completed"
|
912 |
-
msgstr "IPN Zahlung abgeschlossen"
|
913 |
-
|
914 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:139
|
915 |
-
msgid "Enable PayPal Adaptive Payments"
|
916 |
-
msgstr "PayPal Adaptive Payments aktivieren"
|
917 |
-
|
918 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:145
|
919 |
-
msgid "Method Title"
|
920 |
-
msgstr "Methoden-Überschrift"
|
921 |
-
|
922 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:146
|
923 |
-
msgid "This controls the title which the user sees during checkout."
|
924 |
-
msgstr ""
|
925 |
-
"Hier wird der Titel eingestellt, den der Benutzer während des "
|
926 |
-
"Abschlusses an der Kasse sieht."
|
927 |
-
|
928 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:147
|
929 |
-
msgid "PayPal"
|
930 |
-
msgstr "PayPal"
|
931 |
-
|
932 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:152
|
933 |
-
msgid "Description"
|
934 |
-
msgstr "Beschreibung"
|
935 |
-
|
936 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:153
|
937 |
-
msgid "This controls the description which the user sees during checkout."
|
938 |
-
msgstr ""
|
939 |
-
"Hier wird der Text eingestellt, den der Benutzer während des "
|
940 |
-
"Abschlusses an der Kasse sieht."
|
941 |
-
|
942 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:154
|
943 |
-
msgid "Pay via PayPal!"
|
944 |
-
msgstr "Zahlen Sie mit Paypal!"
|
945 |
-
|
946 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:165
|
947 |
-
msgid "Live Credentials"
|
948 |
-
msgstr "Live Credentials"
|
949 |
-
|
950 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:167
|
951 |
-
#, php-format
|
952 |
-
msgid ""
|
953 |
-
"You must have an <a href=\"%s\">Application ID</a> to process live "
|
954 |
-
"transactions. You do not need one for testing in Sandbox mode."
|
955 |
-
msgstr ""
|
956 |
-
"Sie benötigen eine <a href=\"%s\">Application ID</a> um Live-"
|
957 |
-
"Transaktionen auszuführen. Nicht erforderlich zum Testen im Sandbox-"
|
958 |
-
"Modus."
|
959 |
-
|
960 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:172
|
961 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:206
|
962 |
-
msgid "PayPal Email"
|
963 |
-
msgstr "PayPal E-Mail"
|
964 |
-
|
965 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:173
|
966 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:207
|
967 |
-
msgid "The email address main payments should go to."
|
968 |
-
msgstr "Die E-Mail-Adresse, an die die Hauptzahlungen gehen sollen."
|
969 |
-
|
970 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:178
|
971 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:212
|
972 |
-
msgid "API Username"
|
973 |
-
msgstr "API Benutzername"
|
974 |
-
|
975 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:183
|
976 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:217
|
977 |
-
msgid "API Password"
|
978 |
-
msgstr "API Passwort"
|
979 |
-
|
980 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:188
|
981 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:222
|
982 |
-
msgid "API Signature"
|
983 |
-
msgstr "API Signatur"
|
984 |
-
|
985 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:193
|
986 |
-
msgid "Application ID"
|
987 |
-
msgstr "Application ID"
|
988 |
-
|
989 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:195
|
990 |
-
msgid "Only required when doing live transactions."
|
991 |
-
msgstr "Nur erforderlich, wenn Live-Zahlungen genutzt werden."
|
992 |
-
|
993 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:199
|
994 |
-
msgid "Sandbox Credentials"
|
995 |
-
msgstr "Sandbox Credentials"
|
996 |
-
|
997 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:201
|
998 |
-
#, php-format
|
999 |
-
msgid ""
|
1000 |
-
"You can signup for a sandbox developer account <a href=\"%s\">here</a>. You "
|
1001 |
-
"need a developer account if you want to enable Sandbox mode for testing."
|
1002 |
-
msgstr ""
|
1003 |
-
"Sie können sich für einen Sandbox Developer Account <a href=\"%s"
|
1004 |
-
"\">hier</a> anmelden. Sie benötigen einen Developer Account, wenn Sie "
|
1005 |
-
"den Sandbox-Modus zum Testen aktivieren wollen."
|
1006 |
-
|
1007 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:233
|
1008 |
-
msgid "Misc. Settings"
|
1009 |
-
msgstr "Einstellungen"
|
1010 |
-
|
1011 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:238
|
1012 |
-
msgid "Enable PayPal Sandbox mode"
|
1013 |
-
msgstr "PayPal Sandbox-Modus aktivieren"
|
1014 |
-
|
1015 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:244
|
1016 |
-
msgid "Enable logging"
|
1017 |
-
msgstr "Logging aktivieren"
|
1018 |
-
|
1019 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:261
|
1020 |
-
msgid ""
|
1021 |
-
"The PayPal Adaptive Payments gateway can instantly pay your vendors their "
|
1022 |
-
"due commission (if enabled). Also used to mass pay vendors on a schedule / "
|
1023 |
-
"manual method (if enabled)."
|
1024 |
-
msgstr ""
|
1025 |
-
"Das PayPal Adaptive Payments Gateway kann Ihren Verkäufern sofort nach "
|
1026 |
-
"einem Verkauf die angefallene Provision automatisch auszahlen (sofern diese "
|
1027 |
-
"Funktion aktiviert ist). Es wird auch benutzt, um Massenzahlungen an die "
|
1028 |
-
"Verkäufer - manuell oder nach Zeitplan - auszuführen."
|
1029 |
-
|
1030 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:271
|
1031 |
-
msgid "Gateway Disabled"
|
1032 |
-
msgstr "Gateway deaktiviert"
|
1033 |
-
|
1034 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:271
|
1035 |
-
#, php-format
|
1036 |
-
msgid "%s does not support your store currency."
|
1037 |
-
msgstr "%s unterstützt nicht die im Shop eingestellte Währung."
|
1038 |
-
|
1039 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:390
|
1040 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:526
|
1041 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:147
|
1042 |
-
#, php-format
|
1043 |
-
msgid "Error: %s"
|
1044 |
-
msgstr "Fehler: %s"
|
1045 |
-
|
1046 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:398
|
1047 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:399
|
1048 |
-
#, php-format
|
1049 |
-
msgid "Error ID: %s. %s"
|
1050 |
-
msgstr "Error ID: %s. %s"
|
1051 |
-
|
1052 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:565
|
1053 |
-
#, php-format
|
1054 |
-
msgid "Attempted to checkout with %s when shipping costs are not permitted."
|
1055 |
-
msgstr "Versucht mit %s auszuchecken, wenn Versandkosten nicht gestattet sind."
|
1056 |
-
|
1057 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:566
|
1058 |
-
#, php-format
|
1059 |
-
msgid "You can not use %s when there are shipping costs."
|
1060 |
-
msgstr "Sie können %s nicht benutzen, wenn Versandkosten enthalten sind."
|
1061 |
-
|
1062 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:113
|
1063 |
-
msgid "No vendors found to pay. Maybe they haven't set a PayPal address?"
|
1064 |
-
msgstr ""
|
1065 |
-
"Keine Verkäufer gefunden, an die gezahlt werden kann. Vielleicht haben "
|
1066 |
-
"diese keine PayPal-Adresse hinterlegt?"
|
1067 |
-
|
1068 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:160
|
1069 |
-
msgid "All due commission has been paid for."
|
1070 |
-
msgstr "Alle ausstehenden Provosionszahlungen wurden ausgezahlt."
|
1071 |
-
|
1072 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:166
|
1073 |
-
msgid ""
|
1074 |
-
"All due commission has been paid for, but I could not clear it from their "
|
1075 |
-
"profiles due to an internal error. Commission will still be listed as due. "
|
1076 |
-
"Please manually mark the commission as paid from the Commissions page."
|
1077 |
-
msgstr ""
|
1078 |
-
"Alle offenen Provisionen wurden ausgezahlt, aber aufgrund eines internen "
|
1079 |
-
"Fehlers konnten die Provisionen nicht auf den Status bezahlt gesetzt werden. "
|
1080 |
-
"Die Provisionen werden weiterhin als offen gelistet. Bitte manuell auf "
|
1081 |
-
"bezahlt setzen."
|
1082 |
-
|
1083 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:200
|
1084 |
-
msgid "WooCommerce: Mass payments for vendors update"
|
1085 |
-
msgstr "WooCommerce: Massenzahlung für Verkäfer Update"
|
1086 |
-
|
1087 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:202
|
1088 |
-
msgid ""
|
1089 |
-
"Hello! A payment was just triggered to mass pay all vendors their due "
|
1090 |
-
"commission."
|
1091 |
-
msgstr ""
|
1092 |
-
"Hallo! Eine Massenzahlung wurde so eben ausgelöst um allen Verkä"
|
1093 |
-
"ufern ihre aussstehenden Provisionen zu zahlen."
|
1094 |
-
|
1095 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:203
|
1096 |
-
#, php-format
|
1097 |
-
msgid "Payment status: %s."
|
1098 |
-
msgstr "Auszahlungsstatus: %s."
|
1099 |
-
|
1100 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:204
|
1101 |
-
#, php-format
|
1102 |
-
msgid "Payment message: %s."
|
1103 |
-
msgstr "Nachricht zur Zahlung: %s."
|
1104 |
-
|
1105 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:207
|
1106 |
-
#, php-format
|
1107 |
-
msgid "Payment total: %s."
|
1108 |
-
msgstr "Zahlung gesamt: %s."
|
1109 |
-
|
1110 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:137
|
1111 |
-
msgid ""
|
1112 |
-
"The plugin has been updated, but could not be reactivated. Please reactivate "
|
1113 |
-
"it manually."
|
1114 |
-
msgstr ""
|
1115 |
-
"Das Plugin wurde geupdated, konnte aber nicht aktiviert werden. Bitte "
|
1116 |
-
"aktivieren Sie es von Hand erneut."
|
1117 |
-
|
1118 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:138
|
1119 |
-
msgid "Plugin reactivated successfully."
|
1120 |
-
msgstr "Plugin erfolgreich erneut aktiviert."
|
1121 |
-
|
1122 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:229
|
1123 |
-
msgid "MGates.me Updates"
|
1124 |
-
msgstr "MGates.me Updates"
|
1125 |
-
|
1126 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:259
|
1127 |
-
msgid "MGates.me Plugin Updater"
|
1128 |
-
msgstr "MGates.me Plugin-Updater"
|
1129 |
-
|
1130 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:270
|
1131 |
-
msgid "Enter your license key to automatically receive updates."
|
1132 |
-
msgstr ""
|
1133 |
-
"Fügen Sie den Lizenzschlüssel hinzu, um automatisch Plugin-Updates "
|
1134 |
-
"zu erhalten."
|
1135 |
-
|
1136 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:295
|
1137 |
-
#: productvendor\views\dashboard\settings\settings.php:19
|
1138 |
-
msgid "Save"
|
1139 |
-
msgstr "Speichern"
|
1140 |
-
|
1141 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:296
|
1142 |
-
msgid "Check for updates <b>now</b>"
|
1143 |
-
msgstr "<b>Jetzt</b> auf Updates prüfen."
|
1144 |
-
|
1145 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:323
|
1146 |
-
#, php-format
|
1147 |
-
msgid ""
|
1148 |
-
"<b style=\"color: #468847;\">Key deactivated.</b> License key for <i>%s</i> "
|
1149 |
-
"has been <b>deactivated</b>."
|
1150 |
-
msgstr ""
|
1151 |
-
"<b style=\"color: #468847;\">Schlüssel wurde deaktiviert.</b> Der "
|
1152 |
-
"Lizenzschlüssel für <i>%s</i> wurde <b>deaktiviert</b>."
|
1153 |
-
|
1154 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:325
|
1155 |
-
#, php-format
|
1156 |
-
msgid ""
|
1157 |
-
"<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> could not "
|
1158 |
-
"be deactivated."
|
1159 |
-
msgstr ""
|
1160 |
-
"<b style=\"color: #B94A48;\">Fehler.</b> Der Lizenzschlüssel für "
|
1161 |
-
"<i>%s</i> konnte nicht deaktiviert werden."
|
1162 |
-
|
1163 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:333
|
1164 |
-
#, php-format
|
1165 |
-
msgid ""
|
1166 |
-
"<b style=\"color: #468847;\">Key activated.</b> License key for <i>%s</i> "
|
1167 |
-
"has been <b>activated</b>."
|
1168 |
-
msgstr ""
|
1169 |
-
"<b style=\"color: #468847;\">Schlüssel aktiviert.</b> Der "
|
1170 |
-
"Lizenzschlüssel für<i>%s</i> wurde <b>aktiviert</b>."
|
1171 |
-
|
1172 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:335
|
1173 |
-
#, php-format
|
1174 |
-
msgid ""
|
1175 |
-
"<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> is invalid."
|
1176 |
-
msgstr ""
|
1177 |
-
"<b style=\"color: #B94A48;\">Error.</b> Lizenz-Key für <i>%s</i> ist "
|
1178 |
-
"ungültig."
|
1179 |
-
|
1180 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:370
|
1181 |
-
msgid "Enable MGates.me Plugin Updates."
|
1182 |
-
msgstr "Aktiviere MGates.me Plugin Updates."
|
1183 |
-
|
1184 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:372
|
1185 |
-
#, php-format
|
1186 |
-
msgid ""
|
1187 |
-
"<a href=\"%1$s\">Add your license keys</a> to enable automatic plugin "
|
1188 |
-
"updates."
|
1189 |
-
msgstr ""
|
1190 |
-
"<a href=\"%1$s\">Fügen Sie den Lizenz-Schlüssel hinzu</a>, um die "
|
1191 |
-
"automatischen Plugin-Updates zu aktivieren."
|
1192 |
-
|
1193 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:379
|
1194 |
-
msgid "Hide This Message"
|
1195 |
-
msgstr "Diese Nachricht verbergen"
|
1196 |
-
|
1197 |
-
#: productvendor\views\dashboard\denied.php:5
|
1198 |
-
msgid "Your account has not yet been approved to become a vendor."
|
1199 |
-
msgstr ""
|
1200 |
-
"Ihr Benutzerprofil ist noch nicht als Verkäufer-Account freigeschaltet."
|
1201 |
-
|
1202 |
-
#: productvendor\views\dashboard\denied.php:9
|
1203 |
-
msgid "Your account is not vendor capable."
|
1204 |
-
msgstr "Ihr Benutzerprofil ist nicht als Verkäufer freigeschaltet."
|
1205 |
-
|
1206 |
-
#: productvendor\views\dashboard\denied.php:24
|
1207 |
-
#, php-format
|
1208 |
-
msgid "I have read and accepted the <a href=\"%s\">terms and conditions</a>"
|
1209 |
-
msgstr ""
|
1210 |
-
"Ich habe die <a href=\"%s\">Verkäufer-Bedingungen</a> gelesen und "
|
1211 |
-
"akzeptiert."
|
1212 |
-
|
1213 |
-
#: productvendor\views\dashboard\denied.php:30
|
1214 |
-
msgid "Submit"
|
1215 |
-
msgstr "Absenden"
|
1216 |
-
|
1217 |
-
#: productvendor\views\dashboard\links.php:1
|
1218 |
-
msgid "Control Center"
|
1219 |
-
msgstr "Kontrollzentrum"
|
1220 |
-
|
1221 |
-
#: productvendor\views\dashboard\links.php:3
|
1222 |
-
msgid "My shop"
|
1223 |
-
msgstr "Mein Shop"
|
1224 |
-
|
1225 |
-
#: productvendor\views\dashboard\links.php:7
|
1226 |
-
msgid "My settings"
|
1227 |
-
msgstr "Meine Einstellungen"
|
1228 |
-
|
1229 |
-
#: productvendor\views\dashboard\links.php:13
|
1230 |
-
msgid "Submit a product"
|
1231 |
-
msgstr "Produkt hinzufügen"
|
1232 |
-
|
1233 |
-
#: productvendor\views\dashboard\reports.php:1
|
1234 |
-
msgid "Sales Report"
|
1235 |
-
msgstr "Verkaufs-Bericht"
|
1236 |
-
|
1237 |
-
#: productvendor\views\dashboard\reports.php:17
|
1238 |
-
msgid "Rate"
|
1239 |
-
msgstr "Quote"
|
1240 |
-
|
1241 |
-
#: productvendor\views\dashboard\reports.php:37
|
1242 |
-
msgid "Show Orders"
|
1243 |
-
msgstr "Zeige Bestellungen"
|
1244 |
-
|
1245 |
-
#: productvendor\views\dashboard\reports.php:45
|
1246 |
-
msgid "Totals"
|
1247 |
-
msgstr "Gesamt"
|
1248 |
-
|
1249 |
-
#: productvendor\views\dashboard\reports.php:58
|
1250 |
-
msgid "You have no sales during this period."
|
1251 |
-
msgstr "Sie haben keine Verkäufe innerhalb dieses Zeitraums."
|
1252 |
-
|
1253 |
-
#: productvendor\views\dashboard\reports.php:66
|
1254 |
-
msgid "You have no products."
|
1255 |
-
msgstr "Sie haben keine Produkte."
|
1256 |
-
|
1257 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:2
|
1258 |
-
msgid "PayPal Address"
|
1259 |
-
msgstr "PayPal-Adresse"
|
1260 |
-
|
1261 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:3
|
1262 |
-
msgid "Your PayPal address is used to send you your commission."
|
1263 |
-
msgstr ""
|
1264 |
-
"Diese Paypal-eMail-Adresse wird verwendet, um angefallenen Provisionen "
|
1265 |
-
"auszuzahlen."
|
1266 |
-
|
1267 |
-
#: productvendor\views\dashboard\settings\seller-info.php:3
|
1268 |
-
msgid "This is displayed on each of your products."
|
1269 |
-
msgstr ""
|
1270 |
-
"Dies wird bei jedem Ihrer Produkte auf der Produktseite bei der "
|
1271 |
-
"Produktbeschreibung in einem extra Tab angezeigt."
|
1272 |
-
|
1273 |
-
#: productvendor\views\dashboard\settings\shop-description.php:2
|
1274 |
-
msgid "Shop Description"
|
1275 |
-
msgstr "Shop-Beschreibung"
|
1276 |
-
|
1277 |
-
#: productvendor\views\dashboard\settings\shop-description.php:3
|
1278 |
-
#, php-format
|
1279 |
-
msgid "This is displayed on your <a href=\"%s\">shop page</a>."
|
1280 |
-
msgstr "Dies wird auf Ihrer <a href=\"%s\">Shop-Seite</a> angezeigt."
|
1281 |
-
|
1282 |
-
#: productvendor\views\emails\application-status.php:5
|
1283 |
-
#, php-format
|
1284 |
-
msgid "Hi there. This is a notification about a vendor application on %s."
|
1285 |
-
msgstr ""
|
1286 |
-
"Hallo. Dies ist eine Benachrichtigung über eine vorliegende, neue "
|
1287 |
-
"Bewerbung als Verkäufer auf %s."
|
1288 |
-
|
1289 |
-
#: productvendor\views\emails\application-status.php:8
|
1290 |
-
#, php-format
|
1291 |
-
msgid "Application status: %s"
|
1292 |
-
msgstr "Bewerbung-Status: %s"
|
1293 |
-
|
1294 |
-
#: productvendor\views\emails\application-status.php:9
|
1295 |
-
#, php-format
|
1296 |
-
msgid "Applicant username: %s"
|
1297 |
-
msgstr "Username des Bewerbers: %s"
|
1298 |
-
|
1299 |
-
#: productvendor\views\orders\csv-export.php:6
|
1300 |
-
msgid "Export orders"
|
1301 |
-
msgstr "Bestellungen exportieren"
|
1302 |
-
|
1303 |
-
#: productvendor\views\orders\orders.php:135
|
1304 |
-
#: productvendor\views\orders\table-body-simple.php:39
|
1305 |
-
#, php-format
|
1306 |
-
msgid "Total quantity: %d"
|
1307 |
-
msgstr "Menge gesamt: %d"
|
1308 |
-
|
1309 |
-
#: productvendor\views\orders\orders.php:159
|
1310 |
-
msgid "Comments"
|
1311 |
-
msgstr "Kommentare"
|
1312 |
-
|
1313 |
-
#: productvendor\views\orders\orders.php:188
|
1314 |
-
msgid "Shipping - Tracking #"
|
1315 |
-
msgstr "Versand - Sendungsverfolgung #"
|
1316 |
-
|
1317 |
-
#: productvendor\views\orders\orders.php:200
|
1318 |
-
msgid "Shipping - Mark Shipped"
|
1319 |
-
msgstr "Versand - kennzeichne als versandt"
|
1320 |
-
|
1321 |
-
#: productvendor\views\orders\orders.php:207
|
1322 |
-
msgid "Enter your tracking number first before marking the order as shipped."
|
1323 |
-
msgstr ""
|
1324 |
-
"Erst die Sendungsnummer eingeben, bevor die Bestellung als versandt "
|
1325 |
-
"gekennzeichnet wird."
|
1326 |
-
|
1327 |
-
#: productvendor\views\orders\table-body-simple.php:21
|
1328 |
-
#: productvendor\views\orders\table-body-variable.php:24
|
1329 |
-
#, php-format
|
1330 |
-
msgid "Quantity: %d"
|
1331 |
-
msgstr "Menge: %d"
|
1332 |
-
|
1333 |
-
#: productvendor\views\orders\comments\add-new-comment.php:10
|
1334 |
-
msgid "Add comment"
|
1335 |
-
msgstr "Kommentar hinzufügen"
|
1336 |
-
|
1337 |
-
#: productvendor\views\orders\comments\existing-comments.php:9
|
1338 |
-
#, php-format
|
1339 |
-
msgid "added %s ago"
|
1340 |
-
msgstr "hinzugefügt vor %s"
|
1341 |
-
|
1342 |
-
#: productvendor\views\orders\customer-note\customer-note.php:4
|
1343 |
-
msgid "Customer note"
|
1344 |
-
msgstr "Kundenmitteilung"
|
1345 |
-
|
1346 |
-
#: productvendor\views\orders\customer-note\customer-note.php:8
|
1347 |
-
msgid "No customer note."
|
1348 |
-
msgstr "Keine Kundenmitteilung."
|
1349 |
-
|
1350 |
-
#: productvendor\views\orders\shipping\shipping-form.php:8
|
1351 |
-
msgid "Mark order as shipped"
|
1352 |
-
msgstr "Bestellung als versendet kennzeichnen."
|
1353 |
-
|
1354 |
-
#: productvendor\views\orders\shipping\tracking-form.php:6
|
1355 |
-
msgid "Provider:"
|
1356 |
-
msgstr "Versandunternehmen:"
|
1357 |
-
|
1358 |
-
#: productvendor\views\orders\shipping\tracking-form.php:8
|
1359 |
-
msgid "Custom Provider"
|
1360 |
-
msgstr "Benutzerdefiniertes Versandunternehmen"
|
1361 |
-
|
1362 |
-
#: productvendor\views\orders\shipping\tracking-form.php:30
|
1363 |
-
msgid "Provider Name:"
|
1364 |
-
msgstr "Name des Versendunternehmens:"
|
1365 |
-
|
1366 |
-
#: productvendor\views\orders\shipping\tracking-form.php:38
|
1367 |
-
msgid "Tracking number:"
|
1368 |
-
msgstr "Sendungsverfolgungs-Nr.:"
|
1369 |
-
|
1370 |
-
#: productvendor\views\orders\shipping\tracking-form.php:46
|
1371 |
-
msgid "Tracking link:"
|
1372 |
-
msgstr "Link zur Sendungsverfolgung:"
|
1373 |
-
|
1374 |
-
#: productvendor\views\orders\shipping\tracking-form.php:54
|
1375 |
-
msgid "Date shipped:"
|
1376 |
-
msgstr "Versanddatum:"
|
1377 |
-
|
1378 |
-
#: productvendor\views\orders\shipping\tracking-form.php:62
|
1379 |
-
msgid "Preview:"
|
1380 |
-
msgstr "Vorschau:"
|
1381 |
-
|
1382 |
-
#: productvendor\views\orders\shipping\tracking-form.php:62
|
1383 |
-
msgid "Click here to track your shipment"
|
1384 |
-
msgstr "Hier klicken, um Ihre Sendung zu verfolgen"
|
1385 |
-
|
1386 |
-
#: productvendor\views\orders\shipping\tracking-form.php:70
|
1387 |
-
msgid "Update tracking number"
|
1388 |
-
msgstr "Sendungs-Nr. aktualisieren"
|
1389 |
-
|
1390 |
-
#~ msgid "Error: WooCommerce v2.0 or greater is required to use this plugin."
|
1391 |
-
#~ msgstr ""
|
1392 |
-
#~ "Fehler: WooCommerce v2.0 oder höher ist erforderlich um dieses "
|
1393 |
-
#~ "Plugin nutzen zu können."
|
1394 |
-
|
1395 |
-
#~ msgid "E-mail"
|
1396 |
-
#~ msgstr "E-Mail"
|
1397 |
-
|
1398 |
-
#~ msgid "View: Order details"
|
1399 |
-
#~ msgstr "Ansehen: Bestell-Details"
|
1400 |
-
|
1401 |
-
#~ msgid ""
|
1402 |
-
#~ "Thank you for your order, please click the button below to pay with %s."
|
1403 |
-
#~ msgstr ""
|
1404 |
-
#~ "Vielen Dank für Ihre Bestellung. Bitte klicken Sie auf den "
|
1405 |
-
#~ "nachfolgenden Button, um mit %s zu zahlen."
|
1406 |
-
|
1407 |
-
#~ msgid "Pay via PayPal"
|
1408 |
-
#~ msgstr "Zahlung via Paypal"
|
1409 |
-
|
1410 |
-
#~ msgid "Cancel order & restore cart"
|
1411 |
-
#~ msgstr "Bestellung abbrechen & Warenkorb wiederherstellen"
|
1412 |
-
|
1413 |
-
#~ msgid ""
|
1414 |
-
#~ "Thank you for your order. We are now redirecting you to PayPal to make "
|
1415 |
-
#~ "payment."
|
1416 |
-
#~ msgstr ""
|
1417 |
-
#~ "Vielen Dank für Ihre Bestellung. Wir leiten Sie nun direkt zu "
|
1418 |
-
#~ "PayPayl weiter, damit Sie die Zahlung abschließen können."
|
1419 |
-
|
1420 |
-
#~ msgid "Shop Description (HTML enabled)"
|
1421 |
-
#~ msgstr "Shop-Beschreibung (HTML aktiviert)"
|
1422 |
-
|
1423 |
-
#~ msgid "Shop page"
|
1424 |
-
#~ msgstr "Shop-Seite"
|
1425 |
-
|
1426 |
-
#~ msgid "Sales"
|
1427 |
-
#~ msgstr "Verkäufe"
|
1428 |
-
|
1429 |
-
#~ msgid "Due commission"
|
1430 |
-
#~ msgstr "Ausstehende Provision"
|
1431 |
-
|
1432 |
-
#~ msgid "Title"
|
1433 |
-
#~ msgstr "Titel"
|
1434 |
-
|
1435 |
-
#~ msgid "Due"
|
1436 |
-
#~ msgstr "Ausstehend"
|
1437 |
-
|
1438 |
-
#~ msgid "My Products"
|
1439 |
-
#~ msgstr "Meine Produkte"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WCVendors/languages/wc_vendors-en_US.mo
DELETED
Binary file
|
WCVendors/languages/wc_vendors-en_US.po
DELETED
@@ -1,1199 +0,0 @@
|
|
1 |
-
# WooCommerce translation strings
|
2 |
-
# Copyright (C) 2011-2012
|
3 |
-
# This file is distributed under the same license as the WooCommerce package.
|
4 |
-
# Last Updated: February 24, 2013.
|
5 |
-
msgid ""
|
6 |
-
msgstr ""
|
7 |
-
"Project-Id-Version: Product Vendor v1.0\n"
|
8 |
-
"Report-Msgid-Bugs-To: Matt Gates <info@mgates.me\n"
|
9 |
-
"POT-Creation-Date: 2013-04-05 10:53-0400\n"
|
10 |
-
"PO-Revision-Date: 2013-04-18 11:48-0500\n"
|
11 |
-
"Last-Translator: Matt Gates <info@mgates.me>\n"
|
12 |
-
"Language-Team: \n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
|
17 |
-
#: class-product-vendor.php:57
|
18 |
-
#: productvendor\classes\admin\class-admin-users.php:270
|
19 |
-
msgid "Product Vendor"
|
20 |
-
msgstr ""
|
21 |
-
|
22 |
-
#: class-product-vendor.php:81
|
23 |
-
msgid "<b>Product Vendor is disabled</b>. Product Vendor requires WooCommerce v2.0.1."
|
24 |
-
msgstr ""
|
25 |
-
|
26 |
-
#: productvendor\classes\class-cron.php:86
|
27 |
-
#, php-format
|
28 |
-
msgid "Payment total: %s"
|
29 |
-
msgstr ""
|
30 |
-
|
31 |
-
#: productvendor\classes\class-cron.php:143
|
32 |
-
msgid "Once Weekly"
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: productvendor\classes\class-cron.php:148
|
36 |
-
msgid "Once every two weeks"
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
#: productvendor\classes\class-cron.php:153
|
40 |
-
msgid "Once a month"
|
41 |
-
msgstr ""
|
42 |
-
|
43 |
-
#: productvendor\classes\class-install.php:94
|
44 |
-
#: productvendor\classes\class-install.php:245
|
45 |
-
msgid "Pending Vendor"
|
46 |
-
msgstr ""
|
47 |
-
|
48 |
-
#: productvendor\classes\class-install.php:196
|
49 |
-
msgid "Vendor Dashboard"
|
50 |
-
msgstr ""
|
51 |
-
|
52 |
-
#: productvendor\classes\class-install.php:197
|
53 |
-
#: productvendor\classes\admin\settings\sf-options.php:122
|
54 |
-
msgid "Orders"
|
55 |
-
msgstr ""
|
56 |
-
|
57 |
-
#: productvendor\classes\class-install.php:198
|
58 |
-
msgid "Shop Settings"
|
59 |
-
msgstr ""
|
60 |
-
|
61 |
-
#: productvendor\classes\admin\class-admin-page.php:14
|
62 |
-
#: productvendor\classes\admin\class-admin-page.php:35
|
63 |
-
#: productvendor\classes\admin\class-admin-reports.php:299
|
64 |
-
#: productvendor\classes\admin\class-product-meta.php:139
|
65 |
-
#: productvendor\classes\admin\class-product-meta.php:155
|
66 |
-
#: productvendor\views\dashboard\reports.php:19
|
67 |
-
msgid "Commission"
|
68 |
-
msgstr ""
|
69 |
-
|
70 |
-
#: productvendor\classes\admin\class-admin-page.php:142
|
71 |
-
#: productvendor\classes\admin\class-admin-reports.php:164
|
72 |
-
#: productvendor\views\dashboard\reports.php:17
|
73 |
-
msgid "Product"
|
74 |
-
msgstr ""
|
75 |
-
|
76 |
-
#: productvendor\classes\admin\class-admin-page.php:143
|
77 |
-
msgid "Order ID"
|
78 |
-
msgstr ""
|
79 |
-
|
80 |
-
#: productvendor\classes\admin\class-admin-page.php:144
|
81 |
-
#: productvendor\classes\admin\class-admin-reports.php:165
|
82 |
-
#: productvendor\classes\admin\class-product-meta.php:38
|
83 |
-
msgid "Vendor"
|
84 |
-
msgstr ""
|
85 |
-
|
86 |
-
#: productvendor\classes\admin\class-admin-page.php:145
|
87 |
-
#: productvendor\classes\admin\class-admin-reports.php:166
|
88 |
-
#: productvendor\classes\admin\class-admin-reports.php:304
|
89 |
-
#: productvendor\classes\admin\class-admin-reports.php:329
|
90 |
-
msgid "Total"
|
91 |
-
msgstr ""
|
92 |
-
|
93 |
-
#: productvendor\classes\admin\class-admin-page.php:146
|
94 |
-
#: productvendor\classes\admin\class-admin-reports.php:168
|
95 |
-
msgid "Status"
|
96 |
-
msgstr ""
|
97 |
-
|
98 |
-
#: productvendor\classes\admin\class-admin-page.php:147
|
99 |
-
#: productvendor\classes\front\orders\class-orders.php:168
|
100 |
-
msgid "Date"
|
101 |
-
msgstr ""
|
102 |
-
|
103 |
-
#: productvendor\classes\admin\class-admin-page.php:182
|
104 |
-
msgid "Mark paid"
|
105 |
-
msgstr ""
|
106 |
-
|
107 |
-
#: productvendor\classes\admin\class-admin-page.php:183
|
108 |
-
msgid "Mark due"
|
109 |
-
msgstr ""
|
110 |
-
|
111 |
-
#: productvendor\classes\admin\class-admin-page.php:184
|
112 |
-
msgid "Mark reversed"
|
113 |
-
msgstr ""
|
114 |
-
|
115 |
-
#: productvendor\classes\admin\class-admin-page.php:208
|
116 |
-
msgid "Commission marked paid."
|
117 |
-
msgstr ""
|
118 |
-
|
119 |
-
#: productvendor\classes\admin\class-admin-page.php:215
|
120 |
-
msgid "Commission marked due."
|
121 |
-
msgstr ""
|
122 |
-
|
123 |
-
#: productvendor\classes\admin\class-admin-page.php:222
|
124 |
-
msgid "Commission marked reversed."
|
125 |
-
msgstr ""
|
126 |
-
|
127 |
-
#: productvendor\classes\admin\class-admin-reports.php:39
|
128 |
-
msgid "Product Vendors"
|
129 |
-
msgstr ""
|
130 |
-
|
131 |
-
#: productvendor\classes\admin\class-admin-reports.php:42
|
132 |
-
msgid "Overview"
|
133 |
-
msgstr ""
|
134 |
-
|
135 |
-
#: productvendor\classes\admin\class-admin-reports.php:48
|
136 |
-
msgid "Commission by vendor"
|
137 |
-
msgstr ""
|
138 |
-
|
139 |
-
#: productvendor\classes\admin\class-admin-reports.php:115
|
140 |
-
#: productvendor\views\dashboard\date-picker.php:3
|
141 |
-
msgid "From:"
|
142 |
-
msgstr ""
|
143 |
-
|
144 |
-
#: productvendor\classes\admin\class-admin-reports.php:115
|
145 |
-
#: productvendor\views\dashboard\date-picker.php:6
|
146 |
-
msgid "To:"
|
147 |
-
msgstr ""
|
148 |
-
|
149 |
-
#: productvendor\classes\admin\class-admin-reports.php:115
|
150 |
-
#: productvendor\classes\admin\class-admin-reports.php:230
|
151 |
-
#: productvendor\views\dashboard\date-picker.php:9
|
152 |
-
msgid "Show"
|
153 |
-
msgstr ""
|
154 |
-
|
155 |
-
#: productvendor\classes\admin\class-admin-reports.php:126
|
156 |
-
msgid "Total paid in range"
|
157 |
-
msgstr ""
|
158 |
-
|
159 |
-
#: productvendor\classes\admin\class-admin-reports.php:128
|
160 |
-
#: productvendor\classes\admin\class-admin-reports.php:134
|
161 |
-
#: productvendor\classes\admin\class-admin-reports.php:140
|
162 |
-
#: productvendor\classes\front\orders\class-export-csv.php:50
|
163 |
-
#: productvendor\views\orders\table-body-simple.php:13
|
164 |
-
msgid "n/a"
|
165 |
-
msgstr ""
|
166 |
-
|
167 |
-
#: productvendor\classes\admin\class-admin-reports.php:132
|
168 |
-
msgid "Total due in range"
|
169 |
-
msgstr ""
|
170 |
-
|
171 |
-
#: productvendor\classes\admin\class-admin-reports.php:138
|
172 |
-
msgid "Total reversed in range"
|
173 |
-
msgstr ""
|
174 |
-
|
175 |
-
#: productvendor\classes\admin\class-admin-reports.php:147
|
176 |
-
msgid "Recent Commission"
|
177 |
-
msgstr ""
|
178 |
-
|
179 |
-
#: productvendor\classes\admin\class-admin-reports.php:163
|
180 |
-
#: productvendor\classes\front\orders\class-orders.php:161
|
181 |
-
msgid "Order"
|
182 |
-
msgstr ""
|
183 |
-
|
184 |
-
#: productvendor\classes\admin\class-admin-reports.php:167
|
185 |
-
msgid "Date & Time"
|
186 |
-
msgstr ""
|
187 |
-
|
188 |
-
#: productvendor\classes\admin\class-admin-reports.php:174
|
189 |
-
msgid "N/A"
|
190 |
-
msgstr ""
|
191 |
-
|
192 |
-
#: productvendor\classes\admin\class-admin-reports.php:178
|
193 |
-
msgid "D j M Y \\a\\t h:ia"
|
194 |
-
msgstr ""
|
195 |
-
|
196 |
-
#: productvendor\classes\admin\class-admin-reports.php:187
|
197 |
-
msgid "No commission yet"
|
198 |
-
msgstr ""
|
199 |
-
|
200 |
-
#: productvendor\classes\admin\class-admin-reports.php:217
|
201 |
-
msgid "Show:"
|
202 |
-
msgstr ""
|
203 |
-
|
204 |
-
#: productvendor\classes\admin\class-admin-reports.php:298
|
205 |
-
msgid "Month"
|
206 |
-
msgstr ""
|
207 |
-
|
208 |
-
#: productvendor\classes\admin\class-admin-reports.php:300
|
209 |
-
msgid "Tax"
|
210 |
-
msgstr ""
|
211 |
-
|
212 |
-
#: productvendor\classes\admin\class-admin-reports.php:301
|
213 |
-
msgid "Shipping"
|
214 |
-
msgstr ""
|
215 |
-
|
216 |
-
#: productvendor\classes\admin\class-admin-reports.php:302
|
217 |
-
msgid "Reversed"
|
218 |
-
msgstr ""
|
219 |
-
|
220 |
-
#: productvendor\classes\admin\class-admin-reports.php:303
|
221 |
-
msgid "Paid"
|
222 |
-
msgstr ""
|
223 |
-
|
224 |
-
#: productvendor\classes\admin\class-admin-users.php:278
|
225 |
-
msgid "Enable HTML for the shop description"
|
226 |
-
msgstr ""
|
227 |
-
|
228 |
-
#: productvendor\classes\admin\class-admin-users.php:283
|
229 |
-
msgid "Shop name"
|
230 |
-
msgstr ""
|
231 |
-
|
232 |
-
#: productvendor\classes\admin\class-admin-users.php:287
|
233 |
-
msgid "PayPal E-mail"
|
234 |
-
msgstr ""
|
235 |
-
|
236 |
-
#: productvendor\classes\admin\class-admin-users.php:287
|
237 |
-
msgid "required"
|
238 |
-
msgstr ""
|
239 |
-
|
240 |
-
#: productvendor\classes\admin\class-admin-users.php:291
|
241 |
-
msgid "Commission due"
|
242 |
-
msgstr ""
|
243 |
-
|
244 |
-
#: productvendor\classes\admin\class-admin-users.php:308
|
245 |
-
msgid "Commission Due"
|
246 |
-
msgstr ""
|
247 |
-
|
248 |
-
#: productvendor\classes\admin\class-product-meta.php:162
|
249 |
-
msgid "Leave blank for default"
|
250 |
-
msgstr ""
|
251 |
-
|
252 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:25
|
253 |
-
msgid "Approve"
|
254 |
-
msgstr ""
|
255 |
-
|
256 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:26
|
257 |
-
msgid "Deny"
|
258 |
-
msgstr ""
|
259 |
-
|
260 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:70
|
261 |
-
msgid "Vendor has been <b>denied</b>."
|
262 |
-
msgstr ""
|
263 |
-
|
264 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:81
|
265 |
-
msgid "Vendor has been <b>approved</b>."
|
266 |
-
msgstr ""
|
267 |
-
|
268 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:94
|
269 |
-
msgid "Pending Vendors"
|
270 |
-
msgstr ""
|
271 |
-
|
272 |
-
#: productvendor\classes\admin\emails\class-emails.php:71
|
273 |
-
#: productvendor\classes\front\class-vendor-cart.php:39
|
274 |
-
#: productvendor\classes\front\class-vendor-cart.php:55
|
275 |
-
msgid "Sold by"
|
276 |
-
msgstr ""
|
277 |
-
|
278 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:27
|
279 |
-
msgid "Vendor Application"
|
280 |
-
msgstr ""
|
281 |
-
|
282 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:28
|
283 |
-
msgid "Vendor application will either be approved, denied, or pending."
|
284 |
-
msgstr ""
|
285 |
-
|
286 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:30
|
287 |
-
msgid "Application {status}"
|
288 |
-
msgstr ""
|
289 |
-
|
290 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:31
|
291 |
-
msgid "[{blogname}] Your vendor application has been {status}"
|
292 |
-
msgstr ""
|
293 |
-
|
294 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:115
|
295 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:224
|
296 |
-
msgid "Enable/Disable"
|
297 |
-
msgstr ""
|
298 |
-
|
299 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:117
|
300 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:226
|
301 |
-
msgid "Enable this email notification"
|
302 |
-
msgstr ""
|
303 |
-
|
304 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:121
|
305 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:230
|
306 |
-
msgid "Subject"
|
307 |
-
msgstr ""
|
308 |
-
|
309 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:123
|
310 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:232
|
311 |
-
#, php-format
|
312 |
-
msgid "This controls the email subject line. Leave blank to use the default subject: <code>%s</code>."
|
313 |
-
msgstr ""
|
314 |
-
|
315 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:128
|
316 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:237
|
317 |
-
msgid "Email Heading"
|
318 |
-
msgstr ""
|
319 |
-
|
320 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:130
|
321 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:239
|
322 |
-
#, php-format
|
323 |
-
msgid "This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>."
|
324 |
-
msgstr ""
|
325 |
-
|
326 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:135
|
327 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:244
|
328 |
-
msgid "Email type"
|
329 |
-
msgstr ""
|
330 |
-
|
331 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:137
|
332 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:246
|
333 |
-
msgid "Choose which format of email to send."
|
334 |
-
msgstr ""
|
335 |
-
|
336 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:141
|
337 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:250
|
338 |
-
msgid "Plain text"
|
339 |
-
msgstr ""
|
340 |
-
|
341 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:142
|
342 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:251
|
343 |
-
msgid "HTML"
|
344 |
-
msgstr ""
|
345 |
-
|
346 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:143
|
347 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:252
|
348 |
-
msgid "Multipart"
|
349 |
-
msgstr ""
|
350 |
-
|
351 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:27
|
352 |
-
msgid "Notify vendors"
|
353 |
-
msgstr ""
|
354 |
-
|
355 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:28
|
356 |
-
msgid "New order emails are sent when an order is received/paid by a customer."
|
357 |
-
msgstr ""
|
358 |
-
|
359 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:30
|
360 |
-
msgid "New customer order"
|
361 |
-
msgstr ""
|
362 |
-
|
363 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:31
|
364 |
-
msgid "[{blogname}] New customer order ({order_number}) - {order_date}"
|
365 |
-
msgstr ""
|
366 |
-
|
367 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:102
|
368 |
-
msgid "Commission Subtotal:"
|
369 |
-
msgstr ""
|
370 |
-
|
371 |
-
#: productvendor\classes\admin\settings\sf-options.php:4
|
372 |
-
msgid "General"
|
373 |
-
msgstr ""
|
374 |
-
|
375 |
-
#: productvendor\classes\admin\settings\sf-options.php:5
|
376 |
-
msgid "General options"
|
377 |
-
msgstr ""
|
378 |
-
|
379 |
-
#: productvendor\classes\admin\settings\sf-options.php:8
|
380 |
-
msgid "Default commission (%)"
|
381 |
-
msgstr ""
|
382 |
-
|
383 |
-
#: productvendor\classes\admin\settings\sf-options.php:9
|
384 |
-
msgid "Choose the default rate for each product. If a product has a commission rate already set, this value will be ignored for that product."
|
385 |
-
msgstr ""
|
386 |
-
|
387 |
-
#: productvendor\classes\admin\settings\sf-options.php:20
|
388 |
-
msgid "Registration"
|
389 |
-
msgstr ""
|
390 |
-
|
391 |
-
#: productvendor\classes\admin\settings\sf-options.php:21
|
392 |
-
msgid "Allow users or guests to apply to become a vendor"
|
393 |
-
msgstr ""
|
394 |
-
|
395 |
-
#: productvendor\classes\admin\settings\sf-options.php:22
|
396 |
-
msgid "This will show a checkbox on the My Account page's registration form asking if the user would like to apply to be a vendor. Also, on the Vendor Dashboard, users can apply to become a vendor."
|
397 |
-
msgstr ""
|
398 |
-
|
399 |
-
#: productvendor\classes\admin\settings\sf-options.php:29
|
400 |
-
msgid "Taxes"
|
401 |
-
msgstr ""
|
402 |
-
|
403 |
-
#: productvendor\classes\admin\settings\sf-options.php:30
|
404 |
-
msgid "Give vendors any tax collected per-product"
|
405 |
-
msgstr ""
|
406 |
-
|
407 |
-
#: productvendor\classes\admin\settings\sf-options.php:31
|
408 |
-
msgid "The tax collected on a vendor's product will be given to him in its entirety"
|
409 |
-
msgstr ""
|
410 |
-
|
411 |
-
#: productvendor\classes\admin\settings\sf-options.php:37
|
412 |
-
msgid "Shop options"
|
413 |
-
msgstr ""
|
414 |
-
|
415 |
-
#: productvendor\classes\admin\settings\sf-options.php:40
|
416 |
-
msgid "Shop HTML"
|
417 |
-
msgstr ""
|
418 |
-
|
419 |
-
#: productvendor\classes\admin\settings\sf-options.php:41
|
420 |
-
msgid "Enable HTML for a vendor's shop description by default"
|
421 |
-
msgstr ""
|
422 |
-
|
423 |
-
#: productvendor\classes\admin\settings\sf-options.php:48
|
424 |
-
msgid "Vendor shop page"
|
425 |
-
msgstr ""
|
426 |
-
|
427 |
-
#: productvendor\classes\admin\settings\sf-options.php:49
|
428 |
-
msgid "Eg: <code>yoursite.com/[your_setting_here]/[vendor_name_here]</code>"
|
429 |
-
msgstr ""
|
430 |
-
|
431 |
-
#: productvendor\classes\admin\settings\sf-options.php:55
|
432 |
-
#: productvendor\classes\admin\settings\sf-options.php:180
|
433 |
-
msgid "Products"
|
434 |
-
msgstr ""
|
435 |
-
|
436 |
-
#: productvendor\classes\admin\settings\sf-options.php:56
|
437 |
-
msgid "Product Add Page"
|
438 |
-
msgstr ""
|
439 |
-
|
440 |
-
#: productvendor\classes\admin\settings\sf-options.php:56
|
441 |
-
msgid "Configure what to hide from all vendors when adding a product"
|
442 |
-
msgstr ""
|
443 |
-
|
444 |
-
#: productvendor\classes\admin\settings\sf-options.php:59
|
445 |
-
msgid "Left side panel"
|
446 |
-
msgstr ""
|
447 |
-
|
448 |
-
#: productvendor\classes\admin\settings\sf-options.php:60
|
449 |
-
msgid "Hide these areas of the add product page for vendors"
|
450 |
-
msgstr ""
|
451 |
-
|
452 |
-
#: productvendor\classes\admin\settings\sf-options.php:74
|
453 |
-
msgid "Types"
|
454 |
-
msgstr ""
|
455 |
-
|
456 |
-
#: productvendor\classes\admin\settings\sf-options.php:75
|
457 |
-
msgid "Hide these product types from the vendor"
|
458 |
-
msgstr ""
|
459 |
-
|
460 |
-
#: productvendor\classes\admin\settings\sf-options.php:88
|
461 |
-
msgid "Type options"
|
462 |
-
msgstr ""
|
463 |
-
|
464 |
-
#: productvendor\classes\admin\settings\sf-options.php:89
|
465 |
-
msgid "Hide these product options from the vendor"
|
466 |
-
msgstr ""
|
467 |
-
|
468 |
-
#: productvendor\classes\admin\settings\sf-options.php:100
|
469 |
-
msgid "Miscellaneous"
|
470 |
-
msgstr ""
|
471 |
-
|
472 |
-
#: productvendor\classes\admin\settings\sf-options.php:111
|
473 |
-
msgid "Stylesheet"
|
474 |
-
msgstr ""
|
475 |
-
|
476 |
-
#: productvendor\classes\admin\settings\sf-options.php:112
|
477 |
-
msgid "You can add CSS in this textarea, which will be loaded on the product add/edit page for vendors."
|
478 |
-
msgstr ""
|
479 |
-
|
480 |
-
#: productvendor\classes\admin\settings\sf-options.php:118
|
481 |
-
msgid "Capabilities"
|
482 |
-
msgstr ""
|
483 |
-
|
484 |
-
#: productvendor\classes\admin\settings\sf-options.php:119
|
485 |
-
msgid "Permissions"
|
486 |
-
msgstr ""
|
487 |
-
|
488 |
-
#: productvendor\classes\admin\settings\sf-options.php:119
|
489 |
-
msgid "General permissions used around the shop"
|
490 |
-
msgstr ""
|
491 |
-
|
492 |
-
#: productvendor\classes\admin\settings\sf-options.php:123
|
493 |
-
msgid "View orders"
|
494 |
-
msgstr ""
|
495 |
-
|
496 |
-
#: productvendor\classes\admin\settings\sf-options.php:124
|
497 |
-
msgid "Show customer details such as email, address, name, etc, for each order"
|
498 |
-
msgstr ""
|
499 |
-
|
500 |
-
#: productvendor\classes\admin\settings\sf-options.php:131
|
501 |
-
msgid "View comments"
|
502 |
-
msgstr ""
|
503 |
-
|
504 |
-
#: productvendor\classes\admin\settings\sf-options.php:132
|
505 |
-
msgid "View all vendor comments for an order on the frontend"
|
506 |
-
msgstr ""
|
507 |
-
|
508 |
-
#: productvendor\classes\admin\settings\sf-options.php:139
|
509 |
-
msgid "Submit comments"
|
510 |
-
msgstr ""
|
511 |
-
|
512 |
-
#: productvendor\classes\admin\settings\sf-options.php:140
|
513 |
-
msgid "Submit comments for an order on the frontend. Eg, tracking ID for a product"
|
514 |
-
msgstr ""
|
515 |
-
|
516 |
-
#: productvendor\classes\admin\settings\sf-options.php:147
|
517 |
-
msgid "View email addresses"
|
518 |
-
msgstr ""
|
519 |
-
|
520 |
-
#: productvendor\classes\admin\settings\sf-options.php:148
|
521 |
-
msgid "While viewing order details on the frontend, you can disable or enable email addresses"
|
522 |
-
msgstr ""
|
523 |
-
|
524 |
-
#: productvendor\classes\admin\settings\sf-options.php:155
|
525 |
-
msgid "Export a CSV file of orders for a product"
|
526 |
-
msgstr ""
|
527 |
-
|
528 |
-
#: productvendor\classes\admin\settings\sf-options.php:156
|
529 |
-
msgid "Vendors could export orders for a product on the frontend"
|
530 |
-
msgstr ""
|
531 |
-
|
532 |
-
#: productvendor\classes\admin\settings\sf-options.php:163
|
533 |
-
msgid "Reports"
|
534 |
-
msgstr ""
|
535 |
-
|
536 |
-
#: productvendor\classes\admin\settings\sf-options.php:164
|
537 |
-
msgid "View backend sales reports"
|
538 |
-
msgstr ""
|
539 |
-
|
540 |
-
#: productvendor\classes\admin\settings\sf-options.php:165
|
541 |
-
msgid "Graphs and tables via the Reports page in backend. The reports will only display sales data that pretain to their products"
|
542 |
-
msgstr ""
|
543 |
-
|
544 |
-
#: productvendor\classes\admin\settings\sf-options.php:172
|
545 |
-
msgid "View Frontend sales reports"
|
546 |
-
msgstr ""
|
547 |
-
|
548 |
-
#: productvendor\classes\admin\settings\sf-options.php:173
|
549 |
-
msgid "Sales table on the frontend on the My Account page. The table will only display sales data that pretain to their products"
|
550 |
-
msgstr ""
|
551 |
-
|
552 |
-
#: productvendor\classes\admin\settings\sf-options.php:181
|
553 |
-
msgid "Submit products"
|
554 |
-
msgstr ""
|
555 |
-
|
556 |
-
#: productvendor\classes\admin\settings\sf-options.php:182
|
557 |
-
msgid "Vendors could submit a product through the backend, and an admin would approve or deny it"
|
558 |
-
msgstr ""
|
559 |
-
|
560 |
-
#: productvendor\classes\admin\settings\sf-options.php:189
|
561 |
-
msgid "Edit live products"
|
562 |
-
msgstr ""
|
563 |
-
|
564 |
-
#: productvendor\classes\admin\settings\sf-options.php:190
|
565 |
-
msgid "Vendors could edit an approved product after it has already gone live. There is no approval or review after editing a live product. This could be dangerous with malicious vendors, so take caution."
|
566 |
-
msgstr ""
|
567 |
-
|
568 |
-
#: productvendor\classes\admin\settings\sf-options.php:197
|
569 |
-
msgid "Submit products live without requiring approval"
|
570 |
-
msgstr ""
|
571 |
-
|
572 |
-
#: productvendor\classes\admin\settings\sf-options.php:198
|
573 |
-
msgid "Vendors can submit products without review or approval from a shop admin. This could be dangerous with malicious vendors, so take caution."
|
574 |
-
msgstr ""
|
575 |
-
|
576 |
-
#: productvendor\classes\admin\settings\sf-options.php:204
|
577 |
-
msgid "Pages"
|
578 |
-
msgstr ""
|
579 |
-
|
580 |
-
#: productvendor\classes\admin\settings\sf-options.php:205
|
581 |
-
msgid "Page configuration"
|
582 |
-
msgstr ""
|
583 |
-
|
584 |
-
#: productvendor\classes\admin\settings\sf-options.php:208
|
585 |
-
msgid "Vendor dashboard"
|
586 |
-
msgstr ""
|
587 |
-
|
588 |
-
#: productvendor\classes\admin\settings\sf-options.php:209
|
589 |
-
msgid "Choose the page that has the shortcode <code>[pv_vendor_dashboard]</code><br/>By default, My Account > Vendor Dashboard should have the shortcode."
|
590 |
-
msgstr ""
|
591 |
-
|
592 |
-
#: productvendor\classes\admin\settings\sf-options.php:216
|
593 |
-
msgid "Shop settings"
|
594 |
-
msgstr ""
|
595 |
-
|
596 |
-
#: productvendor\classes\admin\settings\sf-options.php:217
|
597 |
-
msgid "Choose the page that has the shortcode <code>[pv_shop_settings]</code><br/>These are the shop settings a vendor can configure."
|
598 |
-
msgstr ""
|
599 |
-
|
600 |
-
#: productvendor\classes\admin\settings\sf-options.php:224
|
601 |
-
msgid "Orders page"
|
602 |
-
msgstr ""
|
603 |
-
|
604 |
-
#: productvendor\classes\admin\settings\sf-options.php:225
|
605 |
-
msgid "Choose the page that has the shortcode <code>[pv_orders]</code><br/>By default, My Account > Orders should have the shortcode."
|
606 |
-
msgstr ""
|
607 |
-
|
608 |
-
#: productvendor\classes\admin\settings\sf-options.php:232
|
609 |
-
msgid "Vendor terms"
|
610 |
-
msgstr ""
|
611 |
-
|
612 |
-
#: productvendor\classes\admin\settings\sf-options.php:233
|
613 |
-
msgid "These terms are shown to a user when submitting an application to become a vendor.<br/>If left blank, no terms will be shown to the applicant."
|
614 |
-
msgstr ""
|
615 |
-
|
616 |
-
#: productvendor\classes\admin\settings\sf-options.php:251
|
617 |
-
msgid "Payments"
|
618 |
-
msgstr ""
|
619 |
-
|
620 |
-
#: productvendor\classes\admin\settings\sf-options.php:252
|
621 |
-
msgid "User payments"
|
622 |
-
msgstr ""
|
623 |
-
|
624 |
-
#: productvendor\classes\admin\settings\sf-options.php:253
|
625 |
-
#, php-format
|
626 |
-
msgid "Total commission currently due: %s. <a href=\"%s\">View details</a>."
|
627 |
-
msgstr ""
|
628 |
-
|
629 |
-
#: productvendor\classes\admin\settings\sf-options.php:254
|
630 |
-
#, php-format
|
631 |
-
msgid "Make sure you update your PayPal Adaptive Payments settings <a href=\"%s\">here</a>."
|
632 |
-
msgstr ""
|
633 |
-
|
634 |
-
#: productvendor\classes\admin\settings\sf-options.php:257
|
635 |
-
msgid "Instant pay"
|
636 |
-
msgstr ""
|
637 |
-
|
638 |
-
#: productvendor\classes\admin\settings\sf-options.php:258
|
639 |
-
msgid "Instantly pay vendors their commission when an order is made"
|
640 |
-
msgstr ""
|
641 |
-
|
642 |
-
#: productvendor\classes\admin\settings\sf-options.php:259
|
643 |
-
msgid "For this to work, customers must checkout with the PayPal Adaptive Payments gateway. Using other gateways will not pay vendors instantly"
|
644 |
-
msgstr ""
|
645 |
-
|
646 |
-
#: productvendor\classes\admin\settings\sf-options.php:266
|
647 |
-
msgid "Payment schedule"
|
648 |
-
msgstr ""
|
649 |
-
|
650 |
-
#: productvendor\classes\admin\settings\sf-options.php:267
|
651 |
-
msgid "Note: Schedule will only work if instant pay is unchecked"
|
652 |
-
msgstr ""
|
653 |
-
|
654 |
-
#: productvendor\classes\admin\settings\sf-options.php:272
|
655 |
-
msgid "Weekly"
|
656 |
-
msgstr ""
|
657 |
-
|
658 |
-
#: productvendor\classes\admin\settings\sf-options.php:273
|
659 |
-
msgid "Biweekly"
|
660 |
-
msgstr ""
|
661 |
-
|
662 |
-
#: productvendor\classes\admin\settings\sf-options.php:274
|
663 |
-
msgid "Monthly"
|
664 |
-
msgstr ""
|
665 |
-
|
666 |
-
#: productvendor\classes\admin\settings\sf-options.php:275
|
667 |
-
msgid "Manual"
|
668 |
-
msgstr ""
|
669 |
-
|
670 |
-
#: productvendor\classes\admin\settings\sf-options.php:276
|
671 |
-
msgid "Now"
|
672 |
-
msgstr ""
|
673 |
-
|
674 |
-
#: productvendor\classes\admin\settings\sf-options.php:281
|
675 |
-
msgid "Email notification"
|
676 |
-
msgstr ""
|
677 |
-
|
678 |
-
#: productvendor\classes\admin\settings\sf-options.php:282
|
679 |
-
msgid "Send the WooCommerce admin an email each time a payment has been made via the payment schedule options above"
|
680 |
-
msgstr ""
|
681 |
-
|
682 |
-
#: productvendor\classes\admin\settings\classes\sf-class-format-options.php:201
|
683 |
-
#: productvendor\classes\admin\settings\classes\sf-class-format-options.php:205
|
684 |
-
msgid "Select a page..."
|
685 |
-
msgstr ""
|
686 |
-
|
687 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:149
|
688 |
-
#: productvendor\views\dashboard\settings\settings.php:1
|
689 |
-
msgid "Settings"
|
690 |
-
msgstr ""
|
691 |
-
|
692 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:279
|
693 |
-
msgid "Could not load settings at: "
|
694 |
-
msgstr ""
|
695 |
-
|
696 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:279
|
697 |
-
msgid "Error - WP Settings Framework"
|
698 |
-
msgstr ""
|
699 |
-
|
700 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:344
|
701 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:73
|
702 |
-
msgid "Settings saved."
|
703 |
-
msgstr ""
|
704 |
-
|
705 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:457
|
706 |
-
#, php-format
|
707 |
-
msgid "Save %s changes"
|
708 |
-
msgstr ""
|
709 |
-
|
710 |
-
#: productvendor\classes\front\class-vendor-shop.php:45
|
711 |
-
#: productvendor\views\dashboard\settings\seller-info.php:2
|
712 |
-
msgid "Seller info"
|
713 |
-
msgstr ""
|
714 |
-
|
715 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:46
|
716 |
-
msgid "Your PayPal address is not a valid email address."
|
717 |
-
msgstr ""
|
718 |
-
|
719 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:55
|
720 |
-
msgid "That shop name is already taken. Your shop name must be unique."
|
721 |
-
msgstr ""
|
722 |
-
|
723 |
-
#: productvendor\classes\front\orders\class-export-csv.php:60
|
724 |
-
#: productvendor\views\dashboard\reports.php:18
|
725 |
-
msgid "Quantity"
|
726 |
-
msgstr ""
|
727 |
-
|
728 |
-
#: productvendor\classes\front\orders\class-orders.php:97
|
729 |
-
msgid "You haven't selected a product's orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you'd like to view."
|
730 |
-
msgstr ""
|
731 |
-
|
732 |
-
#: productvendor\classes\front\orders\class-orders.php:102
|
733 |
-
msgid "No orders."
|
734 |
-
msgstr ""
|
735 |
-
|
736 |
-
#: productvendor\classes\front\orders\class-orders.php:162
|
737 |
-
msgid "Full name"
|
738 |
-
msgstr ""
|
739 |
-
|
740 |
-
#: productvendor\classes\front\orders\class-orders.php:163
|
741 |
-
msgid "Address"
|
742 |
-
msgstr ""
|
743 |
-
|
744 |
-
#: productvendor\classes\front\orders\class-orders.php:164
|
745 |
-
msgid "City"
|
746 |
-
msgstr ""
|
747 |
-
|
748 |
-
#: productvendor\classes\front\orders\class-orders.php:165
|
749 |
-
msgid "State"
|
750 |
-
msgstr ""
|
751 |
-
|
752 |
-
#: productvendor\classes\front\orders\class-orders.php:166
|
753 |
-
msgid "Zip"
|
754 |
-
msgstr ""
|
755 |
-
|
756 |
-
#: productvendor\classes\front\orders\class-orders.php:167
|
757 |
-
msgid "Email address"
|
758 |
-
msgstr ""
|
759 |
-
|
760 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:40
|
761 |
-
#: productvendor\views\dashboard\denied.php:16
|
762 |
-
msgid "Apply to become a vendor?"
|
763 |
-
msgstr ""
|
764 |
-
|
765 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:46
|
766 |
-
#: productvendor\views\dashboard\denied.php:23
|
767 |
-
#, php-format
|
768 |
-
msgid "I have read and accepted the <a href=\"%s\">terms and conditions</a>"
|
769 |
-
msgstr ""
|
770 |
-
|
771 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:80
|
772 |
-
msgid "Application denied. You are an administrator."
|
773 |
-
msgstr ""
|
774 |
-
|
775 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:82
|
776 |
-
msgid "Your application has been submitted."
|
777 |
-
msgstr ""
|
778 |
-
|
779 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:105
|
780 |
-
msgid "You must accept the terms and conditions to become a vendor."
|
781 |
-
msgstr ""
|
782 |
-
|
783 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:39
|
784 |
-
msgid "PayPal Adaptive Payments"
|
785 |
-
msgstr ""
|
786 |
-
|
787 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:117
|
788 |
-
#, php-format
|
789 |
-
msgid "Something went wrong. Response from PayPal invalidated this order. Status: %s."
|
790 |
-
msgstr ""
|
791 |
-
|
792 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:122
|
793 |
-
msgid "IPN payment completed"
|
794 |
-
msgstr ""
|
795 |
-
|
796 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:144
|
797 |
-
msgid "Enable PayPal Adaptive Payments"
|
798 |
-
msgstr ""
|
799 |
-
|
800 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:150
|
801 |
-
msgid "Method Title"
|
802 |
-
msgstr ""
|
803 |
-
|
804 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:151
|
805 |
-
msgid "This controls the title which the user sees during checkout."
|
806 |
-
msgstr ""
|
807 |
-
|
808 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:152
|
809 |
-
msgid "PayPal"
|
810 |
-
msgstr ""
|
811 |
-
|
812 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:157
|
813 |
-
msgid "Description"
|
814 |
-
msgstr ""
|
815 |
-
|
816 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:158
|
817 |
-
msgid "This controls the description which the user sees during checkout."
|
818 |
-
msgstr ""
|
819 |
-
|
820 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:159
|
821 |
-
msgid "Pay via PayPal!"
|
822 |
-
msgstr ""
|
823 |
-
|
824 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:170
|
825 |
-
msgid "Live Credentials"
|
826 |
-
msgstr ""
|
827 |
-
|
828 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:172
|
829 |
-
#, php-format
|
830 |
-
msgid "You must have an <a href=\"%s\">Application ID</a> to process live transactions. You do not need one for testing in Sandbox mode."
|
831 |
-
msgstr ""
|
832 |
-
|
833 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:177
|
834 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:211
|
835 |
-
msgid "PayPal Email"
|
836 |
-
msgstr ""
|
837 |
-
|
838 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:178
|
839 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:212
|
840 |
-
msgid "The email address main payments should go to."
|
841 |
-
msgstr ""
|
842 |
-
|
843 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:183
|
844 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:217
|
845 |
-
msgid "API Username"
|
846 |
-
msgstr ""
|
847 |
-
|
848 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:188
|
849 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:222
|
850 |
-
msgid "API Password"
|
851 |
-
msgstr ""
|
852 |
-
|
853 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:193
|
854 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:227
|
855 |
-
msgid "API Signature"
|
856 |
-
msgstr ""
|
857 |
-
|
858 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:198
|
859 |
-
msgid "Application ID"
|
860 |
-
msgstr ""
|
861 |
-
|
862 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:200
|
863 |
-
msgid "Only required when doing live transactions."
|
864 |
-
msgstr ""
|
865 |
-
|
866 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:204
|
867 |
-
msgid "Sandbox Credentials"
|
868 |
-
msgstr ""
|
869 |
-
|
870 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:206
|
871 |
-
#, php-format
|
872 |
-
msgid "You can signup for a sandbox developer account <a href=\"%s\">here</a>. You need a developer account if you want to enable Sandbox mode for testing."
|
873 |
-
msgstr ""
|
874 |
-
|
875 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:238
|
876 |
-
msgid "Misc. Settings"
|
877 |
-
msgstr ""
|
878 |
-
|
879 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:243
|
880 |
-
msgid "Enable PayPal Sandbox mode"
|
881 |
-
msgstr ""
|
882 |
-
|
883 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:249
|
884 |
-
msgid "Enable logging"
|
885 |
-
msgstr ""
|
886 |
-
|
887 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:266
|
888 |
-
msgid "The PayPal Adaptive Payments gateway can instantly pay your vendors their due commission (if enabled). Also used to mass pay vendors on a schedule / manual method (if enabled)."
|
889 |
-
msgstr ""
|
890 |
-
|
891 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:267
|
892 |
-
#, php-format
|
893 |
-
msgid "<b>Important:</b> Unless you're using the <a href=\"%s\">beta version of TRS2</a>, all shipping costs will be given to the shop admin. Vendors will not receive shipping costs."
|
894 |
-
msgstr ""
|
895 |
-
|
896 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:277
|
897 |
-
msgid "Gateway Disabled"
|
898 |
-
msgstr ""
|
899 |
-
|
900 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:277
|
901 |
-
#, php-format
|
902 |
-
msgid "%s does not support your store currency."
|
903 |
-
msgstr ""
|
904 |
-
|
905 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:363
|
906 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:478
|
907 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:147
|
908 |
-
#, php-format
|
909 |
-
msgid "Error: %s"
|
910 |
-
msgstr ""
|
911 |
-
|
912 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:371
|
913 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:372
|
914 |
-
#, php-format
|
915 |
-
msgid "Error ID: %s. %s"
|
916 |
-
msgstr ""
|
917 |
-
|
918 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:113
|
919 |
-
msgid "No vendors found to pay. Maybe they haven't set a PayPal address?"
|
920 |
-
msgstr ""
|
921 |
-
|
922 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:160
|
923 |
-
msgid "All due commission has been paid for."
|
924 |
-
msgstr ""
|
925 |
-
|
926 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:166
|
927 |
-
msgid "All due commission has been paid for, but I could not clear it from their profiles due to an internal error. Commission will still be listed as due. Please manually mark the commission as paid from the Commissions page."
|
928 |
-
msgstr ""
|
929 |
-
|
930 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:200
|
931 |
-
msgid "WooCommerce: Mass payments for vendors update"
|
932 |
-
msgstr ""
|
933 |
-
|
934 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:202
|
935 |
-
msgid "Hello! A payment was just triggered to mass pay all vendors their due commission."
|
936 |
-
msgstr ""
|
937 |
-
|
938 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:203
|
939 |
-
#, php-format
|
940 |
-
msgid "Payment status: %s."
|
941 |
-
msgstr ""
|
942 |
-
|
943 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:204
|
944 |
-
#, php-format
|
945 |
-
msgid "Payment message: %s."
|
946 |
-
msgstr ""
|
947 |
-
|
948 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:207
|
949 |
-
#, php-format
|
950 |
-
msgid "Payment total: %s."
|
951 |
-
msgstr ""
|
952 |
-
|
953 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:137
|
954 |
-
msgid "The plugin has been updated, but could not be reactivated. Please reactivate it manually."
|
955 |
-
msgstr ""
|
956 |
-
|
957 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:138
|
958 |
-
msgid "Plugin reactivated successfully."
|
959 |
-
msgstr ""
|
960 |
-
|
961 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:229
|
962 |
-
msgid "MGates.me Updates"
|
963 |
-
msgstr ""
|
964 |
-
|
965 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:259
|
966 |
-
msgid "MGates.me Plugin Updater"
|
967 |
-
msgstr ""
|
968 |
-
|
969 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:270
|
970 |
-
msgid "Enter your license key to automatically receive updates."
|
971 |
-
msgstr ""
|
972 |
-
|
973 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:295
|
974 |
-
#: productvendor\views\dashboard\settings\settings.php:46
|
975 |
-
msgid "Save"
|
976 |
-
msgstr ""
|
977 |
-
|
978 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:296
|
979 |
-
msgid "Check for updates <b>now</b>"
|
980 |
-
msgstr ""
|
981 |
-
|
982 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:323
|
983 |
-
#, php-format
|
984 |
-
msgid "<b style=\"color: #468847;\">Key deactivated.</b> License key for <i>%s</i> has been <b>deactivated</b>."
|
985 |
-
msgstr ""
|
986 |
-
|
987 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:325
|
988 |
-
#, php-format
|
989 |
-
msgid "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> could not be deactivated."
|
990 |
-
msgstr ""
|
991 |
-
|
992 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:333
|
993 |
-
#, php-format
|
994 |
-
msgid "<b style=\"color: #468847;\">Key activated.</b> License key for <i>%s</i> has been <b>activated</b>."
|
995 |
-
msgstr ""
|
996 |
-
|
997 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:335
|
998 |
-
#, php-format
|
999 |
-
msgid "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> is invalid."
|
1000 |
-
msgstr ""
|
1001 |
-
|
1002 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:370
|
1003 |
-
msgid "Enable MGates.me Plugin Updates."
|
1004 |
-
msgstr ""
|
1005 |
-
|
1006 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:372
|
1007 |
-
#, php-format
|
1008 |
-
msgid "<a href=\"%1$s\">Add your license keys</a> to enable automatic plugin updates."
|
1009 |
-
msgstr ""
|
1010 |
-
|
1011 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:379
|
1012 |
-
msgid "Hide This Message"
|
1013 |
-
msgstr ""
|
1014 |
-
|
1015 |
-
#: productvendor\views\dashboard\denied.php:5
|
1016 |
-
msgid "Your account has not yet been approved to become a vendor."
|
1017 |
-
msgstr ""
|
1018 |
-
|
1019 |
-
#: productvendor\views\dashboard\denied.php:9
|
1020 |
-
msgid "Your account is not vendor capable."
|
1021 |
-
msgstr ""
|
1022 |
-
|
1023 |
-
#: productvendor\views\dashboard\denied.php:42
|
1024 |
-
msgid "Submit"
|
1025 |
-
msgstr ""
|
1026 |
-
|
1027 |
-
#: productvendor\views\dashboard\links.php:1
|
1028 |
-
msgid "Control Center"
|
1029 |
-
msgstr ""
|
1030 |
-
|
1031 |
-
#: productvendor\views\dashboard\links.php:3
|
1032 |
-
msgid "My shop"
|
1033 |
-
msgstr ""
|
1034 |
-
|
1035 |
-
#: productvendor\views\dashboard\links.php:7
|
1036 |
-
msgid "My settings"
|
1037 |
-
msgstr ""
|
1038 |
-
|
1039 |
-
#: productvendor\views\dashboard\links.php:13
|
1040 |
-
msgid "Submit a product"
|
1041 |
-
msgstr ""
|
1042 |
-
|
1043 |
-
#: productvendor\views\dashboard\reports.php:1
|
1044 |
-
msgid "Sales Report"
|
1045 |
-
msgstr ""
|
1046 |
-
|
1047 |
-
#: productvendor\views\dashboard\reports.php:20
|
1048 |
-
msgid "Rate"
|
1049 |
-
msgstr ""
|
1050 |
-
|
1051 |
-
#: productvendor\views\dashboard\reports.php:43
|
1052 |
-
msgid "Show Orders"
|
1053 |
-
msgstr ""
|
1054 |
-
|
1055 |
-
#: productvendor\views\dashboard\reports.php:51
|
1056 |
-
msgid "Totals"
|
1057 |
-
msgstr ""
|
1058 |
-
|
1059 |
-
#: productvendor\views\dashboard\reports.php:64
|
1060 |
-
msgid "You have no sales during this period."
|
1061 |
-
msgstr ""
|
1062 |
-
|
1063 |
-
#: productvendor\views\dashboard\reports.php:72
|
1064 |
-
msgid "You haven't made any sales yet."
|
1065 |
-
msgstr ""
|
1066 |
-
|
1067 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:2
|
1068 |
-
msgid "PayPal Address"
|
1069 |
-
msgstr ""
|
1070 |
-
|
1071 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:3
|
1072 |
-
msgid "Your PayPal address is used to send you your commission."
|
1073 |
-
msgstr ""
|
1074 |
-
|
1075 |
-
#: productvendor\views\dashboard\settings\seller-info.php:3
|
1076 |
-
msgid "This is displayed on each of your products."
|
1077 |
-
msgstr ""
|
1078 |
-
|
1079 |
-
#: productvendor\views\dashboard\settings\shop-description.php:2
|
1080 |
-
msgid "Shop Description"
|
1081 |
-
msgstr ""
|
1082 |
-
|
1083 |
-
#: productvendor\views\dashboard\settings\shop-description.php:3
|
1084 |
-
#, php-format
|
1085 |
-
msgid "This is displayed on your <a href=\"%s\">shop page</a>."
|
1086 |
-
msgstr ""
|
1087 |
-
|
1088 |
-
#: productvendor\views\dashboard\settings\shop-name.php:2
|
1089 |
-
msgid "Shop Name"
|
1090 |
-
msgstr ""
|
1091 |
-
|
1092 |
-
#: productvendor\views\dashboard\settings\shop-name.php:3
|
1093 |
-
msgid "Your shop name is public and must be unique."
|
1094 |
-
msgstr ""
|
1095 |
-
|
1096 |
-
#: productvendor\views\emails\application-status.php:5
|
1097 |
-
#, php-format
|
1098 |
-
msgid "Hi there. This is a notification about a vendor application on %s."
|
1099 |
-
msgstr ""
|
1100 |
-
|
1101 |
-
#: productvendor\views\emails\application-status.php:8
|
1102 |
-
#, php-format
|
1103 |
-
msgid "Application status: %s"
|
1104 |
-
msgstr ""
|
1105 |
-
|
1106 |
-
#: productvendor\views\emails\application-status.php:9
|
1107 |
-
#, php-format
|
1108 |
-
msgid "Applicant username: %s"
|
1109 |
-
msgstr ""
|
1110 |
-
|
1111 |
-
#: productvendor\views\orders\csv-export.php:6
|
1112 |
-
msgid "Export orders"
|
1113 |
-
msgstr ""
|
1114 |
-
|
1115 |
-
#: productvendor\views\orders\orders.php:149
|
1116 |
-
#: productvendor\views\orders\table-body-simple.php:39
|
1117 |
-
#, php-format
|
1118 |
-
msgid "Total quantity: %d"
|
1119 |
-
msgstr ""
|
1120 |
-
|
1121 |
-
#: productvendor\views\orders\orders.php:175
|
1122 |
-
msgid "Comments"
|
1123 |
-
msgstr ""
|
1124 |
-
|
1125 |
-
#: productvendor\views\orders\orders.php:209
|
1126 |
-
msgid "Shipping - Tracking #"
|
1127 |
-
msgstr ""
|
1128 |
-
|
1129 |
-
#: productvendor\views\orders\orders.php:227
|
1130 |
-
msgid "Shipping - Mark Shipped"
|
1131 |
-
msgstr ""
|
1132 |
-
|
1133 |
-
#: productvendor\views\orders\orders.php:234
|
1134 |
-
msgid "Enter your tracking number first before marking the order as shipped."
|
1135 |
-
msgstr ""
|
1136 |
-
|
1137 |
-
#: productvendor\views\orders\table-body-simple.php:21
|
1138 |
-
#: productvendor\views\orders\table-body-variable.php:24
|
1139 |
-
#, php-format
|
1140 |
-
msgid "Quantity: %d"
|
1141 |
-
msgstr ""
|
1142 |
-
|
1143 |
-
#: productvendor\views\orders\comments\add-new-comment.php:10
|
1144 |
-
msgid "Add comment"
|
1145 |
-
msgstr ""
|
1146 |
-
|
1147 |
-
#: productvendor\views\orders\comments\existing-comments.php:9
|
1148 |
-
#, php-format
|
1149 |
-
msgid "added %s ago"
|
1150 |
-
msgstr ""
|
1151 |
-
|
1152 |
-
#: productvendor\views\orders\customer-note\customer-note.php:4
|
1153 |
-
msgid "Customer note"
|
1154 |
-
msgstr ""
|
1155 |
-
|
1156 |
-
#: productvendor\views\orders\customer-note\customer-note.php:8
|
1157 |
-
msgid "No customer note."
|
1158 |
-
msgstr ""
|
1159 |
-
|
1160 |
-
#: productvendor\views\orders\shipping\shipping-form.php:8
|
1161 |
-
msgid "Mark order as shipped"
|
1162 |
-
msgstr ""
|
1163 |
-
|
1164 |
-
#: productvendor\views\orders\shipping\tracking-form.php:6
|
1165 |
-
msgid "Provider:"
|
1166 |
-
msgstr ""
|
1167 |
-
|
1168 |
-
#: productvendor\views\orders\shipping\tracking-form.php:8
|
1169 |
-
msgid "Custom Provider"
|
1170 |
-
msgstr ""
|
1171 |
-
|
1172 |
-
#: productvendor\views\orders\shipping\tracking-form.php:30
|
1173 |
-
msgid "Provider Name:"
|
1174 |
-
msgstr ""
|
1175 |
-
|
1176 |
-
#: productvendor\views\orders\shipping\tracking-form.php:38
|
1177 |
-
msgid "Tracking number:"
|
1178 |
-
msgstr ""
|
1179 |
-
|
1180 |
-
#: productvendor\views\orders\shipping\tracking-form.php:46
|
1181 |
-
msgid "Tracking link:"
|
1182 |
-
msgstr ""
|
1183 |
-
|
1184 |
-
#: productvendor\views\orders\shipping\tracking-form.php:54
|
1185 |
-
msgid "Date shipped:"
|
1186 |
-
msgstr ""
|
1187 |
-
|
1188 |
-
#: productvendor\views\orders\shipping\tracking-form.php:62
|
1189 |
-
msgid "Preview:"
|
1190 |
-
msgstr ""
|
1191 |
-
|
1192 |
-
#: productvendor\views\orders\shipping\tracking-form.php:62
|
1193 |
-
msgid "Click here to track your shipment"
|
1194 |
-
msgstr ""
|
1195 |
-
|
1196 |
-
#: productvendor\views\orders\shipping\tracking-form.php:70
|
1197 |
-
msgid "Update tracking number"
|
1198 |
-
msgstr ""
|
1199 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WCVendors/languages/wc_vendors-fr_FR.mo
DELETED
Binary file
|
WCVendors/languages/wc_vendors-fr_FR.po
DELETED
@@ -1,1286 +0,0 @@
|
|
1 |
-
# Woocommerce translation strings
|
2 |
-
# Copyright (C) 2011-2012
|
3 |
-
# This file is distributed under the same license as the Woocommerce package.
|
4 |
-
# Last Updated: August 17, 2013.
|
5 |
-
msgid ""
|
6 |
-
msgstr ""
|
7 |
-
"Project-Id-Version: Woocommerce v1.0.1\n"
|
8 |
-
"Report-Msgid-Bugs-To: Woocommerce <info@Woocommerce.com>\n"
|
9 |
-
"POT-Creation-Date: 2013-08-17 07:57-0400\n"
|
10 |
-
"PO-Revision-Date: 2013-08-21 13:02-0500\n"
|
11 |
-
"Last-Translator: Matt Gates <info@mgates.me>\n"
|
12 |
-
"Language-Team: Woocommerce <info@Woocommerce.com>\n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"X-Generator: Poedit 1.5.7\n"
|
17 |
-
|
18 |
-
#: class-product-vendor.php:57
|
19 |
-
#: productvendor\classes\admin\class-admin-users.php:296
|
20 |
-
msgid "Product Vendor"
|
21 |
-
msgstr "Product Vendor"
|
22 |
-
|
23 |
-
#: class-product-vendor.php:79
|
24 |
-
msgid "<b>Product Vendor is disabled</b>. Product Vendor requires WooCommerce v2.0.1."
|
25 |
-
msgstr "<b>Product Vendor est désactivé</b>. Product Vendor nécessite WooCommerce v2.0.1."
|
26 |
-
|
27 |
-
#: productvendor\classes\class-cron.php:86
|
28 |
-
#, php-format
|
29 |
-
msgid "Payment total: %s"
|
30 |
-
msgstr "Total a payer: %s"
|
31 |
-
|
32 |
-
#: productvendor\classes\class-cron.php:143
|
33 |
-
msgid "Once Weekly"
|
34 |
-
msgstr "Chaque semaine"
|
35 |
-
|
36 |
-
#: productvendor\classes\class-cron.php:148
|
37 |
-
msgid "Once every two weeks"
|
38 |
-
msgstr "Toutes les 2 semaines"
|
39 |
-
|
40 |
-
#: productvendor\classes\class-cron.php:153
|
41 |
-
msgid "Once a month"
|
42 |
-
msgstr "Chaque mois"
|
43 |
-
|
44 |
-
#: productvendor\classes\class-install.php:99
|
45 |
-
#: productvendor\classes\class-install.php:250
|
46 |
-
msgid "Pending Vendor"
|
47 |
-
msgstr "Vendeur En Attente"
|
48 |
-
|
49 |
-
#: productvendor\classes\class-install.php:201
|
50 |
-
msgid "Vendor Dashboard"
|
51 |
-
msgstr "Tableau de bord Du vendeur"
|
52 |
-
|
53 |
-
#: productvendor\classes\class-install.php:202
|
54 |
-
#: productvendor\classes\admin\settings\sf-options.php:130
|
55 |
-
msgid "Orders"
|
56 |
-
msgstr "Commandes"
|
57 |
-
|
58 |
-
#: productvendor\classes\class-install.php:203
|
59 |
-
msgid "Shop Settings"
|
60 |
-
msgstr "Paramètres de votre boutique"
|
61 |
-
|
62 |
-
#: productvendor\classes\admin\class-admin-page.php:24
|
63 |
-
#: productvendor\classes\admin\class-admin-page.php:83
|
64 |
-
#: productvendor\classes\admin\class-admin-reports.php:323
|
65 |
-
#: productvendor\classes\admin\class-product-meta.php:139
|
66 |
-
#: productvendor\classes\admin\class-product-meta.php:155
|
67 |
-
#: productvendor\views\dashboard\reports.php:19
|
68 |
-
msgid "Commission"
|
69 |
-
msgstr "Commission"
|
70 |
-
|
71 |
-
#: productvendor\classes\admin\class-admin-page.php:192
|
72 |
-
#: productvendor\classes\admin\class-admin-reports.php:161
|
73 |
-
#: productvendor\views\dashboard\reports.php:17
|
74 |
-
msgid "Product"
|
75 |
-
msgstr "Produit"
|
76 |
-
|
77 |
-
#: productvendor\classes\admin\class-admin-page.php:193
|
78 |
-
msgid "Order ID"
|
79 |
-
msgstr "Numero de commande"
|
80 |
-
|
81 |
-
#: productvendor\classes\admin\class-admin-page.php:194
|
82 |
-
#: productvendor\classes\admin\class-admin-reports.php:162
|
83 |
-
#: productvendor\classes\admin\class-product-meta.php:38
|
84 |
-
msgid "Vendor"
|
85 |
-
msgstr "Vendeur"
|
86 |
-
|
87 |
-
#: productvendor\classes\admin\class-admin-page.php:195
|
88 |
-
#: productvendor\classes\admin\class-admin-reports.php:163
|
89 |
-
#: productvendor\classes\admin\class-admin-reports.php:328
|
90 |
-
#: productvendor\classes\admin\class-admin-reports.php:352
|
91 |
-
msgid "Total"
|
92 |
-
msgstr "Total"
|
93 |
-
|
94 |
-
#: productvendor\classes\admin\class-admin-page.php:196
|
95 |
-
#: productvendor\classes\admin\class-admin-reports.php:165
|
96 |
-
msgid "Status"
|
97 |
-
msgstr "Statut"
|
98 |
-
|
99 |
-
#: productvendor\classes\admin\class-admin-page.php:197
|
100 |
-
#: productvendor\classes\front\orders\class-orders.php:203
|
101 |
-
msgid "Date"
|
102 |
-
msgstr "Date"
|
103 |
-
|
104 |
-
#: productvendor\classes\admin\class-admin-page.php:232
|
105 |
-
msgid "Mark paid"
|
106 |
-
msgstr "Indiquer Payer"
|
107 |
-
|
108 |
-
#: productvendor\classes\admin\class-admin-page.php:233
|
109 |
-
msgid "Mark due"
|
110 |
-
msgstr "Indiquer A Payer"
|
111 |
-
|
112 |
-
#: productvendor\classes\admin\class-admin-page.php:234
|
113 |
-
msgid "Mark reversed"
|
114 |
-
msgstr "Indiquer reverser"
|
115 |
-
|
116 |
-
#: productvendor\classes\admin\class-admin-page.php:249
|
117 |
-
msgid "Filter"
|
118 |
-
msgstr "Filtres"
|
119 |
-
|
120 |
-
#: productvendor\classes\admin\class-admin-page.php:282
|
121 |
-
msgid "Show all dates"
|
122 |
-
msgstr "Montrer Toutes Les Dates"
|
123 |
-
|
124 |
-
#: productvendor\classes\admin\class-admin-page.php:295
|
125 |
-
#, php-format
|
126 |
-
msgid "%1$s %2$d"
|
127 |
-
msgstr "%1$s %2$d"
|
128 |
-
|
129 |
-
#: productvendor\classes\admin\class-admin-page.php:321
|
130 |
-
msgid "Commission marked paid."
|
131 |
-
msgstr "Commission payée"
|
132 |
-
|
133 |
-
#: productvendor\classes\admin\class-admin-page.php:328
|
134 |
-
msgid "Commission marked due."
|
135 |
-
msgstr "Commission a payer"
|
136 |
-
|
137 |
-
#: productvendor\classes\admin\class-admin-page.php:335
|
138 |
-
msgid "Commission marked reversed."
|
139 |
-
msgstr "Commission reversée"
|
140 |
-
|
141 |
-
#: productvendor\classes\admin\class-admin-reports.php:38
|
142 |
-
msgid "Product Vendors"
|
143 |
-
msgstr "Vendeurs"
|
144 |
-
|
145 |
-
#: productvendor\classes\admin\class-admin-reports.php:41
|
146 |
-
msgid "Overview"
|
147 |
-
msgstr "Vue D'ensemble"
|
148 |
-
|
149 |
-
#: productvendor\classes\admin\class-admin-reports.php:47
|
150 |
-
msgid "Commission by vendor"
|
151 |
-
msgstr "Commission par vendeur"
|
152 |
-
|
153 |
-
#: productvendor\classes\admin\class-admin-reports.php:53
|
154 |
-
msgid "Commission by product"
|
155 |
-
msgstr "Commission par produit"
|
156 |
-
|
157 |
-
#: productvendor\classes\admin\class-admin-reports.php:112
|
158 |
-
#: productvendor\views\dashboard\date-picker.php:3
|
159 |
-
msgid "From:"
|
160 |
-
msgstr "De:"
|
161 |
-
|
162 |
-
#: productvendor\classes\admin\class-admin-reports.php:112
|
163 |
-
#: productvendor\views\dashboard\date-picker.php:6
|
164 |
-
msgid "To:"
|
165 |
-
msgstr "A:"
|
166 |
-
|
167 |
-
#: productvendor\classes\admin\class-admin-reports.php:112
|
168 |
-
#: productvendor\classes\admin\class-admin-reports.php:262
|
169 |
-
#: productvendor\views\dashboard\date-picker.php:9
|
170 |
-
msgid "Show"
|
171 |
-
msgstr "Voir"
|
172 |
-
|
173 |
-
#: productvendor\classes\admin\class-admin-reports.php:123
|
174 |
-
msgid "Total paid in range"
|
175 |
-
msgstr "Total des sommes versées"
|
176 |
-
|
177 |
-
#: productvendor\classes\admin\class-admin-reports.php:125
|
178 |
-
#: productvendor\classes\admin\class-admin-reports.php:131
|
179 |
-
#: productvendor\classes\admin\class-admin-reports.php:137
|
180 |
-
msgid "n/a"
|
181 |
-
msgstr ""
|
182 |
-
|
183 |
-
#: productvendor\classes\admin\class-admin-reports.php:129
|
184 |
-
msgid "Total due in range"
|
185 |
-
msgstr "Total des sommes dues"
|
186 |
-
|
187 |
-
#: productvendor\classes\admin\class-admin-reports.php:135
|
188 |
-
msgid "Total reversed in range"
|
189 |
-
msgstr "Total des sommes reversées"
|
190 |
-
|
191 |
-
#: productvendor\classes\admin\class-admin-reports.php:144
|
192 |
-
msgid "Recent Commission"
|
193 |
-
msgstr "Commission Recentes"
|
194 |
-
|
195 |
-
#: productvendor\classes\admin\class-admin-reports.php:160
|
196 |
-
#: productvendor\classes\front\orders\class-orders.php:196
|
197 |
-
msgid "Order"
|
198 |
-
msgstr "Commande"
|
199 |
-
|
200 |
-
#: productvendor\classes\admin\class-admin-reports.php:164
|
201 |
-
msgid "Date & Time"
|
202 |
-
msgstr "Date & Heure"
|
203 |
-
|
204 |
-
#: productvendor\classes\admin\class-admin-reports.php:171
|
205 |
-
msgid "N/A"
|
206 |
-
msgstr "N/A"
|
207 |
-
|
208 |
-
#: productvendor\classes\admin\class-admin-reports.php:175
|
209 |
-
msgid "D j M Y \\a\\t h:ia"
|
210 |
-
msgstr ""
|
211 |
-
|
212 |
-
#: productvendor\classes\admin\class-admin-reports.php:184
|
213 |
-
msgid "No commission yet"
|
214 |
-
msgstr "Pas encore de commission"
|
215 |
-
|
216 |
-
#: productvendor\classes\admin\class-admin-reports.php:215
|
217 |
-
msgid "Show:"
|
218 |
-
msgstr "Montrer:"
|
219 |
-
|
220 |
-
#: productvendor\classes\admin\class-admin-reports.php:225
|
221 |
-
msgid "Search for a product…"
|
222 |
-
msgstr "Recherche d'un produit…"
|
223 |
-
|
224 |
-
#: productvendor\classes\admin\class-admin-reports.php:255
|
225 |
-
msgid "Select a vendor…"
|
226 |
-
msgstr "Choisir un Vendeur…"
|
227 |
-
|
228 |
-
#: productvendor\classes\admin\class-admin-reports.php:322
|
229 |
-
msgid "Month"
|
230 |
-
msgstr "Mois"
|
231 |
-
|
232 |
-
#: productvendor\classes\admin\class-admin-reports.php:324
|
233 |
-
msgid "Tax"
|
234 |
-
msgstr "Taxes"
|
235 |
-
|
236 |
-
#: productvendor\classes\admin\class-admin-reports.php:325
|
237 |
-
#: productvendor\views\orders\orders.php:111
|
238 |
-
msgid "Shipping"
|
239 |
-
msgstr "Livraison"
|
240 |
-
|
241 |
-
#: productvendor\classes\admin\class-admin-reports.php:326
|
242 |
-
msgid "Reversed"
|
243 |
-
msgstr "Reverser"
|
244 |
-
|
245 |
-
#: productvendor\classes\admin\class-admin-reports.php:327
|
246 |
-
msgid "Paid"
|
247 |
-
msgstr "Payer"
|
248 |
-
|
249 |
-
#: productvendor\classes\admin\class-admin-users.php:305
|
250 |
-
msgid "Enable HTML for the shop description"
|
251 |
-
msgstr "Activer le HTML pour la description de la boutique."
|
252 |
-
|
253 |
-
#: productvendor\classes\admin\class-admin-users.php:311
|
254 |
-
msgid "Shop name"
|
255 |
-
msgstr "Nom de la boutique"
|
256 |
-
|
257 |
-
#: productvendor\classes\admin\class-admin-users.php:316
|
258 |
-
msgid "PayPal E-mail"
|
259 |
-
msgstr "E-Mail Paypal"
|
260 |
-
|
261 |
-
#: productvendor\classes\admin\class-admin-users.php:316
|
262 |
-
msgid "required"
|
263 |
-
msgstr "required"
|
264 |
-
|
265 |
-
#: productvendor\classes\admin\class-admin-users.php:321
|
266 |
-
msgid "Commission due"
|
267 |
-
msgstr "Commission due"
|
268 |
-
|
269 |
-
#: productvendor\classes\admin\class-admin-users.php:326
|
270 |
-
#: productvendor\classes\front\class-vendor-shop.php:58
|
271 |
-
#: productvendor\views\dashboard\settings\seller-info.php:2
|
272 |
-
msgid "Seller info"
|
273 |
-
msgstr "Information du vendeur"
|
274 |
-
|
275 |
-
#: productvendor\classes\admin\class-admin-users.php:331
|
276 |
-
msgid "Shop description"
|
277 |
-
msgstr "Description de la boutique"
|
278 |
-
|
279 |
-
#: productvendor\classes\admin\class-admin-users.php:349
|
280 |
-
msgid "Commission Due"
|
281 |
-
msgstr "Commission due"
|
282 |
-
|
283 |
-
#: productvendor\classes\admin\class-product-meta.php:162
|
284 |
-
msgid "Leave blank for default"
|
285 |
-
msgstr "Laisser blanc par défaut"
|
286 |
-
|
287 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:25
|
288 |
-
msgid "Approve"
|
289 |
-
msgstr "Accepter"
|
290 |
-
|
291 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:26
|
292 |
-
msgid "Deny"
|
293 |
-
msgstr "Refuser"
|
294 |
-
|
295 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:70
|
296 |
-
msgid "Vendor has been <b>denied</b>."
|
297 |
-
msgstr "Le vendeur a été <b>refusé</b>."
|
298 |
-
|
299 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:81
|
300 |
-
msgid "Vendor has been <b>approved</b>."
|
301 |
-
msgstr "Le vendeur a été <b>accepté</b>."
|
302 |
-
|
303 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:94
|
304 |
-
msgid "Pending Vendors"
|
305 |
-
msgstr "Vendeur en attente"
|
306 |
-
|
307 |
-
#: productvendor\classes\admin\emails\class-emails.php:85
|
308 |
-
#: productvendor\classes\front\class-vendor-cart.php:41
|
309 |
-
#: productvendor\classes\front\class-vendor-cart.php:60
|
310 |
-
msgid "Sold by"
|
311 |
-
msgstr "Vendu par"
|
312 |
-
|
313 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:27
|
314 |
-
msgid "Vendor Application"
|
315 |
-
msgstr "Demande de vendeur"
|
316 |
-
|
317 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:28
|
318 |
-
msgid "Vendor application will either be approved, denied, or pending."
|
319 |
-
msgstr "La demande du vendeur sera soit approuvée, refusée, ou en attente."
|
320 |
-
|
321 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:30
|
322 |
-
msgid "Application {status}"
|
323 |
-
msgstr "Demande {status}"
|
324 |
-
|
325 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:31
|
326 |
-
msgid "[{blogname}] Your vendor application has been {status}"
|
327 |
-
msgstr "Votre demande pour etre vendeur a été"
|
328 |
-
|
329 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:115
|
330 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:120
|
331 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:224
|
332 |
-
msgid "Enable/Disable"
|
333 |
-
msgstr "Activer / Désactiver"
|
334 |
-
|
335 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:117
|
336 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:122
|
337 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:226
|
338 |
-
msgid "Enable this email notification"
|
339 |
-
msgstr "Activer cette notification "
|
340 |
-
|
341 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:121
|
342 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:126
|
343 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:230
|
344 |
-
msgid "Subject"
|
345 |
-
msgstr "Sujet"
|
346 |
-
|
347 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:123
|
348 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:128
|
349 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:232
|
350 |
-
#, php-format
|
351 |
-
msgid "This controls the email subject line. Leave blank to use the default subject: <code>%s</code>."
|
352 |
-
msgstr "Control du sujet. Laissez vide pour utiliser l'objet par défaut: <code>%s</code>."
|
353 |
-
|
354 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:128
|
355 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:133
|
356 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:237
|
357 |
-
msgid "Email Heading"
|
358 |
-
msgstr "Entête de l'email"
|
359 |
-
|
360 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:130
|
361 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:135
|
362 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:239
|
363 |
-
#, php-format
|
364 |
-
msgid "This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>."
|
365 |
-
msgstr "Control du entête. Laissez vide pour utiliser l'entête par défaut: <code>%s</code>."
|
366 |
-
|
367 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:135
|
368 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:140
|
369 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:244
|
370 |
-
msgid "Email type"
|
371 |
-
msgstr "Email type"
|
372 |
-
|
373 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:137
|
374 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:142
|
375 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:246
|
376 |
-
msgid "Choose which format of email to send."
|
377 |
-
msgstr "Choisir le format d'email"
|
378 |
-
|
379 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:141
|
380 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:146
|
381 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:250
|
382 |
-
msgid "Plain text"
|
383 |
-
msgstr "Texte"
|
384 |
-
|
385 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:142
|
386 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:147
|
387 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:251
|
388 |
-
msgid "HTML"
|
389 |
-
msgstr "HTML"
|
390 |
-
|
391 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:143
|
392 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:148
|
393 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:252
|
394 |
-
msgid "Multipart"
|
395 |
-
msgstr "Multipart"
|
396 |
-
|
397 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:27
|
398 |
-
msgid "New Vendor Product"
|
399 |
-
msgstr "Nouveau Produit"
|
400 |
-
|
401 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:28
|
402 |
-
msgid "New order emails are sent when a new product is submitted by a vendor"
|
403 |
-
msgstr "E-mails de nouvelles commandes envoyées quand un nouveau produit est présentée par un fournisseur"
|
404 |
-
|
405 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:30
|
406 |
-
msgid "New product submitted: {product_name}"
|
407 |
-
msgstr "Nouveau produit soumis: {product_name}"
|
408 |
-
|
409 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:31
|
410 |
-
msgid "[{blogname}] New product submitted by {vendor_name} - {product_name}"
|
411 |
-
msgstr "[{blogname}] Nouveau produit soumis par {vendor_name} - {product_name}"
|
412 |
-
|
413 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:27
|
414 |
-
msgid "Notify vendors"
|
415 |
-
msgstr "Notifier les vendeurs"
|
416 |
-
|
417 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:28
|
418 |
-
msgid "New order emails are sent when an order is received/paid by a customer."
|
419 |
-
msgstr "E-mails de nouvelles commandes envoyées quand un ordre est reçu / payé par un client."
|
420 |
-
|
421 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:30
|
422 |
-
msgid "New customer order"
|
423 |
-
msgstr "Nouvelle Commande"
|
424 |
-
|
425 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:31
|
426 |
-
msgid "[{blogname}] New customer order ({order_number}) - {order_date}"
|
427 |
-
msgstr "[{blogname}] Nouvelle Commande {order_number}) - {order_date}"
|
428 |
-
|
429 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:102
|
430 |
-
msgid "Commission Subtotal:"
|
431 |
-
msgstr "Sous-Total Commission :"
|
432 |
-
|
433 |
-
#: productvendor\classes\admin\settings\sf-options.php:4
|
434 |
-
msgid "General"
|
435 |
-
msgstr "General"
|
436 |
-
|
437 |
-
#: productvendor\classes\admin\settings\sf-options.php:5
|
438 |
-
msgid "General options"
|
439 |
-
msgstr "Options Generales"
|
440 |
-
|
441 |
-
#: productvendor\classes\admin\settings\sf-options.php:8
|
442 |
-
msgid "Default commission (%)"
|
443 |
-
msgstr "Defaut Commission (%)"
|
444 |
-
|
445 |
-
#: productvendor\classes\admin\settings\sf-options.php:9
|
446 |
-
msgid "The default rate the vendor receives for each product. If a product has a commission rate already set, this value will be ignored for that product."
|
447 |
-
msgstr "Le taux par défaut que le vendeur reçoit pour chaque produit. Si un produit a un taux de commission déjà défini, cette valeur sera ignorée pour ce produit."
|
448 |
-
|
449 |
-
#: productvendor\classes\admin\settings\sf-options.php:20
|
450 |
-
msgid "Registration"
|
451 |
-
msgstr "Inscription"
|
452 |
-
|
453 |
-
#: productvendor\classes\admin\settings\sf-options.php:21
|
454 |
-
msgid "Allow users or guests to apply to become a vendor"
|
455 |
-
msgstr "Autoriser les utilisateurs ou les invités à s'inscrire pour devenir un vendeur"
|
456 |
-
|
457 |
-
#: productvendor\classes\admin\settings\sf-options.php:22
|
458 |
-
msgid "This will show a checkbox on the My Account page's registration form asking if the user would like to apply to be a vendor. Also, on the Vendor Dashboard, users can apply to become a vendor."
|
459 |
-
msgstr "Cela fera apparaître une case à cocher sur le formulaire d'inscription de la page Mon Compte demandant si l'utilisateur souhaite s'inscrire pour être un vendeur. En outre, sur le tableau de bord du vendeur, les utilisateurs peuvent demander à devenir un vendeur."
|
460 |
-
|
461 |
-
#: productvendor\classes\admin\settings\sf-options.php:29
|
462 |
-
msgid "Approve vendor applications manually"
|
463 |
-
msgstr "Approuver les demandes des vendeurs manuellement"
|
464 |
-
|
465 |
-
#: productvendor\classes\admin\settings\sf-options.php:30
|
466 |
-
msgid "With this unchecked, all vendor applications are automatically accepted. Otherwise, you must approve each manually."
|
467 |
-
msgstr "Avec cette cochée, toutes les actions de vendeurs sont automatiquement acceptés. Sinon, vous devez approuver chacune manuellement."
|
468 |
-
|
469 |
-
#: productvendor\classes\admin\settings\sf-options.php:37
|
470 |
-
msgid "Taxes"
|
471 |
-
msgstr "Taxes"
|
472 |
-
|
473 |
-
#: productvendor\classes\admin\settings\sf-options.php:38
|
474 |
-
msgid "Give vendors any tax collected per-product"
|
475 |
-
msgstr "Donnez au vendeur toutes taxes perçues par produit"
|
476 |
-
|
477 |
-
#: productvendor\classes\admin\settings\sf-options.php:39
|
478 |
-
msgid "The tax collected on a vendor's product will be given to him in its entirety"
|
479 |
-
msgstr "La taxe perçue sur le produit d'un vendeur va lui être donnée dans son intégralité"
|
480 |
-
|
481 |
-
#: productvendor\classes\admin\settings\sf-options.php:45
|
482 |
-
msgid "Shop options"
|
483 |
-
msgstr "Option de la boutique"
|
484 |
-
|
485 |
-
#: productvendor\classes\admin\settings\sf-options.php:48
|
486 |
-
msgid "Shop HTML"
|
487 |
-
msgstr "Boutique HTML"
|
488 |
-
|
489 |
-
#: productvendor\classes\admin\settings\sf-options.php:49
|
490 |
-
msgid "Enable HTML for a vendor's shop description by default"
|
491 |
-
msgstr "Activer la description HTML pour la boutique d'un vendeur par défaut"
|
492 |
-
|
493 |
-
#: productvendor\classes\admin\settings\sf-options.php:56
|
494 |
-
msgid "Vendor shop page"
|
495 |
-
msgstr "Page de la boutique d'un vendeur"
|
496 |
-
|
497 |
-
#: productvendor\classes\admin\settings\sf-options.php:57
|
498 |
-
msgid "Eg: <code>yoursite.com/[your_setting_here]/[vendor_name_here]</code>"
|
499 |
-
msgstr ""
|
500 |
-
|
501 |
-
#: productvendor\classes\admin\settings\sf-options.php:63
|
502 |
-
#: productvendor\classes\admin\settings\sf-options.php:188
|
503 |
-
msgid "Products"
|
504 |
-
msgstr "Produits"
|
505 |
-
|
506 |
-
#: productvendor\classes\admin\settings\sf-options.php:64
|
507 |
-
msgid "Product Add Page"
|
508 |
-
msgstr "Page Ajout Produit"
|
509 |
-
|
510 |
-
#: productvendor\classes\admin\settings\sf-options.php:64
|
511 |
-
msgid "Configure what to hide from all vendors when adding a product"
|
512 |
-
msgstr "Configurez ce que vous voulez cacher pour tous les vendeurs lors de l'ajout d'un produit"
|
513 |
-
|
514 |
-
#: productvendor\classes\admin\settings\sf-options.php:67
|
515 |
-
msgid "Left side panel"
|
516 |
-
msgstr "Panneau latéral gauche"
|
517 |
-
|
518 |
-
#: productvendor\classes\admin\settings\sf-options.php:68
|
519 |
-
msgid "Hide these areas of the add product page for vendors"
|
520 |
-
msgstr "Masquer ces zones de la page ajout produit pour les vendeurs"
|
521 |
-
|
522 |
-
#: productvendor\classes\admin\settings\sf-options.php:82
|
523 |
-
msgid "Types"
|
524 |
-
msgstr "Types"
|
525 |
-
|
526 |
-
#: productvendor\classes\admin\settings\sf-options.php:83
|
527 |
-
msgid "Hide these product types from the vendor"
|
528 |
-
msgstr "Masquer ces types produits pour le vendeur"
|
529 |
-
|
530 |
-
#: productvendor\classes\admin\settings\sf-options.php:96
|
531 |
-
msgid "Type options"
|
532 |
-
msgstr "Type options"
|
533 |
-
|
534 |
-
#: productvendor\classes\admin\settings\sf-options.php:97
|
535 |
-
msgid "Hide these product options from the vendor"
|
536 |
-
msgstr "Masquer ces options produits pour le vendeur"
|
537 |
-
|
538 |
-
#: productvendor\classes\admin\settings\sf-options.php:108
|
539 |
-
msgid "Miscellaneous"
|
540 |
-
msgstr "Miscellaneous"
|
541 |
-
|
542 |
-
#: productvendor\classes\admin\settings\sf-options.php:119
|
543 |
-
msgid "Stylesheet"
|
544 |
-
msgstr "Stylesheet"
|
545 |
-
|
546 |
-
#: productvendor\classes\admin\settings\sf-options.php:120
|
547 |
-
msgid "You can add CSS in this textarea, which will be loaded on the product add/edit page for vendors."
|
548 |
-
msgstr "Vous pouvez ajouter des CSS dans cette zone de texte, qui sera chargée sur la page ajouter / modifier produit pour les vendeurs."
|
549 |
-
|
550 |
-
#: productvendor\classes\admin\settings\sf-options.php:126
|
551 |
-
msgid "Capabilities"
|
552 |
-
msgstr "Ffonctionnalités"
|
553 |
-
|
554 |
-
#: productvendor\classes\admin\settings\sf-options.php:127
|
555 |
-
msgid "Permissions"
|
556 |
-
msgstr "Autorisations"
|
557 |
-
|
558 |
-
#: productvendor\classes\admin\settings\sf-options.php:127
|
559 |
-
msgid "General permissions used around the shop"
|
560 |
-
msgstr "Autorisations générales utiliséespour la boutique"
|
561 |
-
|
562 |
-
#: productvendor\classes\admin\settings\sf-options.php:131
|
563 |
-
msgid "View orders"
|
564 |
-
msgstr "Voir Commandes"
|
565 |
-
|
566 |
-
#: productvendor\classes\admin\settings\sf-options.php:132
|
567 |
-
msgid "Show customer details such as email, address, name, etc, for each order"
|
568 |
-
msgstr "Afficher les détails des clients tels que e-mail, adresse, nom, etc, pour chaque commande"
|
569 |
-
|
570 |
-
#: productvendor\classes\admin\settings\sf-options.php:139
|
571 |
-
msgid "View comments"
|
572 |
-
msgstr "Voir les commentaires"
|
573 |
-
|
574 |
-
#: productvendor\classes\admin\settings\sf-options.php:140
|
575 |
-
msgid "View all vendor comments for an order on the frontend"
|
576 |
-
msgstr "Voir tous les commentaires des vendeurs pour une commande sur le frontend"
|
577 |
-
|
578 |
-
#: productvendor\classes\admin\settings\sf-options.php:147
|
579 |
-
msgid "Submit comments"
|
580 |
-
msgstr "Envois commentaires"
|
581 |
-
|
582 |
-
#: productvendor\classes\admin\settings\sf-options.php:148
|
583 |
-
msgid "Submit comments for an order on the frontend. Eg, tracking ID for a product"
|
584 |
-
msgstr "Envois commentaires pour une commande en frontend. Ex numero de suivi par produit"
|
585 |
-
|
586 |
-
#: productvendor\classes\admin\settings\sf-options.php:155
|
587 |
-
msgid "View email addresses"
|
588 |
-
msgstr "Voir adresse email"
|
589 |
-
|
590 |
-
#: productvendor\classes\admin\settings\sf-options.php:156
|
591 |
-
msgid "While viewing order details on the frontend, you can disable or enable email addresses"
|
592 |
-
msgstr "Lors de l'affichage des détails de la commande sur l'interface, vous pouvez activer ou désactiver les adresses e-mail"
|
593 |
-
|
594 |
-
#: productvendor\classes\admin\settings\sf-options.php:163
|
595 |
-
msgid "Export a CSV file of orders for a product"
|
596 |
-
msgstr "Export CSV des commandes pour un produit"
|
597 |
-
|
598 |
-
#: productvendor\classes\admin\settings\sf-options.php:164
|
599 |
-
msgid "Vendors could export orders for a product on the frontend"
|
600 |
-
msgstr "Les vendeurs peuvent exporter les commandes pour un produit sur le frontend"
|
601 |
-
|
602 |
-
#: productvendor\classes\admin\settings\sf-options.php:171
|
603 |
-
msgid "Reports"
|
604 |
-
msgstr "Rapports"
|
605 |
-
|
606 |
-
#: productvendor\classes\admin\settings\sf-options.php:172
|
607 |
-
msgid "View backend sales reports"
|
608 |
-
msgstr "Voir les commandes dans le backend"
|
609 |
-
|
610 |
-
#: productvendor\classes\admin\settings\sf-options.php:173
|
611 |
-
msgid "Graphs and tables via the Reports page in backend. The reports will only display sales data that pertain to their products"
|
612 |
-
msgstr "Graphiques et tableaux via la page Rapports en backend. Les rapports n'affichent que les données sur les ventes qui se rapportent à leurs produits"
|
613 |
-
|
614 |
-
#: productvendor\classes\admin\settings\sf-options.php:180
|
615 |
-
msgid "View Frontend sales reports"
|
616 |
-
msgstr "Voir les rapports de ventes en frontend"
|
617 |
-
|
618 |
-
#: productvendor\classes\admin\settings\sf-options.php:181
|
619 |
-
msgid "Sales table on the frontend on the My Account page. The table will only display sales data that pertain to their products"
|
620 |
-
msgstr "Tableau des ventes sur le frontend sur la page Mon compte. Le tableau n'affiche que les données de ventes qui s'appliquent à leurs produits"
|
621 |
-
|
622 |
-
#: productvendor\classes\admin\settings\sf-options.php:189
|
623 |
-
msgid "Submit products"
|
624 |
-
msgstr "Soummettre produits"
|
625 |
-
|
626 |
-
#: productvendor\classes\admin\settings\sf-options.php:190
|
627 |
-
msgid "Vendors could submit a product through the backend, and an admin would approve or deny it"
|
628 |
-
msgstr "Les vendeurs peuvent soumettre un produit à travers le backend, et un admin devra approuver ou refuser."
|
629 |
-
|
630 |
-
#: productvendor\classes\admin\settings\sf-options.php:197
|
631 |
-
msgid "Edit live products"
|
632 |
-
msgstr "Editer produit en ligne"
|
633 |
-
|
634 |
-
#: productvendor\classes\admin\settings\sf-options.php:198
|
635 |
-
msgid "Vendors could edit an approved product after it has already gone live. There is no approval or review after editing a live product. This could be dangerous with malicious vendors, so take caution."
|
636 |
-
msgstr "Les vendeurs peuvent modifier un produit approuvé après qu'il soit en ligne. Il n'y a pas d'approbation ou d'examen après la modification d'un produit vivant. Cela pourrait être dangereux avec les vendeurs malveillants. Soyez vigileant."
|
637 |
-
|
638 |
-
#: productvendor\classes\admin\settings\sf-options.php:205
|
639 |
-
msgid "Submit products live without requiring approval"
|
640 |
-
msgstr "Soumettre Produits en ligne sans approbation"
|
641 |
-
|
642 |
-
#: productvendor\classes\admin\settings\sf-options.php:206
|
643 |
-
msgid "Vendors can submit products without review or approval from a shop admin. This could be dangerous with malicious vendors, so take caution."
|
644 |
-
msgstr "Les vendeurs peuvent soumettre produits sans révision ou l'approbation d'un administrateur de la boutique. Cela pourrait être dangereux avec les vendeurs malveillants. Soyez vigileant."
|
645 |
-
|
646 |
-
#: productvendor\classes\admin\settings\sf-options.php:212
|
647 |
-
msgid "Pages"
|
648 |
-
msgstr "Pages"
|
649 |
-
|
650 |
-
#: productvendor\classes\admin\settings\sf-options.php:213
|
651 |
-
msgid "Page configuration"
|
652 |
-
msgstr "Page de configuration"
|
653 |
-
|
654 |
-
#: productvendor\classes\admin\settings\sf-options.php:216
|
655 |
-
msgid "Vendor dashboard"
|
656 |
-
msgstr "Dashboard Vendeur"
|
657 |
-
|
658 |
-
#: productvendor\classes\admin\settings\sf-options.php:217
|
659 |
-
msgid "Choose the page that has the shortcode <code>[pv_vendor_dashboard]</code><br/>By default, My Account > Vendor Dashboard should have the shortcode."
|
660 |
-
msgstr "Choisir la page qui a le shortcode <code>[pv_vendor_dashboard]</code><br/>Par defaut, My Account > Vendor Dashboard a le shortcode."
|
661 |
-
|
662 |
-
#: productvendor\classes\admin\settings\sf-options.php:224
|
663 |
-
msgid "Shop settings"
|
664 |
-
msgstr "Parametres de la boutique"
|
665 |
-
|
666 |
-
#: productvendor\classes\admin\settings\sf-options.php:225
|
667 |
-
msgid "Choose the page that has the shortcode <code>[pv_shop_settings]</code><br/>These are the shop settings a vendor can configure."
|
668 |
-
msgstr "Choisir la page qui a le shortcode <code>[pv_shop_settings]</code><br/>Ce sont les paramètres de la boutique du vendeur"
|
669 |
-
|
670 |
-
#: productvendor\classes\admin\settings\sf-options.php:232
|
671 |
-
msgid "Orders page"
|
672 |
-
msgstr "Page Commandes"
|
673 |
-
|
674 |
-
#: productvendor\classes\admin\settings\sf-options.php:233
|
675 |
-
msgid "Choose the page that has the shortcode <code>[pv_orders]</code><br/>By default, My Account > Orders should have the shortcode."
|
676 |
-
msgstr "Choisir la page qui a le shortcode <code>[pv_orders]</code><br/>par défaut, My Account > Orders a le shortcode."
|
677 |
-
|
678 |
-
#: productvendor\classes\admin\settings\sf-options.php:240
|
679 |
-
msgid "Vendor terms"
|
680 |
-
msgstr "Termes du vendeur"
|
681 |
-
|
682 |
-
#: productvendor\classes\admin\settings\sf-options.php:241
|
683 |
-
msgid "These terms are shown to a user when submitting an application to become a vendor.<br/>If left blank, no terms will be shown to the applicant."
|
684 |
-
msgstr "Ces termes sont présentés à l'utilisateur lors de la soumission d'une demande pour devenir un fournisseur. <br/> Si laissé vide, aucun terme seront affichés au demandeur."
|
685 |
-
|
686 |
-
#: productvendor\classes\admin\settings\sf-options.php:259
|
687 |
-
msgid "Payments"
|
688 |
-
msgstr "Paiements"
|
689 |
-
|
690 |
-
#: productvendor\classes\admin\settings\sf-options.php:260
|
691 |
-
msgid "User payments"
|
692 |
-
msgstr "Paiements Utilisateur"
|
693 |
-
|
694 |
-
#: productvendor\classes\admin\settings\sf-options.php:261
|
695 |
-
#, php-format
|
696 |
-
msgid "Total commission currently due: %s. <a href=\"%s\">View details</a>."
|
697 |
-
msgstr "Total des commissions dues: %s. <a href=\"%s\">Voir Détails</a>."
|
698 |
-
|
699 |
-
#: productvendor\classes\admin\settings\sf-options.php:262
|
700 |
-
#, php-format
|
701 |
-
msgid "Make sure you update your PayPal Adaptive Payments settings <a href=\"%s\">here</a>."
|
702 |
-
msgstr "Assurez-vous que vous avez mis à jour vos paramètres de paiements PayPal <a href=\"%s\">ici</a>."
|
703 |
-
|
704 |
-
#: productvendor\classes\admin\settings\sf-options.php:265
|
705 |
-
msgid "Instant pay"
|
706 |
-
msgstr "Instant pay"
|
707 |
-
|
708 |
-
#: productvendor\classes\admin\settings\sf-options.php:266
|
709 |
-
msgid "Instantly pay vendors their commission when an order is made"
|
710 |
-
msgstr "Payer instantanément les vendeurs quand une commande est faite"
|
711 |
-
|
712 |
-
#: productvendor\classes\admin\settings\sf-options.php:267
|
713 |
-
msgid "For this to work, customers must checkout with the PayPal Adaptive Payments gateway. Using other gateways will not pay vendors instantly"
|
714 |
-
msgstr "Pour que cela fonctionne, les clients doivent accéder à la passerelle Adaptive PayPal. L'utilisation d'autres passerelles ne paiera pas les vendeurs instantanément"
|
715 |
-
|
716 |
-
#: productvendor\classes\admin\settings\sf-options.php:274
|
717 |
-
msgid "Payment schedule"
|
718 |
-
msgstr "Calendrier des paiements"
|
719 |
-
|
720 |
-
#: productvendor\classes\admin\settings\sf-options.php:275
|
721 |
-
msgid "Note: Schedule will only work if instant pay is unchecked"
|
722 |
-
msgstr "Note: Calendrier des paiements ne fonctionne que si le paiement instantané est décoché"
|
723 |
-
|
724 |
-
#: productvendor\classes\admin\settings\sf-options.php:280
|
725 |
-
msgid "Weekly"
|
726 |
-
msgstr "Par semaine"
|
727 |
-
|
728 |
-
#: productvendor\classes\admin\settings\sf-options.php:281
|
729 |
-
msgid "Biweekly"
|
730 |
-
msgstr "Par 2 semaines"
|
731 |
-
|
732 |
-
#: productvendor\classes\admin\settings\sf-options.php:282
|
733 |
-
msgid "Monthly"
|
734 |
-
msgstr "Par mois"
|
735 |
-
|
736 |
-
#: productvendor\classes\admin\settings\sf-options.php:283
|
737 |
-
msgid "Manual"
|
738 |
-
msgstr "Manuel"
|
739 |
-
|
740 |
-
#: productvendor\classes\admin\settings\sf-options.php:284
|
741 |
-
msgid "Now"
|
742 |
-
msgstr "Maintenant"
|
743 |
-
|
744 |
-
#: productvendor\classes\admin\settings\sf-options.php:289
|
745 |
-
msgid "Email notification"
|
746 |
-
msgstr "Notification Email"
|
747 |
-
|
748 |
-
#: productvendor\classes\admin\settings\sf-options.php:290
|
749 |
-
msgid "Send the WooCommerce admin an email each time a payment has been made via the payment schedule options above"
|
750 |
-
msgstr "Envoyer a l'admin WooCommerce un email chaque fois qu'un paiement a été effectué via les options du calendrier de paiement ci-dessus"
|
751 |
-
|
752 |
-
#: productvendor\classes\admin\settings\classes\sf-class-format-options.php:207
|
753 |
-
msgid "Select a page..."
|
754 |
-
msgstr "Choisir une page..."
|
755 |
-
|
756 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:149
|
757 |
-
#: productvendor\views\dashboard\settings\settings.php:1
|
758 |
-
msgid "Settings"
|
759 |
-
msgstr "Parametres"
|
760 |
-
|
761 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:282
|
762 |
-
msgid "Could not load settings at: "
|
763 |
-
msgstr "Impossible de charger les parametres à l'adresse:"
|
764 |
-
|
765 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:282
|
766 |
-
msgid "Error - WP Settings Framework"
|
767 |
-
msgstr "Error - WP Settings Framework"
|
768 |
-
|
769 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:347
|
770 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:73
|
771 |
-
msgid "Settings saved."
|
772 |
-
msgstr "Parametres sauvegarder"
|
773 |
-
|
774 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:460
|
775 |
-
#, php-format
|
776 |
-
msgid "Save %s changes"
|
777 |
-
msgstr "Changements sauver %s"
|
778 |
-
|
779 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:46
|
780 |
-
msgid "Your PayPal address is not a valid email address."
|
781 |
-
msgstr "Votre E-mail PayPal n'est pas valide."
|
782 |
-
|
783 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:55
|
784 |
-
msgid "That shop name is already taken. Your shop name must be unique."
|
785 |
-
msgstr "Ce nom de la boutique est déjà pris. Votre nom de la boutique doit être unique."
|
786 |
-
|
787 |
-
#: productvendor\classes\front\orders\class-export-csv.php:35
|
788 |
-
msgid "Extra data"
|
789 |
-
msgstr "Extra data"
|
790 |
-
|
791 |
-
#: productvendor\classes\front\orders\class-export-csv.php:36
|
792 |
-
#: productvendor\views\dashboard\reports.php:18
|
793 |
-
msgid "Quantity"
|
794 |
-
msgstr "Quantité"
|
795 |
-
|
796 |
-
#: productvendor\classes\front\orders\class-orders.php:98
|
797 |
-
msgid "You haven't selected a product's orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you'd like to view."
|
798 |
-
msgstr "Vous n'avez pas choisi les commandes d'un produit a voir ! S'il vous plaît revenir au tableau de bord du vendeur et cliquez sur Afficher les commandes du produit que vous souhaitez consulter."
|
799 |
-
|
800 |
-
#: productvendor\classes\front\orders\class-orders.php:102
|
801 |
-
msgid "No orders."
|
802 |
-
msgstr "Pas de Commandes"
|
803 |
-
|
804 |
-
#: productvendor\classes\front\orders\class-orders.php:135
|
805 |
-
#: productvendor\classes\front\orders\class-orders.php:136
|
806 |
-
msgid "Tracking number"
|
807 |
-
msgstr "Numero de suivi"
|
808 |
-
|
809 |
-
#: productvendor\classes\front\orders\class-orders.php:138
|
810 |
-
msgid "Success. Your tracking number has been updated."
|
811 |
-
msgstr "Succes. Votre numéro de suivi a ete mis a jour"
|
812 |
-
|
813 |
-
#: productvendor\classes\front\orders\class-orders.php:197
|
814 |
-
msgid "Full name"
|
815 |
-
msgstr "Nom Complet"
|
816 |
-
|
817 |
-
#: productvendor\classes\front\orders\class-orders.php:198
|
818 |
-
msgid "Address"
|
819 |
-
msgstr "Adresse"
|
820 |
-
|
821 |
-
#: productvendor\classes\front\orders\class-orders.php:199
|
822 |
-
msgid "City"
|
823 |
-
msgstr "Ville"
|
824 |
-
|
825 |
-
#: productvendor\classes\front\orders\class-orders.php:200
|
826 |
-
msgid "State"
|
827 |
-
msgstr "Etat"
|
828 |
-
|
829 |
-
#: productvendor\classes\front\orders\class-orders.php:201
|
830 |
-
msgid "Zip"
|
831 |
-
msgstr "Code Postal "
|
832 |
-
|
833 |
-
#: productvendor\classes\front\orders\class-orders.php:202
|
834 |
-
msgid "Email address"
|
835 |
-
msgstr "Adresse Email"
|
836 |
-
|
837 |
-
#: productvendor\classes\front\orders\class-submit-comment.php:40
|
838 |
-
msgid "You've left the comment field empty!"
|
839 |
-
msgstr "Vous avez laissé le champ de commentaire vide!"
|
840 |
-
|
841 |
-
#: productvendor\classes\front\orders\class-submit-comment.php:61
|
842 |
-
msgid "Success. The customer has been notified of your comment."
|
843 |
-
msgstr "Succès. Le client a été avisé de votre commentaire."
|
844 |
-
|
845 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:40
|
846 |
-
#: productvendor\views\dashboard\denied.php:16
|
847 |
-
msgid "Apply to become a vendor?"
|
848 |
-
msgstr "Postuler pour devenir vendeur ?"
|
849 |
-
|
850 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:46
|
851 |
-
#: productvendor\views\dashboard\denied.php:23
|
852 |
-
#, php-format
|
853 |
-
msgid "I have read and accepted the <a href=\"%s\">terms and conditions</a>"
|
854 |
-
msgstr "J'ai lu et accepté <a href=\"%s\">les termes et conditions</a>"
|
855 |
-
|
856 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:80
|
857 |
-
msgid "Application denied. You are an administrator."
|
858 |
-
msgstr "Demande rejetée. Vous êtes un administrateur."
|
859 |
-
|
860 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:82
|
861 |
-
msgid "Your application has been submitted."
|
862 |
-
msgstr "Votre demande a été soumise."
|
863 |
-
|
864 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:118
|
865 |
-
msgid "You must accept the terms and conditions to become a vendor."
|
866 |
-
msgstr "Vous devez accepter les termes et conditions pour devenir un vendeur."
|
867 |
-
|
868 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:39
|
869 |
-
msgid "PayPal Adaptive Payments"
|
870 |
-
msgstr "PayPal Adaptive Payments"
|
871 |
-
|
872 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:115
|
873 |
-
#, php-format
|
874 |
-
msgid "Something went wrong. Response from PayPal invalidated this order. Status: %s."
|
875 |
-
msgstr "Something went wrong. Response from PayPal invalidated this order. Status: %s."
|
876 |
-
|
877 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:120
|
878 |
-
msgid "IPN payment completed"
|
879 |
-
msgstr "IPN payment completed"
|
880 |
-
|
881 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:142
|
882 |
-
msgid "Enable PayPal Adaptive Payments"
|
883 |
-
msgstr "Activer PayPal Adaptive Payments"
|
884 |
-
|
885 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:148
|
886 |
-
msgid "Method Title"
|
887 |
-
msgstr "Titre de la méthode"
|
888 |
-
|
889 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:149
|
890 |
-
msgid "This controls the title which the user sees during checkout."
|
891 |
-
msgstr "Contrôle du titre que voit l'utilisateur lors de la commande."
|
892 |
-
|
893 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:150
|
894 |
-
msgid "PayPal"
|
895 |
-
msgstr "PayPal"
|
896 |
-
|
897 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:155
|
898 |
-
msgid "Description"
|
899 |
-
msgstr "Description"
|
900 |
-
|
901 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:156
|
902 |
-
msgid "This controls the description which the user sees during checkout."
|
903 |
-
msgstr "Contrôle la description que voit l'utilisateur lors de la commande."
|
904 |
-
|
905 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:157
|
906 |
-
msgid "Pay via PayPal!"
|
907 |
-
msgstr "Payer via Paypal!"
|
908 |
-
|
909 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:168
|
910 |
-
msgid "Live Credentials"
|
911 |
-
msgstr "Certificats en ligne"
|
912 |
-
|
913 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:170
|
914 |
-
#, php-format
|
915 |
-
msgid "You must have an <a href=\"%s\">Application ID</a> to process live transactions. You do not need one for testing in Sandbox mode."
|
916 |
-
msgstr "You must have an <a href=\"%s\">Application ID</a> to process live transactions. You do not need one for testing in Sandbox mode."
|
917 |
-
|
918 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:175
|
919 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:209
|
920 |
-
msgid "PayPal Email"
|
921 |
-
msgstr "Email PayPal"
|
922 |
-
|
923 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:176
|
924 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:210
|
925 |
-
msgid "The email address main payments should go to."
|
926 |
-
msgstr "L'email principal de paiement"
|
927 |
-
|
928 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:181
|
929 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:215
|
930 |
-
msgid "API Username"
|
931 |
-
msgstr "API Username"
|
932 |
-
|
933 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:186
|
934 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:220
|
935 |
-
msgid "API Password"
|
936 |
-
msgstr "API Password"
|
937 |
-
|
938 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:191
|
939 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:225
|
940 |
-
msgid "API Signature"
|
941 |
-
msgstr "API Signature"
|
942 |
-
|
943 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:196
|
944 |
-
msgid "Application ID"
|
945 |
-
msgstr "Application ID"
|
946 |
-
|
947 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:198
|
948 |
-
msgid "Only required when doing live transactions."
|
949 |
-
msgstr "N'est nécessaire que lorsque vous effectuez des transactions en direct."
|
950 |
-
|
951 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:202
|
952 |
-
msgid "Sandbox Credentials"
|
953 |
-
msgstr "Sandbox Credentials"
|
954 |
-
|
955 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:204
|
956 |
-
#, php-format
|
957 |
-
msgid "You can signup for a sandbox developer account <a href=\"%s\">here</a>. You need a developer account if you want to enable Sandbox mode for testing."
|
958 |
-
msgstr "You can signup for a sandbox developer account <a href=\"%s\">here</a>. You need a developer account if you want to enable Sandbox mode for testing."
|
959 |
-
|
960 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:236
|
961 |
-
msgid "Misc. Settings"
|
962 |
-
msgstr "Misc. Settings"
|
963 |
-
|
964 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:241
|
965 |
-
msgid "Enable PayPal Sandbox mode"
|
966 |
-
msgstr "Activer le mode PayPal Sandbox"
|
967 |
-
|
968 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:247
|
969 |
-
msgid "Enable logging"
|
970 |
-
msgstr "Activer logging"
|
971 |
-
|
972 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:264
|
973 |
-
msgid "The PayPal Adaptive Payments gateway can instantly pay your vendors their due commission (if enabled). Also used to mass pay vendors on a schedule / manual method (if enabled)."
|
974 |
-
msgstr "The PayPal Adaptive Payments gateway can instantly pay your vendors their due commission (if enabled). Also used to mass pay vendors on a schedule / manual method (if enabled)."
|
975 |
-
|
976 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:265
|
977 |
-
#, php-format
|
978 |
-
msgid "<b>Important:</b> Unless you're using the <a href=\"%s\">beta version of TRS2</a>, all shipping costs will be given to the shop admin. Vendors will not receive shipping costs."
|
979 |
-
msgstr "<b>Important:</b> Unless you're using the <a href=\"%s\">beta version of TRS2</a>, all shipping costs will be given to the shop admin. Vendors will not receive shipping costs."
|
980 |
-
|
981 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:275
|
982 |
-
msgid "Gateway Disabled"
|
983 |
-
msgstr "Gateway Disabled"
|
984 |
-
|
985 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:275
|
986 |
-
#, php-format
|
987 |
-
msgid "%s does not support your store currency."
|
988 |
-
msgstr "%s does not support your store currency."
|
989 |
-
|
990 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:361
|
991 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:469
|
992 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:147
|
993 |
-
#, php-format
|
994 |
-
msgid "Error: %s"
|
995 |
-
msgstr "Erreur: %s"
|
996 |
-
|
997 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:369
|
998 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:370
|
999 |
-
#, php-format
|
1000 |
-
msgid "Error ID: %s. %s"
|
1001 |
-
msgstr "Erreur ID: %s. %s"
|
1002 |
-
|
1003 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:113
|
1004 |
-
msgid "No vendors found to pay. Maybe they haven't set a PayPal address?"
|
1005 |
-
msgstr "Pas de vendeurs trouvés à payer. Peut-être qu'ils n'ont pas défini une adresse PayPal?"
|
1006 |
-
|
1007 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:160
|
1008 |
-
msgid "All due commission has been paid for."
|
1009 |
-
msgstr "Toutes les commissions ont été payée."
|
1010 |
-
|
1011 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:166
|
1012 |
-
msgid "All due commission has been paid for, but I could not clear it from their profiles due to an internal error. Commission will still be listed as due. Please manually mark the commission as paid from the Commissions page."
|
1013 |
-
msgstr "Toutes les commission ont été payé, mais je ne pouvais pas le faire disparaître de leurs profils en raison d'une erreur interne. Les commissions seront toujours listé comme a payer. S'il vous plaît marquer manuellement les commissions comme payés à la page des commissions."
|
1014 |
-
|
1015 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:200
|
1016 |
-
msgid "WooCommerce: Mass payments for vendors update"
|
1017 |
-
msgstr "WooCommerce: paiements en masse mise à jour des vendeurs"
|
1018 |
-
|
1019 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:202
|
1020 |
-
msgid "Hello! A payment was just triggered to mass pay all vendors their due commission."
|
1021 |
-
msgstr "Bonjour! Un paiement a été déclenché pour payer tous les vendeurs leurs commissions dues."
|
1022 |
-
|
1023 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:203
|
1024 |
-
#, php-format
|
1025 |
-
msgid "Payment status: %s."
|
1026 |
-
msgstr "Statut Payement: %s."
|
1027 |
-
|
1028 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:204
|
1029 |
-
#, php-format
|
1030 |
-
msgid "Payment message: %s."
|
1031 |
-
msgstr "Message Payement: %s."
|
1032 |
-
|
1033 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:207
|
1034 |
-
#, php-format
|
1035 |
-
msgid "Payment total: %s."
|
1036 |
-
msgstr "Payement total: %s."
|
1037 |
-
|
1038 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:137
|
1039 |
-
msgid "The plugin has been updated, but could not be reactivated. Please reactivate it manually."
|
1040 |
-
msgstr "The plugin has been updated, but could not be reactivated. Please reactivate it manually."
|
1041 |
-
|
1042 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:138
|
1043 |
-
msgid "Plugin reactivated successfully."
|
1044 |
-
msgstr "Plugin réactivé avec succès."
|
1045 |
-
|
1046 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:229
|
1047 |
-
msgid "MGates.me Updates"
|
1048 |
-
msgstr "Mises a jour MGates.me"
|
1049 |
-
|
1050 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:259
|
1051 |
-
msgid "MGates.me Plugin Updater"
|
1052 |
-
msgstr "MGates.me Plugin Updater"
|
1053 |
-
|
1054 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:270
|
1055 |
-
msgid "Enter your license key to automatically receive updates."
|
1056 |
-
msgstr "Entrez votre numéro de licence afin de recevoir automatiquement les mises à jour."
|
1057 |
-
|
1058 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:295
|
1059 |
-
#: productvendor\views\dashboard\settings\settings.php:46
|
1060 |
-
msgid "Save"
|
1061 |
-
msgstr "Sauvegarder"
|
1062 |
-
|
1063 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:296
|
1064 |
-
msgid "Check for updates <b>now</b>"
|
1065 |
-
msgstr "Check for updates <b>now</b>"
|
1066 |
-
|
1067 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:323
|
1068 |
-
#, php-format
|
1069 |
-
msgid "<b style=\"color: #468847;\">Key deactivated.</b> License key for <i>%s</i> has been <b>deactivated</b>."
|
1070 |
-
msgstr "<b style=\"color: #468847;\">Key deactivated.</b> License key for <i>%s</i> has been <b>deactivated</b>."
|
1071 |
-
|
1072 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:325
|
1073 |
-
#, php-format
|
1074 |
-
msgid "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> could not be deactivated."
|
1075 |
-
msgstr "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> could not be deactivated."
|
1076 |
-
|
1077 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:333
|
1078 |
-
#, php-format
|
1079 |
-
msgid "<b style=\"color: #468847;\">Key activated.</b> License key for <i>%s</i> has been <b>activated</b>."
|
1080 |
-
msgstr "<b style=\"color: #468847;\">Key activated.</b> License key for <i>%s</i> has been <b>activated</b>."
|
1081 |
-
|
1082 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:335
|
1083 |
-
#, php-format
|
1084 |
-
msgid "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> is invalid."
|
1085 |
-
msgstr "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> is invalid."
|
1086 |
-
|
1087 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:370
|
1088 |
-
msgid "Enable MGates.me Plugin Updates."
|
1089 |
-
msgstr "Authoriser les mises a jour des plugin MGates.me."
|
1090 |
-
|
1091 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:372
|
1092 |
-
#, php-format
|
1093 |
-
msgid "<a href=\"%1$s\">Add your license keys</a> to enable automatic plugin updates."
|
1094 |
-
msgstr "<a href=\"%1$s\">Add your license keys</a> to enable automatic plugin updates."
|
1095 |
-
|
1096 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:379
|
1097 |
-
msgid "Hide This Message"
|
1098 |
-
msgstr "Masquer ce message"
|
1099 |
-
|
1100 |
-
#: productvendor\views\dashboard\denied.php:5
|
1101 |
-
msgid "Your account has not yet been approved to become a vendor."
|
1102 |
-
msgstr "Votre compte n'a pas encore été approuvé pour devenir Vendeur."
|
1103 |
-
|
1104 |
-
#: productvendor\views\dashboard\denied.php:9
|
1105 |
-
msgid "Your account is not vendor capable."
|
1106 |
-
msgstr "Votre compte n'a pas les authorisations vendeur."
|
1107 |
-
|
1108 |
-
#: productvendor\views\dashboard\denied.php:42
|
1109 |
-
msgid "Submit"
|
1110 |
-
msgstr "Soumettre"
|
1111 |
-
|
1112 |
-
#: productvendor\views\dashboard\links.php:1
|
1113 |
-
msgid "Control Center"
|
1114 |
-
msgstr "Mon Espace"
|
1115 |
-
|
1116 |
-
#: productvendor\views\dashboard\links.php:3
|
1117 |
-
msgid "My shop"
|
1118 |
-
msgstr "Ma boutique"
|
1119 |
-
|
1120 |
-
#: productvendor\views\dashboard\links.php:7
|
1121 |
-
msgid "My settings"
|
1122 |
-
msgstr "Mes parametres"
|
1123 |
-
|
1124 |
-
#: productvendor\views\dashboard\links.php:13
|
1125 |
-
msgid "Submit a product"
|
1126 |
-
msgstr "Soumettre un produit"
|
1127 |
-
|
1128 |
-
#: productvendor\views\dashboard\reports.php:1
|
1129 |
-
msgid "Sales Report"
|
1130 |
-
msgstr "Rapport de vente"
|
1131 |
-
|
1132 |
-
#: productvendor\views\dashboard\reports.php:20
|
1133 |
-
msgid "Rate"
|
1134 |
-
msgstr "Taux"
|
1135 |
-
|
1136 |
-
#: productvendor\views\dashboard\reports.php:43
|
1137 |
-
msgid "Show Orders"
|
1138 |
-
msgstr "Voir Commandes"
|
1139 |
-
|
1140 |
-
#: productvendor\views\dashboard\reports.php:51
|
1141 |
-
msgid "Totals"
|
1142 |
-
msgstr "Totales"
|
1143 |
-
|
1144 |
-
#: productvendor\views\dashboard\reports.php:64
|
1145 |
-
msgid "You have no sales during this period."
|
1146 |
-
msgstr "Vous n'avez pas de ventes au cours de cette période."
|
1147 |
-
|
1148 |
-
#: productvendor\views\dashboard\reports.php:72
|
1149 |
-
msgid "You haven't made any sales yet."
|
1150 |
-
msgstr "Vous n'avez pas encore fait de vente."
|
1151 |
-
|
1152 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:2
|
1153 |
-
msgid "PayPal Address"
|
1154 |
-
msgstr "Adresse Email Paypal"
|
1155 |
-
|
1156 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:3
|
1157 |
-
msgid "Your PayPal address is used to send you your commission."
|
1158 |
-
msgstr "Votre adresse PayPal est utilisée pour vous payer votre commission."
|
1159 |
-
|
1160 |
-
#: productvendor\views\dashboard\settings\seller-info.php:3
|
1161 |
-
msgid "This is displayed on each of your products."
|
1162 |
-
msgstr "Ce message s'affiche sur chacun de vos produits."
|
1163 |
-
|
1164 |
-
#: productvendor\views\dashboard\settings\shop-description.php:2
|
1165 |
-
msgid "Shop Description"
|
1166 |
-
msgstr "Description de votre boutique"
|
1167 |
-
|
1168 |
-
#: productvendor\views\dashboard\settings\shop-description.php:3
|
1169 |
-
#, php-format
|
1170 |
-
msgid "This is displayed on your <a href=\"%s\">shop page</a>."
|
1171 |
-
msgstr "Ceci est affiché sur <a href=\"%s\">page boutique</a>. "
|
1172 |
-
|
1173 |
-
#: productvendor\views\dashboard\settings\shop-name.php:2
|
1174 |
-
msgid "Shop Name"
|
1175 |
-
msgstr "Nom de votre boutique"
|
1176 |
-
|
1177 |
-
#: productvendor\views\dashboard\settings\shop-name.php:3
|
1178 |
-
msgid "Your shop name is public and must be unique."
|
1179 |
-
msgstr "Le nom de votre boutique est publique et doit être unique."
|
1180 |
-
|
1181 |
-
#: productvendor\views\emails\application-status.php:5
|
1182 |
-
#, php-format
|
1183 |
-
msgid "Hi there. This is a notification about a vendor application on %s."
|
1184 |
-
msgstr "Hello. Il s'agit d'une notification pour une demande de vendeur sur% s."
|
1185 |
-
|
1186 |
-
#: productvendor\views\emails\application-status.php:8
|
1187 |
-
#, php-format
|
1188 |
-
msgid "Application status: %s"
|
1189 |
-
msgstr "Statut du Candidat: %s"
|
1190 |
-
|
1191 |
-
#: productvendor\views\emails\application-status.php:9
|
1192 |
-
#, php-format
|
1193 |
-
msgid "Applicant username: %s"
|
1194 |
-
msgstr "Nom d'utilisateur du Candidat: %s"
|
1195 |
-
|
1196 |
-
#: productvendor\views\emails\new-product.php:5
|
1197 |
-
#, php-format
|
1198 |
-
msgid "Hi there. This is a notification about a new product on %s."
|
1199 |
-
msgstr "Hello. Il s'agit d'une notification a propos d'un nouveau produit sur% s."
|
1200 |
-
|
1201 |
-
#: productvendor\views\emails\new-product.php:8
|
1202 |
-
#, php-format
|
1203 |
-
msgid "Product title: %s"
|
1204 |
-
msgstr "Titre du Produit: %s"
|
1205 |
-
|
1206 |
-
#: productvendor\views\emails\new-product.php:9
|
1207 |
-
#, php-format
|
1208 |
-
msgid "Submitted by: %s"
|
1209 |
-
msgstr "Soumis par: %s"
|
1210 |
-
|
1211 |
-
#: productvendor\views\emails\new-product.php:10
|
1212 |
-
#, php-format
|
1213 |
-
msgid "Edit product: %s"
|
1214 |
-
msgstr "Editer produit: %s"
|
1215 |
-
|
1216 |
-
#: productvendor\views\orders\csv-export.php:6
|
1217 |
-
msgid "Export orders"
|
1218 |
-
msgstr "Export Commandes"
|
1219 |
-
|
1220 |
-
#: productvendor\views\orders\orders.php:82
|
1221 |
-
#, php-format
|
1222 |
-
msgid "Comments (%s)"
|
1223 |
-
msgstr "Commentaires (%s)"
|
1224 |
-
|
1225 |
-
#: productvendor\views\orders\table-body.php:25
|
1226 |
-
#, php-format
|
1227 |
-
msgid "Quantity: %d"
|
1228 |
-
msgstr "Quantité: %d"
|
1229 |
-
|
1230 |
-
#: productvendor\views\orders\comments\add-new-comment.php:10
|
1231 |
-
msgid "Add comment"
|
1232 |
-
msgstr "Ajouter Commentaire"
|
1233 |
-
|
1234 |
-
#: productvendor\views\orders\comments\existing-comments.php:9
|
1235 |
-
#, php-format
|
1236 |
-
msgid "added %s ago"
|
1237 |
-
msgstr "Ajouter il y a %s"
|
1238 |
-
|
1239 |
-
#: productvendor\views\orders\customer-note\customer-note.php:4
|
1240 |
-
msgid "Customer note"
|
1241 |
-
msgstr "Note de l'acheteur"
|
1242 |
-
|
1243 |
-
#: productvendor\views\orders\customer-note\customer-note.php:8
|
1244 |
-
msgid "No customer note."
|
1245 |
-
msgstr "Pas de note de l'acheteur"
|
1246 |
-
|
1247 |
-
#: productvendor\views\orders\shipping\shipping-form.php:46
|
1248 |
-
msgid "Provider:"
|
1249 |
-
msgstr "Fournisseur"
|
1250 |
-
|
1251 |
-
#: productvendor\views\orders\shipping\shipping-form.php:48
|
1252 |
-
msgid "Custom Provider"
|
1253 |
-
msgstr "Fournisseur personnalisé"
|
1254 |
-
|
1255 |
-
#: productvendor\views\orders\shipping\shipping-form.php:68
|
1256 |
-
msgid "Provider Name:"
|
1257 |
-
msgstr "Nom du fournisseur:"
|
1258 |
-
|
1259 |
-
#: productvendor\views\orders\shipping\shipping-form.php:76
|
1260 |
-
msgid "Tracking number:"
|
1261 |
-
msgstr "Numéro de suivi:"
|
1262 |
-
|
1263 |
-
#: productvendor\views\orders\shipping\shipping-form.php:84
|
1264 |
-
msgid "Tracking link:"
|
1265 |
-
msgstr "Lien de suivi:"
|
1266 |
-
|
1267 |
-
#: productvendor\views\orders\shipping\shipping-form.php:93
|
1268 |
-
msgid "Date shipped:"
|
1269 |
-
msgstr "Date de l'expédition:"
|
1270 |
-
|
1271 |
-
#: productvendor\views\orders\shipping\shipping-form.php:101
|
1272 |
-
msgid "Preview:"
|
1273 |
-
msgstr "Aperçu:"
|
1274 |
-
|
1275 |
-
#: productvendor\views\orders\shipping\shipping-form.php:101
|
1276 |
-
msgid "Click here to track your shipment"
|
1277 |
-
msgstr "Cliquez ici pour votre numero de tracking"
|
1278 |
-
|
1279 |
-
#: productvendor\views\orders\shipping\shipping-form.php:109
|
1280 |
-
msgid "Update tracking number"
|
1281 |
-
msgstr "Update numéro de tracking"
|
1282 |
-
|
1283 |
-
#: productvendor\views\orders\shipping\shipping-form.php:110
|
1284 |
-
msgid "Mark as shipped"
|
1285 |
-
msgstr "Marquer comme envoyé"
|
1286 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WCVendors/languages/wc_vendors-it_IT.mo
DELETED
Binary file
|
WCVendors/languages/wc_vendors-it_IT.po
DELETED
@@ -1,1288 +0,0 @@
|
|
1 |
-
# Woocommerce translation strings
|
2 |
-
# Copyright (C) 2011-2012
|
3 |
-
# This file is distributed under the same license as the Woocommerce package.
|
4 |
-
# Last Updated: August 17, 2013.
|
5 |
-
msgid ""
|
6 |
-
msgstr ""
|
7 |
-
"Project-Id-Version: Woocommerce v1.0.1\n"
|
8 |
-
"Report-Msgid-Bugs-To: Woocommerce <info@Woocommerce.com>\n"
|
9 |
-
"POT-Creation-Date: 2013-08-17 07:57-0400\n"
|
10 |
-
"PO-Revision-Date: 2013-08-19 20:08-0500\n"
|
11 |
-
"Last-Translator: Matt Gates <info@mgates.me>\n"
|
12 |
-
"Language-Team: Pixeland <info@pixeland.it>\n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"X-Generator: Poedit 1.5.7\n"
|
17 |
-
"Language: Italiano\n"
|
18 |
-
"X-Poedit-SourceCharset: UTF-8\n"
|
19 |
-
|
20 |
-
#: class-product-vendor.php:57
|
21 |
-
#: productvendor\classes\admin\class-admin-users.php:296
|
22 |
-
msgid "Product Vendor"
|
23 |
-
msgstr "Product Vendor"
|
24 |
-
|
25 |
-
#: class-product-vendor.php:79
|
26 |
-
msgid "<b>Product Vendor is disabled</b>. Product Vendor requires WooCommerce v2.0.1."
|
27 |
-
msgstr "<b>Product Vendor è disabilitato</b>. Product Vendor richiede WooCommerce v2.0.1."
|
28 |
-
|
29 |
-
#: productvendor\classes\class-cron.php:86
|
30 |
-
#, php-format
|
31 |
-
msgid "Payment total: %s"
|
32 |
-
msgstr "Totale Pagamento: %s"
|
33 |
-
|
34 |
-
#: productvendor\classes\class-cron.php:143
|
35 |
-
msgid "Once Weekly"
|
36 |
-
msgstr "Una volta a settimana"
|
37 |
-
|
38 |
-
#: productvendor\classes\class-cron.php:148
|
39 |
-
msgid "Once every two weeks"
|
40 |
-
msgstr "Una volta ogni due settimane"
|
41 |
-
|
42 |
-
#: productvendor\classes\class-cron.php:153
|
43 |
-
msgid "Once a month"
|
44 |
-
msgstr "Una volta al mese"
|
45 |
-
|
46 |
-
#: productvendor\classes\class-install.php:99
|
47 |
-
#: productvendor\classes\class-install.php:250
|
48 |
-
msgid "Pending Vendor"
|
49 |
-
msgstr "Venditore in sospeso"
|
50 |
-
|
51 |
-
#: productvendor\classes\class-install.php:201
|
52 |
-
msgid "Vendor Dashboard"
|
53 |
-
msgstr "Dashboard venditore"
|
54 |
-
|
55 |
-
#: productvendor\classes\class-install.php:202
|
56 |
-
#: productvendor\classes\admin\settings\sf-options.php:130
|
57 |
-
msgid "Orders"
|
58 |
-
msgstr "Ordini"
|
59 |
-
|
60 |
-
#: productvendor\classes\class-install.php:203
|
61 |
-
msgid "Shop Settings"
|
62 |
-
msgstr "Impostazioni del negozio"
|
63 |
-
|
64 |
-
#: productvendor\classes\admin\class-admin-page.php:24
|
65 |
-
#: productvendor\classes\admin\class-admin-page.php:83
|
66 |
-
#: productvendor\classes\admin\class-admin-reports.php:323
|
67 |
-
#: productvendor\classes\admin\class-product-meta.php:139
|
68 |
-
#: productvendor\classes\admin\class-product-meta.php:155
|
69 |
-
#: productvendor\views\dashboard\reports.php:19
|
70 |
-
msgid "Commission"
|
71 |
-
msgstr "Commissione"
|
72 |
-
|
73 |
-
#: productvendor\classes\admin\class-admin-page.php:192
|
74 |
-
#: productvendor\classes\admin\class-admin-reports.php:161
|
75 |
-
#: productvendor\views\dashboard\reports.php:17
|
76 |
-
msgid "Product"
|
77 |
-
msgstr "Prodotto"
|
78 |
-
|
79 |
-
#: productvendor\classes\admin\class-admin-page.php:193
|
80 |
-
msgid "Order ID"
|
81 |
-
msgstr "ID ordine"
|
82 |
-
|
83 |
-
#: productvendor\classes\admin\class-admin-page.php:194
|
84 |
-
#: productvendor\classes\admin\class-admin-reports.php:162
|
85 |
-
#: productvendor\classes\admin\class-product-meta.php:38
|
86 |
-
msgid "Vendor"
|
87 |
-
msgstr "Venditore"
|
88 |
-
|
89 |
-
#: productvendor\classes\admin\class-admin-page.php:195
|
90 |
-
#: productvendor\classes\admin\class-admin-reports.php:163
|
91 |
-
#: productvendor\classes\admin\class-admin-reports.php:328
|
92 |
-
#: productvendor\classes\admin\class-admin-reports.php:352
|
93 |
-
msgid "Total"
|
94 |
-
msgstr "Totale"
|
95 |
-
|
96 |
-
#: productvendor\classes\admin\class-admin-page.php:196
|
97 |
-
#: productvendor\classes\admin\class-admin-reports.php:165
|
98 |
-
msgid "Status"
|
99 |
-
msgstr "Stato"
|
100 |
-
|
101 |
-
#: productvendor\classes\admin\class-admin-page.php:197
|
102 |
-
#: productvendor\classes\front\orders\class-orders.php:203
|
103 |
-
msgid "Date"
|
104 |
-
msgstr "Data"
|
105 |
-
|
106 |
-
#: productvendor\classes\admin\class-admin-page.php:232
|
107 |
-
msgid "Mark paid"
|
108 |
-
msgstr "Segna come pagato"
|
109 |
-
|
110 |
-
#: productvendor\classes\admin\class-admin-page.php:233
|
111 |
-
msgid "Mark due"
|
112 |
-
msgstr "Segna come dovuto"
|
113 |
-
|
114 |
-
#: productvendor\classes\admin\class-admin-page.php:234
|
115 |
-
msgid "Mark reversed"
|
116 |
-
msgstr "Segna come revocato"
|
117 |
-
|
118 |
-
#: productvendor\classes\admin\class-admin-page.php:249
|
119 |
-
msgid "Filter"
|
120 |
-
msgstr "Filtro"
|
121 |
-
|
122 |
-
#: productvendor\classes\admin\class-admin-page.php:282
|
123 |
-
msgid "Show all dates"
|
124 |
-
msgstr "Visualizza tutti i dati"
|
125 |
-
|
126 |
-
#: productvendor\classes\admin\class-admin-page.php:295
|
127 |
-
#, php-format
|
128 |
-
msgid "%1$s %2$d"
|
129 |
-
msgstr "%1$s %2$d"
|
130 |
-
|
131 |
-
#: productvendor\classes\admin\class-admin-page.php:321
|
132 |
-
msgid "Commission marked paid."
|
133 |
-
msgstr "Commissione segnata come pagata."
|
134 |
-
|
135 |
-
#: productvendor\classes\admin\class-admin-page.php:328
|
136 |
-
msgid "Commission marked due."
|
137 |
-
msgstr "Commissione segnata come dovuta."
|
138 |
-
|
139 |
-
#: productvendor\classes\admin\class-admin-page.php:335
|
140 |
-
msgid "Commission marked reversed."
|
141 |
-
msgstr "Commissione segnata come revocata."
|
142 |
-
|
143 |
-
#: productvendor\classes\admin\class-admin-reports.php:38
|
144 |
-
msgid "Product Vendors"
|
145 |
-
msgstr "Prodotto dei Venditori"
|
146 |
-
|
147 |
-
#: productvendor\classes\admin\class-admin-reports.php:41
|
148 |
-
msgid "Overview"
|
149 |
-
msgstr "Panoramica"
|
150 |
-
|
151 |
-
#: productvendor\classes\admin\class-admin-reports.php:47
|
152 |
-
msgid "Commission by vendor"
|
153 |
-
msgstr "Commissione del venditore"
|
154 |
-
|
155 |
-
#: productvendor\classes\admin\class-admin-reports.php:53
|
156 |
-
msgid "Commission by product"
|
157 |
-
msgstr "Commissione del prodotto"
|
158 |
-
|
159 |
-
#: productvendor\classes\admin\class-admin-reports.php:112
|
160 |
-
#: productvendor\views\dashboard\date-picker.php:3
|
161 |
-
msgid "From:"
|
162 |
-
msgstr "Da:"
|
163 |
-
|
164 |
-
#: productvendor\classes\admin\class-admin-reports.php:112
|
165 |
-
#: productvendor\views\dashboard\date-picker.php:6
|
166 |
-
msgid "To:"
|
167 |
-
msgstr "A:"
|
168 |
-
|
169 |
-
#: productvendor\classes\admin\class-admin-reports.php:112
|
170 |
-
#: productvendor\classes\admin\class-admin-reports.php:262
|
171 |
-
#: productvendor\views\dashboard\date-picker.php:9
|
172 |
-
msgid "Show"
|
173 |
-
msgstr "Mostra"
|
174 |
-
|
175 |
-
#: productvendor\classes\admin\class-admin-reports.php:123
|
176 |
-
msgid "Total paid in range"
|
177 |
-
msgstr "Totale pagato in gamma"
|
178 |
-
|
179 |
-
#: productvendor\classes\admin\class-admin-reports.php:125
|
180 |
-
#: productvendor\classes\admin\class-admin-reports.php:131
|
181 |
-
#: productvendor\classes\admin\class-admin-reports.php:137
|
182 |
-
msgid "n/a"
|
183 |
-
msgstr "n/a"
|
184 |
-
|
185 |
-
#: productvendor\classes\admin\class-admin-reports.php:129
|
186 |
-
msgid "Total due in range"
|
187 |
-
msgstr "Totale dovuto nel range"
|
188 |
-
|
189 |
-
#: productvendor\classes\admin\class-admin-reports.php:135
|
190 |
-
msgid "Total reversed in range"
|
191 |
-
msgstr "Totale invertita nel range"
|
192 |
-
|
193 |
-
#: productvendor\classes\admin\class-admin-reports.php:144
|
194 |
-
msgid "Recent Commission"
|
195 |
-
msgstr "Commissione Recente"
|
196 |
-
|
197 |
-
#: productvendor\classes\admin\class-admin-reports.php:160
|
198 |
-
#: productvendor\classes\front\orders\class-orders.php:196
|
199 |
-
msgid "Order"
|
200 |
-
msgstr "Ordine"
|
201 |
-
|
202 |
-
#: productvendor\classes\admin\class-admin-reports.php:164
|
203 |
-
msgid "Date & Time"
|
204 |
-
msgstr "Data & Orario"
|
205 |
-
|
206 |
-
#: productvendor\classes\admin\class-admin-reports.php:171
|
207 |
-
msgid "N/A"
|
208 |
-
msgstr "N/A"
|
209 |
-
|
210 |
-
#: productvendor\classes\admin\class-admin-reports.php:175
|
211 |
-
msgid "D j M Y \\a\\t h:ia"
|
212 |
-
msgstr "D j M Y \\a\\t h:ia"
|
213 |
-
|
214 |
-
#: productvendor\classes\admin\class-admin-reports.php:184
|
215 |
-
msgid "No commission yet"
|
216 |
-
msgstr "Nessuna commissione ancora"
|
217 |
-
|
218 |
-
#: productvendor\classes\admin\class-admin-reports.php:215
|
219 |
-
msgid "Show:"
|
220 |
-
msgstr "Mostra:"
|
221 |
-
|
222 |
-
#: productvendor\classes\admin\class-admin-reports.php:225
|
223 |
-
msgid "Search for a product…"
|
224 |
-
msgstr "Cerca un prodotto…"
|
225 |
-
|
226 |
-
#: productvendor\classes\admin\class-admin-reports.php:255
|
227 |
-
msgid "Select a vendor…"
|
228 |
-
msgstr "Seleziona un venditore…"
|
229 |
-
|
230 |
-
#: productvendor\classes\admin\class-admin-reports.php:322
|
231 |
-
msgid "Month"
|
232 |
-
msgstr "Mese"
|
233 |
-
|
234 |
-
#: productvendor\classes\admin\class-admin-reports.php:324
|
235 |
-
msgid "Tax"
|
236 |
-
msgstr "Tassa"
|
237 |
-
|
238 |
-
#: productvendor\classes\admin\class-admin-reports.php:325
|
239 |
-
#: productvendor\views\orders\orders.php:111
|
240 |
-
msgid "Shipping"
|
241 |
-
msgstr "Spedizione"
|
242 |
-
|
243 |
-
#: productvendor\classes\admin\class-admin-reports.php:326
|
244 |
-
msgid "Reversed"
|
245 |
-
msgstr "Revocato"
|
246 |
-
|
247 |
-
#: productvendor\classes\admin\class-admin-reports.php:327
|
248 |
-
msgid "Paid"
|
249 |
-
msgstr "Pagato"
|
250 |
-
|
251 |
-
#: productvendor\classes\admin\class-admin-users.php:305
|
252 |
-
msgid "Enable HTML for the shop description"
|
253 |
-
msgstr "Abilita l'Html per la descrizione del negozio"
|
254 |
-
|
255 |
-
#: productvendor\classes\admin\class-admin-users.php:311
|
256 |
-
msgid "Shop name"
|
257 |
-
msgstr "Nome del negozio"
|
258 |
-
|
259 |
-
#: productvendor\classes\admin\class-admin-users.php:316
|
260 |
-
msgid "PayPal E-mail"
|
261 |
-
msgstr "E-mail PayPal"
|
262 |
-
|
263 |
-
#: productvendor\classes\admin\class-admin-users.php:316
|
264 |
-
msgid "required"
|
265 |
-
msgstr "Richiesta"
|
266 |
-
|
267 |
-
#: productvendor\classes\admin\class-admin-users.php:321
|
268 |
-
msgid "Commission due"
|
269 |
-
msgstr "Commissione dovuta"
|
270 |
-
|
271 |
-
#: productvendor\classes\admin\class-admin-users.php:326
|
272 |
-
#: productvendor\classes\front\class-vendor-shop.php:58
|
273 |
-
#: productvendor\views\dashboard\settings\seller-info.php:2
|
274 |
-
msgid "Seller info"
|
275 |
-
msgstr "Informazioni venditore"
|
276 |
-
|
277 |
-
#: productvendor\classes\admin\class-admin-users.php:331
|
278 |
-
msgid "Shop description"
|
279 |
-
msgstr "Descrizione del negozio"
|
280 |
-
|
281 |
-
#: productvendor\classes\admin\class-admin-users.php:349
|
282 |
-
msgid "Commission Due"
|
283 |
-
msgstr "Commissione dovuta"
|
284 |
-
|
285 |
-
#: productvendor\classes\admin\class-product-meta.php:162
|
286 |
-
msgid "Leave blank for default"
|
287 |
-
msgstr "Lascia bianco di default"
|
288 |
-
|
289 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:25
|
290 |
-
msgid "Approve"
|
291 |
-
msgstr "Approva"
|
292 |
-
|
293 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:26
|
294 |
-
msgid "Deny"
|
295 |
-
msgstr "Nega"
|
296 |
-
|
297 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:70
|
298 |
-
msgid "Vendor has been <b>denied</b>."
|
299 |
-
msgstr "Il venditore <b>non è stato accettato</b>."
|
300 |
-
|
301 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:81
|
302 |
-
msgid "Vendor has been <b>approved</b>."
|
303 |
-
msgstr "Il venditore è stato <b>approvato</b>."
|
304 |
-
|
305 |
-
#: productvendor\classes\admin\class-vendor-applicants.php:94
|
306 |
-
msgid "Pending Vendors"
|
307 |
-
msgstr "Venditori in sospeso"
|
308 |
-
|
309 |
-
#: productvendor\classes\admin\emails\class-emails.php:85
|
310 |
-
#: productvendor\classes\front\class-vendor-cart.php:41
|
311 |
-
#: productvendor\classes\front\class-vendor-cart.php:60
|
312 |
-
msgid "Sold by"
|
313 |
-
msgstr "Venduto da"
|
314 |
-
|
315 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:27
|
316 |
-
msgid "Vendor Application"
|
317 |
-
msgstr "Richiesta venditore"
|
318 |
-
|
319 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:28
|
320 |
-
msgid "Vendor application will either be approved, denied, or pending."
|
321 |
-
msgstr "La richiesta del venditore sarà approvata, negata o messa in sospeso."
|
322 |
-
|
323 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:30
|
324 |
-
msgid "Application {status}"
|
325 |
-
msgstr "Richiesta {status}"
|
326 |
-
|
327 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:31
|
328 |
-
msgid "[{blogname}] Your vendor application has been {status}"
|
329 |
-
msgstr "[{blogname}] La tua richiesta del venditore è stata {status}"
|
330 |
-
|
331 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:115
|
332 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:120
|
333 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:224
|
334 |
-
msgid "Enable/Disable"
|
335 |
-
msgstr "Abilita/Disabilita"
|
336 |
-
|
337 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:117
|
338 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:122
|
339 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:226
|
340 |
-
msgid "Enable this email notification"
|
341 |
-
msgstr "Abilita questa notificazione email"
|
342 |
-
|
343 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:121
|
344 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:126
|
345 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:230
|
346 |
-
msgid "Subject"
|
347 |
-
msgstr "Soggetto"
|
348 |
-
|
349 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:123
|
350 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:128
|
351 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:232
|
352 |
-
#, php-format
|
353 |
-
msgid "This controls the email subject line. Leave blank to use the default subject: <code>%s</code>."
|
354 |
-
msgstr "Questo controlla la linea del soggetto dell'email. Lascia bianco per usare il soggetto di default: <code>%s</code>."
|
355 |
-
|
356 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:128
|
357 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:133
|
358 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:237
|
359 |
-
msgid "Email Heading"
|
360 |
-
msgstr "Testata email."
|
361 |
-
|
362 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:130
|
363 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:135
|
364 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:239
|
365 |
-
#, php-format
|
366 |
-
msgid "This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>."
|
367 |
-
msgstr "Questo controlla il contenuto della testata principale senza notificazione mail. Lascia bianco per usare la testata di default: <code>%s</code>."
|
368 |
-
|
369 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:135
|
370 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:140
|
371 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:244
|
372 |
-
msgid "Email type"
|
373 |
-
msgstr "Tipo email"
|
374 |
-
|
375 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:137
|
376 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:142
|
377 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:246
|
378 |
-
msgid "Choose which format of email to send."
|
379 |
-
msgstr "Scegli quale formato di email spedire."
|
380 |
-
|
381 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:141
|
382 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:146
|
383 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:250
|
384 |
-
msgid "Plain text"
|
385 |
-
msgstr "Testo normale"
|
386 |
-
|
387 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:142
|
388 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:147
|
389 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:251
|
390 |
-
msgid "HTML"
|
391 |
-
msgstr "HTML"
|
392 |
-
|
393 |
-
#: productvendor\classes\admin\emails\class-wc-approve-vendor.php:143
|
394 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:148
|
395 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:252
|
396 |
-
msgid "Multipart"
|
397 |
-
msgstr "Multipart"
|
398 |
-
|
399 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:27
|
400 |
-
msgid "New Vendor Product"
|
401 |
-
msgstr "Nuovo prodotto del venditore"
|
402 |
-
|
403 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:28
|
404 |
-
msgid "New order emails are sent when a new product is submitted by a vendor"
|
405 |
-
msgstr "Le email del nuovo ordine sono inviate quando un nuovo prodotto è inserito da un venditore."
|
406 |
-
|
407 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:30
|
408 |
-
msgid "New product submitted: {product_name}"
|
409 |
-
msgstr "Nuovo prodotto inserito: {product_name}"
|
410 |
-
|
411 |
-
#: productvendor\classes\admin\emails\class-wc-notify-admin.php:31
|
412 |
-
msgid "[{blogname}] New product submitted by {vendor_name} - {product_name}"
|
413 |
-
msgstr "[{blogname}] Nuovo prodotto inserito da {vendor_name} - {product_name}"
|
414 |
-
|
415 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:27
|
416 |
-
msgid "Notify vendors"
|
417 |
-
msgstr "Notifica venditori"
|
418 |
-
|
419 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:28
|
420 |
-
msgid "New order emails are sent when an order is received/paid by a customer."
|
421 |
-
msgstr "Le email dei nuovo ordine sono inviate quando un ordine è ricevuto/pagato da un cliente."
|
422 |
-
|
423 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:30
|
424 |
-
msgid "New customer order"
|
425 |
-
msgstr "Nuovo ordine del cliente"
|
426 |
-
|
427 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:31
|
428 |
-
msgid "[{blogname}] New customer order ({order_number}) - {order_date}"
|
429 |
-
msgstr "[{blogname}] Nuovo ordine del cliente ({order_number}) - {order_date}"
|
430 |
-
|
431 |
-
#: productvendor\classes\admin\emails\class-wc-notify-vendor.php:102
|
432 |
-
msgid "Commission Subtotal:"
|
433 |
-
msgstr "Subtotale commissione:"
|
434 |
-
|
435 |
-
#: productvendor\classes\admin\settings\sf-options.php:4
|
436 |
-
msgid "General"
|
437 |
-
msgstr "Generale"
|
438 |
-
|
439 |
-
#: productvendor\classes\admin\settings\sf-options.php:5
|
440 |
-
msgid "General options"
|
441 |
-
msgstr "Opzioni generali"
|
442 |
-
|
443 |
-
#: productvendor\classes\admin\settings\sf-options.php:8
|
444 |
-
msgid "Default commission (%)"
|
445 |
-
msgstr "Commissione di default (%)"
|
446 |
-
|
447 |
-
#: productvendor\classes\admin\settings\sf-options.php:9
|
448 |
-
msgid "The default rate the vendor receives for each product. If a product has a commission rate already set, this value will be ignored for that product."
|
449 |
-
msgstr "Il tasso di default che il venditore riceve per ogni prodotto. Se un prodotto ha un tasso di commissione già settato, questovalore sarà ignorato per quel prodotto."
|
450 |
-
|
451 |
-
#: productvendor\classes\admin\settings\sf-options.php:20
|
452 |
-
msgid "Registration"
|
453 |
-
msgstr "Registrazione"
|
454 |
-
|
455 |
-
#: productvendor\classes\admin\settings\sf-options.php:21
|
456 |
-
msgid "Allow users or guests to apply to become a vendor"
|
457 |
-
msgstr "Consentire agli utenti o agli ospiti di diventare venditori"
|
458 |
-
|
459 |
-
#: productvendor\classes\admin\settings\sf-options.php:22
|
460 |
-
msgid "This will show a checkbox on the My Account page's registration form asking if the user would like to apply to be a vendor. Also, on the Vendor Dashboard, users can apply to become a vendor."
|
461 |
-
msgstr "Questo mostrerà un checkbox sul modulo di registrazione della pagina del \"Mio account\" chiedendo se l'utente vuole fare domanda per essere venditore. Inoltre, sulla Dashboard del venditore, gli utenti possono diventare venditori."
|
462 |
-
|
463 |
-
#: productvendor\classes\admin\settings\sf-options.php:29
|
464 |
-
msgid "Approve vendor applications manually"
|
465 |
-
msgstr "Approva le richieste del venditore manualmente"
|
466 |
-
|
467 |
-
#: productvendor\classes\admin\settings\sf-options.php:30
|
468 |
-
msgid "With this unchecked, all vendor applications are automatically accepted. Otherwise, you must approve each manually."
|
469 |
-
msgstr "Con questo non spuntato, tutte le richieste del venditore sono automaticamente accettate. Diversamente, tu puoi approvarle manualmente."
|
470 |
-
|
471 |
-
#: productvendor\classes\admin\settings\sf-options.php:37
|
472 |
-
msgid "Taxes"
|
473 |
-
msgstr "Tasse"
|
474 |
-
|
475 |
-
#: productvendor\classes\admin\settings\sf-options.php:38
|
476 |
-
msgid "Give vendors any tax collected per-product"
|
477 |
-
msgstr "Dai ai venditori ogni tassa collezionata per prodotto"
|
478 |
-
|
479 |
-
#: productvendor\classes\admin\settings\sf-options.php:39
|
480 |
-
msgid "The tax collected on a vendor's product will be given to him in its entirety"
|
481 |
-
msgstr "La tassa raccolta sul prodotto del venditore sarà data a lui per intero"
|
482 |
-
|
483 |
-
#: productvendor\classes\admin\settings\sf-options.php:45
|
484 |
-
msgid "Shop options"
|
485 |
-
msgstr "Opzioni negozio"
|
486 |
-
|
487 |
-
#: productvendor\classes\admin\settings\sf-options.php:48
|
488 |
-
msgid "Shop HTML"
|
489 |
-
msgstr "HTML negozio"
|
490 |
-
|
491 |
-
#: productvendor\classes\admin\settings\sf-options.php:49
|
492 |
-
msgid "Enable HTML for a vendor's shop description by default"
|
493 |
-
msgstr "Abilita l'HTML per la descrizione del nogozio del venditore di default"
|
494 |
-
|
495 |
-
#: productvendor\classes\admin\settings\sf-options.php:56
|
496 |
-
msgid "Vendor shop page"
|
497 |
-
msgstr "Pagina del negozio del venditore"
|
498 |
-
|
499 |
-
#: productvendor\classes\admin\settings\sf-options.php:57
|
500 |
-
msgid "Eg: <code>yoursite.com/[your_setting_here]/[vendor_name_here]</code>"
|
501 |
-
msgstr "Eg: <code>tuosito.com/[your_setting_here]/[vendor_name_here]</code>"
|
502 |
-
|
503 |
-
#: productvendor\classes\admin\settings\sf-options.php:63
|
504 |
-
#: productvendor\classes\admin\settings\sf-options.php:188
|
505 |
-
msgid "Products"
|
506 |
-
msgstr "Prodotti"
|
507 |
-
|
508 |
-
#: productvendor\classes\admin\settings\sf-options.php:64
|
509 |
-
msgid "Product Add Page"
|
510 |
-
msgstr "Pagina aggiunta prodotto"
|
511 |
-
|
512 |
-
#: productvendor\classes\admin\settings\sf-options.php:64
|
513 |
-
msgid "Configure what to hide from all vendors when adding a product"
|
514 |
-
msgstr "Configura cosa nascondere a tutti i venditori quando aggiungono un prodotto"
|
515 |
-
|
516 |
-
#: productvendor\classes\admin\settings\sf-options.php:67
|
517 |
-
msgid "Left side panel"
|
518 |
-
msgstr "Pannello laterale sinistro"
|
519 |
-
|
520 |
-
#: productvendor\classes\admin\settings\sf-options.php:68
|
521 |
-
msgid "Hide these areas of the add product page for vendors"
|
522 |
-
msgstr "Nascondi queste aree di pagina aggiunta prodotto per i venditori"
|
523 |
-
|
524 |
-
#: productvendor\classes\admin\settings\sf-options.php:82
|
525 |
-
msgid "Types"
|
526 |
-
msgstr "Tipi"
|
527 |
-
|
528 |
-
#: productvendor\classes\admin\settings\sf-options.php:83
|
529 |
-
msgid "Hide these product types from the vendor"
|
530 |
-
msgstr "Nascondi questi tipi di prodotti al venditore"
|
531 |
-
|
532 |
-
#: productvendor\classes\admin\settings\sf-options.php:96
|
533 |
-
msgid "Type options"
|
534 |
-
msgstr "Opzioni di tipo"
|
535 |
-
|
536 |
-
#: productvendor\classes\admin\settings\sf-options.php:97
|
537 |
-
msgid "Hide these product options from the vendor"
|
538 |
-
msgstr "Nascondi queste opzioni del prodotto al venditore"
|
539 |
-
|
540 |
-
#: productvendor\classes\admin\settings\sf-options.php:108
|
541 |
-
msgid "Miscellaneous"
|
542 |
-
msgstr "Varie"
|
543 |
-
|
544 |
-
#: productvendor\classes\admin\settings\sf-options.php:119
|
545 |
-
msgid "Stylesheet"
|
546 |
-
msgstr "Foglio di stile"
|
547 |
-
|
548 |
-
#: productvendor\classes\admin\settings\sf-options.php:120
|
549 |
-
msgid "You can add CSS in this textarea, which will be loaded on the product add/edit page for vendors."
|
550 |
-
msgstr "Puoi aggiungere codice CSS in questa area di testo, che sarà caricato sulla pagina aggiungi/modifica dei venditori."
|
551 |
-
|
552 |
-
#: productvendor\classes\admin\settings\sf-options.php:126
|
553 |
-
msgid "Capabilities"
|
554 |
-
msgstr "Capacità"
|
555 |
-
|
556 |
-
#: productvendor\classes\admin\settings\sf-options.php:127
|
557 |
-
msgid "Permissions"
|
558 |
-
msgstr "Autorizzazioni"
|
559 |
-
|
560 |
-
#: productvendor\classes\admin\settings\sf-options.php:127
|
561 |
-
msgid "General permissions used around the shop"
|
562 |
-
msgstr "Autorizzazioni generali usati per il negozio"
|
563 |
-
|
564 |
-
#: productvendor\classes\admin\settings\sf-options.php:131
|
565 |
-
msgid "View orders"
|
566 |
-
msgstr "Visualizza ordini"
|
567 |
-
|
568 |
-
#: productvendor\classes\admin\settings\sf-options.php:132
|
569 |
-
msgid "Show customer details such as email, address, name, etc, for each order"
|
570 |
-
msgstr "Mostra i dettagli del cliente come email, indiizzo, nome, etc, per ogni ordine"
|
571 |
-
|
572 |
-
#: productvendor\classes\admin\settings\sf-options.php:139
|
573 |
-
msgid "View comments"
|
574 |
-
msgstr "Visualizza commenti"
|
575 |
-
|
576 |
-
#: productvendor\classes\admin\settings\sf-options.php:140
|
577 |
-
msgid "View all vendor comments for an order on the frontend"
|
578 |
-
msgstr "Visualizza tutti i commenti del venditore per un ordine sul frontend"
|
579 |
-
|
580 |
-
#: productvendor\classes\admin\settings\sf-options.php:147
|
581 |
-
msgid "Submit comments"
|
582 |
-
msgstr "Invia commenti"
|
583 |
-
|
584 |
-
#: productvendor\classes\admin\settings\sf-options.php:148
|
585 |
-
msgid "Submit comments for an order on the frontend. Eg, tracking ID for a product"
|
586 |
-
msgstr "Invia commenti per un ordine sul fronend. Eg, ID rilevamento per un prodotto"
|
587 |
-
|
588 |
-
#: productvendor\classes\admin\settings\sf-options.php:155
|
589 |
-
msgid "View email addresses"
|
590 |
-
msgstr "Visualizza indirizzi email"
|
591 |
-
|
592 |
-
#: productvendor\classes\admin\settings\sf-options.php:156
|
593 |
-
msgid "While viewing order details on the frontend, you can disable or enable email addresses"
|
594 |
-
msgstr "Durante la visualizzazione dei dettagli dell'ordine sul front-end, è possibile disabilitare o abilitare gli indirizzi email"
|
595 |
-
|
596 |
-
#: productvendor\classes\admin\settings\sf-options.php:163
|
597 |
-
msgid "Export a CSV file of orders for a product"
|
598 |
-
msgstr "Esporta un file CSV degli ordini per un prodotto"
|
599 |
-
|
600 |
-
#: productvendor\classes\admin\settings\sf-options.php:164
|
601 |
-
msgid "Vendors could export orders for a product on the frontend"
|
602 |
-
msgstr "I venditori possono esportare ordini per un prodotto sul fronted"
|
603 |
-
|
604 |
-
#: productvendor\classes\admin\settings\sf-options.php:171
|
605 |
-
msgid "Reports"
|
606 |
-
msgstr "Rapporti"
|
607 |
-
|
608 |
-
#: productvendor\classes\admin\settings\sf-options.php:172
|
609 |
-
msgid "View backend sales reports"
|
610 |
-
msgstr "Visualizza i rapporti delle vendite del backend"
|
611 |
-
|
612 |
-
#: productvendor\classes\admin\settings\sf-options.php:173
|
613 |
-
msgid "Graphs and tables via the Reports page in backend. The reports will only display sales data that pertain to their products"
|
614 |
-
msgstr "Grafici e tabelle tramite la pagina dei rapporti nel backend. I rapporti visualizzeranno solo i dati di vendita che appartengono ai loro prodotti"
|
615 |
-
|
616 |
-
#: productvendor\classes\admin\settings\sf-options.php:180
|
617 |
-
msgid "View Frontend sales reports"
|
618 |
-
msgstr "Visualizza i rapporti delle vendite del frontend"
|
619 |
-
|
620 |
-
#: productvendor\classes\admin\settings\sf-options.php:181
|
621 |
-
msgid "Sales table on the frontend on the My Account page. The table will only display sales data that pertain to their products"
|
622 |
-
msgstr "Tabella vendita sul frontend sulla pagina Mio Account . Nella tabella verranno visualizzati solo i dati di vendita che appartengono ai loro prodotti"
|
623 |
-
|
624 |
-
#: productvendor\classes\admin\settings\sf-options.php:189
|
625 |
-
msgid "Submit products"
|
626 |
-
msgstr "Invia prodotti"
|
627 |
-
|
628 |
-
#: productvendor\classes\admin\settings\sf-options.php:190
|
629 |
-
msgid "Vendors could submit a product through the backend, and an admin would approve or deny it"
|
630 |
-
msgstr "I venditori possono inviare un prodotto attraverso il backend, e un admin può approvarlo o negarlo"
|
631 |
-
|
632 |
-
#: productvendor\classes\admin\settings\sf-options.php:197
|
633 |
-
msgid "Edit live products"
|
634 |
-
msgstr "Modifica prodotti dal vivo"
|
635 |
-
|
636 |
-
#: productvendor\classes\admin\settings\sf-options.php:198
|
637 |
-
msgid "Vendors could edit an approved product after it has already gone live. There is no approval or review after editing a live product. This could be dangerous with malicious vendors, so take caution."
|
638 |
-
msgstr "I venditori possono modificare un prodotto approvato dopo che è già stato inserito. Non c'è alcuna approvazione o revisione dopo la modifica di un prodotto inserito. Questo potrebbe essere pericoloso con venditori scorretti, quindi di fare attenzione.\t"
|
639 |
-
|
640 |
-
#: productvendor\classes\admin\settings\sf-options.php:205
|
641 |
-
msgid "Submit products live without requiring approval"
|
642 |
-
msgstr "Inviare prodotti senza chiedere l'approvazione"
|
643 |
-
|
644 |
-
#: productvendor\classes\admin\settings\sf-options.php:206
|
645 |
-
msgid "Vendors can submit products without review or approval from a shop admin. This could be dangerous with malicious vendors, so take caution."
|
646 |
-
msgstr "I venditori possono inviare prodotti senza revisione e approvazione da parte di un amministratore di negozio. Questo potrebbe essere pericoloso con venditori scorretti, quindi di fare attenzione."
|
647 |
-
|
648 |
-
#: productvendor\classes\admin\settings\sf-options.php:212
|
649 |
-
msgid "Pages"
|
650 |
-
msgstr "Pagine"
|
651 |
-
|
652 |
-
#: productvendor\classes\admin\settings\sf-options.php:213
|
653 |
-
msgid "Page configuration"
|
654 |
-
msgstr "Configurazione pagina"
|
655 |
-
|
656 |
-
#: productvendor\classes\admin\settings\sf-options.php:216
|
657 |
-
msgid "Vendor dashboard"
|
658 |
-
msgstr "Dashboard venditore"
|
659 |
-
|
660 |
-
#: productvendor\classes\admin\settings\sf-options.php:217
|
661 |
-
msgid "Choose the page that has the shortcode <code>[pv_vendor_dashboard]</code><br/>By default, My Account > Vendor Dashboard should have the shortcode."
|
662 |
-
msgstr "Scegli la pagina che ha lo shortcode <code>[pv_vendor_dashboard]</code><br/>Di default, Mio Account > Dashboard venditore dovrebbe avere lo shortcode."
|
663 |
-
|
664 |
-
#: productvendor\classes\admin\settings\sf-options.php:224
|
665 |
-
msgid "Shop settings"
|
666 |
-
msgstr "Impostazioni del negozio"
|
667 |
-
|
668 |
-
#: productvendor\classes\admin\settings\sf-options.php:225
|
669 |
-
msgid "Choose the page that has the shortcode <code>[pv_shop_settings]</code><br/>These are the shop settings a vendor can configure."
|
670 |
-
msgstr "Scegli la pagina che ha lo shortcode <code>[pv_shop_settings]</code><br/>Queste sono le impostazioni del negozio che un venditore può configurare."
|
671 |
-
|
672 |
-
#: productvendor\classes\admin\settings\sf-options.php:232
|
673 |
-
msgid "Orders page"
|
674 |
-
msgstr "Pagina ordini"
|
675 |
-
|
676 |
-
#: productvendor\classes\admin\settings\sf-options.php:233
|
677 |
-
msgid "Choose the page that has the shortcode <code>[pv_orders]</code><br/>By default, My Account > Orders should have the shortcode."
|
678 |
-
msgstr "Scegli la pagina che ha lo shortcode <code>[pv_orders]</code><br/>Di default, Mio Account > Ordini dovrebbe avere lo shortcode."
|
679 |
-
|
680 |
-
#: productvendor\classes\admin\settings\sf-options.php:240
|
681 |
-
msgid "Vendor terms"
|
682 |
-
msgstr "Termini venditore"
|
683 |
-
|
684 |
-
#: productvendor\classes\admin\settings\sf-options.php:241
|
685 |
-
msgid "These terms are shown to a user when submitting an application to become a vendor.<br/>If left blank, no terms will be shown to the applicant."
|
686 |
-
msgstr "Questi termini sono indicati ad un utente quando invia una richiesta per diventare un venditore. <br/>Se lasciato vuoto, nessun termine verrà mostrato al richiedente."
|
687 |
-
|
688 |
-
#: productvendor\classes\admin\settings\sf-options.php:259
|
689 |
-
msgid "Payments"
|
690 |
-
msgstr "Pagamenti"
|
691 |
-
|
692 |
-
#: productvendor\classes\admin\settings\sf-options.php:260
|
693 |
-
msgid "User payments"
|
694 |
-
msgstr "Pagamenti utente"
|
695 |
-
|
696 |
-
#: productvendor\classes\admin\settings\sf-options.php:261
|
697 |
-
#, php-format
|
698 |
-
msgid "Total commission currently due: %s. <a href=\"%s\">View details</a>."
|
699 |
-
msgstr "Totale Commissione attualmente dovuto: %s. <a href=\"%s\">Visualizzare i dettagli</a>."
|
700 |
-
|
701 |
-
#: productvendor\classes\admin\settings\sf-options.php:262
|
702 |
-
#, php-format
|
703 |
-
msgid "Make sure you update your PayPal Adaptive Payments settings <a href=\"%s\">here</a>."
|
704 |
-
msgstr "Aggiornare le impostazioni di Pagamenti adattativi PayPal <a href=\"%s\">qui</a>."
|
705 |
-
|
706 |
-
#: productvendor\classes\admin\settings\sf-options.php:265
|
707 |
-
msgid "Instant pay"
|
708 |
-
msgstr "Pagamento instantaneo"
|
709 |
-
|
710 |
-
#: productvendor\classes\admin\settings\sf-options.php:266
|
711 |
-
msgid "Instantly pay vendors their commission when an order is made"
|
712 |
-
msgstr "Paga instantaneamente le commissioni ai venditori quando è fatto un ordine"
|
713 |
-
|
714 |
-
#: productvendor\classes\admin\settings\sf-options.php:267
|
715 |
-
msgid "For this to work, customers must checkout with the PayPal Adaptive Payments gateway. Using other gateways will not pay vendors instantly"
|
716 |
-
msgstr "Per questo lavoro, i clienti devono effettuare il checkout con il gateway di pagamenti adattivo PayPal. Utilizzando altri gateway i venditori non verranno pagati istantaneamente"
|
717 |
-
|
718 |
-
#: productvendor\classes\admin\settings\sf-options.php:274
|
719 |
-
msgid "Payment schedule"
|
720 |
-
msgstr "Scadenze di pagamento"
|
721 |
-
|
722 |
-
#: productvendor\classes\admin\settings\sf-options.php:275
|
723 |
-
msgid "Note: Schedule will only work if instant pay is unchecked"
|
724 |
-
msgstr "Nota: Il programma funzionerà solo se la paga istantanea è deselezionata"
|
725 |
-
|
726 |
-
#: productvendor\classes\admin\settings\sf-options.php:280
|
727 |
-
msgid "Weekly"
|
728 |
-
msgstr "Settimanale"
|
729 |
-
|
730 |
-
#: productvendor\classes\admin\settings\sf-options.php:281
|
731 |
-
msgid "Biweekly"
|
732 |
-
msgstr "Bisettimanale"
|
733 |
-
|
734 |
-
#: productvendor\classes\admin\settings\sf-options.php:282
|
735 |
-
msgid "Monthly"
|
736 |
-
msgstr "Mensile"
|
737 |
-
|
738 |
-
#: productvendor\classes\admin\settings\sf-options.php:283
|
739 |
-
msgid "Manual"
|
740 |
-
msgstr "Manuale"
|
741 |
-
|
742 |
-
#: productvendor\classes\admin\settings\sf-options.php:284
|
743 |
-
msgid "Now"
|
744 |
-
msgstr "Adesso"
|
745 |
-
|
746 |
-
#: productvendor\classes\admin\settings\sf-options.php:289
|
747 |
-
msgid "Email notification"
|
748 |
-
msgstr "Notificazione email"
|
749 |
-
|
750 |
-
#: productvendor\classes\admin\settings\sf-options.php:290
|
751 |
-
msgid "Send the WooCommerce admin an email each time a payment has been made via the payment schedule options above"
|
752 |
-
msgstr "Invia all'amministratore WooCommerce un'e-mail ogni volta che è stato effettuato un pagamento tramite le opzioni del programma di pagamento sopra\t"
|
753 |
-
|
754 |
-
#: productvendor\classes\admin\settings\classes\sf-class-format-options.php:207
|
755 |
-
msgid "Select a page..."
|
756 |
-
msgstr "Seleziona una pagina..."
|
757 |
-
|
758 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:149
|
759 |
-
#: productvendor\views\dashboard\settings\settings.php:1
|
760 |
-
msgid "Settings"
|
761 |
-
msgstr "Impostazioni"
|
762 |
-
|
763 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:282
|
764 |
-
msgid "Could not load settings at: "
|
765 |
-
msgstr "Impossibile caricare le impostazioni a:"
|
766 |
-
|
767 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:282
|
768 |
-
msgid "Error - WP Settings Framework"
|
769 |
-
msgstr "Errore - Impostazioni Framework WP"
|
770 |
-
|
771 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:347
|
772 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:73
|
773 |
-
msgid "Settings saved."
|
774 |
-
msgstr "Impostazioni salvate."
|
775 |
-
|
776 |
-
#: productvendor\classes\admin\settings\classes\sf-class-settings.php:460
|
777 |
-
#, php-format
|
778 |
-
msgid "Save %s changes"
|
779 |
-
msgstr "Salva %s cambiamenti"
|
780 |
-
|
781 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:46
|
782 |
-
msgid "Your PayPal address is not a valid email address."
|
783 |
-
msgstr "Il tuo indirizzo PayPal non è un indirizzo email valido."
|
784 |
-
|
785 |
-
#: productvendor\classes\front\dashboard\class-vendor-dashboard.php:55
|
786 |
-
msgid "That shop name is already taken. Your shop name must be unique."
|
787 |
-
msgstr "Il nome del negozio già esiste. Il nome del tuo negozio deve essere unico."
|
788 |
-
|
789 |
-
#: productvendor\classes\front\orders\class-export-csv.php:35
|
790 |
-
msgid "Extra data"
|
791 |
-
msgstr "Dati aggiuntivi"
|
792 |
-
|
793 |
-
#: productvendor\classes\front\orders\class-export-csv.php:36
|
794 |
-
#: productvendor\views\dashboard\reports.php:18
|
795 |
-
msgid "Quantity"
|
796 |
-
msgstr "Quantità"
|
797 |
-
|
798 |
-
#: productvendor\classes\front\orders\class-orders.php:98
|
799 |
-
msgid "You haven't selected a product's orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you'd like to view."
|
800 |
-
msgstr "Non hai selezionato gli ordini di un prodotto da visualizzare! Si prega di tornare alla Dashboard Vendor e fare clic su Visualizza ordini sul prodotto che si desidera visualizzare."
|
801 |
-
|
802 |
-
#: productvendor\classes\front\orders\class-orders.php:102
|
803 |
-
msgid "No orders."
|
804 |
-
msgstr "Nessun ordine."
|
805 |
-
|
806 |
-
#: productvendor\classes\front\orders\class-orders.php:135
|
807 |
-
#: productvendor\classes\front\orders\class-orders.php:136
|
808 |
-
msgid "Tracking number"
|
809 |
-
msgstr "Numero identificativo (Tracking number)"
|
810 |
-
|
811 |
-
#: productvendor\classes\front\orders\class-orders.php:138
|
812 |
-
msgid "Success. Your tracking number has been updated."
|
813 |
-
msgstr "Bene. Il numero identificativo (Tracking number) è stato aggiornato."
|
814 |
-
|
815 |
-
#: productvendor\classes\front\orders\class-orders.php:197
|
816 |
-
msgid "Full name"
|
817 |
-
msgstr "Nome completo"
|
818 |
-
|
819 |
-
#: productvendor\classes\front\orders\class-orders.php:198
|
820 |
-
msgid "Address"
|
821 |
-
msgstr "Indirizzo"
|
822 |
-
|
823 |
-
#: productvendor\classes\front\orders\class-orders.php:199
|
824 |
-
msgid "City"
|
825 |
-
msgstr "Città"
|
826 |
-
|
827 |
-
#: productvendor\classes\front\orders\class-orders.php:200
|
828 |
-
msgid "State"
|
829 |
-
msgstr "Stato"
|
830 |
-
|
831 |
-
#: productvendor\classes\front\orders\class-orders.php:201
|
832 |
-
msgid "Zip"
|
833 |
-
msgstr "CAP"
|
834 |
-
|
835 |
-
#: productvendor\classes\front\orders\class-orders.php:202
|
836 |
-
msgid "Email address"
|
837 |
-
msgstr "Indirizzo email"
|
838 |
-
|
839 |
-
#: productvendor\classes\front\orders\class-submit-comment.php:40
|
840 |
-
msgid "You've left the comment field empty!"
|
841 |
-
msgstr "Hai lasciato il campo di commento vuoto!"
|
842 |
-
|
843 |
-
#: productvendor\classes\front\orders\class-submit-comment.php:61
|
844 |
-
msgid "Success. The customer has been notified of your comment."
|
845 |
-
msgstr "Bene. E' stato notificato il tuo commento al cliente."
|
846 |
-
|
847 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:40
|
848 |
-
#: productvendor\views\dashboard\denied.php:16
|
849 |
-
msgid "Apply to become a vendor?"
|
850 |
-
msgstr "Domanda per diventare un venditore?"
|
851 |
-
|
852 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:46
|
853 |
-
#: productvendor\views\dashboard\denied.php:23
|
854 |
-
#, php-format
|
855 |
-
msgid "I have read and accepted the <a href=\"%s\">terms and conditions</a>"
|
856 |
-
msgstr "Ho letto e accettato i <a href=\"%s\">termini e le condizioni</a>"
|
857 |
-
|
858 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:80
|
859 |
-
msgid "Application denied. You are an administrator."
|
860 |
-
msgstr "Richiesta negata. Sei un amministratore."
|
861 |
-
|
862 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:82
|
863 |
-
msgid "Your application has been submitted."
|
864 |
-
msgstr "La tua richiesta è stata inviata."
|
865 |
-
|
866 |
-
#: productvendor\classes\front\signup\class-vendor-signup.php:118
|
867 |
-
msgid "You must accept the terms and conditions to become a vendor."
|
868 |
-
msgstr "Devi accettare i termini e le condizioni per diventare un venditore."
|
869 |
-
|
870 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:39
|
871 |
-
msgid "PayPal Adaptive Payments"
|
872 |
-
msgstr "Pagamenti adattivi PayPal"
|
873 |
-
|
874 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:115
|
875 |
-
#, php-format
|
876 |
-
msgid "Something went wrong. Response from PayPal invalidated this order. Status: %s."
|
877 |
-
msgstr "Qualcosa è andato storto. La risposta da PayPal invalida questo ordine. Stato: % s."
|
878 |
-
|
879 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:120
|
880 |
-
msgid "IPN payment completed"
|
881 |
-
msgstr "Pagamento IPN completato"
|
882 |
-
|
883 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:142
|
884 |
-
msgid "Enable PayPal Adaptive Payments"
|
885 |
-
msgstr "Abilita i pagamenti adattativi PayPal"
|
886 |
-
|
887 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:148
|
888 |
-
msgid "Method Title"
|
889 |
-
msgstr "Metodo titolo"
|
890 |
-
|
891 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:149
|
892 |
-
msgid "This controls the title which the user sees during checkout."
|
893 |
-
msgstr "Questo controlla il titolo che l'utente vede durante il checkout."
|
894 |
-
|
895 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:150
|
896 |
-
msgid "PayPal"
|
897 |
-
msgstr "PayPal"
|
898 |
-
|
899 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:155
|
900 |
-
msgid "Description"
|
901 |
-
msgstr "Descrizione"
|
902 |
-
|
903 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:156
|
904 |
-
msgid "This controls the description which the user sees during checkout."
|
905 |
-
msgstr "Questo controlla la descrizione che l'utente vede durante il checkout"
|
906 |
-
|
907 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:157
|
908 |
-
msgid "Pay via PayPal!"
|
909 |
-
msgstr "Paga tramite PayPal!"
|
910 |
-
|
911 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:168
|
912 |
-
msgid "Live Credentials"
|
913 |
-
msgstr "Credenziali Live"
|
914 |
-
|
915 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:170
|
916 |
-
#, php-format
|
917 |
-
msgid "You must have an <a href=\"%s\">Application ID</a> to process live transactions. You do not need one for testing in Sandbox mode."
|
918 |
-
msgstr "Devi avere un <a href=\"%s\">Application ID</a> per processare le transazioni inserite. Tu non ne hai bisogno per il testing nel Sandbox mode."
|
919 |
-
|
920 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:175
|
921 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:209
|
922 |
-
msgid "PayPal Email"
|
923 |
-
msgstr "Email PayPal"
|
924 |
-
|
925 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:176
|
926 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:210
|
927 |
-
msgid "The email address main payments should go to."
|
928 |
-
msgstr "I pagamenti dell'indirizzo email principale dovrebbero andare a:"
|
929 |
-
|
930 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:181
|
931 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:215
|
932 |
-
msgid "API Username"
|
933 |
-
msgstr "Username API (API Username)"
|
934 |
-
|
935 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:186
|
936 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:220
|
937 |
-
msgid "API Password"
|
938 |
-
msgstr "Password API (API Password)"
|
939 |
-
|
940 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:191
|
941 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:225
|
942 |
-
msgid "API Signature"
|
943 |
-
msgstr "Firma API (API Signature)"
|
944 |
-
|
945 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:196
|
946 |
-
msgid "Application ID"
|
947 |
-
msgstr "ID Richiesta (Application ID)"
|
948 |
-
|
949 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:198
|
950 |
-
msgid "Only required when doing live transactions."
|
951 |
-
msgstr "Richiesto solo quando si effettuano delle transazioni."
|
952 |
-
|
953 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:202
|
954 |
-
msgid "Sandbox Credentials"
|
955 |
-
msgstr "Credenziali Sandbox"
|
956 |
-
|
957 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:204
|
958 |
-
#, php-format
|
959 |
-
msgid "You can signup for a sandbox developer account <a href=\"%s\">here</a>. You need a developer account if you want to enable Sandbox mode for testing."
|
960 |
-
msgstr "Puoi iscriverti ad un account sandbox sviluppatore <a href=\"%s\">qui</a>. Tu hai bisogno di un account sviluppatore se tu vuoi abilitare il Sandbox mode per i test."
|
961 |
-
|
962 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:236
|
963 |
-
msgid "Misc. Settings"
|
964 |
-
msgstr "Impostazioni varie"
|
965 |
-
|
966 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:241
|
967 |
-
msgid "Enable PayPal Sandbox mode"
|
968 |
-
msgstr "Attiva la modalità PayPal Sandbox"
|
969 |
-
|
970 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:247
|
971 |
-
msgid "Enable logging"
|
972 |
-
msgstr "Abilitare il logging"
|
973 |
-
|
974 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:264
|
975 |
-
msgid "The PayPal Adaptive Payments gateway can instantly pay your vendors their due commission (if enabled). Also used to mass pay vendors on a schedule / manual method (if enabled)."
|
976 |
-
msgstr "Il gateway dei pagamenti adattativi PayPal può instantaneamente pagare i tuoi venditori le loro commissioni dovute (se abilitato). Utilizzato anche per pagare in massa i venditori su un programma / metodo manuale (se abilitato)."
|
977 |
-
|
978 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:265
|
979 |
-
#, php-format
|
980 |
-
msgid "<b>Important:</b> Unless you're using the <a href=\"%s\">beta version of TRS2</a>, all shipping costs will be given to the shop admin. Vendors will not receive shipping costs."
|
981 |
-
msgstr "<b>Importante:</b> A meno che non stai usando il<a href=\"%s\">beta version of TRS2</a>, tutti i costi di spedizione saranno dati al negozio dell'amministrazione. I venditori non riceveranno i costi di spedizione."
|
982 |
-
|
983 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:275
|
984 |
-
msgid "Gateway Disabled"
|
985 |
-
msgstr "Gateway disabilitato"
|
986 |
-
|
987 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:275
|
988 |
-
#, php-format
|
989 |
-
msgid "%s does not support your store currency."
|
990 |
-
msgstr "%s non supporta la valuta del tuo negozio."
|
991 |
-
|
992 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:361
|
993 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:469
|
994 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:147
|
995 |
-
#, php-format
|
996 |
-
msgid "Error: %s"
|
997 |
-
msgstr "Errore: %s"
|
998 |
-
|
999 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:369
|
1000 |
-
#: productvendor\classes\gateways\paypal_advpayments\paypal_ap.php:370
|
1001 |
-
#, php-format
|
1002 |
-
msgid "Error ID: %s. %s"
|
1003 |
-
msgstr "Errore ID: %s. %s"
|
1004 |
-
|
1005 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:113
|
1006 |
-
msgid "No vendors found to pay. Maybe they haven't set a PayPal address?"
|
1007 |
-
msgstr "Nessun venditore trovato per pagare. Forse non hanno impostato un indirizzo di PayPal?"
|
1008 |
-
|
1009 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:160
|
1010 |
-
msgid "All due commission has been paid for."
|
1011 |
-
msgstr "Tutte le commissioni dovute sono state pagate."
|
1012 |
-
|
1013 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:166
|
1014 |
-
msgid "All due commission has been paid for, but I could not clear it from their profiles due to an internal error. Commission will still be listed as due. Please manually mark the commission as paid from the Commissions page."
|
1015 |
-
msgstr "Tutta la commissione dovuta è stata pagata, ma non riuscivo a cancellarlo dai loro profili a causa di un errore interno. La commissione sarà ancora elencata come dovuta. Per favore contrassegna manualmente la commissione come pagato dalla pagina di commissioni."
|
1016 |
-
|
1017 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:200
|
1018 |
-
msgid "WooCommerce: Mass payments for vendors update"
|
1019 |
-
msgstr "WooCommerce: I pagamenti di massa per aggiornamento venditori"
|
1020 |
-
|
1021 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:202
|
1022 |
-
msgid "Hello! A payment was just triggered to mass pay all vendors their due commission."
|
1023 |
-
msgstr "Ciao! Un pagamento è stato appena attivato per pagare in massa a tutti i venditori la loro commissione dovuta."
|
1024 |
-
|
1025 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:203
|
1026 |
-
#, php-format
|
1027 |
-
msgid "Payment status: %s."
|
1028 |
-
msgstr "Stato pagamento: %s."
|
1029 |
-
|
1030 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:204
|
1031 |
-
#, php-format
|
1032 |
-
msgid "Payment message: %s."
|
1033 |
-
msgstr "Messaggio pagamento: %s."
|
1034 |
-
|
1035 |
-
#: productvendor\classes\gateways\paypal_masspay\class-paypal-masspay.php:207
|
1036 |
-
#, php-format
|
1037 |
-
msgid "Payment total: %s."
|
1038 |
-
msgstr "Totale pagamento: % s."
|
1039 |
-
|
1040 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:137
|
1041 |
-
msgid "The plugin has been updated, but could not be reactivated. Please reactivate it manually."
|
1042 |
-
msgstr "Il plugin è stato aggiornato, ma potrebbe non essere tato riattivato. Si prega di riattivarlo manualmente."
|
1043 |
-
|
1044 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:138
|
1045 |
-
msgid "Plugin reactivated successfully."
|
1046 |
-
msgstr "Plugin riattivato con successo."
|
1047 |
-
|
1048 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:229
|
1049 |
-
msgid "MGates.me Updates"
|
1050 |
-
msgstr "Aggiornamenti MGates.me"
|
1051 |
-
|
1052 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:259
|
1053 |
-
msgid "MGates.me Plugin Updater"
|
1054 |
-
msgstr "MGates.me Plugin Updater"
|
1055 |
-
|
1056 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:270
|
1057 |
-
msgid "Enter your license key to automatically receive updates."
|
1058 |
-
msgstr "Inserisci la tua chiave di licenza per ricevere aggiornamenti automaticamente."
|
1059 |
-
|
1060 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:295
|
1061 |
-
#: productvendor\views\dashboard\settings\settings.php:46
|
1062 |
-
msgid "Save"
|
1063 |
-
msgstr "Salva"
|
1064 |
-
|
1065 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:296
|
1066 |
-
msgid "Check for updates <b>now</b>"
|
1067 |
-
msgstr "Cerca aggiornamenti <b>ora</b>"
|
1068 |
-
|
1069 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:323
|
1070 |
-
#, php-format
|
1071 |
-
msgid "<b style=\"color: #468847;\">Key deactivated.</b> License key for <i>%s</i> has been <b>deactivated</b>."
|
1072 |
-
msgstr "<b style=\"color: #468847;\">Chiave disattivata.</b>La chiave della licenza per<i>%s</i> è stata <b>disattivata</b>."
|
1073 |
-
|
1074 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:325
|
1075 |
-
#, php-format
|
1076 |
-
msgid "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> could not be deactivated."
|
1077 |
-
msgstr "<b style=\"color: #B94A48;\">Errore.</b> La chiave della licenza per<i>%s</i> potrebbe non essere disattivata."
|
1078 |
-
|
1079 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:333
|
1080 |
-
#, php-format
|
1081 |
-
msgid "<b style=\"color: #468847;\">Key activated.</b> License key for <i>%s</i> has been <b>activated</b>."
|
1082 |
-
msgstr "<b style=\"color: #468847;\">Chiave attivata.</b> La chiave della licenza per <i>%s</i>è stata<b>attivata</b>."
|
1083 |
-
|
1084 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:335
|
1085 |
-
#, php-format
|
1086 |
-
msgid "<b style=\"color: #B94A48;\">Error.</b> License key for <i>%s</i> is invalid."
|
1087 |
-
msgstr "<b style=\"color: #B94A48;\">Errore.</b> La chiave della licenza per<i>%s</i> non è valida."
|
1088 |
-
|
1089 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:370
|
1090 |
-
msgid "Enable MGates.me Plugin Updates."
|
1091 |
-
msgstr "Abilita Aggiornamenti MGates.me Plugin"
|
1092 |
-
|
1093 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:372
|
1094 |
-
#, php-format
|
1095 |
-
msgid "<a href=\"%1$s\">Add your license keys</a> to enable automatic plugin updates."
|
1096 |
-
msgstr "<a href=\"%1$s\">Aggiungi le tue chiavi licenza</a> per abilitare gli aggiornamenti automatici del plugin."
|
1097 |
-
|
1098 |
-
#: productvendor\classes\mg-includes\class-mgates-plugin-updater.php:379
|
1099 |
-
msgid "Hide This Message"
|
1100 |
-
msgstr "Nascondi questo messaggio"
|
1101 |
-
|
1102 |
-
#: productvendor\views\dashboard\denied.php:5
|
1103 |
-
msgid "Your account has not yet been approved to become a vendor."
|
1104 |
-
msgstr "Il tuo account non è stato ancora approvato per diventare un venditore."
|
1105 |
-
|
1106 |
-
#: productvendor\views\dashboard\denied.php:9
|
1107 |
-
msgid "Your account is not vendor capable."
|
1108 |
-
msgstr "Il tuo account non è un account venditore."
|
1109 |
-
|
1110 |
-
#: productvendor\views\dashboard\denied.php:42
|
1111 |
-
msgid "Submit"
|
1112 |
-
msgstr "Invia"
|
1113 |
-
|
1114 |
-
#: productvendor\views\dashboard\links.php:1
|
1115 |
-
msgid "Control Center"
|
1116 |
-
msgstr "Centro di controllo"
|
1117 |
-
|
1118 |
-
#: productvendor\views\dashboard\links.php:3
|
1119 |
-
msgid "My shop"
|
1120 |
-
msgstr "Il mio negozio"
|
1121 |
-
|
1122 |
-
#: productvendor\views\dashboard\links.php:7
|
1123 |
-
msgid "My settings"
|
1124 |
-
msgstr "Le mie impostazioni"
|
1125 |
-
|
1126 |
-
#: productvendor\views\dashboard\links.php:13
|
1127 |
-
msgid "Submit a product"
|
1128 |
-
msgstr "Invia un prodotto"
|
1129 |
-
|
1130 |
-
#: productvendor\views\dashboard\reports.php:1
|
1131 |
-
msgid "Sales Report"
|
1132 |
-
msgstr "Rapporto Vendite\t"
|
1133 |
-
|
1134 |
-
#: productvendor\views\dashboard\reports.php:20
|
1135 |
-
msgid "Rate"
|
1136 |
-
msgstr "Tasso"
|
1137 |
-
|
1138 |
-
#: productvendor\views\dashboard\reports.php:43
|
1139 |
-
msgid "Show Orders"
|
1140 |
-
msgstr "Mostra ordini"
|
1141 |
-
|
1142 |
-
#: productvendor\views\dashboard\reports.php:51
|
1143 |
-
msgid "Totals"
|
1144 |
-
msgstr "Totali"
|
1145 |
-
|
1146 |
-
#: productvendor\views\dashboard\reports.php:64
|
1147 |
-
msgid "You have no sales during this period."
|
1148 |
-
msgstr "Non hai vendite in questo periodo."
|
1149 |
-
|
1150 |
-
#: productvendor\views\dashboard\reports.php:72
|
1151 |
-
msgid "You haven't made any sales yet."
|
1152 |
-
msgstr "Non hai venduto ancora niente."
|
1153 |
-
|
1154 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:2
|
1155 |
-
msgid "PayPal Address"
|
1156 |
-
msgstr "Indirizzo PayPal"
|
1157 |
-
|
1158 |
-
#: productvendor\views\dashboard\settings\paypal-email-form.php:3
|
1159 |
-
msgid "Your PayPal address is used to send you your commission."
|
1160 |
-
msgstr "Il tuo indirizzo PayPal è usato per inviare a te la tua commissione."
|
1161 |
-
|
1162 |
-
#: productvendor\views\dashboard\settings\seller-info.php:3
|
1163 |
-
msgid "This is displayed on each of your products."
|
1164 |
-
msgstr "Questo è mostrato su tutti i tuoi prodotti."
|
1165 |
-
|
1166 |
-
#: productvendor\views\dashboard\settings\shop-description.php:2
|
1167 |
-
msgid "Shop Description"
|
1168 |
-
msgstr "Descrizione negozio"
|
1169 |
-
|
1170 |
-
#: productvendor\views\dashboard\settings\shop-description.php:3
|
1171 |
-
#, php-format
|
1172 |
-
msgid "This is displayed on your <a href=\"%s\">shop page</a>."
|
1173 |
-
msgstr "Questo è mostrato sulla tua <a href=\"%s\">pagina del negozio</a>."
|
1174 |
-
|
1175 |
-
#: productvendor\views\dashboard\settings\shop-name.php:2
|
1176 |
-
msgid "Shop Name"
|
1177 |
-
msgstr "Nome negozio"
|
1178 |
-
|
1179 |
-
#: productvendor\views\dashboard\settings\shop-name.php:3
|
1180 |
-
msgid "Your shop name is public and must be unique."
|
1181 |
-
msgstr "Il nome del tuo negozio è pubblico e deve essere unico."
|
1182 |
-
|
1183 |
-
#: productvendor\views\emails\application-status.php:5
|
1184 |
-
#, php-format
|
1185 |
-
msgid "Hi there. This is a notification about a vendor application on %s."
|
1186 |
-
msgstr "Ehilà. Questa è una notifica relativa ad una richiesta del venditore su % s."
|
1187 |
-
|
1188 |
-
#: productvendor\views\emails\application-status.php:8
|
1189 |
-
#, php-format
|
1190 |
-
msgid "Application status: %s"
|
1191 |
-
msgstr "Stato richiesta: %s"
|
1192 |
-
|
1193 |
-
#: productvendor\views\emails\application-status.php:9
|
1194 |
-
#, php-format
|
1195 |
-
msgid "Applicant username: %s"
|
1196 |
-
msgstr "Nome utente richiedente: %s"
|
1197 |
-
|
1198 |
-
#: productvendor\views\emails\new-product.php:5
|
1199 |
-
#, php-format
|
1200 |
-
msgid "Hi there. This is a notification about a new product on %s."
|
1201 |
-
msgstr "Ehilà. Questa è una notifica di un nuovo prodotto su %s."
|
1202 |
-
|
1203 |
-
#: productvendor\views\emails\new-product.php:8
|
1204 |
-
#, php-format
|
1205 |
-
msgid "Product title: %s"
|
1206 |
-
msgstr "Titolo prodotto: %s"
|
1207 |
-
|
1208 |
-
#: productvendor\views\emails\new-product.php:9
|
1209 |
-
#, php-format
|
1210 |
-
msgid "Submitted by: %s"
|
1211 |
-
msgstr "Inviato da: %s"
|
1212 |
-
|
1213 |
-
#: productvendor\views\emails\new-product.php:10
|
1214 |
-
#, php-format
|
1215 |
-
msgid "Edit product: %s"
|
1216 |
-
msgstr "Modifica prodotto: %s"
|
1217 |
-
|
1218 |
-
#: productvendor\views\orders\csv-export.php:6
|
1219 |
-
msgid "Export orders"
|
1220 |
-
msgstr "Esporta ordini"
|
1221 |
-
|
1222 |
-
#: productvendor\views\orders\orders.php:82
|
1223 |
-
#, php-format
|
1224 |
-
msgid "Comments (%s)"
|
1225 |
-
msgstr "Commenti (%s)"
|
1226 |
-
|
1227 |
-
#: productvendor\views\orders\table-body.php:25
|
1228 |
-
#, php-format
|
1229 |
-
msgid "Quantity: %d"
|
1230 |
-
msgstr "Quantità: %d"
|
1231 |
-
|
1232 |
-
#: productvendor\views\orders\comments\add-new-comment.php:10
|
1233 |
-
msgid "Add comment"
|
1234 |
-
msgstr "Aggiungi commento"
|
1235 |
-
|
1236 |
-
#: productvendor\views\orders\comments\existing-comments.php:9
|
1237 |
-
#, php-format
|
1238 |
-
msgid "added %s ago"
|
1239 |
-
msgstr "Aggiunto %s giorni fà"
|
1240 |
-
|
1241 |
-
#: productvendor\views\orders\customer-note\customer-note.php:4
|
1242 |
-
msgid "Customer note"
|
1243 |
-
msgstr "Nota del cliente"
|
1244 |
-
|
1245 |
-
#: productvendor\views\orders\customer-note\customer-note.php:8
|
1246 |
-
msgid "No customer note."
|
1247 |
-
msgstr "Nessuna nota del cliente."
|
1248 |
-
|
1249 |
-
#: productvendor\views\orders\shipping\shipping-form.php:46
|
1250 |
-
msgid "Provider:"
|
1251 |
-
msgstr "Provider:"
|
1252 |
-
|
1253 |
-
#: productvendor\views\orders\shipping\shipping-form.php:48
|
1254 |
-
msgid "Custom Provider"
|
1255 |
-
msgstr "Provider personalizzato"
|
1256 |
-
|
1257 |
-
#: productvendor\views\orders\shipping\shipping-form.php:68
|
1258 |
-
msgid "Provider Name:"
|
1259 |
-
msgstr "Nome provider:"
|
1260 |
-
|
1261 |
-
#: productvendor\views\orders\shipping\shipping-form.php:76
|
1262 |
-
msgid "Tracking number:"
|
1263 |
-
msgstr "Numero identificativo (Tracking number):"
|
1264 |
-
|
1265 |
-
#: productvendor\views\orders\shipping\shipping-form.php:84
|
1266 |
-
msgid "Tracking link:"
|
1267 |
-
msgstr "Link identificativo (Tracking link):"
|
1268 |
-
|
1269 |
-
#: productvendor\views\orders\shipping\shipping-form.php:93
|
1270 |
-
msgid "Date shipped:"
|
1271 |
-
msgstr "Data di spedizione:"
|
1272 |
-
|
1273 |
-
#: productvendor\views\orders\shipping\shipping-form.php:101
|
1274 |
-
msgid "Preview:"
|
1275 |
-
msgstr "Anteprima:"
|
1276 |
-
|
1277 |
-
#: productvendor\views\orders\shipping\shipping-form.php:101
|
1278 |
-
msgid "Click here to track your shipment"
|
1279 |
-
msgstr "Clicca qui per rilevare la tua spedizione"
|
1280 |
-
|
1281 |
-
#: productvendor\views\orders\shipping\shipping-form.php:109
|
1282 |
-
msgid "Update tracking number"
|
1283 |
-
msgstr "Aggiorna numero identificativo (Tracking link)"
|
1284 |
-
|
1285 |
-
#: productvendor\views\orders\shipping\shipping-form.php:110
|
1286 |
-
msgid "Mark as shipped"
|
1287 |
-
msgstr "Segna come spedito"
|
1288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WCVendors/views/front/vendor-list.php
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* Template Variables available
|
4 |
-
* $shop_name : pv_shop_name
|
5 |
-
* $shop_description : pv_shop_description (completely sanitized)
|
6 |
-
* $shop_link : the vendor shop link
|
7 |
-
* $vendor_id : current vendor id for customization
|
8 |
-
*/
|
9 |
-
?>
|
10 |
-
|
11 |
-
<li>
|
12 |
-
<a href="<?php echo $shop_link; ?>" alt="<?php echo $shop_name; ?>" >
|
13 |
-
<figure>
|
14 |
-
<?php echo get_avatar($vendor_id, 50); ?>
|
15 |
-
<span><?php echo $shop_name; ?></span>
|
16 |
-
</figure>
|
17 |
-
</a>
|
18 |
-
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{WCVendors/assets → assets}/css/wcv-frontend.css
RENAMED
@@ -1,544 +1,544 @@
|
|
1 |
-
/*!
|
2 |
-
* Bootstrap v2.1.1
|
3 |
-
*
|
4 |
-
* Copyright 2012 Twitter, Inc
|
5 |
-
* Licensed under the Apache License v2.0
|
6 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
7 |
-
*
|
8 |
-
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
9 |
-
*/
|
10 |
-
clearfix {
|
11 |
-
*zoom: 1;
|
12 |
-
}
|
13 |
-
|
14 |
-
.clearfix:before, .clearfix:after {
|
15 |
-
display: table;
|
16 |
-
content: "";
|
17 |
-
line-height: 0;
|
18 |
-
}
|
19 |
-
|
20 |
-
.clearfix:after {
|
21 |
-
clear: both;
|
22 |
-
}
|
23 |
-
|
24 |
-
.hide-text {
|
25 |
-
font: 0/0 a;
|
26 |
-
color: transparent;
|
27 |
-
text-shadow: none;
|
28 |
-
background-color: transparent;
|
29 |
-
border: 0;
|
30 |
-
}
|
31 |
-
|
32 |
-
.input-block-level {
|
33 |
-
display: block;
|
34 |
-
width: 100%;
|
35 |
-
min-height: 30px;
|
36 |
-
-webkit-box-sizing: border-box;
|
37 |
-
-moz-box-sizing: border-box;
|
38 |
-
box-sizing: border-box;
|
39 |
-
}
|
40 |
-
|
41 |
-
.btn {
|
42 |
-
display: inline-block;
|
43 |
-
*display: inline;
|
44 |
-
*zoom: 1;
|
45 |
-
padding: 4px 14px;
|
46 |
-
margin-bottom: 0;
|
47 |
-
font-size: 14px;
|
48 |
-
line-height: 20px;
|
49 |
-
*line-height: 20px;
|
50 |
-
text-align: center;
|
51 |
-
vertical-align: middle;
|
52 |
-
cursor: pointer;
|
53 |
-
color: #333333;
|
54 |
-
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
55 |
-
background-color: #f5f5f5;
|
56 |
-
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
57 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
58 |
-
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
59 |
-
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
60 |
-
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
61 |
-
background-repeat: repeat-x;
|
62 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
|
63 |
-
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
|
64 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
65 |
-
*background-color: #e6e6e6;
|
66 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
67 |
-
border: 1px solid #bbbbbb;
|
68 |
-
*border: 0;
|
69 |
-
border-bottom-color: #a2a2a2;
|
70 |
-
-webkit-border-radius: 4px;
|
71 |
-
-moz-border-radius: 4px;
|
72 |
-
border-radius: 4px;
|
73 |
-
*margin-left: .3em;
|
74 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
75 |
-
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
76 |
-
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
77 |
-
}
|
78 |
-
|
79 |
-
.btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {
|
80 |
-
color: #333333;
|
81 |
-
background-color: #e6e6e6;
|
82 |
-
*background-color: #d9d9d9;
|
83 |
-
}
|
84 |
-
|
85 |
-
.btn:active, .btn.active {
|
86 |
-
background-color: #cccccc \9;
|
87 |
-
}
|
88 |
-
|
89 |
-
.btn:first-child {
|
90 |
-
*margin-left: 0;
|
91 |
-
}
|
92 |
-
|
93 |
-
.btn:hover {
|
94 |
-
color: #333333;
|
95 |
-
text-decoration: none;
|
96 |
-
background-color: #e6e6e6;
|
97 |
-
*background-color: #d9d9d9;
|
98 |
-
background-position: 0 -15px;
|
99 |
-
-webkit-transition: background-position 0.1s linear;
|
100 |
-
-moz-transition: background-position 0.1s linear;
|
101 |
-
-o-transition: background-position 0.1s linear;
|
102 |
-
transition: background-position 0.1s linear;
|
103 |
-
}
|
104 |
-
|
105 |
-
.btn:focus {
|
106 |
-
outline: thin dotted #333;
|
107 |
-
outline: 5px auto -webkit-focus-ring-color;
|
108 |
-
outline-offset: -2px;
|
109 |
-
}
|
110 |
-
|
111 |
-
.btn.active, .btn:active {
|
112 |
-
background-color: #e6e6e6;
|
113 |
-
background-color: #d9d9d9 \9;
|
114 |
-
background-image: none;
|
115 |
-
outline: 0;
|
116 |
-
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
117 |
-
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
118 |
-
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
119 |
-
}
|
120 |
-
|
121 |
-
.btn.disabled, .btn[disabled] {
|
122 |
-
cursor: default;
|
123 |
-
background-color: #e6e6e6;
|
124 |
-
background-image: none;
|
125 |
-
opacity: 0.65;
|
126 |
-
filter: alpha(opacity=65);
|
127 |
-
-webkit-box-shadow: none;
|
128 |
-
-moz-box-shadow: none;
|
129 |
-
box-shadow: none;
|
130 |
-
}
|
131 |
-
|
132 |
-
.btn-large {
|
133 |
-
padding: 9px 14px;
|
134 |
-
font-size: 16px;
|
135 |
-
line-height: normal;
|
136 |
-
-webkit-border-radius: 5px;
|
137 |
-
-moz-border-radius: 5px;
|
138 |
-
border-radius: 5px;
|
139 |
-
}
|
140 |
-
|
141 |
-
.btn-large [class^="icon-"] {
|
142 |
-
margin-top: 2px;
|
143 |
-
}
|
144 |
-
|
145 |
-
.btn-small {
|
146 |
-
padding: 3px 9px;
|
147 |
-
font-size: 12px;
|
148 |
-
line-height: 18px;
|
149 |
-
}
|
150 |
-
|
151 |
-
.btn-small [class^="icon-"] {
|
152 |
-
margin-top: 0;
|
153 |
-
}
|
154 |
-
|
155 |
-
.btn-mini {
|
156 |
-
padding: 2px 6px;
|
157 |
-
font-size: 11px;
|
158 |
-
line-height: 17px;
|
159 |
-
}
|
160 |
-
|
161 |
-
.btn-block {
|
162 |
-
display: block;
|
163 |
-
width: 100%;
|
164 |
-
padding-left: 0;
|
165 |
-
padding-right: 0;
|
166 |
-
-webkit-box-sizing: border-box;
|
167 |
-
-moz-box-sizing: border-box;
|
168 |
-
box-sizing: border-box;
|
169 |
-
}
|
170 |
-
|
171 |
-
.btn-block + .btn-block {
|
172 |
-
margin-top: 5px;
|
173 |
-
}
|
174 |
-
|
175 |
-
input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block {
|
176 |
-
width: 100%;
|
177 |
-
}
|
178 |
-
|
179 |
-
.btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active {
|
180 |
-
color: rgba(255, 255, 255, 0.75);
|
181 |
-
}
|
182 |
-
|
183 |
-
.btn {
|
184 |
-
border-color: #c5c5c5;
|
185 |
-
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
186 |
-
}
|
187 |
-
|
188 |
-
.btn-primary {
|
189 |
-
color: #ffffff;
|
190 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
191 |
-
background-color: #006dcc;
|
192 |
-
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
193 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
194 |
-
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
195 |
-
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
196 |
-
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
|
197 |
-
background-repeat: repeat-x;
|
198 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
|
199 |
-
border-color: #0044cc #0044cc #002a80;
|
200 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
201 |
-
*background-color: #0044cc;
|
202 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
203 |
-
}
|
204 |
-
|
205 |
-
.btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] {
|
206 |
-
color: #ffffff;
|
207 |
-
background-color: #0044cc;
|
208 |
-
*background-color: #003bb3;
|
209 |
-
}
|
210 |
-
|
211 |
-
.btn-primary:active, .btn-primary.active {
|
212 |
-
background-color: #003399 \9;
|
213 |
-
}
|
214 |
-
|
215 |
-
.btn-warning {
|
216 |
-
color: #ffffff;
|
217 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
218 |
-
background-color: #faa732;
|
219 |
-
background-image: -moz-linear-gradient(top, #fbb450, #f89406);
|
220 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
|
221 |
-
background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
|
222 |
-
background-image: -o-linear-gradient(top, #fbb450, #f89406);
|
223 |
-
background-image: linear-gradient(to bottom, #fbb450, #f89406);
|
224 |
-
background-repeat: repeat-x;
|
225 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
|
226 |
-
border-color: #f89406 #f89406 #ad6704;
|
227 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
228 |
-
*background-color: #f89406;
|
229 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
230 |
-
}
|
231 |
-
|
232 |
-
.btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] {
|
233 |
-
color: #ffffff;
|
234 |
-
background-color: #f89406;
|
235 |
-
*background-color: #df8505;
|
236 |
-
}
|
237 |
-
|
238 |
-
.btn-warning:active, .btn-warning.active {
|
239 |
-
background-color: #c67605 \9;
|
240 |
-
}
|
241 |
-
|
242 |
-
.btn-danger {
|
243 |
-
color: #ffffff;
|
244 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
245 |
-
background-color: #da4f49;
|
246 |
-
background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
|
247 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
|
248 |
-
background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
|
249 |
-
background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
|
250 |
-
background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
|
251 |
-
background-repeat: repeat-x;
|
252 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
|
253 |
-
border-color: #bd362f #bd362f #802420;
|
254 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
255 |
-
*background-color: #bd362f;
|
256 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
257 |
-
}
|
258 |
-
|
259 |
-
.btn-danger:hover, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] {
|
260 |
-
color: #ffffff;
|
261 |
-
background-color: #bd362f;
|
262 |
-
*background-color: #a9302a;
|
263 |
-
}
|
264 |
-
|
265 |
-
.btn-danger:active, .btn-danger.active {
|
266 |
-
background-color: #942a25 \9;
|
267 |
-
}
|
268 |
-
|
269 |
-
.btn-success {
|
270 |
-
color: #ffffff;
|
271 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
272 |
-
background-color: #5bb75b;
|
273 |
-
background-image: -moz-linear-gradient(top, #62c462, #51a351);
|
274 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
|
275 |
-
background-image: -webkit-linear-gradient(top, #62c462, #51a351);
|
276 |
-
background-image: -o-linear-gradient(top, #62c462, #51a351);
|
277 |
-
background-image: linear-gradient(to bottom, #62c462, #51a351);
|
278 |
-
background-repeat: repeat-x;
|
279 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
|
280 |
-
border-color: #51a351 #51a351 #387038;
|
281 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
282 |
-
*background-color: #51a351;
|
283 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
284 |
-
}
|
285 |
-
|
286 |
-
.btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] {
|
287 |
-
color: #ffffff;
|
288 |
-
background-color: #51a351;
|
289 |
-
*background-color: #499249;
|
290 |
-
}
|
291 |
-
|
292 |
-
.btn-success:active, .btn-success.active {
|
293 |
-
background-color: #408140 \9;
|
294 |
-
}
|
295 |
-
|
296 |
-
.btn-info {
|
297 |
-
color: #ffffff;
|
298 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
299 |
-
background-color: #49afcd;
|
300 |
-
background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
|
301 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
|
302 |
-
background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
|
303 |
-
background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
|
304 |
-
background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
|
305 |
-
background-repeat: repeat-x;
|
306 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
|
307 |
-
border-color: #2f96b4 #2f96b4 #1f6377;
|
308 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
309 |
-
*background-color: #2f96b4;
|
310 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
311 |
-
}
|
312 |
-
|
313 |
-
.btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] {
|
314 |
-
color: #ffffff;
|
315 |
-
background-color: #2f96b4;
|
316 |
-
*background-color: #2a85a0;
|
317 |
-
}
|
318 |
-
|
319 |
-
.btn-info:active, .btn-info.active {
|
320 |
-
background-color: #24748c \9;
|
321 |
-
}
|
322 |
-
|
323 |
-
.btn-inverse {
|
324 |
-
color: #ffffff;
|
325 |
-
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
326 |
-
background-color: #363636;
|
327 |
-
background-image: -moz-linear-gradient(top, #444444, #222222);
|
328 |
-
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
|
329 |
-
background-image: -webkit-linear-gradient(top, #444444, #222222);
|
330 |
-
background-image: -o-linear-gradient(top, #444444, #222222);
|
331 |
-
background-image: linear-gradient(to bottom, #444444, #222222);
|
332 |
-
background-repeat: repeat-x;
|
333 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
|
334 |
-
border-color: #222222 #222222 #000000;
|
335 |
-
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
336 |
-
*background-color: #222222;
|
337 |
-
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
338 |
-
}
|
339 |
-
|
340 |
-
.btn-inverse:hover, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] {
|
341 |
-
color: #ffffff;
|
342 |
-
background-color: #222222;
|
343 |
-
*background-color: #151515;
|
344 |
-
}
|
345 |
-
|
346 |
-
.btn-inverse:active, .btn-inverse.active {
|
347 |
-
background-color: #080808 \9;
|
348 |
-
}
|
349 |
-
|
350 |
-
button.btn, input[type="submit"].btn {
|
351 |
-
*padding-top: 3px;
|
352 |
-
*padding-bottom: 3px;
|
353 |
-
}
|
354 |
-
|
355 |
-
button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner {
|
356 |
-
padding: 0;
|
357 |
-
border: 0;
|
358 |
-
}
|
359 |
-
|
360 |
-
button.btn.btn-large, input[type="submit"].btn.btn-large {
|
361 |
-
*padding-top: 7px;
|
362 |
-
*padding-bottom: 7px;
|
363 |
-
}
|
364 |
-
|
365 |
-
button.btn.btn-small, input[type="submit"].btn.btn-small {
|
366 |
-
*padding-top: 3px;
|
367 |
-
*padding-bottom: 3px;
|
368 |
-
}
|
369 |
-
|
370 |
-
button.btn.btn-mini, input[type="submit"].btn.btn-mini {
|
371 |
-
*padding-top: 1px;
|
372 |
-
*padding-bottom: 1px;
|
373 |
-
}
|
374 |
-
|
375 |
-
.btn-link, .btn-link:active, .btn-link[disabled] {
|
376 |
-
background-color: transparent;
|
377 |
-
background-image: none;
|
378 |
-
-webkit-box-shadow: none;
|
379 |
-
-moz-box-shadow: none;
|
380 |
-
box-shadow: none;
|
381 |
-
}
|
382 |
-
|
383 |
-
.btn-link {
|
384 |
-
border-color: transparent;
|
385 |
-
cursor: pointer;
|
386 |
-
color: #0088cc;
|
387 |
-
-webkit-border-radius: 0;
|
388 |
-
-moz-border-radius: 0;
|
389 |
-
border-radius: 0;
|
390 |
-
}
|
391 |
-
|
392 |
-
.btn-link:hover {
|
393 |
-
color: #005580;
|
394 |
-
text-decoration: underline;
|
395 |
-
background-color: transparent;
|
396 |
-
}
|
397 |
-
|
398 |
-
.btn-link[disabled]:hover {
|
399 |
-
color: #333333;
|
400 |
-
text-decoration: none;
|
401 |
-
}
|
402 |
-
|
403 |
-
table {
|
404 |
-
max-width: 100%;
|
405 |
-
background-color: transparent;
|
406 |
-
border-collapse: collapse;
|
407 |
-
border-spacing: 0;
|
408 |
-
}
|
409 |
-
|
410 |
-
.table {
|
411 |
-
width: 100%;
|
412 |
-
margin-bottom: 20px;
|
413 |
-
}
|
414 |
-
|
415 |
-
.table th, .table td {
|
416 |
-
padding: 8px;
|
417 |
-
line-height: 20px;
|
418 |
-
text-align: left;
|
419 |
-
vertical-align: top;
|
420 |
-
border-top: 1px solid #dddddd;
|
421 |
-
}
|
422 |
-
|
423 |
-
.table th {
|
424 |
-
font-weight: bold;
|
425 |
-
}
|
426 |
-
|
427 |
-
.table thead th {
|
428 |
-
vertical-align: bottom;
|
429 |
-
}
|
430 |
-
|
431 |
-
.table caption + thead tr:first-child th, .table caption + thead tr:first-child td, .table colgroup + thead tr:first-child th, .table colgroup + thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td {
|
432 |
-
border-top: 0;
|
433 |
-
}
|
434 |
-
|
435 |
-
.table tbody + tbody {
|
436 |
-
border-top: 2px solid #dddddd;
|
437 |
-
}
|
438 |
-
|
439 |
-
.table-condensed th, .table-condensed td {
|
440 |
-
padding: 4px 5px;
|
441 |
-
}
|
442 |
-
|
443 |
-
.table-bordered {
|
444 |
-
border: 1px solid #dddddd;
|
445 |
-
border-collapse: separate;
|
446 |
-
*border-collapse: collapse;
|
447 |
-
border-left: 0;
|
448 |
-
-webkit-border-radius: 4px;
|
449 |
-
-moz-border-radius: 4px;
|
450 |
-
border-radius: 4px;
|
451 |
-
}
|
452 |
-
|
453 |
-
.table-bordered th, .table-bordered td {
|
454 |
-
border-left: 1px solid #dddddd;
|
455 |
-
}
|
456 |
-
|
457 |
-
.table-bordered caption + thead tr:first-child th, .table-bordered caption + tbody tr:first-child th, .table-bordered caption + tbody tr:first-child td, .table-bordered colgroup + thead tr:first-child th, .table-bordered colgroup + tbody tr:first-child th, .table-bordered colgroup + tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td {
|
458 |
-
border-top: 0;
|
459 |
-
}
|
460 |
-
|
461 |
-
.table-bordered thead:first-child tr:first-child th:first-child, .table-bordered tbody:first-child tr:first-child td:first-child {
|
462 |
-
-webkit-border-top-left-radius: 4px;
|
463 |
-
border-top-left-radius: 4px;
|
464 |
-
-moz-border-radius-topleft: 4px;
|
465 |
-
}
|
466 |
-
|
467 |
-
.table-bordered thead:first-child tr:first-child th:last-child, .table-bordered tbody:first-child tr:first-child td:last-child {
|
468 |
-
-webkit-border-top-right-radius: 4px;
|
469 |
-
border-top-right-radius: 4px;
|
470 |
-
-moz-border-radius-topright: 4px;
|
471 |
-
}
|
472 |
-
|
473 |
-
.table-bordered thead:last-child tr:last-child th:first-child, .table-bordered tbody:last-child tr:last-child td:first-child, .table-bordered tfoot:last-child tr:last-child td:first-child {
|
474 |
-
-webkit-border-radius: 0 0 0 4px;
|
475 |
-
-moz-border-radius: 0 0 0 4px;
|
476 |
-
border-radius: 0 0 0 4px;
|
477 |
-
-webkit-border-bottom-left-radius: 4px;
|
478 |
-
border-bottom-left-radius: 4px;
|
479 |
-
-moz-border-radius-bottomleft: 4px;
|
480 |
-
}
|
481 |
-
|
482 |
-
.table-bordered thead:last-child tr:last-child th:last-child, .table-bordered tbody:last-child tr:last-child td:last-child, .table-bordered tfoot:last-child tr:last-child td:last-child {
|
483 |
-
-webkit-border-bottom-right-radius: 4px;
|
484 |
-
border-bottom-right-radius: 4px;
|
485 |
-
-moz-border-radius-bottomright: 4px;
|
486 |
-
}
|
487 |
-
|
488 |
-
.table-bordered caption + thead tr:first-child th:first-child, .table-bordered caption + tbody tr:first-child td:first-child, .table-bordered colgroup + thead tr:first-child th:first-child, .table-bordered colgroup + tbody tr:first-child td:first-child {
|
489 |
-
-webkit-border-top-left-radius: 4px;
|
490 |
-
border-top-left-radius: 4px;
|
491 |
-
-moz-border-radius-topleft: 4px;
|
492 |
-
}
|
493 |
-
|
494 |
-
.table-bordered caption + thead tr:first-child th:last-child, .table-bordered caption + tbody tr:first-child td:last-child, .table-bordered colgroup + thead tr:first-child th:last-child, .table-bordered colgroup + tbody tr:first-child td:last-child {
|
495 |
-
-webkit-border-top-right-radius: 4px;
|
496 |
-
border-top-right-radius: 4px;
|
497 |
-
-moz-border-radius-topleft: 4px;
|
498 |
-
}
|
499 |
-
|
500 |
-
.table-striped tbody tr:nth-child(odd) td, .table-striped tbody tr:nth-child(odd) th {
|
501 |
-
background-color: #f9f9f9;
|
502 |
-
}
|
503 |
-
|
504 |
-
.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
|
505 |
-
background-color: #f5f5f5;
|
506 |
-
}
|
507 |
-
|
508 |
-
table [class*=span], .row-fluid table [class*=span] {
|
509 |
-
display: table-cell;
|
510 |
-
float: none;
|
511 |
-
margin-left: 0;
|
512 |
-
}
|
513 |
-
|
514 |
-
.table tbody tr.success td {
|
515 |
-
background-color: #dff0d8;
|
516 |
-
}
|
517 |
-
|
518 |
-
.table tbody tr.error td {
|
519 |
-
background-color: #f2dede;
|
520 |
-
}
|
521 |
-
|
522 |
-
.table tbody tr.warning td {
|
523 |
-
background-color: #fcf8e3;
|
524 |
-
}
|
525 |
-
|
526 |
-
.table tbody tr.info td {
|
527 |
-
background-color: #d9edf7;
|
528 |
-
}
|
529 |
-
|
530 |
-
.table-hover tbody tr.success:hover td {
|
531 |
-
background-color: #d0e9c6;
|
532 |
-
}
|
533 |
-
|
534 |
-
.table-hover tbody tr.error:hover td {
|
535 |
-
background-color: #ebcccc;
|
536 |
-
}
|
537 |
-
|
538 |
-
.table-hover tbody tr.warning:hover td {
|
539 |
-
background-color: #faf2cc;
|
540 |
-
}
|
541 |
-
|
542 |
-
.table-hover tbody tr.info:hover td {
|
543 |
-
background-color: #c4e3f3;
|
544 |
}
|
1 |
+
/*!
|
2 |
+
* Bootstrap v2.1.1
|
3 |
+
*
|
4 |
+
* Copyright 2012 Twitter, Inc
|
5 |
+
* Licensed under the Apache License v2.0
|
6 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
7 |
+
*
|
8 |
+
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
9 |
+
*/
|
10 |
+
clearfix {
|
11 |
+
*zoom: 1;
|
12 |
+
}
|
13 |
+
|
14 |
+
.clearfix:before, .clearfix:after {
|
15 |
+
display: table;
|
16 |
+
content: "";
|
17 |
+
line-height: 0;
|
18 |
+
}
|
19 |
+
|
20 |
+
.clearfix:after {
|
21 |
+
clear: both;
|
22 |
+
}
|
23 |
+
|
24 |
+
.hide-text {
|
25 |
+
font: 0/0 a;
|
26 |
+
color: transparent;
|
27 |
+
text-shadow: none;
|
28 |
+
background-color: transparent;
|
29 |
+
border: 0;
|
30 |
+
}
|
31 |
+
|
32 |
+
.input-block-level {
|
33 |
+
display: block;
|
34 |
+
width: 100%;
|
35 |
+
min-height: 30px;
|
36 |
+
-webkit-box-sizing: border-box;
|
37 |
+
-moz-box-sizing: border-box;
|
38 |
+
box-sizing: border-box;
|
39 |
+
}
|
40 |
+
|
41 |
+
.btn {
|
42 |
+
display: inline-block;
|
43 |
+
*display: inline;
|
44 |
+
*zoom: 1;
|
45 |
+
padding: 4px 14px;
|
46 |
+
margin-bottom: 0;
|
47 |
+
font-size: 14px;
|
48 |
+
line-height: 20px;
|
49 |
+
*line-height: 20px;
|
50 |
+
text-align: center;
|
51 |
+
vertical-align: middle;
|
52 |
+
cursor: pointer;
|
53 |
+
color: #333333;
|
54 |
+
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
|
55 |
+
background-color: #f5f5f5;
|
56 |
+
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
|
57 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
|
58 |
+
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
|
59 |
+
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
|
60 |
+
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
|
61 |
+
background-repeat: repeat-x;
|
62 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
|
63 |
+
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
|
64 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
65 |
+
*background-color: #e6e6e6;
|
66 |
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
67 |
+
border: 1px solid #bbbbbb;
|
68 |
+
*border: 0;
|
69 |
+
border-bottom-color: #a2a2a2;
|
70 |
+
-webkit-border-radius: 4px;
|
71 |
+
-moz-border-radius: 4px;
|
72 |
+
border-radius: 4px;
|
73 |
+
*margin-left: .3em;
|
74 |
+
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
75 |
+
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
76 |
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
|
77 |
+
}
|
78 |
+
|
79 |
+
.btn:hover, .btn:active, .btn.active, .btn.disabled, .btn[disabled] {
|
80 |
+
color: #333333;
|
81 |
+
background-color: #e6e6e6;
|
82 |
+
*background-color: #d9d9d9;
|
83 |
+
}
|
84 |
+
|
85 |
+
.btn:active, .btn.active {
|
86 |
+
background-color: #cccccc \9;
|
87 |
+
}
|
88 |
+
|
89 |
+
.btn:first-child {
|
90 |
+
*margin-left: 0;
|
91 |
+
}
|
92 |
+
|
93 |
+
.btn:hover {
|
94 |
+
color: #333333;
|
95 |
+
text-decoration: none;
|
96 |
+
background-color: #e6e6e6;
|
97 |
+
*background-color: #d9d9d9;
|
98 |
+
background-position: 0 -15px;
|
99 |
+
-webkit-transition: background-position 0.1s linear;
|
100 |
+
-moz-transition: background-position 0.1s linear;
|
101 |
+
-o-transition: background-position 0.1s linear;
|
102 |
+
transition: background-position 0.1s linear;
|
103 |
+
}
|
104 |
+
|
105 |
+
.btn:focus {
|
106 |
+
outline: thin dotted #333;
|
107 |
+
outline: 5px auto -webkit-focus-ring-color;
|
108 |
+
outline-offset: -2px;
|
109 |
+
}
|
110 |
+
|
111 |
+
.btn.active, .btn:active {
|
112 |
+
background-color: #e6e6e6;
|
113 |
+
background-color: #d9d9d9 \9;
|
114 |
+
background-image: none;
|
115 |
+
outline: 0;
|
116 |
+
-webkit-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
117 |
+
-moz-box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
118 |
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
|
119 |
+
}
|
120 |
+
|
121 |
+
.btn.disabled, .btn[disabled] {
|
122 |
+
cursor: default;
|
123 |
+
background-color: #e6e6e6;
|
124 |
+
background-image: none;
|
125 |
+
opacity: 0.65;
|
126 |
+
filter: alpha(opacity=65);
|
127 |
+
-webkit-box-shadow: none;
|
128 |
+
-moz-box-shadow: none;
|
129 |
+
box-shadow: none;
|
130 |
+
}
|
131 |
+
|
132 |
+
.btn-large {
|
133 |
+
padding: 9px 14px;
|
134 |
+
font-size: 16px;
|
135 |
+
line-height: normal;
|
136 |
+
-webkit-border-radius: 5px;
|
137 |
+
-moz-border-radius: 5px;
|
138 |
+
border-radius: 5px;
|
139 |
+
}
|
140 |
+
|
141 |
+
.btn-large [class^="icon-"] {
|
142 |
+
margin-top: 2px;
|
143 |
+
}
|
144 |
+
|
145 |
+
.btn-small {
|
146 |
+
padding: 3px 9px;
|
147 |
+
font-size: 12px;
|
148 |
+
line-height: 18px;
|
149 |
+
}
|
150 |
+
|
151 |
+
.btn-small [class^="icon-"] {
|
152 |
+
margin-top: 0;
|
153 |
+
}
|
154 |
+
|
155 |
+
.btn-mini {
|
156 |
+
padding: 2px 6px;
|
157 |
+
font-size: 11px;
|
158 |
+
line-height: 17px;
|
159 |
+
}
|
160 |
+
|
161 |
+
.btn-block {
|
162 |
+
display: block;
|
163 |
+
width: 100%;
|
164 |
+
padding-left: 0;
|
165 |
+
padding-right: 0;
|
166 |
+
-webkit-box-sizing: border-box;
|
167 |
+
-moz-box-sizing: border-box;
|
168 |
+
box-sizing: border-box;
|
169 |
+
}
|
170 |
+
|
171 |
+
.btn-block + .btn-block {
|
172 |
+
margin-top: 5px;
|
173 |
+
}
|
174 |
+
|
175 |
+
input[type="submit"].btn-block, input[type="reset"].btn-block, input[type="button"].btn-block {
|
176 |
+
width: 100%;
|
177 |
+
}
|
178 |
+
|
179 |
+
.btn-primary.active, .btn-warning.active, .btn-danger.active, .btn-success.active, .btn-info.active, .btn-inverse.active {
|
180 |
+
color: rgba(255, 255, 255, 0.75);
|
181 |
+
}
|
182 |
+
|
183 |
+
.btn {
|
184 |
+
border-color: #c5c5c5;
|
185 |
+
border-color: rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
|
186 |
+
}
|
187 |
+
|
188 |
+
.btn-primary {
|
189 |
+
color: #ffffff;
|
190 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
191 |
+
background-color: #006dcc;
|
192 |
+
background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
|
193 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
|
194 |
+
background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
|
195 |
+
background-image: -o-linear-gradient(top, #0088cc, #0044cc);
|
196 |
+
background-image: linear-gradient(to bottom, #0088cc, #0044cc);
|
197 |
+
background-repeat: repeat-x;
|
198 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc', endColorstr='#ff0044cc', GradientType=0);
|
199 |
+
border-color: #0044cc #0044cc #002a80;
|
200 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
201 |
+
*background-color: #0044cc;
|
202 |
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
203 |
+
}
|
204 |
+
|
205 |
+
.btn-primary:hover, .btn-primary:active, .btn-primary.active, .btn-primary.disabled, .btn-primary[disabled] {
|
206 |
+
color: #ffffff;
|
207 |
+
background-color: #0044cc;
|
208 |
+
*background-color: #003bb3;
|
209 |
+
}
|
210 |
+
|
211 |
+
.btn-primary:active, .btn-primary.active {
|
212 |
+
background-color: #003399 \9;
|
213 |
+
}
|
214 |
+
|
215 |
+
.btn-warning {
|
216 |
+
color: #ffffff;
|
217 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
218 |
+
background-color: #faa732;
|
219 |
+
background-image: -moz-linear-gradient(top, #fbb450, #f89406);
|
220 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));
|
221 |
+
background-image: -webkit-linear-gradient(top, #fbb450, #f89406);
|
222 |
+
background-image: -o-linear-gradient(top, #fbb450, #f89406);
|
223 |
+
background-image: linear-gradient(to bottom, #fbb450, #f89406);
|
224 |
+
background-repeat: repeat-x;
|
225 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450', endColorstr='#fff89406', GradientType=0);
|
226 |
+
border-color: #f89406 #f89406 #ad6704;
|
227 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
228 |
+
*background-color: #f89406;
|
229 |
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
230 |
+
}
|
231 |
+
|
232 |
+
.btn-warning:hover, .btn-warning:active, .btn-warning.active, .btn-warning.disabled, .btn-warning[disabled] {
|
233 |
+
color: #ffffff;
|
234 |
+
background-color: #f89406;
|
235 |
+
*background-color: #df8505;
|
236 |
+
}
|
237 |
+
|
238 |
+
.btn-warning:active, .btn-warning.active {
|
239 |
+
background-color: #c67605 \9;
|
240 |
+
}
|
241 |
+
|
242 |
+
.btn-danger {
|
243 |
+
color: #ffffff;
|
244 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
245 |
+
background-color: #da4f49;
|
246 |
+
background-image: -moz-linear-gradient(top, #ee5f5b, #bd362f);
|
247 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));
|
248 |
+
background-image: -webkit-linear-gradient(top, #ee5f5b, #bd362f);
|
249 |
+
background-image: -o-linear-gradient(top, #ee5f5b, #bd362f);
|
250 |
+
background-image: linear-gradient(to bottom, #ee5f5b, #bd362f);
|
251 |
+
background-repeat: repeat-x;
|
252 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b', endColorstr='#ffbd362f', GradientType=0);
|
253 |
+
border-color: #bd362f #bd362f #802420;
|
254 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
255 |
+
*background-color: #bd362f;
|
256 |
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
257 |
+
}
|
258 |
+
|
259 |
+
.btn-danger:hover, .btn-danger:active, .btn-danger.active, .btn-danger.disabled, .btn-danger[disabled] {
|
260 |
+
color: #ffffff;
|
261 |
+
background-color: #bd362f;
|
262 |
+
*background-color: #a9302a;
|
263 |
+
}
|
264 |
+
|
265 |
+
.btn-danger:active, .btn-danger.active {
|
266 |
+
background-color: #942a25 \9;
|
267 |
+
}
|
268 |
+
|
269 |
+
.btn-success {
|
270 |
+
color: #ffffff;
|
271 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
272 |
+
background-color: #5bb75b;
|
273 |
+
background-image: -moz-linear-gradient(top, #62c462, #51a351);
|
274 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));
|
275 |
+
background-image: -webkit-linear-gradient(top, #62c462, #51a351);
|
276 |
+
background-image: -o-linear-gradient(top, #62c462, #51a351);
|
277 |
+
background-image: linear-gradient(to bottom, #62c462, #51a351);
|
278 |
+
background-repeat: repeat-x;
|
279 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462', endColorstr='#ff51a351', GradientType=0);
|
280 |
+
border-color: #51a351 #51a351 #387038;
|
281 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
282 |
+
*background-color: #51a351;
|
283 |
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
284 |
+
}
|
285 |
+
|
286 |
+
.btn-success:hover, .btn-success:active, .btn-success.active, .btn-success.disabled, .btn-success[disabled] {
|
287 |
+
color: #ffffff;
|
288 |
+
background-color: #51a351;
|
289 |
+
*background-color: #499249;
|
290 |
+
}
|
291 |
+
|
292 |
+
.btn-success:active, .btn-success.active {
|
293 |
+
background-color: #408140 \9;
|
294 |
+
}
|
295 |
+
|
296 |
+
.btn-info {
|
297 |
+
color: #ffffff;
|
298 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
299 |
+
background-color: #49afcd;
|
300 |
+
background-image: -moz-linear-gradient(top, #5bc0de, #2f96b4);
|
301 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));
|
302 |
+
background-image: -webkit-linear-gradient(top, #5bc0de, #2f96b4);
|
303 |
+
background-image: -o-linear-gradient(top, #5bc0de, #2f96b4);
|
304 |
+
background-image: linear-gradient(to bottom, #5bc0de, #2f96b4);
|
305 |
+
background-repeat: repeat-x;
|
306 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2f96b4', GradientType=0);
|
307 |
+
border-color: #2f96b4 #2f96b4 #1f6377;
|
308 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
309 |
+
*background-color: #2f96b4;
|
310 |
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
311 |
+
}
|
312 |
+
|
313 |
+
.btn-info:hover, .btn-info:active, .btn-info.active, .btn-info.disabled, .btn-info[disabled] {
|
314 |
+
color: #ffffff;
|
315 |
+
background-color: #2f96b4;
|
316 |
+
*background-color: #2a85a0;
|
317 |
+
}
|
318 |
+
|
319 |
+
.btn-info:active, .btn-info.active {
|
320 |
+
background-color: #24748c \9;
|
321 |
+
}
|
322 |
+
|
323 |
+
.btn-inverse {
|
324 |
+
color: #ffffff;
|
325 |
+
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
|
326 |
+
background-color: #363636;
|
327 |
+
background-image: -moz-linear-gradient(top, #444444, #222222);
|
328 |
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#444444), to(#222222));
|
329 |
+
background-image: -webkit-linear-gradient(top, #444444, #222222);
|
330 |
+
background-image: -o-linear-gradient(top, #444444, #222222);
|
331 |
+
background-image: linear-gradient(to bottom, #444444, #222222);
|
332 |
+
background-repeat: repeat-x;
|
333 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444', endColorstr='#ff222222', GradientType=0);
|
334 |
+
border-color: #222222 #222222 #000000;
|
335 |
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
336 |
+
*background-color: #222222;
|
337 |
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
|
338 |
+
}
|
339 |
+
|
340 |
+
.btn-inverse:hover, .btn-inverse:active, .btn-inverse.active, .btn-inverse.disabled, .btn-inverse[disabled] {
|
341 |
+
color: #ffffff;
|
342 |
+
background-color: #222222;
|
343 |
+
*background-color: #151515;
|
344 |
+
}
|
345 |
+
|
346 |
+
.btn-inverse:active, .btn-inverse.active {
|
347 |
+
background-color: #080808 \9;
|
348 |
+
}
|
349 |
+
|
350 |
+
button.btn, input[type="submit"].btn {
|
351 |
+
*padding-top: 3px;
|
352 |
+
*padding-bottom: 3px;
|
353 |
+
}
|
354 |
+
|
355 |
+
button.btn::-moz-focus-inner, input[type="submit"].btn::-moz-focus-inner {
|
356 |
+
padding: 0;
|
357 |
+
border: 0;
|
358 |
+
}
|
359 |
+
|
360 |
+
button.btn.btn-large, input[type="submit"].btn.btn-large {
|
361 |
+
*padding-top: 7px;
|
362 |
+
*padding-bottom: 7px;
|
363 |
+
}
|
364 |
+
|
365 |
+
button.btn.btn-small, input[type="submit"].btn.btn-small {
|
366 |
+
*padding-top: 3px;
|
367 |
+
*padding-bottom: 3px;
|
368 |
+
}
|
369 |
+
|
370 |
+
button.btn.btn-mini, input[type="submit"].btn.btn-mini {
|
371 |
+
*padding-top: 1px;
|
372 |
+
*padding-bottom: 1px;
|
373 |
+
}
|
374 |
+
|
375 |
+
.btn-link, .btn-link:active, .btn-link[disabled] {
|
376 |
+
background-color: transparent;
|
377 |
+
background-image: none;
|
378 |
+
-webkit-box-shadow: none;
|
379 |
+
-moz-box-shadow: none;
|
380 |
+
box-shadow: none;
|
381 |
+
}
|
382 |
+
|
383 |
+
.btn-link {
|
384 |
+
border-color: transparent;
|
385 |
+
cursor: pointer;
|
386 |
+
color: #0088cc;
|
387 |
+
-webkit-border-radius: 0;
|
388 |
+
-moz-border-radius: 0;
|
389 |
+
border-radius: 0;
|
390 |
+
}
|
391 |
+
|
392 |
+
.btn-link:hover {
|
393 |
+
color: #005580;
|
394 |
+
text-decoration: underline;
|
395 |
+
background-color: transparent;
|
396 |
+
}
|
397 |
+
|
398 |
+
.btn-link[disabled]:hover {
|
399 |
+
color: #333333;
|
400 |
+
text-decoration: none;
|
401 |
+
}
|
402 |
+
|
403 |
+
table {
|
404 |
+
max-width: 100%;
|
405 |
+
background-color: transparent;
|
406 |
+
border-collapse: collapse;
|
407 |
+
border-spacing: 0;
|
408 |
+
}
|
409 |
+
|
410 |
+
.table {
|
411 |
+
width: 100%;
|
412 |
+
margin-bottom: 20px;
|
413 |
+
}
|
414 |
+
|
415 |
+
.table th, .table td {
|
416 |
+
padding: 8px;
|
417 |
+
line-height: 20px;
|
418 |
+
text-align: left;
|
419 |
+
vertical-align: top;
|
420 |
+
border-top: 1px solid #dddddd;
|
421 |
+
}
|
422 |
+
|
423 |
+
.table th {
|
424 |
+
font-weight: bold;
|
425 |
+
}
|
426 |
+
|
427 |
+
.table thead th {
|
428 |
+
vertical-align: bottom;
|
429 |
+
}
|
430 |
+
|
431 |
+
.table caption + thead tr:first-child th, .table caption + thead tr:first-child td, .table colgroup + thead tr:first-child th, .table colgroup + thead tr:first-child td, .table thead:first-child tr:first-child th, .table thead:first-child tr:first-child td {
|
432 |
+
border-top: 0;
|
433 |
+
}
|
434 |
+
|
435 |
+
.table tbody + tbody {
|
436 |
+
border-top: 2px solid #dddddd;
|
437 |
+
}
|
438 |
+
|
439 |
+
.table-condensed th, .table-condensed td {
|
440 |
+
padding: 4px 5px;
|
441 |
+
}
|
442 |
+
|
443 |
+
.table-bordered {
|
444 |
+
border: 1px solid #dddddd;
|
445 |
+
border-collapse: separate;
|
446 |
+
*border-collapse: collapse;
|
447 |
+
border-left: 0;
|
448 |
+
-webkit-border-radius: 4px;
|
449 |
+
-moz-border-radius: 4px;
|
450 |
+
border-radius: 4px;
|
451 |
+
}
|
452 |
+
|
453 |
+
.table-bordered th, .table-bordered td {
|
454 |
+
border-left: 1px solid #dddddd;
|
455 |
+
}
|
456 |
+
|
457 |
+
.table-bordered caption + thead tr:first-child th, .table-bordered caption + tbody tr:first-child th, .table-bordered caption + tbody tr:first-child td, .table-bordered colgroup + thead tr:first-child th, .table-bordered colgroup + tbody tr:first-child th, .table-bordered colgroup + tbody tr:first-child td, .table-bordered thead:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child th, .table-bordered tbody:first-child tr:first-child td {
|
458 |
+
border-top: 0;
|
459 |
+
}
|
460 |
+
|
461 |
+
.table-bordered thead:first-child tr:first-child th:first-child, .table-bordered tbody:first-child tr:first-child td:first-child {
|
462 |
+
-webkit-border-top-left-radius: 4px;
|
463 |
+
border-top-left-radius: 4px;
|
464 |
+
-moz-border-radius-topleft: 4px;
|
465 |
+
}
|
466 |
+
|
467 |
+
.table-bordered thead:first-child tr:first-child th:last-child, .table-bordered tbody:first-child tr:first-child td:last-child {
|
468 |
+
-webkit-border-top-right-radius: 4px;
|
469 |
+
border-top-right-radius: 4px;
|
470 |
+
-moz-border-radius-topright: 4px;
|
471 |
+
}
|
472 |
+
|
473 |
+
.table-bordered thead:last-child tr:last-child th:first-child, .table-bordered tbody:last-child tr:last-child td:first-child, .table-bordered tfoot:last-child tr:last-child td:first-child {
|
474 |
+
-webkit-border-radius: 0 0 0 4px;
|
475 |
+
-moz-border-radius: 0 0 0 4px;
|
476 |
+
border-radius: 0 0 0 4px;
|
477 |
+
-webkit-border-bottom-left-radius: 4px;
|
478 |
+
border-bottom-left-radius: 4px;
|
479 |
+
-moz-border-radius-bottomleft: 4px;
|
480 |
+
}
|
481 |
+
|
482 |
+
.table-bordered thead:last-child tr:last-child th:last-child, .table-bordered tbody:last-child tr:last-child td:last-child, .table-bordered tfoot:last-child tr:last-child td:last-child {
|
483 |
+
-webkit-border-bottom-right-radius: 4px;
|
484 |
+
border-bottom-right-radius: 4px;
|
485 |
+
-moz-border-radius-bottomright: 4px;
|
486 |
+
}
|
487 |
+
|
488 |
+
.table-bordered caption + thead tr:first-child th:first-child, .table-bordered caption + tbody tr:first-child td:first-child, .table-bordered colgroup + thead tr:first-child th:first-child, .table-bordered colgroup + tbody tr:first-child td:first-child {
|
489 |
+
-webkit-border-top-left-radius: 4px;
|
490 |
+
border-top-left-radius: 4px;
|
491 |
+
-moz-border-radius-topleft: 4px;
|
492 |
+
}
|
493 |
+
|
494 |
+
.table-bordered caption + thead tr:first-child th:last-child, .table-bordered caption + tbody tr:first-child td:last-child, .table-bordered colgroup + thead tr:first-child th:last-child, .table-bordered colgroup + tbody tr:first-child td:last-child {
|
495 |
+
-webkit-border-top-right-radius: 4px;
|
496 |
+
border-top-right-radius: 4px;
|
497 |
+
-moz-border-radius-topleft: 4px;
|
498 |
+
}
|
499 |
+
|
500 |
+
.table-striped tbody tr:nth-child(odd) td, .table-striped tbody tr:nth-child(odd) th {
|
501 |
+
background-color: #f9f9f9;
|
502 |
+
}
|
503 |
+
|
504 |
+
.table-hover tbody tr:hover td, .table-hover tbody tr:hover th {
|
505 |
+
background-color: #f5f5f5;
|
506 |
+
}
|
507 |
+
|
508 |
+
table [class*=span], .row-fluid table [class*=span] {
|
509 |
+
display: table-cell;
|
510 |
+
float: none;
|
511 |
+
margin-left: 0;
|
512 |
+
}
|
513 |
+
|
514 |
+
.table tbody tr.success td {
|
515 |
+
background-color: #dff0d8;
|
516 |
+
}
|
517 |
+
|
518 |
+
.table tbody tr.error td {
|
519 |
+
background-color: #f2dede;
|
520 |
+
}
|
521 |
+
|
522 |
+
.table tbody tr.warning td {
|
523 |
+
background-color: #fcf8e3;
|
524 |
+
}
|
525 |
+
|
526 |
+
.table tbody tr.info td {
|
527 |
+
background-color: #d9edf7;
|
528 |
+
}
|
529 |
+
|
530 |
+
.table-hover tbody tr.success:hover td {
|
531 |
+
background-color: #d0e9c6;
|
532 |
+
}
|
533 |
+
|
534 |
+
.table-hover tbody tr.error:hover td {
|
535 |
+
background-color: #ebcccc;
|
536 |
+
}
|
537 |
+
|
538 |
+
.table-hover tbody tr.warning:hover td {
|
539 |
+
background-color: #faf2cc;
|
540 |
+
}
|
541 |
+
|
542 |
+
.table-hover tbody tr.info:hover td {
|
543 |
+
background-color: #c4e3f3;
|
544 |
}
|
{WCVendors/assets → assets}/images/icons/truck.png
RENAMED
File without changes
|
{WCVendors/assets → assets}/js/front-orders.js
RENAMED
@@ -1,9 +1,9 @@
|
|
1 |
-
jQuery(function () {
|
2 |
-
jQuery('p.custom_tracking_link_field, p.custom_tracking_provider_field').hide();
|
3 |
-
jQuery('div.order-comments, div.order-tracking').hide();
|
4 |
-
|
5 |
-
jQuery('a.order-comments-link, a.order-tracking-link').on('click', function (e) {
|
6 |
-
e.preventDefault();
|
7 |
-
jQuery(this).next('div').slideToggle();
|
8 |
-
});
|
9 |
});
|
1 |
+
jQuery(function () {
|
2 |
+
jQuery('p.custom_tracking_link_field, p.custom_tracking_provider_field').hide();
|
3 |
+
jQuery('div.order-comments, div.order-tracking').hide();
|
4 |
+
|
5 |
+
jQuery('a.order-comments-link, a.order-tracking-link').on('click', function (e) {
|
6 |
+
e.preventDefault();
|
7 |
+
jQuery(this).next('div').slideToggle();
|
8 |
+
});
|
9 |
});
|
{WCVendors/assets → assets}/js/wcv-admin-quick-edit.js
RENAMED
File without changes
|
changelog.txt
CHANGED
@@ -1,5 +1,22 @@
|
|
1 |
Changelog for WC Vendors
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Version 1.5.0
|
4 |
|
5 |
* Added: Spanish translation thanks Mauricio
|
1 |
Changelog for WC Vendors
|
2 |
|
3 |
+
Version 1.6.1
|
4 |
+
|
5 |
+
* Fixed: Support for Per Product Shipping 2.2.x #126
|
6 |
+
|
7 |
+
Version 1.6.0
|
8 |
+
|
9 |
+
* Added: Admin notices for vendor page slug & permalinks
|
10 |
+
* Fixed: Plugin row meta links
|
11 |
+
* Added: Upgrade notice
|
12 |
+
* Fixed: Rounding issue #120
|
13 |
+
* Fixed: Paypal https host check depreciated call
|
14 |
+
* Added: show_products attribute #107
|
15 |
+
* Updated: Text in denied template to make more sense when registration disabled #123
|
16 |
+
* Updated: wcv_vendorslist shortcode now shows 3 column output #123
|
17 |
+
* Fixed: Index issue #122
|
18 |
+
* Updated: New plugin and template directory structure - IMPORTANT READ KB
|
19 |
+
|
20 |
Version 1.5.0
|
21 |
|
22 |
* Added: Spanish translation thanks Mauricio
|
class-wc-vendors.php
CHANGED
@@ -7,12 +7,12 @@
|
|
7 |
* Author: WC Vendors
|
8 |
* Author URI: http://wcvendors.com
|
9 |
*
|
10 |
-
* Version: 1.
|
11 |
* Requires at least: 4.0.0
|
12 |
* Tested up to: 4.1.1
|
13 |
*
|
14 |
* Text Domain: wcvendors
|
15 |
-
* Domain Path: /
|
16 |
*
|
17 |
* @category Plugin
|
18 |
* @copyright Copyright © 2012 Matt Gates
|
@@ -25,7 +25,7 @@
|
|
25 |
/**
|
26 |
* Required functions
|
27 |
*/
|
28 |
-
require_once trailingslashit( dirname( __FILE__ ) ) . '
|
29 |
|
30 |
/**
|
31 |
* Check if WooCommerce is active
|
@@ -33,8 +33,9 @@ require_once trailingslashit( dirname( __FILE__ ) ) . 'WCVendors/classes/include
|
|
33 |
if ( is_woocommerce_activated() ) {
|
34 |
|
35 |
/* Define an absolute path to our plugin directory. */
|
36 |
-
if ( !defined( 'wcv_plugin_dir' ) ) define( 'wcv_plugin_dir', trailingslashit( dirname( __FILE__ ) ) . '
|
37 |
-
if ( !defined( 'wcv_assets_url' ) ) define( 'wcv_assets_url', trailingslashit( plugins_url( '
|
|
|
38 |
|
39 |
$domain = 'wcvendors';
|
40 |
|
@@ -45,7 +46,7 @@ if ( is_woocommerce_activated() ) {
|
|
45 |
//Place your custom translations into wp-content/languages/wc-vendors to be upgrade safe
|
46 |
load_textdomain($domain, WP_LANG_DIR.'/wc-vendors/'.$domain.'-'.$locale.'.mo');
|
47 |
|
48 |
-
load_plugin_textdomain( 'wcvendors', false, dirname( plugin_basename( __FILE__ ) ) . '/
|
49 |
|
50 |
|
51 |
/**
|
@@ -72,11 +73,17 @@ if ( is_woocommerce_activated() ) {
|
|
72 |
// Install & upgrade
|
73 |
add_action( 'admin_init', array( $this, 'check_install' ) );
|
74 |
add_action( 'admin_init', array( $this, 'maybe_flush_permalinks' ), 99 );
|
|
|
|
|
|
|
75 |
|
76 |
add_action( 'plugins_loaded', array( $this, 'load_settings' ) );
|
77 |
add_action( 'plugins_loaded', array( $this, 'include_gateways' ) );
|
78 |
add_action( 'plugins_loaded', array( $this, 'include_core' ) );
|
79 |
add_action( 'current_screen', array( $this, 'include_assets' ) );
|
|
|
|
|
|
|
80 |
|
81 |
add_action( self::$id . '_options_updated', array( $this, 'option_updates' ), 10, 2 );
|
82 |
|
@@ -250,8 +257,10 @@ if ( is_woocommerce_activated() ) {
|
|
250 |
|
251 |
|
252 |
/**
|
|
|
|
|
253 |
*
|
254 |
-
|
255 |
public function maybe_flush_permalinks()
|
256 |
{
|
257 |
if ( get_option( WC_Vendors::$id . '_flush_rules' ) ) {
|
@@ -260,6 +269,73 @@ if ( is_woocommerce_activated() ) {
|
|
260 |
}
|
261 |
}
|
262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
|
264 |
}
|
265 |
|
7 |
* Author: WC Vendors
|
8 |
* Author URI: http://wcvendors.com
|
9 |
*
|
10 |
+
* Version: 1.6.1
|
11 |
* Requires at least: 4.0.0
|
12 |
* Tested up to: 4.1.1
|
13 |
*
|
14 |
* Text Domain: wcvendors
|
15 |
+
* Domain Path: /languages/
|
16 |
*
|
17 |
* @category Plugin
|
18 |
* @copyright Copyright © 2012 Matt Gates
|
25 |
/**
|
26 |
* Required functions
|
27 |
*/
|
28 |
+
require_once trailingslashit( dirname( __FILE__ ) ) . 'classes/includes/class-functions.php';
|
29 |
|
30 |
/**
|
31 |
* Check if WooCommerce is active
|
33 |
if ( is_woocommerce_activated() ) {
|
34 |
|
35 |
/* Define an absolute path to our plugin directory. */
|
36 |
+
if ( !defined( 'wcv_plugin_dir' ) ) define( 'wcv_plugin_dir', trailingslashit( dirname( __FILE__ ) ) . '/' );
|
37 |
+
if ( !defined( 'wcv_assets_url' ) ) define( 'wcv_assets_url', trailingslashit( plugins_url( 'assets', __FILE__ ) ) );
|
38 |
+
if ( !defined( 'wcv_plugin_base' ) ) define( 'wcv_plugin_base', plugin_basename( __FILE__ ) );
|
39 |
|
40 |
$domain = 'wcvendors';
|
41 |
|
46 |
//Place your custom translations into wp-content/languages/wc-vendors to be upgrade safe
|
47 |
load_textdomain($domain, WP_LANG_DIR.'/wc-vendors/'.$domain.'-'.$locale.'.mo');
|
48 |
|
49 |
+
load_plugin_textdomain( 'wcvendors', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
50 |
|
51 |
|
52 |
/**
|
73 |
// Install & upgrade
|
74 |
add_action( 'admin_init', array( $this, 'check_install' ) );
|
75 |
add_action( 'admin_init', array( $this, 'maybe_flush_permalinks' ), 99 );
|
76 |
+
add_action( 'admin_init', array( $this, 'wcv_required_ignore_notices' ) );
|
77 |
+
add_action( 'admin_notices', array( $this, 'wcv_required_admin_notice') );
|
78 |
+
|
79 |
|
80 |
add_action( 'plugins_loaded', array( $this, 'load_settings' ) );
|
81 |
add_action( 'plugins_loaded', array( $this, 'include_gateways' ) );
|
82 |
add_action( 'plugins_loaded', array( $this, 'include_core' ) );
|
83 |
add_action( 'current_screen', array( $this, 'include_assets' ) );
|
84 |
+
|
85 |
+
add_filter( 'plugin_row_meta', array($this, 'plugin_row_meta'), 10, 2 );
|
86 |
+
|
87 |
|
88 |
add_action( self::$id . '_options_updated', array( $this, 'option_updates' ), 10, 2 );
|
89 |
|
257 |
|
258 |
|
259 |
/**
|
260 |
+
* If the settings are updated and the vendor page link has changed update permalinks
|
261 |
+
* @access public
|
262 |
*
|
263 |
+
*/
|
264 |
public function maybe_flush_permalinks()
|
265 |
{
|
266 |
if ( get_option( WC_Vendors::$id . '_flush_rules' ) ) {
|
269 |
}
|
270 |
}
|
271 |
|
272 |
+
/**
|
273 |
+
* Add links to plugin page to our external help site.
|
274 |
+
* @param $links - links array from action
|
275 |
+
* @param $file - file reference for this plugin
|
276 |
+
* @access public
|
277 |
+
*
|
278 |
+
*/
|
279 |
+
public static function plugin_row_meta( $links, $file ) {
|
280 |
+
if ( $file == wcv_plugin_base ) {
|
281 |
+
|
282 |
+
$row_meta = array(
|
283 |
+
'docs' => '<a href="http://www.wcvendors.com/knowledgebase/" target="_blank">'.__( 'Documentation/KB', 'wcvendors' ).'</a>',
|
284 |
+
'help' => '<a href="http://www.wcvendors.com/help/" target="_blank">'.__( 'Help Forums', 'wcvendors').'</a>',
|
285 |
+
'support' => '<a href="http://www.wcvendors.com/contact-us/" target="_blank">'.__( 'Paid Support', 'wcvendors' ).'</a>'
|
286 |
+
);
|
287 |
+
|
288 |
+
return array_merge( $links, $row_meta );
|
289 |
+
}
|
290 |
+
|
291 |
+
return (array) $links;
|
292 |
+
}
|
293 |
+
|
294 |
+
/**
|
295 |
+
* Add admin notices to ensure users are saving the settings correctly
|
296 |
+
* @access public
|
297 |
+
*
|
298 |
+
*/
|
299 |
+
public function wcv_required_admin_notice(){
|
300 |
+
global $current_user;
|
301 |
+
|
302 |
+
if ( current_user_can( 'manage_options' ) ) {
|
303 |
+
$current_user_id = $current_user->ID;
|
304 |
+
|
305 |
+
if ( WC_Vendors::$pv_options->get_option( 'vendor_shop_permalink' ) == null && ! get_user_meta( $current_user_id, 'wcv_shop_ignore_notice' ) ) {
|
306 |
+
echo '<div class="updated">
|
307 |
+
<p>'.sprintf (__('WC Vendors requires the Vendor shop page value be set <a href="%s">click here to set it.</a> | <a href="%s">Hide Notice</a>','wcvendors'), 'admin.php?page=wc_prd_vendor' ,add_query_arg( 'wcv_shop_ignore_notice', '0' )).'</p>
|
308 |
+
</div>';
|
309 |
+
}
|
310 |
+
|
311 |
+
$general_tab = ( isset( $_GET['tab'] ) && 'general' == $_GET['tab'] ) || !isset( $_GET['tab'] ) ? true : false;
|
312 |
+
|
313 |
+
if ( isset( $_GET['page'] ) && 'wc_prd_vendor' == $_GET['page'] && isset( $_GET[ 'settings-updated' ] ) && $general_tab == true && ! get_user_meta( $current_user_id, 'wcv_pl_ignore_notice' ) ) {
|
314 |
+
echo '<div class="updated">
|
315 |
+
<p>'.sprintf (__('You must save your permalinks once you have modified your vendor page. <a href="%s">click here to save</a>. | <a href="%s">Hide Notice</a>','wcvendors'), 'options-permalink.php', add_query_arg( 'cron_mail_ignore', '0' )).'</p>
|
316 |
+
</div>';
|
317 |
+
}
|
318 |
+
}
|
319 |
+
}
|
320 |
+
|
321 |
+
/**
|
322 |
+
* Add user meta to remember ignore notices
|
323 |
+
* @access public
|
324 |
+
*
|
325 |
+
*/
|
326 |
+
public function wcv_required_ignore_notices(){
|
327 |
+
global $current_user;
|
328 |
+
$current_user_id = $current_user->ID;
|
329 |
+
|
330 |
+
/* If user clicks to ignore the notice, add that to their user meta */
|
331 |
+
if ( isset( $_GET[ 'wcv_shop_ignore_notice' ] ) && '0' == $_GET[ 'wcv_shop_ignore_notice' ] ) {
|
332 |
+
add_user_meta( $current_user_id, 'wcv_shop_ignore_notice', 'true', true);
|
333 |
+
}
|
334 |
+
if ( isset($_GET['wcv_pl_ignore_notice']) && '0' == $_GET['wcv_pl_ignore_notice'] ) {
|
335 |
+
add_user_meta( $current_user_id, 'wcv_pl_ignore_notice', 'true' , true);
|
336 |
+
}
|
337 |
+
}
|
338 |
+
|
339 |
|
340 |
}
|
341 |
|
{WCVendors/classes → classes}/admin/class-admin-page.php
RENAMED
@@ -1,590 +1,590 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WCV_Admin_Setup
|
4 |
-
{
|
5 |
-
/**
|
6 |
-
* WC > Referrals menu
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
public function __construct()
|
11 |
-
{
|
12 |
-
add_filter( 'set-screen-option', array( 'WCV_Admin_Setup', 'set_table_option' ), 10, 3 );
|
13 |
-
add_action( 'admin_menu', array( 'WCV_Admin_Setup', 'menu' ) );
|
14 |
-
|
15 |
-
add_action( 'woocommerce_admin_order_data_after_shipping_address', array( $this, 'add_vendor_details' ), 10, 2 );
|
16 |
-
add_action( 'woocommerce_admin_order_actions_end', array( $this, 'append_actions' ), 10, 1 );
|
17 |
-
}
|
18 |
-
|
19 |
-
|
20 |
-
public function add_vendor_details( $order )
|
21 |
-
{
|
22 |
-
$actions = $this->append_actions( $order, true );
|
23 |
-
|
24 |
-
if (empty( $actions['wc_pv_shipped']['name'] )) {
|
25 |
-
return;
|
26 |
-
}
|
27 |
-
|
28 |
-
echo '<h4>' . __('Vendors shipped', 'wcvendors') . '</h4><br/>';
|
29 |
-
echo $actions['wc_pv_shipped']['name'];
|
30 |
-
}
|
31 |
-
|
32 |
-
public function append_actions( $order, $order_page = false )
|
33 |
-
{
|
34 |
-
global $woocommerce;
|
35 |
-
|
36 |
-
$authors = WCV_Vendors::get_vendors_from_order( $order );
|
37 |
-
$authors = $authors ? array_keys( $authors ) : array();
|
38 |
-
if ( empty( $authors ) ) return false;
|
39 |
-
|
40 |
-
$shipped = (array) get_post_meta( $order->id, 'wc_pv_shipped', true );
|
41 |
-
$string = '</br></br>';
|
42 |
-
|
43 |
-
foreach ($authors as $author ) {
|
44 |
-
$string .= in_array( $author, $shipped ) ? '✔ ' : '✕ ';
|
45 |
-
$string .= WCV_Vendors::get_vendor_shop_name( $author );
|
46 |
-
$string .= '</br>';
|
47 |
-
}
|
48 |
-
|
49 |
-
$response = array(
|
50 |
-
'url' => '#',
|
51 |
-
'name' => __('Vendors Shipped', 'wcvendors') . $string,
|
52 |
-
'action' => 'wc_pv_shipped',
|
53 |
-
'image_url' => wcv_assets_url . '/images/icons/truck.png',
|
54 |
-
);
|
55 |
-
|
56 |
-
if ( ! $order_page ) {
|
57 |
-
printf( '<a class="button tips %s" href="%s" data-tip="%s"><img style="width:16px;height:16px;" src="%s"></a>', $response['action'], $response['url'], $response['name'], $response['image_url'] );
|
58 |
-
} else {
|
59 |
-
echo $response['name'];
|
60 |
-
}
|
61 |
-
|
62 |
-
return $response;
|
63 |
-
}
|
64 |
-
|
65 |
-
|
66 |
-
/**
|
67 |
-
*
|
68 |
-
*/
|
69 |
-
public static function menu()
|
70 |
-
{
|
71 |
-
$hook = add_submenu_page(
|
72 |
-
'woocommerce',
|
73 |
-
__( 'Commission', 'wcvendors' ), __( 'Commission', 'wcvendors' ),
|
74 |
-
'manage_woocommerce',
|
75 |
-
'pv_admin_commissions',
|
76 |
-
array( 'WCV_Admin_Setup', 'commissions_page' )
|
77 |
-
);
|
78 |
-
|
79 |
-
add_action( "load-$hook", array( 'WCV_Admin_Setup', 'add_options' ) );
|
80 |
-
}
|
81 |
-
|
82 |
-
|
83 |
-
/**
|
84 |
-
*
|
85 |
-
*
|
86 |
-
* @param unknown $status
|
87 |
-
* @param unknown $option
|
88 |
-
* @param unknown $value
|
89 |
-
*
|
90 |
-
* @return unknown
|
91 |
-
*/
|
92 |
-
public static function set_table_option( $status, $option, $value )
|
93 |
-
{
|
94 |
-
if ( $option == 'commission_per_page' ) {
|
95 |
-
return $value;
|
96 |
-
}
|
97 |
-
}
|
98 |
-
|
99 |
-
|
100 |
-
/**
|
101 |
-
*
|
102 |
-
*/
|
103 |
-
public static function add_options()
|
104 |
-
{
|
105 |
-
global $PV_Admin_Page;
|
106 |
-
|
107 |
-
$args = array(
|
108 |
-
'label' => 'Rows',
|
109 |
-
'default' => 10,
|
110 |
-
'option' => 'commission_per_page'
|
111 |
-
);
|
112 |
-
add_screen_option( 'per_page', $args );
|
113 |
-
|
114 |
-
$PV_Admin_Page = new WCV_Admin_Page();
|
115 |
-
|
116 |
-
}
|
117 |
-
|
118 |
-
|
119 |
-
/**
|
120 |
-
* HTML setup for the WC > Commission page
|
121 |
-
*/
|
122 |
-
public static function commissions_page()
|
123 |
-
{
|
124 |
-
global $woocommerce, $PV_Admin_Page;
|
125 |
-
|
126 |
-
$PV_Admin_Page->prepare_items();
|
127 |
-
|
128 |
-
?>
|
129 |
-
|
130 |
-
<div class="wrap">
|
131 |
-
|
132 |
-
<div id="icon-woocommerce" class="icon32 icon32-woocommerce-reports"><br/></div>
|
133 |
-
<h2><?php _e( 'Commission', 'wcvendors' ); ?></h2>
|
134 |
-
|
135 |
-
<form id="posts-filter" method="POST">
|
136 |
-
|
137 |
-
<input type="hidden" name="page" value="pv_admin_commissions"/>
|
138 |
-
<?php $PV_Admin_Page->display() ?>
|
139 |
-
|
140 |
-
</form>
|
141 |
-
<div id="ajax-response"></div>
|
142 |
-
<br class="clear"/>
|
143 |
-
</div>
|
144 |
-
<?php
|
145 |
-
}
|
146 |
-
|
147 |
-
|
148 |
-
}
|
149 |
-
|
150 |
-
|
151 |
-
if ( !class_exists( 'WP_List_Table' ) ) require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
152 |
-
|
153 |
-
/**
|
154 |
-
* WC_Simple_Referral_Admin class.
|
155 |
-
*
|
156 |
-
* @extends WP_List_Table
|
157 |
-
*/
|
158 |
-
class WCV_Admin_Page extends WP_List_Table
|
159 |
-
{
|
160 |
-
|
161 |
-
public $index;
|
162 |
-
|
163 |
-
|
164 |
-
/**
|
165 |
-
* __construct function.
|
166 |
-
*
|
167 |
-
* @access public
|
168 |
-
*/
|
169 |
-
function __construct()
|
170 |
-
{
|
171 |
-
global $status, $page;
|
172 |
-
|
173 |
-
$this->index = 0;
|
174 |
-
|
175 |
-
//Set parent defaults
|
176 |
-
parent::__construct( array(
|
177 |
-
'singular' => 'commission',
|
178 |
-
'plural' => 'commissions',
|
179 |
-
'ajax' => false
|
180 |
-
) );
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
/**
|
185 |
-
* column_default function.
|
186 |
-
*
|
187 |
-
* @access public
|
188 |
-
*
|
189 |
-
* @param unknown $item
|
190 |
-
* @param mixed $column_name
|
191 |
-
*
|
192 |
-
* @return unknown
|
193 |
-
*/
|
194 |
-
function column_default( $item, $column_name )
|
195 |
-
{
|
196 |
-
global $wpdb;
|
197 |
-
|
198 |
-
switch ( $column_name ) {
|
199 |
-
case 'id' :
|
200 |
-
return $item->id;
|
201 |
-
case 'vendor_id' :
|
202 |
-
$user = get_userdata( $item->vendor_id );
|
203 |
-
|
204 |
-
return '<a href="' . admin_url( 'user-edit.php?user_id=' . $item->vendor_id ) . '">' . WCV_Vendors::get_vendor_shop_name( $item->vendor_id ) . '</a>';
|
205 |
-
case 'total_due' :
|
206 |
-
return woocommerce_price( $item->total_due + $item->total_shipping + $item->tax );
|
207 |
-
case 'product_id' :
|
208 |
-
$parent = get_post_ancestors( $item->product_id );
|
209 |
-
$product_id = $parent ? $parent[ 0 ] : $item->product_id;
|
210 |
-
return '<a href="' . admin_url( 'post.php?post=' . $product_id . '&action=edit' ) . '">' . get_the_title( $item->product_id ) . '</a>';
|
211 |
-
case 'order_id' :
|
212 |
-
return '<a href="' . admin_url( 'post.php?post=' . $item->order_id . '&action=edit' ) . '">' . $item->order_id . '</a>';
|
213 |
-
case 'status' :
|
214 |
-
return $item->status;
|
215 |
-
case 'time' :
|
216 |
-
return date_i18n( get_option( 'date_format' ), strtotime( $item->time ) );
|
217 |
-
}
|
218 |
-
}
|
219 |
-
|
220 |
-
|
221 |
-
/**
|
222 |
-
* column_cb function.
|
223 |
-
*
|
224 |
-
* @access public
|
225 |
-
*
|
226 |
-
* @param mixed $item
|
227 |
-
*
|
228 |
-
* @return unknown
|
229 |
-
*/
|
230 |
-
function column_cb( $item )
|
231 |
-
{
|
232 |
-
return sprintf(
|
233 |
-
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
234 |
-
/*$1%s*/
|
235 |
-
'id',
|
236 |
-
/*$2%s*/
|
237 |
-
$item->id
|
238 |
-
);
|
239 |
-
}
|
240 |
-
|
241 |
-
|
242 |
-
/**
|
243 |
-
* get_columns function.
|
244 |
-
*
|
245 |
-
* @access public
|
246 |
-
* @return unknown
|
247 |
-
*/
|
248 |
-
function get_columns()
|
249 |
-
{
|
250 |
-
$columns = array(
|
251 |
-
'cb' => '<input type="checkbox" />',
|
252 |
-
'product_id' => __( 'Product', 'wcvendors' ),
|
253 |
-
'order_id' => __( 'Order ID', 'wcvendors' ),
|
254 |
-
'vendor_id' => __( 'Vendor', 'wcvendors' ),
|
255 |
-
'total_due' => __( 'Total', 'wcvendors' ),
|
256 |
-
'status' => __( 'Status', 'wcvendors' ),
|
257 |
-
'time' => __( 'Date', 'wcvendors' ),
|
258 |
-
);
|
259 |
-
|
260 |
-
return $columns;
|
261 |
-
}
|
262 |
-
|
263 |
-
|
264 |
-
/**
|
265 |
-
* get_sortable_columns function.
|
266 |
-
*
|
267 |
-
* @access public
|
268 |
-
* @return unknown
|
269 |
-
*/
|
270 |
-
function get_sortable_columns()
|
271 |
-
{
|
272 |
-
$sortable_columns = array(
|
273 |
-
'time' => array( 'time', true ),
|
274 |
-
'product_id' => array( 'product_id', false ),
|
275 |
-
'order_id' => array( 'order_id', false ),
|
276 |
-
'total_due' => array( 'total_due', false ),
|
277 |
-
'status' => array( 'status', false ),
|
278 |
-
'vendor_id' => array( 'vendor_id', false ),
|
279 |
-
'status' => array( 'status', false ),
|
280 |
-
);
|
281 |
-
|
282 |
-
return $sortable_columns;
|
283 |
-
}
|
284 |
-
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Get bulk actions
|
288 |
-
*
|
289 |
-
* @return unknown
|
290 |
-
*/
|
291 |
-
function get_bulk_actions()
|
292 |
-
{
|
293 |
-
$actions = array(
|
294 |
-
'mark_paid' => __( 'Mark paid', 'wcvendors' ),
|
295 |
-
'mark_due' => __( 'Mark due', 'wcvendors' ),
|
296 |
-
'mark_reversed' => __( 'Mark reversed', 'wcvendors' ),
|
297 |
-
// 'delete' => __('Delete', 'wcvendors'),
|
298 |
-
);
|
299 |
-
|
300 |
-
return $actions;
|
301 |
-
}
|
302 |
-
|
303 |
-
|
304 |
-
/**
|
305 |
-
*
|
306 |
-
*/
|
307 |
-
function extra_tablenav( $which )
|
308 |
-
{
|
309 |
-
if ( $which == 'top' ) {
|
310 |
-
?>
|
311 |
-
<div class="alignleft actions"><?php
|
312 |
-
$this->months_dropdown( 'commission' );
|
313 |
-
submit_button( __( 'Filter' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
|
314 |
-
?></div>
|
315 |
-
<div class="alignleft actions"><?php
|
316 |
-
$this->status_dropdown( 'commission' );
|
317 |
-
submit_button( __( 'Filter' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
|
318 |
-
?></div><?php
|
319 |
-
}
|
320 |
-
}
|
321 |
-
|
322 |
-
|
323 |
-
/**
|
324 |
-
* Display a monthly dropdown for filtering items
|
325 |
-
*
|
326 |
-
* @since 3.1.0
|
327 |
-
* @access protected
|
328 |
-
*
|
329 |
-
* @param unknown $post_type
|
330 |
-
*/
|
331 |
-
function months_dropdown( $post_type )
|
332 |
-
{
|
333 |
-
global $wpdb, $wp_locale;
|
334 |
-
|
335 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
336 |
-
|
337 |
-
$months = $wpdb->get_results( "
|
338 |
-
SELECT DISTINCT YEAR( time ) AS year, MONTH( time ) AS month
|
339 |
-
FROM $table_name
|
340 |
-
ORDER BY time DESC
|
341 |
-
" );
|
342 |
-
|
343 |
-
$month_count = count( $months );
|
344 |
-
|
345 |
-
if ( !$month_count || ( 1 == $month_count && 0 == $months[ 0 ]->month ) )
|
346 |
-
return;
|
347 |
-
|
348 |
-
$m = isset( $_POST[ 'm' ] ) ? (int) $_POST[ 'm' ] : 0;
|
349 |
-
?>
|
350 |
-
<select name="m">
|
351 |
-
<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
|
352 |
-
<?php
|
353 |
-
foreach ( $months as $arc_row ) {
|
354 |
-
if ( 0 == $arc_row->year )
|
355 |
-
continue;
|
356 |
-
|
357 |
-
$month = zeroise( $arc_row->month, 2 );
|
358 |
-
$year = $arc_row->year;
|
359 |
-
|
360 |
-
printf( "<option %s value='%s'>%s</option>\n",
|
361 |
-
selected( $m, $year . $month, false ),
|
362 |
-
esc_attr( $arc_row->year . $month ),
|
363 |
-
/* translators: 1: month name, 2: 4-digit year */
|
364 |
-
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
|
365 |
-
);
|
366 |
-
}
|
367 |
-
?>
|
368 |
-
</select>
|
369 |
-
<?php
|
370 |
-
}
|
371 |
-
|
372 |
-
/**
|
373 |
-
* Display a status dropdown for filtering items
|
374 |
-
*
|
375 |
-
* @since 3.1.0
|
376 |
-
* @access protected
|
377 |
-
*
|
378 |
-
* @param unknown $post_type
|
379 |
-
*/
|
380 |
-
function status_dropdown( $post_type )
|
381 |
-
{
|
382 |
-
$com_status = isset( $_POST[ 'com_status' ] ) ? $_POST[ 'com_status' ] : '';
|
383 |
-
?>
|
384 |
-
<select name="com_status">
|
385 |
-
<option<?php selected( $com_status, '' ); ?> value=''><?php _e( 'Show all Statuses', 'wcvendors' ); ?></option>
|
386 |
-
<option<?php selected( $com_status, 'due' ); ?> value="due">Due</option>
|
387 |
-
<option<?php selected( $com_status, 'paid' ); ?> value="paid">Paid</option>
|
388 |
-
<option<?php selected( $com_status, 'reversed' ); ?> value="reversed">Reversed</option>
|
389 |
-
</select>
|
390 |
-
<?php
|
391 |
-
}
|
392 |
-
|
393 |
-
|
394 |
-
/**
|
395 |
-
* Process bulk actions
|
396 |
-
*
|
397 |
-
* @return unknown
|
398 |
-
*/
|
399 |
-
function process_bulk_action()
|
400 |
-
{
|
401 |
-
if ( !isset( $_POST[ 'id' ] ) ) return;
|
402 |
-
|
403 |
-
$items = array_map( 'intval', $_POST[ 'id' ] );
|
404 |
-
$ids = implode( ',', $items );
|
405 |
-
|
406 |
-
switch ( $this->current_action() ) {
|
407 |
-
case 'mark_paid':
|
408 |
-
$result = $this->mark_paid( $ids );
|
409 |
-
|
410 |
-
if ( $result )
|
411 |
-
echo '<div class="updated"><p>' . __( 'Commission marked paid.', 'wcvendors' ) . '</p></div>';
|
412 |
-
break;
|
413 |
-
|
414 |
-
case 'mark_due':
|
415 |
-
$result = $this->mark_due( $ids );
|
416 |
-
|
417 |
-
if ( $result )
|
418 |
-
echo '<div class="updated"><p>' . __( 'Commission marked due.', 'wcvendors' ) . '</p></div>';
|
419 |
-
break;
|
420 |
-
|
421 |
-
case 'mark_reversed':
|
422 |
-
$result = $this->mark_reversed( $ids );
|
423 |
-
|
424 |
-
if ( $result )
|
425 |
-
echo '<div class="updated"><p>' . __( 'Commission marked reversed.', 'wcvendors' ) . '</p></div>';
|
426 |
-
break;
|
427 |
-
|
428 |
-
default:
|
429 |
-
// code...
|
430 |
-
break;
|
431 |
-
}
|
432 |
-
|
433 |
-
}
|
434 |
-
|
435 |
-
|
436 |
-
/**
|
437 |
-
*
|
438 |
-
*
|
439 |
-
* @param unknown $ids (optional)
|
440 |
-
*
|
441 |
-
* @return unknown
|
442 |
-
*/
|
443 |
-
public function mark_paid( $ids = array() )
|
444 |
-
{
|
445 |
-
global $wpdb;
|
446 |
-
|
447 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
448 |
-
|
449 |
-
$query = "UPDATE `{$table_name}` SET `status` = 'paid' WHERE id IN ($ids) AND `status` = 'due'";
|
450 |
-
$result = $wpdb->query( $query );
|
451 |
-
|
452 |
-
return $result;
|
453 |
-
}
|
454 |
-
|
455 |
-
|
456 |
-
/**
|
457 |
-
*
|
458 |
-
*
|
459 |
-
* @param unknown $ids (optional)
|
460 |
-
*
|
461 |
-
* @return unknown
|
462 |
-
*/
|
463 |
-
public function mark_reversed( $ids = array() )
|
464 |
-
{
|
465 |
-
global $wpdb;
|
466 |
-
|
467 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
468 |
-
|
469 |
-
$query = "UPDATE `{$table_name}` SET `status` = 'reversed' WHERE id IN ($ids) AND `status` = 'due'";
|
470 |
-
$result = $wpdb->query( $query );
|
471 |
-
|
472 |
-
return $result;
|
473 |
-
}
|
474 |
-
|
475 |
-
|
476 |
-
/**
|
477 |
-
*
|
478 |
-
*
|
479 |
-
* @param unknown $ids (optional)
|
480 |
-
*
|
481 |
-
* @return unknown
|
482 |
-
*/
|
483 |
-
public function mark_due( $ids = array() )
|
484 |
-
{
|
485 |
-
global $wpdb;
|
486 |
-
|
487 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
488 |
-
|
489 |
-
$query = "UPDATE `{$table_name}` SET `status` = 'due' WHERE id IN ($ids)";
|
490 |
-
$result = $wpdb->query( $query );
|
491 |
-
|
492 |
-
return $result;
|
493 |
-
}
|
494 |
-
|
495 |
-
|
496 |
-
/**
|
497 |
-
* prepare_items function.
|
498 |
-
*
|
499 |
-
* @access public
|
500 |
-
*/
|
501 |
-
function prepare_items()
|
502 |
-
{
|
503 |
-
global $wpdb;
|
504 |
-
|
505 |
-
$per_page = $this->get_items_per_page( 'commission_per_page', 10 );
|
506 |
-
$current_page = $this->get_pagenum();
|
507 |
-
|
508 |
-
$orderby = !empty( $_REQUEST[ 'orderby' ] ) ? esc_attr( $_REQUEST[ 'orderby' ] ) : 'time';
|
509 |
-
$order = ( !empty( $_REQUEST[ 'order' ] ) && $_REQUEST[ 'order' ] == 'asc' ) ? 'ASC' : 'DESC';
|
510 |
-
$com_status = !empty( $_REQUEST[ 'com_status' ] ) ? esc_attr( $_REQUEST[ 'com_status' ] ) : '';
|
511 |
-
$status_sql = '';
|
512 |
-
$time_sql = '';
|
513 |
-
|
514 |
-
/**
|
515 |
-
* Init column headers
|
516 |
-
*/
|
517 |
-
$this->_column_headers = $this->get_column_info();
|
518 |
-
|
519 |
-
|
520 |
-
/**
|
521 |
-
* Process bulk actions
|
522 |
-
*/
|
523 |
-
$this->process_bulk_action();
|
524 |
-
|
525 |
-
/**
|
526 |
-
* Get items
|
527 |
-
*/
|
528 |
-
$sql = "SELECT COUNT(id) FROM {$wpdb->prefix}pv_commission";
|
529 |
-
|
530 |
-
if ( !empty( $_POST[ 'm' ] ) ) {
|
531 |
-
$year = substr( $_POST[ 'm' ], 0, 4 );
|
532 |
-
$month = substr( $_POST[ 'm' ], 4, 2 );
|
533 |
-
|
534 |
-
$time_sql = "
|
535 |
-
WHERE MONTH(`time`) = '$month'
|
536 |
-
AND YEAR(`time`) = '$year'
|
537 |
-
";
|
538 |
-
|
539 |
-
$sql .= $time_sql;
|
540 |
-
}
|
541 |
-
|
542 |
-
if ( !empty( $_POST[ 'com_status' ] ) ) {
|
543 |
-
|
544 |
-
if ( $time_sql == '' ) {
|
545 |
-
$status_sql = "
|
546 |
-
WHERE status = '$com_status'
|
547 |
-
";
|
548 |
-
} else {
|
549 |
-
$status_sql = "
|
550 |
-
AND status = '$com_status'
|
551 |
-
";
|
552 |
-
}
|
553 |
-
|
554 |
-
|
555 |
-
$sql .= $status_sql;
|
556 |
-
}
|
557 |
-
|
558 |
-
$max = $wpdb->get_var( $sql );
|
559 |
-
|
560 |
-
$sql = "
|
561 |
-
SELECT * FROM {$wpdb->prefix}pv_commission
|
562 |
-
";
|
563 |
-
|
564 |
-
if ( !empty( $_POST[ 'm' ] ) ) {
|
565 |
-
$sql .= $time_sql;
|
566 |
-
}
|
567 |
-
|
568 |
-
if ( !empty( $_POST['com_status'] ) ) {
|
569 |
-
$sql .= $status_sql;
|
570 |
-
}
|
571 |
-
|
572 |
-
$sql .= "
|
573 |
-
ORDER BY `{$orderby}` {$order}
|
574 |
-
LIMIT %d, %d
|
575 |
-
";
|
576 |
-
|
577 |
-
$this->items = $wpdb->get_results( $wpdb->prepare( $sql, ( $current_page - 1 ) * $per_page, $per_page ) );
|
578 |
-
|
579 |
-
/**
|
580 |
-
* Pagination
|
581 |
-
*/
|
582 |
-
$this->set_pagination_args( array(
|
583 |
-
'total_items' => $max,
|
584 |
-
'per_page' => $per_page,
|
585 |
-
'total_pages' => ceil( $max / $per_page )
|
586 |
-
) );
|
587 |
-
}
|
588 |
-
|
589 |
-
|
590 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WCV_Admin_Setup
|
4 |
+
{
|
5 |
+
/**
|
6 |
+
* WC > Referrals menu
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
public function __construct()
|
11 |
+
{
|
12 |
+
add_filter( 'set-screen-option', array( 'WCV_Admin_Setup', 'set_table_option' ), 10, 3 );
|
13 |
+
add_action( 'admin_menu', array( 'WCV_Admin_Setup', 'menu' ) );
|
14 |
+
|
15 |
+
add_action( 'woocommerce_admin_order_data_after_shipping_address', array( $this, 'add_vendor_details' ), 10, 2 );
|
16 |
+
add_action( 'woocommerce_admin_order_actions_end', array( $this, 'append_actions' ), 10, 1 );
|
17 |
+
}
|
18 |
+
|
19 |
+
|
20 |
+
public function add_vendor_details( $order )
|
21 |
+
{
|
22 |
+
$actions = $this->append_actions( $order, true );
|
23 |
+
|
24 |
+
if (empty( $actions['wc_pv_shipped']['name'] )) {
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
|
28 |
+
echo '<h4>' . __('Vendors shipped', 'wcvendors') . '</h4><br/>';
|
29 |
+
echo $actions['wc_pv_shipped']['name'];
|
30 |
+
}
|
31 |
+
|
32 |
+
public function append_actions( $order, $order_page = false )
|
33 |
+
{
|
34 |
+
global $woocommerce;
|
35 |
+
|
36 |
+
$authors = WCV_Vendors::get_vendors_from_order( $order );
|
37 |
+
$authors = $authors ? array_keys( $authors ) : array();
|
38 |
+
if ( empty( $authors ) ) return false;
|
39 |
+
|
40 |
+
$shipped = (array) get_post_meta( $order->id, 'wc_pv_shipped', true );
|
41 |
+
$string = '</br></br>';
|
42 |
+
|
43 |
+
foreach ($authors as $author ) {
|
44 |
+
$string .= in_array( $author, $shipped ) ? '✔ ' : '✕ ';
|
45 |
+
$string .= WCV_Vendors::get_vendor_shop_name( $author );
|
46 |
+
$string .= '</br>';
|
47 |
+
}
|
48 |
+
|
49 |
+
$response = array(
|
50 |
+
'url' => '#',
|
51 |
+
'name' => __('Vendors Shipped', 'wcvendors') . $string,
|
52 |
+
'action' => 'wc_pv_shipped',
|
53 |
+
'image_url' => wcv_assets_url . '/images/icons/truck.png',
|
54 |
+
);
|
55 |
+
|
56 |
+
if ( ! $order_page ) {
|
57 |
+
printf( '<a class="button tips %s" href="%s" data-tip="%s"><img style="width:16px;height:16px;" src="%s"></a>', $response['action'], $response['url'], $response['name'], $response['image_url'] );
|
58 |
+
} else {
|
59 |
+
echo $response['name'];
|
60 |
+
}
|
61 |
+
|
62 |
+
return $response;
|
63 |
+
}
|
64 |
+
|
65 |
+
|
66 |
+
/**
|
67 |
+
*
|
68 |
+
*/
|
69 |
+
public static function menu()
|
70 |
+
{
|
71 |
+
$hook = add_submenu_page(
|
72 |
+
'woocommerce',
|
73 |
+
__( 'Commission', 'wcvendors' ), __( 'Commission', 'wcvendors' ),
|
74 |
+
'manage_woocommerce',
|
75 |
+
'pv_admin_commissions',
|
76 |
+
array( 'WCV_Admin_Setup', 'commissions_page' )
|
77 |
+
);
|
78 |
+
|
79 |
+
add_action( "load-$hook", array( 'WCV_Admin_Setup', 'add_options' ) );
|
80 |
+
}
|
81 |
+
|
82 |
+
|
83 |
+
/**
|
84 |
+
*
|
85 |
+
*
|
86 |
+
* @param unknown $status
|
87 |
+
* @param unknown $option
|
88 |
+
* @param unknown $value
|
89 |
+
*
|
90 |
+
* @return unknown
|
91 |
+
*/
|
92 |
+
public static function set_table_option( $status, $option, $value )
|
93 |
+
{
|
94 |
+
if ( $option == 'commission_per_page' ) {
|
95 |
+
return $value;
|
96 |
+
}
|
97 |
+
}
|
98 |
+
|
99 |
+
|
100 |
+
/**
|
101 |
+
*
|
102 |
+
*/
|
103 |
+
public static function add_options()
|
104 |
+
{
|
105 |
+
global $PV_Admin_Page;
|
106 |
+
|
107 |
+
$args = array(
|
108 |
+
'label' => 'Rows',
|
109 |
+
'default' => 10,
|
110 |
+
'option' => 'commission_per_page'
|
111 |
+
);
|
112 |
+
add_screen_option( 'per_page', $args );
|
113 |
+
|
114 |
+
$PV_Admin_Page = new WCV_Admin_Page();
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
|
119 |
+
/**
|
120 |
+
* HTML setup for the WC > Commission page
|
121 |
+
*/
|
122 |
+
public static function commissions_page()
|
123 |
+
{
|
124 |
+
global $woocommerce, $PV_Admin_Page;
|
125 |
+
|
126 |
+
$PV_Admin_Page->prepare_items();
|
127 |
+
|
128 |
+
?>
|
129 |
+
|
130 |
+
<div class="wrap">
|
131 |
+
|
132 |
+
<div id="icon-woocommerce" class="icon32 icon32-woocommerce-reports"><br/></div>
|
133 |
+
<h2><?php _e( 'Commission', 'wcvendors' ); ?></h2>
|
134 |
+
|
135 |
+
<form id="posts-filter" method="POST">
|
136 |
+
|
137 |
+
<input type="hidden" name="page" value="pv_admin_commissions"/>
|
138 |
+
<?php $PV_Admin_Page->display() ?>
|
139 |
+
|
140 |
+
</form>
|
141 |
+
<div id="ajax-response"></div>
|
142 |
+
<br class="clear"/>
|
143 |
+
</div>
|
144 |
+
<?php
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
}
|
149 |
+
|
150 |
+
|
151 |
+
if ( !class_exists( 'WP_List_Table' ) ) require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
152 |
+
|
153 |
+
/**
|
154 |
+
* WC_Simple_Referral_Admin class.
|
155 |
+
*
|
156 |
+
* @extends WP_List_Table
|
157 |
+
*/
|
158 |
+
class WCV_Admin_Page extends WP_List_Table
|
159 |
+
{
|
160 |
+
|
161 |
+
public $index;
|
162 |
+
|
163 |
+
|
164 |
+
/**
|
165 |
+
* __construct function.
|
166 |
+
*
|
167 |
+
* @access public
|
168 |
+
*/
|
169 |
+
function __construct()
|
170 |
+
{
|
171 |
+
global $status, $page;
|
172 |
+
|
173 |
+
$this->index = 0;
|
174 |
+
|
175 |
+
//Set parent defaults
|
176 |
+
parent::__construct( array(
|
177 |
+
'singular' => 'commission',
|
178 |
+
'plural' => 'commissions',
|
179 |
+
'ajax' => false
|
180 |
+
) );
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
+
/**
|
185 |
+
* column_default function.
|
186 |
+
*
|
187 |
+
* @access public
|
188 |
+
*
|
189 |
+
* @param unknown $item
|
190 |
+
* @param mixed $column_name
|
191 |
+
*
|
192 |
+
* @return unknown
|
193 |
+
*/
|
194 |
+
function column_default( $item, $column_name )
|
195 |
+
{
|
196 |
+
global $wpdb;
|
197 |
+
|
198 |
+
switch ( $column_name ) {
|
199 |
+
case 'id' :
|
200 |
+
return $item->id;
|
201 |
+
case 'vendor_id' :
|
202 |
+
$user = get_userdata( $item->vendor_id );
|
203 |
+
|
204 |
+
return '<a href="' . admin_url( 'user-edit.php?user_id=' . $item->vendor_id ) . '">' . WCV_Vendors::get_vendor_shop_name( $item->vendor_id ) . '</a>';
|
205 |
+
case 'total_due' :
|
206 |
+
return woocommerce_price( $item->total_due + $item->total_shipping + $item->tax );
|
207 |
+
case 'product_id' :
|
208 |
+
$parent = get_post_ancestors( $item->product_id );
|
209 |
+
$product_id = $parent ? $parent[ 0 ] : $item->product_id;
|
210 |
+
return '<a href="' . admin_url( 'post.php?post=' . $product_id . '&action=edit' ) . '">' . get_the_title( $item->product_id ) . '</a>';
|
211 |
+
case 'order_id' :
|
212 |
+
return '<a href="' . admin_url( 'post.php?post=' . $item->order_id . '&action=edit' ) . '">' . $item->order_id . '</a>';
|
213 |
+
case 'status' :
|
214 |
+
return $item->status;
|
215 |
+
case 'time' :
|
216 |
+
return date_i18n( get_option( 'date_format' ), strtotime( $item->time ) );
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
|
221 |
+
/**
|
222 |
+
* column_cb function.
|
223 |
+
*
|
224 |
+
* @access public
|
225 |
+
*
|
226 |
+
* @param mixed $item
|
227 |
+
*
|
228 |
+
* @return unknown
|
229 |
+
*/
|
230 |
+
function column_cb( $item )
|
231 |
+
{
|
232 |
+
return sprintf(
|
233 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
234 |
+
/*$1%s*/
|
235 |
+
'id',
|
236 |
+
/*$2%s*/
|
237 |
+
$item->id
|
238 |
+
);
|
239 |
+
}
|
240 |
+
|
241 |
+
|
242 |
+
/**
|
243 |
+
* get_columns function.
|
244 |
+
*
|
245 |
+
* @access public
|
246 |
+
* @return unknown
|
247 |
+
*/
|
248 |
+
function get_columns()
|
249 |
+
{
|
250 |
+
$columns = array(
|
251 |
+
'cb' => '<input type="checkbox" />',
|
252 |
+
'product_id' => __( 'Product', 'wcvendors' ),
|
253 |
+
'order_id' => __( 'Order ID', 'wcvendors' ),
|
254 |
+
'vendor_id' => __( 'Vendor', 'wcvendors' ),
|
255 |
+
'total_due' => __( 'Total', 'wcvendors' ),
|
256 |
+
'status' => __( 'Status', 'wcvendors' ),
|
257 |
+
'time' => __( 'Date', 'wcvendors' ),
|
258 |
+
);
|
259 |
+
|
260 |
+
return $columns;
|
261 |
+
}
|
262 |
+
|
263 |
+
|
264 |
+
/**
|
265 |
+
* get_sortable_columns function.
|
266 |
+
*
|
267 |
+
* @access public
|
268 |
+
* @return unknown
|
269 |
+
*/
|
270 |
+
function get_sortable_columns()
|
271 |
+
{
|
272 |
+
$sortable_columns = array(
|
273 |
+
'time' => array( 'time', true ),
|
274 |
+
'product_id' => array( 'product_id', false ),
|
275 |
+
'order_id' => array( 'order_id', false ),
|
276 |
+
'total_due' => array( 'total_due', false ),
|
277 |
+
'status' => array( 'status', false ),
|
278 |
+
'vendor_id' => array( 'vendor_id', false ),
|
279 |
+
'status' => array( 'status', false ),
|
280 |
+
);
|
281 |
+
|
282 |
+
return $sortable_columns;
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Get bulk actions
|
288 |
+
*
|
289 |
+
* @return unknown
|
290 |
+
*/
|
291 |
+
function get_bulk_actions()
|
292 |
+
{
|
293 |
+
$actions = array(
|
294 |
+
'mark_paid' => __( 'Mark paid', 'wcvendors' ),
|
295 |
+
'mark_due' => __( 'Mark due', 'wcvendors' ),
|
296 |
+
'mark_reversed' => __( 'Mark reversed', 'wcvendors' ),
|
297 |
+
// 'delete' => __('Delete', 'wcvendors'),
|
298 |
+
);
|
299 |
+
|
300 |
+
return $actions;
|
301 |
+
}
|
302 |
+
|
303 |
+
|
304 |
+
/**
|
305 |
+
*
|
306 |
+
*/
|
307 |
+
function extra_tablenav( $which )
|
308 |
+
{
|
309 |
+
if ( $which == 'top' ) {
|
310 |
+
?>
|
311 |
+
<div class="alignleft actions"><?php
|
312 |
+
$this->months_dropdown( 'commission' );
|
313 |
+
submit_button( __( 'Filter' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
|
314 |
+
?></div>
|
315 |
+
<div class="alignleft actions"><?php
|
316 |
+
$this->status_dropdown( 'commission' );
|
317 |
+
submit_button( __( 'Filter' ), false, false, false, array( 'id' => "post-query-submit", 'name' => 'do-filter' ) );
|
318 |
+
?></div><?php
|
319 |
+
}
|
320 |
+
}
|
321 |
+
|
322 |
+
|
323 |
+
/**
|
324 |
+
* Display a monthly dropdown for filtering items
|
325 |
+
*
|
326 |
+
* @since 3.1.0
|
327 |
+
* @access protected
|
328 |
+
*
|
329 |
+
* @param unknown $post_type
|
330 |
+
*/
|
331 |
+
function months_dropdown( $post_type )
|
332 |
+
{
|
333 |
+
global $wpdb, $wp_locale;
|
334 |
+
|
335 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
336 |
+
|
337 |
+
$months = $wpdb->get_results( "
|
338 |
+
SELECT DISTINCT YEAR( time ) AS year, MONTH( time ) AS month
|
339 |
+
FROM $table_name
|
340 |
+
ORDER BY time DESC
|
341 |
+
" );
|
342 |
+
|
343 |
+
$month_count = count( $months );
|
344 |
+
|
345 |
+
if ( !$month_count || ( 1 == $month_count && 0 == $months[ 0 ]->month ) )
|
346 |
+
return;
|
347 |
+
|
348 |
+
$m = isset( $_POST[ 'm' ] ) ? (int) $_POST[ 'm' ] : 0;
|
349 |
+
?>
|
350 |
+
<select name="m">
|
351 |
+
<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
|
352 |
+
<?php
|
353 |
+
foreach ( $months as $arc_row ) {
|
354 |
+
if ( 0 == $arc_row->year )
|
355 |
+
continue;
|
356 |
+
|
357 |
+
$month = zeroise( $arc_row->month, 2 );
|
358 |
+
$year = $arc_row->year;
|
359 |
+
|
360 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
361 |
+
selected( $m, $year . $month, false ),
|
362 |
+
esc_attr( $arc_row->year . $month ),
|
363 |
+
/* translators: 1: month name, 2: 4-digit year */
|
364 |
+
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
|
365 |
+
);
|
366 |
+
}
|
367 |
+
?>
|
368 |
+
</select>
|
369 |
+
<?php
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Display a status dropdown for filtering items
|
374 |
+
*
|
375 |
+
* @since 3.1.0
|
376 |
+
* @access protected
|
377 |
+
*
|
378 |
+
* @param unknown $post_type
|
379 |
+
*/
|
380 |
+
function status_dropdown( $post_type )
|
381 |
+
{
|
382 |
+
$com_status = isset( $_POST[ 'com_status' ] ) ? $_POST[ 'com_status' ] : '';
|
383 |
+
?>
|
384 |
+
<select name="com_status">
|
385 |
+
<option<?php selected( $com_status, '' ); ?> value=''><?php _e( 'Show all Statuses', 'wcvendors' ); ?></option>
|
386 |
+
<option<?php selected( $com_status, 'due' ); ?> value="due">Due</option>
|
387 |
+
<option<?php selected( $com_status, 'paid' ); ?> value="paid">Paid</option>
|
388 |
+
<option<?php selected( $com_status, 'reversed' ); ?> value="reversed">Reversed</option>
|
389 |
+
</select>
|
390 |
+
<?php
|
391 |
+
}
|
392 |
+
|
393 |
+
|
394 |
+
/**
|
395 |
+
* Process bulk actions
|
396 |
+
*
|
397 |
+
* @return unknown
|
398 |
+
*/
|
399 |
+
function process_bulk_action()
|
400 |
+
{
|
401 |
+
if ( !isset( $_POST[ 'id' ] ) ) return;
|
402 |
+
|
403 |
+
$items = array_map( 'intval', $_POST[ 'id' ] );
|
404 |
+
$ids = implode( ',', $items );
|
405 |
+
|
406 |
+
switch ( $this->current_action() ) {
|
407 |
+
case 'mark_paid':
|
408 |
+
$result = $this->mark_paid( $ids );
|
409 |
+
|
410 |
+
if ( $result )
|
411 |
+
echo '<div class="updated"><p>' . __( 'Commission marked paid.', 'wcvendors' ) . '</p></div>';
|
412 |
+
break;
|
413 |
+
|
414 |
+
case 'mark_due':
|
415 |
+
$result = $this->mark_due( $ids );
|
416 |
+
|
417 |
+
if ( $result )
|
418 |
+
echo '<div class="updated"><p>' . __( 'Commission marked due.', 'wcvendors' ) . '</p></div>';
|
419 |
+
break;
|
420 |
+
|
421 |
+
case 'mark_reversed':
|
422 |
+
$result = $this->mark_reversed( $ids );
|
423 |
+
|
424 |
+
if ( $result )
|
425 |
+
echo '<div class="updated"><p>' . __( 'Commission marked reversed.', 'wcvendors' ) . '</p></div>';
|
426 |
+
break;
|
427 |
+
|
428 |
+
default:
|
429 |
+
// code...
|
430 |
+
break;
|
431 |
+
}
|
432 |
+
|
433 |
+
}
|
434 |
+
|
435 |
+
|
436 |
+
/**
|
437 |
+
*
|
438 |
+
*
|
439 |
+
* @param unknown $ids (optional)
|
440 |
+
*
|
441 |
+
* @return unknown
|
442 |
+
*/
|
443 |
+
public function mark_paid( $ids = array() )
|
444 |
+
{
|
445 |
+
global $wpdb;
|
446 |
+
|
447 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
448 |
+
|
449 |
+
$query = "UPDATE `{$table_name}` SET `status` = 'paid' WHERE id IN ($ids) AND `status` = 'due'";
|
450 |
+
$result = $wpdb->query( $query );
|
451 |
+
|
452 |
+
return $result;
|
453 |
+
}
|
454 |
+
|
455 |
+
|
456 |
+
/**
|
457 |
+
*
|
458 |
+
*
|
459 |
+
* @param unknown $ids (optional)
|
460 |
+
*
|
461 |
+
* @return unknown
|
462 |
+
*/
|
463 |
+
public function mark_reversed( $ids = array() )
|
464 |
+
{
|
465 |
+
global $wpdb;
|
466 |
+
|
467 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
468 |
+
|
469 |
+
$query = "UPDATE `{$table_name}` SET `status` = 'reversed' WHERE id IN ($ids) AND `status` = 'due'";
|
470 |
+
$result = $wpdb->query( $query );
|
471 |
+
|
472 |
+
return $result;
|
473 |
+
}
|
474 |
+
|
475 |
+
|
476 |
+
/**
|
477 |
+
*
|
478 |
+
*
|
479 |
+
* @param unknown $ids (optional)
|
480 |
+
*
|
481 |
+
* @return unknown
|
482 |
+
*/
|
483 |
+
public function mark_due( $ids = array() )
|
484 |
+
{
|
485 |
+
global $wpdb;
|
486 |
+
|
487 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
488 |
+
|
489 |
+
$query = "UPDATE `{$table_name}` SET `status` = 'due' WHERE id IN ($ids)";
|
490 |
+
$result = $wpdb->query( $query );
|
491 |
+
|
492 |
+
return $result;
|
493 |
+
}
|
494 |
+
|
495 |
+
|
496 |
+
/**
|
497 |
+
* prepare_items function.
|
498 |
+
*
|
499 |
+
* @access public
|
500 |
+
*/
|
501 |
+
function prepare_items()
|
502 |
+
{
|
503 |
+
global $wpdb;
|
504 |
+
|
505 |
+
$per_page = $this->get_items_per_page( 'commission_per_page', 10 );
|
506 |
+
$current_page = $this->get_pagenum();
|
507 |
+
|
508 |
+
$orderby = !empty( $_REQUEST[ 'orderby' ] ) ? esc_attr( $_REQUEST[ 'orderby' ] ) : 'time';
|
509 |
+
$order = ( !empty( $_REQUEST[ 'order' ] ) && $_REQUEST[ 'order' ] == 'asc' ) ? 'ASC' : 'DESC';
|
510 |
+
$com_status = !empty( $_REQUEST[ 'com_status' ] ) ? esc_attr( $_REQUEST[ 'com_status' ] ) : '';
|
511 |
+
$status_sql = '';
|
512 |
+
$time_sql = '';
|
513 |
+
|
514 |
+
/**
|
515 |
+
* Init column headers
|
516 |
+
*/
|
517 |
+
$this->_column_headers = $this->get_column_info();
|
518 |
+
|
519 |
+
|
520 |
+
/**
|
521 |
+
* Process bulk actions
|
522 |
+
*/
|
523 |
+
$this->process_bulk_action();
|
524 |
+
|
525 |
+
/**
|
526 |
+
* Get items
|
527 |
+
*/
|
528 |
+
$sql = "SELECT COUNT(id) FROM {$wpdb->prefix}pv_commission";
|
529 |
+
|
530 |
+
if ( !empty( $_POST[ 'm' ] ) ) {
|
531 |
+
$year = substr( $_POST[ 'm' ], 0, 4 );
|
532 |
+
$month = substr( $_POST[ 'm' ], 4, 2 );
|
533 |
+
|
534 |
+
$time_sql = "
|
535 |
+
WHERE MONTH(`time`) = '$month'
|
536 |
+
AND YEAR(`time`) = '$year'
|
537 |
+
";
|
538 |
+
|
539 |
+
$sql .= $time_sql;
|
540 |
+
}
|
541 |
+
|
542 |
+
if ( !empty( $_POST[ 'com_status' ] ) ) {
|
543 |
+
|
544 |
+
if ( $time_sql == '' ) {
|
545 |
+
$status_sql = "
|
546 |
+
WHERE status = '$com_status'
|
547 |
+
";
|
548 |
+
} else {
|
549 |
+
$status_sql = "
|
550 |
+
AND status = '$com_status'
|
551 |
+
";
|
552 |
+
}
|
553 |
+
|
554 |
+
|
555 |
+
$sql .= $status_sql;
|
556 |
+
}
|
557 |
+
|
558 |
+
$max = $wpdb->get_var( $sql );
|
559 |
+
|
560 |
+
$sql = "
|
561 |
+
SELECT * FROM {$wpdb->prefix}pv_commission
|
562 |
+
";
|
563 |
+
|
564 |
+
if ( !empty( $_POST[ 'm' ] ) ) {
|
565 |
+
$sql .= $time_sql;
|
566 |
+
}
|
567 |
+
|
568 |
+
if ( !empty( $_POST['com_status'] ) ) {
|
569 |
+
$sql .= $status_sql;
|
570 |
+
}
|
571 |
+
|
572 |
+
$sql .= "
|
573 |
+
ORDER BY `{$orderby}` {$order}
|
574 |
+
LIMIT %d, %d
|
575 |
+
";
|
576 |
+
|
577 |
+
$this->items = $wpdb->get_results( $wpdb->prepare( $sql, ( $current_page - 1 ) * $per_page, $per_page ) );
|
578 |
+
|
579 |
+
/**
|
580 |
+
* Pagination
|
581 |
+
*/
|
582 |
+
$this->set_pagination_args( array(
|
583 |
+
'total_items' => $max,
|
584 |
+
'per_page' => $per_page,
|
585 |
+
'total_pages' => ceil( $max / $per_page )
|
586 |
+
) );
|
587 |
+
}
|
588 |
+
|
589 |
+
|
590 |
+
}
|
{WCVendors/classes → classes}/admin/class-admin-reports.php
RENAMED
@@ -1,398 +1,398 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WCV_Admin_Reports class.
|
4 |
-
*
|
5 |
-
* Shows reports related to software in the woocommerce backend
|
6 |
-
*
|
7 |
-
* @author Matt Gates <http://mgates.me>
|
8 |
-
* @package
|
9 |
-
*/
|
10 |
-
|
11 |
-
|
12 |
-
class WCV_Admin_Reports
|
13 |
-
{
|
14 |
-
|
15 |
-
|
16 |
-
/**
|
17 |
-
* __construct function.
|
18 |
-
*
|
19 |
-
* @access public
|
20 |
-
* @return void
|
21 |
-
*
|
22 |
-
* @param bool $debug (optional) (default: false)
|
23 |
-
*/
|
24 |
-
function __construct( $debug = false )
|
25 |
-
{
|
26 |
-
add_filter( 'woocommerce_admin_reports', array( $this, 'reports_tab' ) );
|
27 |
-
}
|
28 |
-
|
29 |
-
/**
|
30 |
-
* reports_tab function.
|
31 |
-
*
|
32 |
-
* @access public
|
33 |
-
*
|
34 |
-
* @param unknown $reports
|
35 |
-
*
|
36 |
-
* @return void
|
37 |
-
*/
|
38 |
-
function reports_tab( $reports )
|
39 |
-
{
|
40 |
-
$reports[ 'vendors' ] = array(
|
41 |
-
'title' => __( 'WC Vendors', 'wcvendors' ),
|
42 |
-
'charts' => array(
|
43 |
-
array(
|
44 |
-
'title' => __( 'Overview', 'wcvendors' ),
|
45 |
-
'description' => '',
|
46 |
-
'hide_title' => true,
|
47 |
-
'function' => array( $this, 'sales' ),
|
48 |
-
),
|
49 |
-
array(
|
50 |
-
'title' => __( 'Commission by vendor', 'wcvendors' ),
|
51 |
-
'description' => '',
|
52 |
-
'hide_title' => true,
|
53 |
-
'function' => array( $this, 'commission' ),
|
54 |
-
),
|
55 |
-
array(
|
56 |
-
'title' => __( 'Commission by product', 'wcvendors' ),
|
57 |
-
'description' => '',
|
58 |
-
'hide_title' => true,
|
59 |
-
'function' => array( $this, 'commission' ),
|
60 |
-
),
|
61 |
-
),
|
62 |
-
);
|
63 |
-
|
64 |
-
return $reports;
|
65 |
-
}
|
66 |
-
|
67 |
-
public function products()
|
68 |
-
{
|
69 |
-
# code...
|
70 |
-
}
|
71 |
-
|
72 |
-
|
73 |
-
/**
|
74 |
-
*
|
75 |
-
*/
|
76 |
-
function sales()
|
77 |
-
{
|
78 |
-
global $start_date, $end_date, $woocommerce, $wpdb;
|
79 |
-
|
80 |
-
$start_date = !empty( $_POST[ 'start_date' ] ) ? $_POST[ 'start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
|
81 |
-
$end_date = !empty( $_POST[ 'end_date' ] ) ? $_POST[ 'end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
|
82 |
-
|
83 |
-
if ( !empty( $_POST[ 'start_date' ] ) ) {
|
84 |
-
$start_date = strtotime( $_POST[ 'start_date' ] );
|
85 |
-
}
|
86 |
-
|
87 |
-
if ( !empty( $_POST[ 'end_date' ] ) ) {
|
88 |
-
$end_date = strtotime( $_POST[ 'end_date' ] );
|
89 |
-
}
|
90 |
-
|
91 |
-
$after = date( 'Y-m-d', $start_date );
|
92 |
-
$before = date( 'Y-m-d', strtotime( '+1 day', $end_date ) );
|
93 |
-
|
94 |
-
$commission_due = $wpdb->get_var( "
|
95 |
-
SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'due'
|
96 |
-
AND time >= '" . $after . "'
|
97 |
-
AND time <= '" . $before . "'
|
98 |
-
" );
|
99 |
-
|
100 |
-
$reversed = $wpdb->get_var( "
|
101 |
-
SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'reversed'
|
102 |
-
AND time >= '" . $after . "'
|
103 |
-
AND time <= '" . $before . "'
|
104 |
-
" );
|
105 |
-
|
106 |
-
$paid = $wpdb->get_var( "
|
107 |
-
SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'paid'
|
108 |
-
AND time >= '" . $after . "'
|
109 |
-
AND time <= '" . $before . "'
|
110 |
-
" );
|
111 |
-
|
112 |
-
?>
|
113 |
-
|
114 |
-
<form method="post" action="">
|
115 |
-
<p><label for="from"><?php _e( 'From:', 'wcvendors' ); ?></label>
|
116 |
-
<input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $start_date ) ); ?>" name="start_date" class="range_datepicker from" id="from" />
|
117 |
-
<label for="to"><?php _e( 'To:', 'wcvendors' ); ?></label>
|
118 |
-
<input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $end_date ) ); ?>" name="end_date" class="range_datepicker to" id="to" />
|
119 |
-
<input type="submit" class="button" value="<?php _e( 'Show', 'wcvendors' ); ?>"/></p>
|
120 |
-
</form>
|
121 |
-
|
122 |
-
<div id="poststuff" class="woocommerce-reports-wrap">
|
123 |
-
<div class="woocommerce-reports-sidebar">
|
124 |
-
<div class="postbox">
|
125 |
-
<h3><span><?php _e( 'Total paid in range', 'wcvendors' ); ?></span></h3>
|
126 |
-
|
127 |
-
<div class="inside">
|
128 |
-
<p class="stat"><?php if ( $paid > 0 ) echo woocommerce_price( $paid ); else _e( 'n/a', 'wcvendors' ); ?></p>
|
129 |
-
</div>
|
130 |
-
</div>
|
131 |
-
<div class="postbox">
|
132 |
-
<h3><span><?php _e( 'Total due in range', 'wcvendors' ); ?></span></h3>
|
133 |
-
|
134 |
-
<div class="inside">
|
135 |
-
<p class="stat"><?php if ( $commission_due > 0 ) echo woocommerce_price( $commission_due ); else _e( 'n/a', 'wcvendors' ); ?></p>
|
136 |
-
</div>
|
137 |
-
</div>
|
138 |
-
<div class="postbox">
|
139 |
-
<h3><span><?php _e( 'Total reversed in range', 'wcvendors' ); ?></span></h3>
|
140 |
-
|
141 |
-
<div class="inside">
|
142 |
-
<p class="stat"><?php if ( $reversed > 0 ) echo woocommerce_price( $reversed ); else _e( 'n/a', 'wcvendors' ); ?></p>
|
143 |
-
</div>
|
144 |
-
</div>
|
145 |
-
</div>
|
146 |
-
|
147 |
-
<div class="woocommerce-reports-main">
|
148 |
-
<div class="postbox">
|
149 |
-
<h3><span><?php _e( 'Recent Commission', 'wcvendors' ); ?></span></h3>
|
150 |
-
|
151 |
-
<div>
|
152 |
-
<?php
|
153 |
-
$commission = $wpdb->get_results( "
|
154 |
-
SELECT * FROM {$wpdb->prefix}pv_commission
|
155 |
-
WHERE time >= '" . $after . "'
|
156 |
-
AND time <= '" . $before . "'
|
157 |
-
ORDER BY time DESC
|
158 |
-
" );
|
159 |
-
|
160 |
-
if ( sizeof( $commission ) > 0 ) {
|
161 |
-
|
162 |
-
?>
|
163 |
-
<div class="woocommerce_order_items_wrapper">
|
164 |
-
<table id="commission-table" class="woocommerce_order_items" cellspacing="0">
|
165 |
-
<thead>
|
166 |
-
<tr>
|
167 |
-
<th><?php _e( 'Order', 'wcvendors' ) ?></th>
|
168 |
-
<th><?php _e( 'Product', 'wcvendors' ) ?></th>
|
169 |
-
<th><?php _e( 'Vendor', 'wcvendors' ) ?></th>
|
170 |
-
<th><?php _e( 'Total', 'wcvendors' ) ?></th>
|
171 |
-
<th><?php _e( 'Date & Time', 'wcvendors' ) ?></th>
|
172 |
-
<th><?php _e( 'Status', 'wcvendors' ) ?></th>
|
173 |
-
</tr>
|
174 |
-
</thead>
|
175 |
-
<tbody>
|
176 |
-
<?php $i = 1;
|
177 |
-
foreach ( $commission as $row ) : $i++ ?>
|
178 |
-
<tr<?php if ( $i % 2 == 1 ) echo ' class="alternate"' ?>>
|
179 |
-
<td><?php if ( $row->order_id ) : ?><a
|
180 |
-
href="<?php echo admin_url( 'post.php?post=' . $row->order_id . '&action=edit' ); ?>"><?php echo $row->order_id; ?></a><?php else : _e( 'N/A', 'wcvendors' ); endif; ?>
|
181 |
-
</td>
|
182 |
-
<td><?php echo get_the_title( $row->product_id ); ?></td>
|
183 |
-
<td><?php echo WCV_Vendors::get_vendor_shop_name( $row->vendor_id ); ?></td>
|
184 |
-
<td><?php echo woocommerce_price( $row->total_due + $row->total_shipping + $row->tax ) ?></td>
|
185 |
-
<td><?php echo date( __( 'D j M Y \a\t h:ia', 'wcvendors' ), strtotime( $row->time ) ) ?></td>
|
186 |
-
<td><?php echo $row->status ?></td>
|
187 |
-
</tr>
|
188 |
-
<?php endforeach; ?>
|
189 |
-
</tbody>
|
190 |
-
</table>
|
191 |
-
</div>
|
192 |
-
<?php
|
193 |
-
} else {
|
194 |
-
?><p><?php _e( 'No commission yet', 'wcvendors' ) ?></p><?php
|
195 |
-
}
|
196 |
-
?>
|
197 |
-
</div>
|
198 |
-
</div>
|
199 |
-
</div>
|
200 |
-
</div>
|
201 |
-
<?php
|
202 |
-
|
203 |
-
}
|
204 |
-
|
205 |
-
|
206 |
-
/**
|
207 |
-
*
|
208 |
-
*/
|
209 |
-
function commission()
|
210 |
-
{
|
211 |
-
global $start_date, $end_date, $woocommerce, $wpdb;
|
212 |
-
|
213 |
-
$latest_woo = version_compare( $woocommerce->version, '2.3', '>' );
|
214 |
-
|
215 |
-
$first_year = $wpdb->get_var( "SELECT time FROM {$wpdb->prefix}pv_commission ORDER BY time ASC LIMIT 1;" );
|
216 |
-
$first_year = $first_year ? date( 'Y', strtotime( $first_year ) ) : date( 'Y' );
|
217 |
-
$current_year = isset( $_POST[ 'show_year' ] ) ? $_POST[ 'show_year' ] : date( 'Y', current_time( 'timestamp' ) );
|
218 |
-
$start_date = strtotime( $current_year . '0101' );
|
219 |
-
|
220 |
-
$vendors = get_users( array( 'role' => 'vendor' ) );
|
221 |
-
$vendors = apply_filters( 'pv_commission_vendors_list', $vendors );
|
222 |
-
$selected_vendor = !empty( $_POST[ 'show_vendor' ] ) ? (int) $_POST[ 'show_vendor' ] : false;
|
223 |
-
$products = !empty( $_POST[ 'product_ids' ] ) ? (array) $_POST[ 'product_ids' ] : array();
|
224 |
-
|
225 |
-
?>
|
226 |
-
|
227 |
-
<form method="post" action="" class="report_filters">
|
228 |
-
<label for="show_year"><?php _e( 'Show:', 'wcvendors' ); ?></label>
|
229 |
-
<select name="show_year" id="show_year">
|
230 |
-
<?php
|
231 |
-
for ( $i = $first_year; $i <= date( 'Y' ); $i++ )
|
232 |
-
printf( '<option value="%s" %s>%s</option>', $i, selected( $current_year, $i, false ), $i );
|
233 |
-
?>
|
234 |
-
</select>
|
235 |
-
<?php if ( $_GET[ 'report' ] == 2 ) {
|
236 |
-
if ($latest_woo) { ?>
|
237 |
-
<input type="hidden" class="wc-product-search" style="width:203px;" name="product_ids[]" data-placeholder="<?php _e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" />
|
238 |
-
<?php } else { ?>
|
239 |
-
<select id="product_ids" name="product_ids[]" class="ajax_chosen_select_products" multiple="multiple"
|
240 |
-
data-placeholder="<?php _e( 'Type in a product name to start searching...', 'wcvendors' ); ?>"
|
241 |
-
style="width: 400px;"></select>
|
242 |
-
<script type="text/javascript">
|
243 |
-
jQuery(function () {
|
244 |
-
|
245 |
-
// Ajax Chosen Product Selectors
|
246 |
-
jQuery("select.ajax_chosen_select_products").ajaxChosen({
|
247 |
-
method: 'GET',
|
248 |
-
url: '<?php echo admin_url('admin-ajax.php'); ?>',
|
249 |
-
dataType: 'json',
|
250 |
-
afterTypeDelay: 100,
|
251 |
-
data: {
|
252 |
-
action: 'woocommerce_json_search_products',
|
253 |
-
security: '<?php echo wp_create_nonce("search-products"); ?>'
|
254 |
-
}
|
255 |
-
}, function (data) {
|
256 |
-
|
257 |
-
var terms = {};
|
258 |
-
|
259 |
-
jQuery.each(data, function (i, val) {
|
260 |
-
terms[i] = val;
|
261 |
-
});
|
262 |
-
|
263 |
-
return terms;
|
264 |
-
});
|
265 |
-
|
266 |
-
});
|
267 |
-
</script>
|
268 |
-
|
269 |
-
<?php }
|
270 |
-
} else { ?>
|
271 |
-
<select class="chosen_select" id="show_vendor" name="show_vendor" style="width: 300px;"
|
272 |
-
data-placeholder="<?php _e( 'Select a vendor…', 'wcvendors' ); ?>">
|
273 |
-
<option></option>
|
274 |
-
<?php foreach ( $vendors as $key => $vendor ) printf( '<option value="%s" %s>%s</option>', $vendor->ID, selected( $selected_vendor, $vendor->ID, false ), $vendor->display_name ); ?>
|
275 |
-
</select>
|
276 |
-
<?php } ?>
|
277 |
-
<input type="submit" class="button" value="<?php _e( 'Show', 'wcvendors' ); ?>"/>
|
278 |
-
</form>
|
279 |
-
|
280 |
-
<?php
|
281 |
-
|
282 |
-
if ( !empty( $selected_vendor ) || !empty( $products ) ) {
|
283 |
-
|
284 |
-
foreach ($products as $key => $product_id) {
|
285 |
-
$_product = get_product($product_id);
|
286 |
-
$childs = $_product->get_children();
|
287 |
-
$products = array_merge($childs, $products);
|
288 |
-
}
|
289 |
-
|
290 |
-
$commissions = array();
|
291 |
-
$filter = !empty( $selected_vendor ) ? (" WHERE vendor_id = " . $selected_vendor) : (" WHERE product_id IN ( " . implode( ', ', $products ) ." )");
|
292 |
-
|
293 |
-
$sql = "SELECT
|
294 |
-
SUM(total_due + total_shipping + tax) as total,
|
295 |
-
SUM(total_due) as commission,
|
296 |
-
SUM(total_shipping) as shipping,
|
297 |
-
SUM(tax) as tax
|
298 |
-
FROM {$wpdb->prefix}pv_commission
|
299 |
-
";
|
300 |
-
|
301 |
-
$paid_sql = "SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission " . $filter . " AND status = 'paid'";
|
302 |
-
$reversed_sql = "SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission" . $filter . " AND status = 'reversed'";
|
303 |
-
$date_sql = " AND date_format(`time`,'%%Y%%m') = %d";
|
304 |
-
|
305 |
-
for ( $count = 0; $count < 12; $count++ ) {
|
306 |
-
$time = strtotime( date( 'Ym', strtotime( '+ ' . $count . ' MONTH', $start_date ) ) . '01' );
|
307 |
-
if ( $time > current_time( 'timestamp' ) ) continue;
|
308 |
-
|
309 |
-
$month = date( 'Ym', strtotime( date( 'Ym', strtotime( '+ ' . $count . ' MONTH', $start_date ) ) . '01' ) );
|
310 |
-
|
311 |
-
$fetch_results = $wpdb->prepare( $sql . $filter . $date_sql, $month );
|
312 |
-
|
313 |
-
$results = $wpdb->get_results( $fetch_results );
|
314 |
-
if ( !empty( $results[ 0 ] ) ) {
|
315 |
-
extract( get_object_vars( $results[ 0 ] ) );
|
316 |
-
}
|
317 |
-
|
318 |
-
$paid = $wpdb->get_var( $wpdb->prepare( $paid_sql . $date_sql, $month ) );
|
319 |
-
$reversed = $wpdb->get_var( $wpdb->prepare( $reversed_sql . $date_sql, $month ) );
|
320 |
-
|
321 |
-
$commissions[ date( 'M', strtotime( $month . '01' ) ) ] = array(
|
322 |
-
'commission' => $commission,
|
323 |
-
'tax' => $tax,
|
324 |
-
'shipping' => $shipping,
|
325 |
-
'reversed' => $reversed,
|
326 |
-
'paid' => $paid,
|
327 |
-
'total' => $total - $reversed - $paid,
|
328 |
-
);
|
329 |
-
|
330 |
-
}
|
331 |
-
|
332 |
-
?>
|
333 |
-
|
334 |
-
<div class="woocommerce-reports-main">
|
335 |
-
<table class="widefat">
|
336 |
-
<thead>
|
337 |
-
<tr>
|
338 |
-
<th><?php _e( 'Month', 'wcvendors' ); ?></th>
|
339 |
-
<th class="total_row"><?php _e( 'Commission', 'wcvendors' ); ?></th>
|
340 |
-
<th class="total_row"><?php _e( 'Tax', 'wcvendors' ); ?></th>
|
341 |
-
<th class="total_row"><?php _e( 'Shipping', 'wcvendors' ); ?></th>
|
342 |
-
<th class="total_row"><?php _e( 'Reversed', 'wcvendors' ); ?></th>
|
343 |
-
<th class="total_row"><?php _e( 'Paid', 'wcvendors' ); ?></th>
|
344 |
-
<th class="total_row"><b><?php _e( 'Total', 'wcvendors' ); ?></th>
|
345 |
-
</tr>
|
346 |
-
</thead>
|
347 |
-
<tfoot>
|
348 |
-
<tr>
|
349 |
-
<?php
|
350 |
-
$total = array(
|
351 |
-
'commission' => 0,
|
352 |
-
'tax' => 0,
|
353 |
-
'shipping' => 0,
|
354 |
-
'reversed' => 0,
|
355 |
-
'paid' => 0,
|
356 |
-
'total' => 0,
|
357 |
-
);
|
358 |
-
|
359 |
-
foreach ( $commissions as $month => $commission ) {
|
360 |
-
$total[ 'commission' ] += $commission[ 'commission' ];
|
361 |
-
$total[ 'tax' ] += $commission[ 'tax' ];
|
362 |
-
$total[ 'shipping' ] += $commission[ 'shipping' ];
|
363 |
-
$total[ 'reversed' ] += $commission[ 'reversed' ];
|
364 |
-
$total[ 'paid' ] += $commission[ 'paid' ];
|
365 |
-
$total[ 'total' ] += $commission[ 'total' ];
|
366 |
-
}
|
367 |
-
|
368 |
-
echo '<td>' . __( 'Total', 'wcvendors' ) . '</td>';
|
369 |
-
|
370 |
-
foreach ( $total as $value ) {
|
371 |
-
echo '<td class="total_row">' . woocommerce_price( $value ) . '</td>';
|
372 |
-
}
|
373 |
-
?>
|
374 |
-
</tr>
|
375 |
-
</tfoot>
|
376 |
-
<tbody>
|
377 |
-
<?php
|
378 |
-
foreach ( $commissions as $month => $commission ) {
|
379 |
-
$alt = ( isset( $alt ) && $alt == 'alt' ) ? '' : 'alt';
|
380 |
-
|
381 |
-
echo '<tr class="' . $alt . '"><td>' . $month . '</td>';
|
382 |
-
|
383 |
-
foreach ( $commission as $value ) {
|
384 |
-
echo '<td class="total_row">' . woocommerce_price( $value ) . '</td>';
|
385 |
-
}
|
386 |
-
|
387 |
-
echo '</tr>';
|
388 |
-
}
|
389 |
-
?>
|
390 |
-
</tbody>
|
391 |
-
</table>
|
392 |
-
</div>
|
393 |
-
|
394 |
-
<?php } ?>
|
395 |
-
<?php
|
396 |
-
|
397 |
-
}
|
398 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WCV_Admin_Reports class.
|
4 |
+
*
|
5 |
+
* Shows reports related to software in the woocommerce backend
|
6 |
+
*
|
7 |
+
* @author Matt Gates <http://mgates.me>
|
8 |
+
* @package
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
class WCV_Admin_Reports
|
13 |
+
{
|
14 |
+
|
15 |
+
|
16 |
+
/**
|
17 |
+
* __construct function.
|
18 |
+
*
|
19 |
+
* @access public
|
20 |
+
* @return void
|
21 |
+
*
|
22 |
+
* @param bool $debug (optional) (default: false)
|
23 |
+
*/
|
24 |
+
function __construct( $debug = false )
|
25 |
+
{
|
26 |
+
add_filter( 'woocommerce_admin_reports', array( $this, 'reports_tab' ) );
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* reports_tab function.
|
31 |
+
*
|
32 |
+
* @access public
|
33 |
+
*
|
34 |
+
* @param unknown $reports
|
35 |
+
*
|
36 |
+
* @return void
|
37 |
+
*/
|
38 |
+
function reports_tab( $reports )
|
39 |
+
{
|
40 |
+
$reports[ 'vendors' ] = array(
|
41 |
+
'title' => __( 'WC Vendors', 'wcvendors' ),
|
42 |
+
'charts' => array(
|
43 |
+
array(
|
44 |
+
'title' => __( 'Overview', 'wcvendors' ),
|
45 |
+
'description' => '',
|
46 |
+
'hide_title' => true,
|
47 |
+
'function' => array( $this, 'sales' ),
|
48 |
+
),
|
49 |
+
array(
|
50 |
+
'title' => __( 'Commission by vendor', 'wcvendors' ),
|
51 |
+
'description' => '',
|
52 |
+
'hide_title' => true,
|
53 |
+
'function' => array( $this, 'commission' ),
|
54 |
+
),
|
55 |
+
array(
|
56 |
+
'title' => __( 'Commission by product', 'wcvendors' ),
|
57 |
+
'description' => '',
|
58 |
+
'hide_title' => true,
|
59 |
+
'function' => array( $this, 'commission' ),
|
60 |
+
),
|
61 |
+
),
|
62 |
+
);
|
63 |
+
|
64 |
+
return $reports;
|
65 |
+
}
|
66 |
+
|
67 |
+
public function products()
|
68 |
+
{
|
69 |
+
# code...
|
70 |
+
}
|
71 |
+
|
72 |
+
|
73 |
+
/**
|
74 |
+
*
|
75 |
+
*/
|
76 |
+
function sales()
|
77 |
+
{
|
78 |
+
global $start_date, $end_date, $woocommerce, $wpdb;
|
79 |
+
|
80 |
+
$start_date = !empty( $_POST[ 'start_date' ] ) ? $_POST[ 'start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
|
81 |
+
$end_date = !empty( $_POST[ 'end_date' ] ) ? $_POST[ 'end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
|
82 |
+
|
83 |
+
if ( !empty( $_POST[ 'start_date' ] ) ) {
|
84 |
+
$start_date = strtotime( $_POST[ 'start_date' ] );
|
85 |
+
}
|
86 |
+
|
87 |
+
if ( !empty( $_POST[ 'end_date' ] ) ) {
|
88 |
+
$end_date = strtotime( $_POST[ 'end_date' ] );
|
89 |
+
}
|
90 |
+
|
91 |
+
$after = date( 'Y-m-d', $start_date );
|
92 |
+
$before = date( 'Y-m-d', strtotime( '+1 day', $end_date ) );
|
93 |
+
|
94 |
+
$commission_due = $wpdb->get_var( "
|
95 |
+
SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'due'
|
96 |
+
AND time >= '" . $after . "'
|
97 |
+
AND time <= '" . $before . "'
|
98 |
+
" );
|
99 |
+
|
100 |
+
$reversed = $wpdb->get_var( "
|
101 |
+
SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'reversed'
|
102 |
+
AND time >= '" . $after . "'
|
103 |
+
AND time <= '" . $before . "'
|
104 |
+
" );
|
105 |
+
|
106 |
+
$paid = $wpdb->get_var( "
|
107 |
+
SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission WHERE status = 'paid'
|
108 |
+
AND time >= '" . $after . "'
|
109 |
+
AND time <= '" . $before . "'
|
110 |
+
" );
|
111 |
+
|
112 |
+
?>
|
113 |
+
|
114 |
+
<form method="post" action="">
|
115 |
+
<p><label for="from"><?php _e( 'From:', 'wcvendors' ); ?></label>
|
116 |
+
<input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $start_date ) ); ?>" name="start_date" class="range_datepicker from" id="from" />
|
117 |
+
<label for="to"><?php _e( 'To:', 'wcvendors' ); ?></label>
|
118 |
+
<input type="text" size="9" placeholder="yyyy-mm-dd" value="<?php echo esc_attr( date( 'Y-m-d', $end_date ) ); ?>" name="end_date" class="range_datepicker to" id="to" />
|
119 |
+
<input type="submit" class="button" value="<?php _e( 'Show', 'wcvendors' ); ?>"/></p>
|
120 |
+
</form>
|
121 |
+
|
122 |
+
<div id="poststuff" class="woocommerce-reports-wrap">
|
123 |
+
<div class="woocommerce-reports-sidebar">
|
124 |
+
<div class="postbox">
|
125 |
+
<h3><span><?php _e( 'Total paid in range', 'wcvendors' ); ?></span></h3>
|
126 |
+
|
127 |
+
<div class="inside">
|
128 |
+
<p class="stat"><?php if ( $paid > 0 ) echo woocommerce_price( $paid ); else _e( 'n/a', 'wcvendors' ); ?></p>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
<div class="postbox">
|
132 |
+
<h3><span><?php _e( 'Total due in range', 'wcvendors' ); ?></span></h3>
|
133 |
+
|
134 |
+
<div class="inside">
|
135 |
+
<p class="stat"><?php if ( $commission_due > 0 ) echo woocommerce_price( $commission_due ); else _e( 'n/a', 'wcvendors' ); ?></p>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
<div class="postbox">
|
139 |
+
<h3><span><?php _e( 'Total reversed in range', 'wcvendors' ); ?></span></h3>
|
140 |
+
|
141 |
+
<div class="inside">
|
142 |
+
<p class="stat"><?php if ( $reversed > 0 ) echo woocommerce_price( $reversed ); else _e( 'n/a', 'wcvendors' ); ?></p>
|
143 |
+
</div>
|
144 |
+
</div>
|
145 |
+
</div>
|
146 |
+
|
147 |
+
<div class="woocommerce-reports-main">
|
148 |
+
<div class="postbox">
|
149 |
+
<h3><span><?php _e( 'Recent Commission', 'wcvendors' ); ?></span></h3>
|
150 |
+
|
151 |
+
<div>
|
152 |
+
<?php
|
153 |
+
$commission = $wpdb->get_results( "
|
154 |
+
SELECT * FROM {$wpdb->prefix}pv_commission
|
155 |
+
WHERE time >= '" . $after . "'
|
156 |
+
AND time <= '" . $before . "'
|
157 |
+
ORDER BY time DESC
|
158 |
+
" );
|
159 |
+
|
160 |
+
if ( sizeof( $commission ) > 0 ) {
|
161 |
+
|
162 |
+
?>
|
163 |
+
<div class="woocommerce_order_items_wrapper">
|
164 |
+
<table id="commission-table" class="woocommerce_order_items" cellspacing="0">
|
165 |
+
<thead>
|
166 |
+
<tr>
|
167 |
+
<th><?php _e( 'Order', 'wcvendors' ) ?></th>
|
168 |
+
<th><?php _e( 'Product', 'wcvendors' ) ?></th>
|
169 |
+
<th><?php _e( 'Vendor', 'wcvendors' ) ?></th>
|
170 |
+
<th><?php _e( 'Total', 'wcvendors' ) ?></th>
|
171 |
+
<th><?php _e( 'Date & Time', 'wcvendors' ) ?></th>
|
172 |
+
<th><?php _e( 'Status', 'wcvendors' ) ?></th>
|
173 |
+
</tr>
|
174 |
+
</thead>
|
175 |
+
<tbody>
|
176 |
+
<?php $i = 1;
|
177 |
+
foreach ( $commission as $row ) : $i++ ?>
|
178 |
+
<tr<?php if ( $i % 2 == 1 ) echo ' class="alternate"' ?>>
|
179 |
+
<td><?php if ( $row->order_id ) : ?><a
|
180 |
+
href="<?php echo admin_url( 'post.php?post=' . $row->order_id . '&action=edit' ); ?>"><?php echo $row->order_id; ?></a><?php else : _e( 'N/A', 'wcvendors' ); endif; ?>
|
181 |
+
</td>
|
182 |
+
<td><?php echo get_the_title( $row->product_id ); ?></td>
|
183 |
+
<td><?php echo WCV_Vendors::get_vendor_shop_name( $row->vendor_id ); ?></td>
|
184 |
+
<td><?php echo woocommerce_price( $row->total_due + $row->total_shipping + $row->tax ) ?></td>
|
185 |
+
<td><?php echo date( __( 'D j M Y \a\t h:ia', 'wcvendors' ), strtotime( $row->time ) ) ?></td>
|
186 |
+
<td><?php echo $row->status ?></td>
|
187 |
+
</tr>
|
188 |
+
<?php endforeach; ?>
|
189 |
+
</tbody>
|
190 |
+
</table>
|
191 |
+
</div>
|
192 |
+
<?php
|
193 |
+
} else {
|
194 |
+
?><p><?php _e( 'No commission yet', 'wcvendors' ) ?></p><?php
|
195 |
+
}
|
196 |
+
?>
|
197 |
+
</div>
|
198 |
+
</div>
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
<?php
|
202 |
+
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
/**
|
207 |
+
*
|
208 |
+
*/
|
209 |
+
function commission()
|
210 |
+
{
|
211 |
+
global $start_date, $end_date, $woocommerce, $wpdb;
|
212 |
+
|
213 |
+
$latest_woo = version_compare( $woocommerce->version, '2.3', '>' );
|
214 |
+
|
215 |
+
$first_year = $wpdb->get_var( "SELECT time FROM {$wpdb->prefix}pv_commission ORDER BY time ASC LIMIT 1;" );
|
216 |
+
$first_year = $first_year ? date( 'Y', strtotime( $first_year ) ) : date( 'Y' );
|
217 |
+
$current_year = isset( $_POST[ 'show_year' ] ) ? $_POST[ 'show_year' ] : date( 'Y', current_time( 'timestamp' ) );
|
218 |
+
$start_date = strtotime( $current_year . '0101' );
|
219 |
+
|
220 |
+
$vendors = get_users( array( 'role' => 'vendor' ) );
|
221 |
+
$vendors = apply_filters( 'pv_commission_vendors_list', $vendors );
|
222 |
+
$selected_vendor = !empty( $_POST[ 'show_vendor' ] ) ? (int) $_POST[ 'show_vendor' ] : false;
|
223 |
+
$products = !empty( $_POST[ 'product_ids' ] ) ? (array) $_POST[ 'product_ids' ] : array();
|
224 |
+
|
225 |
+
?>
|
226 |
+
|
227 |
+
<form method="post" action="" class="report_filters">
|
228 |
+
<label for="show_year"><?php _e( 'Show:', 'wcvendors' ); ?></label>
|
229 |
+
<select name="show_year" id="show_year">
|
230 |
+
<?php
|
231 |
+
for ( $i = $first_year; $i <= date( 'Y' ); $i++ )
|
232 |
+
printf( '<option value="%s" %s>%s</option>', $i, selected( $current_year, $i, false ), $i );
|
233 |
+
?>
|
234 |
+
</select>
|
235 |
+
<?php if ( $_GET[ 'report' ] == 2 ) {
|
236 |
+
if ($latest_woo) { ?>
|
237 |
+
<input type="hidden" class="wc-product-search" style="width:203px;" name="product_ids[]" data-placeholder="<?php _e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" />
|
238 |
+
<?php } else { ?>
|
239 |
+
<select id="product_ids" name="product_ids[]" class="ajax_chosen_select_products" multiple="multiple"
|
240 |
+
data-placeholder="<?php _e( 'Type in a product name to start searching...', 'wcvendors' ); ?>"
|
241 |
+
style="width: 400px;"></select>
|
242 |
+
<script type="text/javascript">
|
243 |
+
jQuery(function () {
|
244 |
+
|
245 |
+
// Ajax Chosen Product Selectors
|
246 |
+
jQuery("select.ajax_chosen_select_products").ajaxChosen({
|
247 |
+
method: 'GET',
|
248 |
+
url: '<?php echo admin_url('admin-ajax.php'); ?>',
|
249 |
+
dataType: 'json',
|
250 |
+
afterTypeDelay: 100,
|
251 |
+
data: {
|
252 |
+
action: 'woocommerce_json_search_products',
|
253 |
+
security: '<?php echo wp_create_nonce("search-products"); ?>'
|
254 |
+
}
|
255 |
+
}, function (data) {
|
256 |
+
|
257 |
+
var terms = {};
|
258 |
+
|
259 |
+
jQuery.each(data, function (i, val) {
|
260 |
+
terms[i] = val;
|
261 |
+
});
|
262 |
+
|
263 |
+
return terms;
|
264 |
+
});
|
265 |
+
|
266 |
+
});
|
267 |
+
</script>
|
268 |
+
|
269 |
+
<?php }
|
270 |
+
} else { ?>
|
271 |
+
<select class="chosen_select" id="show_vendor" name="show_vendor" style="width: 300px;"
|
272 |
+
data-placeholder="<?php _e( 'Select a vendor…', 'wcvendors' ); ?>">
|
273 |
+
<option></option>
|
274 |
+
<?php foreach ( $vendors as $key => $vendor ) printf( '<option value="%s" %s>%s</option>', $vendor->ID, selected( $selected_vendor, $vendor->ID, false ), $vendor->display_name ); ?>
|
275 |
+
</select>
|
276 |
+
<?php } ?>
|
277 |
+
<input type="submit" class="button" value="<?php _e( 'Show', 'wcvendors' ); ?>"/>
|
278 |
+
</form>
|
279 |
+
|
280 |
+
<?php
|
281 |
+
|
282 |
+
if ( !empty( $selected_vendor ) || !empty( $products ) ) {
|
283 |
+
|
284 |
+
foreach ($products as $key => $product_id) {
|
285 |
+
$_product = get_product($product_id);
|
286 |
+
$childs = $_product->get_children();
|
287 |
+
$products = array_merge($childs, $products);
|
288 |
+
}
|
289 |
+
|
290 |
+
$commissions = array();
|
291 |
+
$filter = !empty( $selected_vendor ) ? (" WHERE vendor_id = " . $selected_vendor) : (" WHERE product_id IN ( " . implode( ', ', $products ) ." )");
|
292 |
+
|
293 |
+
$sql = "SELECT
|
294 |
+
SUM(total_due + total_shipping + tax) as total,
|
295 |
+
SUM(total_due) as commission,
|
296 |
+
SUM(total_shipping) as shipping,
|
297 |
+
SUM(tax) as tax
|
298 |
+
FROM {$wpdb->prefix}pv_commission
|
299 |
+
";
|
300 |
+
|
301 |
+
$paid_sql = "SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission " . $filter . " AND status = 'paid'";
|
302 |
+
$reversed_sql = "SELECT SUM(total_due + total_shipping + tax) FROM {$wpdb->prefix}pv_commission" . $filter . " AND status = 'reversed'";
|
303 |
+
$date_sql = " AND date_format(`time`,'%%Y%%m') = %d";
|
304 |
+
|
305 |
+
for ( $count = 0; $count < 12; $count++ ) {
|
306 |
+
$time = strtotime( date( 'Ym', strtotime( '+ ' . $count . ' MONTH', $start_date ) ) . '01' );
|
307 |
+
if ( $time > current_time( 'timestamp' ) ) continue;
|
308 |
+
|
309 |
+
$month = date( 'Ym', strtotime( date( 'Ym', strtotime( '+ ' . $count . ' MONTH', $start_date ) ) . '01' ) );
|
310 |
+
|
311 |
+
$fetch_results = $wpdb->prepare( $sql . $filter . $date_sql, $month );
|
312 |
+
|
313 |
+
$results = $wpdb->get_results( $fetch_results );
|
314 |
+
if ( !empty( $results[ 0 ] ) ) {
|
315 |
+
extract( get_object_vars( $results[ 0 ] ) );
|
316 |
+
}
|
317 |
+
|
318 |
+
$paid = $wpdb->get_var( $wpdb->prepare( $paid_sql . $date_sql, $month ) );
|
319 |
+
$reversed = $wpdb->get_var( $wpdb->prepare( $reversed_sql . $date_sql, $month ) );
|
320 |
+
|
321 |
+
$commissions[ date( 'M', strtotime( $month . '01' ) ) ] = array(
|
322 |
+
'commission' => $commission,
|
323 |
+
'tax' => $tax,
|
324 |
+
'shipping' => $shipping,
|
325 |
+
'reversed' => $reversed,
|
326 |
+
'paid' => $paid,
|
327 |
+
'total' => $total - $reversed - $paid,
|
328 |
+
);
|
329 |
+
|
330 |
+
}
|
331 |
+
|
332 |
+
?>
|
333 |
+
|
334 |
+
<div class="woocommerce-reports-main">
|
335 |
+
<table class="widefat">
|
336 |
+
<thead>
|
337 |
+
<tr>
|
338 |
+
<th><?php _e( 'Month', 'wcvendors' ); ?></th>
|
339 |
+
<th class="total_row"><?php _e( 'Commission', 'wcvendors' ); ?></th>
|
340 |
+
<th class="total_row"><?php _e( 'Tax', 'wcvendors' ); ?></th>
|
341 |
+
<th class="total_row"><?php _e( 'Shipping', 'wcvendors' ); ?></th>
|
342 |
+
<th class="total_row"><?php _e( 'Reversed', 'wcvendors' ); ?></th>
|
343 |
+
<th class="total_row"><?php _e( 'Paid', 'wcvendors' ); ?></th>
|
344 |
+
<th class="total_row"><b><?php _e( 'Total', 'wcvendors' ); ?></th>
|
345 |
+
</tr>
|
346 |
+
</thead>
|
347 |
+
<tfoot>
|
348 |
+
<tr>
|
349 |
+
<?php
|
350 |
+
$total = array(
|
351 |
+
'commission' => 0,
|
352 |
+
'tax' => 0,
|
353 |
+
'shipping' => 0,
|
354 |
+
'reversed' => 0,
|
355 |
+
'paid' => 0,
|
356 |
+
'total' => 0,
|
357 |
+
);
|
358 |
+
|
359 |
+
foreach ( $commissions as $month => $commission ) {
|
360 |
+
$total[ 'commission' ] += $commission[ 'commission' ];
|
361 |
+
$total[ 'tax' ] += $commission[ 'tax' ];
|
362 |
+
$total[ 'shipping' ] += $commission[ 'shipping' ];
|
363 |
+
$total[ 'reversed' ] += $commission[ 'reversed' ];
|
364 |
+
$total[ 'paid' ] += $commission[ 'paid' ];
|
365 |
+
$total[ 'total' ] += $commission[ 'total' ];
|
366 |
+
}
|
367 |
+
|
368 |
+
echo '<td>' . __( 'Total', 'wcvendors' ) . '</td>';
|
369 |
+
|
370 |
+
foreach ( $total as $value ) {
|
371 |
+
echo '<td class="total_row">' . woocommerce_price( $value ) . '</td>';
|
372 |
+
}
|
373 |
+
?>
|
374 |
+
</tr>
|
375 |
+
</tfoot>
|
376 |
+
<tbody>
|
377 |
+
<?php
|
378 |
+
foreach ( $commissions as $month => $commission ) {
|
379 |
+
$alt = ( isset( $alt ) && $alt == 'alt' ) ? '' : 'alt';
|
380 |
+
|
381 |
+
echo '<tr class="' . $alt . '"><td>' . $month . '</td>';
|
382 |
+
|
383 |
+
foreach ( $commission as $value ) {
|
384 |
+
echo '<td class="total_row">' . woocommerce_price( $value ) . '</td>';
|
385 |
+
}
|
386 |
+
|
387 |
+
echo '</tr>';
|
388 |
+
}
|
389 |
+
?>
|
390 |
+
</tbody>
|
391 |
+
</table>
|
392 |
+
</div>
|
393 |
+
|
394 |
+
<?php } ?>
|
395 |
+
<?php
|
396 |
+
|
397 |
+
}
|
398 |
+
}
|
{WCVendors/classes → classes}/admin/class-admin-users.php
RENAMED
@@ -1,411 +1,411 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* WP-Admin users page
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package ProductVendor
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Admin_Users
|
12 |
-
{
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Constructor
|
17 |
-
*/
|
18 |
-
function __construct()
|
19 |
-
{
|
20 |
-
if ( !is_admin() ) return;
|
21 |
-
|
22 |
-
add_action( 'edit_user_profile', array( $this, 'show_extra_profile_fields' ) );
|
23 |
-
add_action( 'edit_user_profile_update', array( $this, 'save_extra_profile_fields' ) );
|
24 |
-
|
25 |
-
add_filter( 'add_menu_classes', array( $this, 'show_pending_number' ) );
|
26 |
-
|
27 |
-
// Disabling non-vendor related items on the admin screens
|
28 |
-
if ( WCV_Vendors::is_vendor( get_current_user_id() ) ) {
|
29 |
-
add_filter( 'woocommerce_csv_product_role', array( $this, 'csv_import_suite_compatibility' ) );
|
30 |
-
add_filter( 'woocommerce_csv_product_export_args', array( $this, 'csv_import_suite_compatibility_export' ) );
|
31 |
-
|
32 |
-
// Admin page lockdown
|
33 |
-
remove_action( 'admin_init', 'woocommerce_prevent_admin_access' );
|
34 |
-
add_action( 'admin_init', array( $this, 'prevent_admin_access' ) );
|
35 |
-
|
36 |
-
add_filter( 'woocommerce_prevent_admin_access', array( $this, 'deny_admin_access' ) );
|
37 |
-
|
38 |
-
|
39 |
-
// WC > Product page fixes
|
40 |
-
add_action( 'load-post-new.php', array( $this, 'confirm_access_to_add' ) );
|
41 |
-
add_action( 'load-edit.php', array( $this, 'edit_nonvendors' ) );
|
42 |
-
add_filter( 'views_edit-product', array( $this, 'hide_nonvendor_links' ) );
|
43 |
-
|
44 |
-
add_action( 'pre_get_posts', array( $this, 'users_own_attachments' ) );
|
45 |
-
add_action( 'admin_menu', array( $this, 'remove_menu_page' ), 99 );
|
46 |
-
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 99 );
|
47 |
-
add_filter( 'product_type_selector', array( $this, 'filter_product_types' ), 99, 2 );
|
48 |
-
add_filter( 'product_type_options', array( $this, 'filter_product_type_options' ), 99 );
|
49 |
-
|
50 |
-
add_filter( 'woocommerce_duplicate_product_capability', array( $this, 'add_duplicate_capability' ) );
|
51 |
-
|
52 |
-
// WC > Product featured
|
53 |
-
$product_misc = (array) WC_Vendors::$pv_options->get_option( 'hide_product_misc' );
|
54 |
-
|
55 |
-
if ($product_misc['featured']) {
|
56 |
-
add_filter( 'manage_product_posts_columns', array($this, 'manage_product_columns'), 99);
|
57 |
-
}
|
58 |
-
|
59 |
-
}
|
60 |
-
|
61 |
-
}
|
62 |
-
|
63 |
-
public function confirm_access_to_add()
|
64 |
-
{
|
65 |
-
if ( empty( $_GET['post_type'] ) || $_GET['post_type'] != 'product' ) {
|
66 |
-
return;
|
67 |
-
}
|
68 |
-
|
69 |
-
$can_submit = WC_Vendors::$pv_options->get_option( 'can_submit_products' );
|
70 |
-
if ( !$can_submit ) {
|
71 |
-
wp_die( 'You are not allowed to submit products.' );
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
// public function get_terms_filter( $terms, $tax, $args )
|
76 |
-
// {
|
77 |
-
// if ( $tax[0] != 'product_type' || ( $tax[0] == 'product_type' && ! empty( $args['include'] ) ) ) {
|
78 |
-
// return $terms;
|
79 |
-
// }
|
80 |
-
|
81 |
-
// $products = WCV_Vendors::get_vendor_products( get_current_user_id() );
|
82 |
-
// $ids = array();
|
83 |
-
// foreach ( $products as $product ) {
|
84 |
-
// $ids[ ] = ( $product->ID );
|
85 |
-
// $product = get_product( $product )->product_type;
|
86 |
-
// var_dump($product);exit;
|
87 |
-
// }
|
88 |
-
|
89 |
-
// $args['include'] = $ids;
|
90 |
-
|
91 |
-
// var_dump($terms);exit;
|
92 |
-
|
93 |
-
// $terms = get_terms( $tax[0], $args);
|
94 |
-
|
95 |
-
|
96 |
-
// return $terms;
|
97 |
-
// }
|
98 |
-
|
99 |
-
public function csv_import_suite_compatibility( $capability )
|
100 |
-
{
|
101 |
-
return 'manage_product';
|
102 |
-
}
|
103 |
-
|
104 |
-
public function csv_import_suite_compatibility_export( $args )
|
105 |
-
{
|
106 |
-
$args[ 'author' ] = get_current_user_id();
|
107 |
-
|
108 |
-
return $args;
|
109 |
-
}
|
110 |
-
|
111 |
-
public function add_duplicate_capability( $capability )
|
112 |
-
{
|
113 |
-
return 'manage_product';
|
114 |
-
}
|
115 |
-
|
116 |
-
|
117 |
-
/**
|
118 |
-
*
|
119 |
-
*
|
120 |
-
* @param unknown $menu
|
121 |
-
*
|
122 |
-
* @return unknown
|
123 |
-
*/
|
124 |
-
public function show_pending_number( $menu )
|
125 |
-
{
|
126 |
-
$num_posts = wp_count_posts( 'product', 'readable' );
|
127 |
-
|
128 |
-
$pending_count = !empty( $num_posts->pending ) ? $num_posts->pending : 0;
|
129 |
-
$menu_str = 'edit.php?post_type=product';
|
130 |
-
|
131 |
-
foreach ( $menu as $menu_key => $menu_data ) {
|
132 |
-
if ( $menu_str != $menu_data[ 2 ] ) continue;
|
133 |
-
$menu[ $menu_key ][ 0 ] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n( $pending_count ) . '</span></span>';
|
134 |
-
}
|
135 |
-
|
136 |
-
return $menu;
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
/**
|
141 |
-
*
|
142 |
-
*
|
143 |
-
* @param unknown $types
|
144 |
-
* @param unknown $product_type
|
145 |
-
*
|
146 |
-
* @return unknown
|
147 |
-
*/
|
148 |
-
function filter_product_types( $types, $product_type )
|
149 |
-
{
|
150 |
-
$product_panel = (array) WC_Vendors::$pv_options->get_option( 'hide_product_panel' );
|
151 |
-
$product_misc = (array) WC_Vendors::$pv_options->get_option( 'hide_product_misc' );
|
152 |
-
$product_types = (array) WC_Vendors::$pv_options->get_option( 'hide_product_types' );
|
153 |
-
$css = WC_Vendors::$pv_options->get_option( 'product_page_css' );
|
154 |
-
$count = 0;
|
155 |
-
|
156 |
-
foreach ( $product_panel as $key => $value ) {
|
157 |
-
if ( $value ) $css .= sprintf( '.%s_tab{display:none !important;}', $key );
|
158 |
-
}
|
159 |
-
|
160 |
-
if ( !empty( $product_misc[ 'taxes' ] ) ) {
|
161 |
-
$css .= '.form-field._tax_status_field, .form-field._tax_class_field{display:none !important;}';
|
162 |
-
}
|
163 |
-
|
164 |
-
unset( $product_misc[ 'taxes' ] );
|
165 |
-
|
166 |
-
foreach ( $product_misc as $key => $value ) {
|
167 |
-
if ( $value ) $css .= sprintf( '._%s_field{display:none !important;}', $key );
|
168 |
-
}
|
169 |
-
|
170 |
-
foreach ( $product_types as $value ) {
|
171 |
-
if ( !$value ) $count++;
|
172 |
-
}
|
173 |
-
|
174 |
-
if ( $count === 1 ) {
|
175 |
-
$css .= '#product-type{display:none !important;}';
|
176 |
-
}
|
177 |
-
|
178 |
-
echo '<style>';
|
179 |
-
echo $css;
|
180 |
-
echo '</style>';
|
181 |
-
|
182 |
-
foreach ( $types as $key => $value ) {
|
183 |
-
if ( !empty( $product_types[ $key ] ) ) {
|
184 |
-
unset( $types[ $key ] );
|
185 |
-
}
|
186 |
-
}
|
187 |
-
|
188 |
-
return $types;
|
189 |
-
}
|
190 |
-
|
191 |
-
|
192 |
-
/**
|
193 |
-
*
|
194 |
-
*
|
195 |
-
* @param unknown $types
|
196 |
-
*
|
197 |
-
* @return unknown
|
198 |
-
*/
|
199 |
-
function filter_product_type_options( $types )
|
200 |
-
{
|
201 |
-
$product_options = WC_Vendors::$pv_options->get_option( 'hide_product_type_options' );
|
202 |
-
|
203 |
-
if ( !$product_options ) return $types;
|
204 |
-
|
205 |
-
foreach ( $types as $key => $value ) {
|
206 |
-
if ( !empty( $product_options[ $key ] ) ) {
|
207 |
-
unset( $types[ $key ] );
|
208 |
-
}
|
209 |
-
}
|
210 |
-
|
211 |
-
return $types;
|
212 |
-
}
|
213 |
-
|
214 |
-
|
215 |
-
/**
|
216 |
-
* Show attachments only belonging to vendor
|
217 |
-
*
|
218 |
-
* @param object $wp_query_obj
|
219 |
-
*/
|
220 |
-
function users_own_attachments( $wp_query_obj )
|
221 |
-
{
|
222 |
-
global $current_user, $pagenow;
|
223 |
-
|
224 |
-
if ( $pagenow == 'upload.php' || ( $pagenow == 'admin-ajax.php' && !empty( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'query-attachments' ) ) {
|
225 |
-
$wp_query_obj->set( 'author', $current_user->ID );
|
226 |
-
}
|
227 |
-
}
|
228 |
-
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Allow vendors to access admin when disabled
|
232 |
-
*/
|
233 |
-
public function prevent_admin_access()
|
234 |
-
{
|
235 |
-
$permitted_user = ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'vendor' ) );
|
236 |
-
|
237 |
-
if ( get_option( 'woocommerce_lock_down_admin' ) == 'yes' && !is_ajax() && !$permitted_user ) {
|
238 |
-
wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
|
239 |
-
exit;
|
240 |
-
}
|
241 |
-
}
|
242 |
-
|
243 |
-
public function deny_admin_access()
|
244 |
-
{
|
245 |
-
return false;
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Request when load-edit.php
|
251 |
-
*/
|
252 |
-
public function edit_nonvendors()
|
253 |
-
{
|
254 |
-
add_action( 'request', array( $this, 'hide_nonvendor_products' ) );
|
255 |
-
}
|
256 |
-
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Hide links that don't matter anymore from vendors
|
260 |
-
*
|
261 |
-
* @param array $views
|
262 |
-
*
|
263 |
-
* @return array
|
264 |
-
*/
|
265 |
-
public function hide_nonvendor_links( $views )
|
266 |
-
{
|
267 |
-
return array();
|
268 |
-
}
|
269 |
-
|
270 |
-
|
271 |
-
/**
|
272 |
-
* Hide products that don't belong to the vendor
|
273 |
-
*
|
274 |
-
* @param array $query_vars
|
275 |
-
*
|
276 |
-
* @return array
|
277 |
-
*/
|
278 |
-
public function hide_nonvendor_products( $query_vars )
|
279 |
-
{
|
280 |
-
$query_vars[ 'author' ] = get_current_user_id();
|
281 |
-
|
282 |
-
return $query_vars;
|
283 |
-
}
|
284 |
-
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Remove the media library menu
|
288 |
-
*/
|
289 |
-
public function remove_menu_page()
|
290 |
-
{
|
291 |
-
global $pagenow, $woocommerce;
|
292 |
-
|
293 |
-
remove_menu_page( 'index.php' ); /* Hides Dashboard menu */
|
294 |
-
remove_menu_page( 'separator1' ); /* Hides separator under Dashboard menu*/
|
295 |
-
remove_all_actions( 'admin_notices' );
|
296 |
-
|
297 |
-
if ( $pagenow == 'index.php' ) {
|
298 |
-
wp_redirect( admin_url( 'profile.php' ) );
|
299 |
-
}
|
300 |
-
}
|
301 |
-
|
302 |
-
|
303 |
-
/**
|
304 |
-
*
|
305 |
-
*/
|
306 |
-
public function remove_meta_boxes()
|
307 |
-
{
|
308 |
-
remove_meta_box( 'postcustom', 'product', 'normal' );
|
309 |
-
remove_meta_box( 'wpseo_meta', 'product', 'normal' );
|
310 |
-
remove_meta_box( 'expirationdatediv', 'product', 'side' );
|
311 |
-
}
|
312 |
-
|
313 |
-
|
314 |
-
/**
|
315 |
-
* Update the vendor PayPal email
|
316 |
-
*
|
317 |
-
* @param int $vendor_id
|
318 |
-
*
|
319 |
-
* @return bool
|
320 |
-
*/
|
321 |
-
public function save_extra_profile_fields( $vendor_id )
|
322 |
-
{
|
323 |
-
if ( !current_user_can( 'edit_user', $vendor_id ) ) return false;
|
324 |
-
|
325 |
-
$users = get_users( array( 'meta_key' => 'pv_shop_slug', 'meta_value' => sanitize_title( $_POST[ 'pv_shop_name' ] ) ) );
|
326 |
-
if ( empty( $users ) || $users[ 0 ]->ID == $vendor_id ) {
|
327 |
-
update_user_meta( $vendor_id, 'pv_shop_name', $_POST[ 'pv_shop_name' ] );
|
328 |
-
update_user_meta( $vendor_id, 'pv_shop_slug', sanitize_title( $_POST[ 'pv_shop_name' ] ) );
|
329 |
-
}
|
330 |
-
|
331 |
-
update_user_meta( $vendor_id, 'pv_paypal', $_POST[ 'pv_paypal' ] );
|
332 |
-
update_user_meta( $vendor_id, 'pv_shop_html_enabled', isset( $_POST[ 'pv_shop_html_enabled' ] ) );
|
333 |
-
update_user_meta( $vendor_id, 'pv_custom_commission_rate', $_POST[ 'pv_custom_commission_rate' ] );
|
334 |
-
update_user_meta( $vendor_id, 'pv_shop_description', $_POST[ 'pv_shop_description' ] );
|
335 |
-
update_user_meta( $vendor_id, 'pv_seller_info', $_POST[ 'pv_seller_info' ] );
|
336 |
-
|
337 |
-
do_action( 'wcvendors_update_admin_user', $vendor_id );
|
338 |
-
}
|
339 |
-
|
340 |
-
|
341 |
-
/**
|
342 |
-
* Show the PayPal field and commision due table
|
343 |
-
*
|
344 |
-
* @param unknown $user
|
345 |
-
*/
|
346 |
-
public function show_extra_profile_fields( $user )
|
347 |
-
{
|
348 |
-
?>
|
349 |
-
<h3><?php _e( 'WC Vendors', 'wcvendors' ); ?></h3>
|
350 |
-
<table class="form-table">
|
351 |
-
<tbody>
|
352 |
-
<?php do_action( 'wcvendors_admin_before_shop_html', $user ); ?>
|
353 |
-
<tr>
|
354 |
-
<th scope="row">Shop HTML</th>
|
355 |
-
<td>
|
356 |
-
<label for="pv_shop_html_enabled">
|
357 |
-
<input name="pv_shop_html_enabled" type="checkbox"
|
358 |
-
id="pv_shop_html_enabled" <?php checked( true, get_user_meta( $user->ID, 'pv_shop_html_enabled', true ), $echo = true ) ?>/>
|
359 |
-
<?php _e( 'Enable HTML for the shop description', 'wcvendors' ); ?>
|
360 |
-
</label>
|
361 |
-
</td>
|
362 |
-
</tr>
|
363 |
-
<?php do_action( 'wcvendors_admin_after_shop_html', $user ); ?>
|
364 |
-
<tr>
|
365 |
-
<th><label for="pv_shop_name"><?php _e( 'Shop name', 'wcvendors' ); ?></label></th>
|
366 |
-
<td><input type="text" name="pv_shop_name" id="pv_shop_name"
|
367 |
-
value="<?php echo get_user_meta( $user->ID, 'pv_shop_name', true ); ?>" class="regular-text">
|
368 |
-
</td>
|
369 |
-
</tr>
|
370 |
-
<?php do_action( 'wcvendors_admin_after_shop_name', $user ); ?>
|
371 |
-
<tr>
|
372 |
-
<th><label for="pv_paypal"><?php _e( 'PayPal E-mail', 'wcvendors' ); ?> <span
|
373 |
-
class="description">(<?php _e( 'required', 'wcvendors' ); ?>)</span></label></th>
|
374 |
-
<td><input type="email" name="pv_paypal" id="pv_paypal"
|
375 |
-
value="<?php echo get_user_meta( $user->ID, 'pv_paypal', true ); ?>" class="regular-text">
|
376 |
-
</td>
|
377 |
-
</tr>
|
378 |
-
<?php do_action( 'wcvendors_admin_after_paypal', $user ); ?>
|
379 |
-
<tr>
|
380 |
-
<th><label for="pv_custom_commission_rate"><?php _e( 'Commission rate', 'wcvendors' ); ?> (%)</label></th>
|
381 |
-
<td><input type="number" step="0.01" max="100" min="0" name="pv_custom_commission_rate" placeholder="<?php _e( 'Leave blank for default', 'wcvendors' ); ?>" id="pv_custom_commission_rate"
|
382 |
-
value="<?php echo get_user_meta( $user->ID, 'pv_custom_commission_rate', true ); ?>" class="regular-text">
|
383 |
-
</td>
|
384 |
-
</tr>
|
385 |
-
<?php do_action( 'wcvendors_admin_after_commission_due', $user ); ?>
|
386 |
-
<tr>
|
387 |
-
<th><label for="pv_seller_info"><?php _e( 'Seller info', 'wcvendors' ); ?></label></th>
|
388 |
-
<td><?php wp_editor( get_user_meta( $user->ID, 'pv_seller_info', true ), 'pv_seller_info' ); ?></td>
|
389 |
-
</tr>
|
390 |
-
<?php do_action( 'wcvendors_admin_after_seller_info', $user ); ?>
|
391 |
-
<tr>
|
392 |
-
<th><label for="pv_shop_description"><?php _e( 'Shop description', 'wcvendors' ); ?></label>
|
393 |
-
</th>
|
394 |
-
<td><?php wp_editor( get_user_meta( $user->ID, 'pv_shop_description', true ), 'pv_shop_description' ); ?></td>
|
395 |
-
</tr>
|
396 |
-
<?php do_action( 'wcvendors_admin_after_shop_description', $user ); ?>
|
397 |
-
</tbody>
|
398 |
-
</table>
|
399 |
-
<?php
|
400 |
-
}
|
401 |
-
|
402 |
-
/*
|
403 |
-
Remove featured check box from the product listing
|
404 |
-
*/
|
405 |
-
public function manage_product_columns( $columns ){
|
406 |
-
global $woocommerce;
|
407 |
-
unset($columns['featured']);
|
408 |
-
return $columns;
|
409 |
-
}
|
410 |
-
|
411 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* WP-Admin users page
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package ProductVendor
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Admin_Users
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Constructor
|
17 |
+
*/
|
18 |
+
function __construct()
|
19 |
+
{
|
20 |
+
if ( !is_admin() ) return;
|
21 |
+
|
22 |
+
add_action( 'edit_user_profile', array( $this, 'show_extra_profile_fields' ) );
|
23 |
+
add_action( 'edit_user_profile_update', array( $this, 'save_extra_profile_fields' ) );
|
24 |
+
|
25 |
+
add_filter( 'add_menu_classes', array( $this, 'show_pending_number' ) );
|
26 |
+
|
27 |
+
// Disabling non-vendor related items on the admin screens
|
28 |
+
if ( WCV_Vendors::is_vendor( get_current_user_id() ) ) {
|
29 |
+
add_filter( 'woocommerce_csv_product_role', array( $this, 'csv_import_suite_compatibility' ) );
|
30 |
+
add_filter( 'woocommerce_csv_product_export_args', array( $this, 'csv_import_suite_compatibility_export' ) );
|
31 |
+
|
32 |
+
// Admin page lockdown
|
33 |
+
remove_action( 'admin_init', 'woocommerce_prevent_admin_access' );
|
34 |
+
add_action( 'admin_init', array( $this, 'prevent_admin_access' ) );
|
35 |
+
|
36 |
+
add_filter( 'woocommerce_prevent_admin_access', array( $this, 'deny_admin_access' ) );
|
37 |
+
|
38 |
+
|
39 |
+
// WC > Product page fixes
|
40 |
+
add_action( 'load-post-new.php', array( $this, 'confirm_access_to_add' ) );
|
41 |
+
add_action( 'load-edit.php', array( $this, 'edit_nonvendors' ) );
|
42 |
+
add_filter( 'views_edit-product', array( $this, 'hide_nonvendor_links' ) );
|
43 |
+
|
44 |
+
add_action( 'pre_get_posts', array( $this, 'users_own_attachments' ) );
|
45 |
+
add_action( 'admin_menu', array( $this, 'remove_menu_page' ), 99 );
|
46 |
+
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 99 );
|
47 |
+
add_filter( 'product_type_selector', array( $this, 'filter_product_types' ), 99, 2 );
|
48 |
+
add_filter( 'product_type_options', array( $this, 'filter_product_type_options' ), 99 );
|
49 |
+
|
50 |
+
add_filter( 'woocommerce_duplicate_product_capability', array( $this, 'add_duplicate_capability' ) );
|
51 |
+
|
52 |
+
// WC > Product featured
|
53 |
+
$product_misc = (array) WC_Vendors::$pv_options->get_option( 'hide_product_misc' );
|
54 |
+
|
55 |
+
if ( isset( $product_misc['featured'] ) ) {
|
56 |
+
add_filter( 'manage_product_posts_columns', array($this, 'manage_product_columns'), 99);
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
62 |
+
|
63 |
+
public function confirm_access_to_add()
|
64 |
+
{
|
65 |
+
if ( empty( $_GET['post_type'] ) || $_GET['post_type'] != 'product' ) {
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
|
69 |
+
$can_submit = WC_Vendors::$pv_options->get_option( 'can_submit_products' );
|
70 |
+
if ( !$can_submit ) {
|
71 |
+
wp_die( 'You are not allowed to submit products.' );
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
// public function get_terms_filter( $terms, $tax, $args )
|
76 |
+
// {
|
77 |
+
// if ( $tax[0] != 'product_type' || ( $tax[0] == 'product_type' && ! empty( $args['include'] ) ) ) {
|
78 |
+
// return $terms;
|
79 |
+
// }
|
80 |
+
|
81 |
+
// $products = WCV_Vendors::get_vendor_products( get_current_user_id() );
|
82 |
+
// $ids = array();
|
83 |
+
// foreach ( $products as $product ) {
|
84 |
+
// $ids[ ] = ( $product->ID );
|
85 |
+
// $product = get_product( $product )->product_type;
|
86 |
+
// var_dump($product);exit;
|
87 |
+
// }
|
88 |
+
|
89 |
+
// $args['include'] = $ids;
|
90 |
+
|
91 |
+
// var_dump($terms);exit;
|
92 |
+
|
93 |
+
// $terms = get_terms( $tax[0], $args);
|
94 |
+
|
95 |
+
|
96 |
+
// return $terms;
|
97 |
+
// }
|
98 |
+
|
99 |
+
public function csv_import_suite_compatibility( $capability )
|
100 |
+
{
|
101 |
+
return 'manage_product';
|
102 |
+
}
|
103 |
+
|
104 |
+
public function csv_import_suite_compatibility_export( $args )
|
105 |
+
{
|
106 |
+
$args[ 'author' ] = get_current_user_id();
|
107 |
+
|
108 |
+
return $args;
|
109 |
+
}
|
110 |
+
|
111 |
+
public function add_duplicate_capability( $capability )
|
112 |
+
{
|
113 |
+
return 'manage_product';
|
114 |
+
}
|
115 |
+
|
116 |
+
|
117 |
+
/**
|
118 |
+
*
|
119 |
+
*
|
120 |
+
* @param unknown $menu
|
121 |
+
*
|
122 |
+
* @return unknown
|
123 |
+
*/
|
124 |
+
public function show_pending_number( $menu )
|
125 |
+
{
|
126 |
+
$num_posts = wp_count_posts( 'product', 'readable' );
|
127 |
+
|
128 |
+
$pending_count = !empty( $num_posts->pending ) ? $num_posts->pending : 0;
|
129 |
+
$menu_str = 'edit.php?post_type=product';
|
130 |
+
|
131 |
+
foreach ( $menu as $menu_key => $menu_data ) {
|
132 |
+
if ( $menu_str != $menu_data[ 2 ] ) continue;
|
133 |
+
$menu[ $menu_key ][ 0 ] .= " <span class='update-plugins count-$pending_count'><span class='plugin-count'>" . number_format_i18n( $pending_count ) . '</span></span>';
|
134 |
+
}
|
135 |
+
|
136 |
+
return $menu;
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
/**
|
141 |
+
*
|
142 |
+
*
|
143 |
+
* @param unknown $types
|
144 |
+
* @param unknown $product_type
|
145 |
+
*
|
146 |
+
* @return unknown
|
147 |
+
*/
|
148 |
+
function filter_product_types( $types, $product_type )
|
149 |
+
{
|
150 |
+
$product_panel = (array) WC_Vendors::$pv_options->get_option( 'hide_product_panel' );
|
151 |
+
$product_misc = (array) WC_Vendors::$pv_options->get_option( 'hide_product_misc' );
|
152 |
+
$product_types = (array) WC_Vendors::$pv_options->get_option( 'hide_product_types' );
|
153 |
+
$css = WC_Vendors::$pv_options->get_option( 'product_page_css' );
|
154 |
+
$count = 0;
|
155 |
+
|
156 |
+
foreach ( $product_panel as $key => $value ) {
|
157 |
+
if ( $value ) $css .= sprintf( '.%s_tab{display:none !important;}', $key );
|
158 |
+
}
|
159 |
+
|
160 |
+
if ( !empty( $product_misc[ 'taxes' ] ) ) {
|
161 |
+
$css .= '.form-field._tax_status_field, .form-field._tax_class_field{display:none !important;}';
|
162 |
+
}
|
163 |
+
|
164 |
+
unset( $product_misc[ 'taxes' ] );
|
165 |
+
|
166 |
+
foreach ( $product_misc as $key => $value ) {
|
167 |
+
if ( $value ) $css .= sprintf( '._%s_field{display:none !important;}', $key );
|
168 |
+
}
|
169 |
+
|
170 |
+
foreach ( $product_types as $value ) {
|
171 |
+
if ( !$value ) $count++;
|
172 |
+
}
|
173 |
+
|
174 |
+
if ( $count === 1 ) {
|
175 |
+
$css .= '#product-type{display:none !important;}';
|
176 |
+
}
|
177 |
+
|
178 |
+
echo '<style>';
|
179 |
+
echo $css;
|
180 |
+
echo '</style>';
|
181 |
+
|
182 |
+
foreach ( $types as $key => $value ) {
|
183 |
+
if ( !empty( $product_types[ $key ] ) ) {
|
184 |
+
unset( $types[ $key ] );
|
185 |
+
}
|
186 |
+
}
|
187 |
+
|
188 |
+
return $types;
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
+
/**
|
193 |
+
*
|
194 |
+
*
|
195 |
+
* @param unknown $types
|
196 |
+
*
|
197 |
+
* @return unknown
|
198 |
+
*/
|
199 |
+
function filter_product_type_options( $types )
|
200 |
+
{
|
201 |
+
$product_options = WC_Vendors::$pv_options->get_option( 'hide_product_type_options' );
|
202 |
+
|
203 |
+
if ( !$product_options ) return $types;
|
204 |
+
|
205 |
+
foreach ( $types as $key => $value ) {
|
206 |
+
if ( !empty( $product_options[ $key ] ) ) {
|
207 |
+
unset( $types[ $key ] );
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
return $types;
|
212 |
+
}
|
213 |
+
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Show attachments only belonging to vendor
|
217 |
+
*
|
218 |
+
* @param object $wp_query_obj
|
219 |
+
*/
|
220 |
+
function users_own_attachments( $wp_query_obj )
|
221 |
+
{
|
222 |
+
global $current_user, $pagenow;
|
223 |
+
|
224 |
+
if ( $pagenow == 'upload.php' || ( $pagenow == 'admin-ajax.php' && !empty( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'query-attachments' ) ) {
|
225 |
+
$wp_query_obj->set( 'author', $current_user->ID );
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
|
230 |
+
/**
|
231 |
+
* Allow vendors to access admin when disabled
|
232 |
+
*/
|
233 |
+
public function prevent_admin_access()
|
234 |
+
{
|
235 |
+
$permitted_user = ( current_user_can( 'edit_posts' ) || current_user_can( 'manage_woocommerce' ) || current_user_can( 'vendor' ) );
|
236 |
+
|
237 |
+
if ( get_option( 'woocommerce_lock_down_admin' ) == 'yes' && !is_ajax() && !$permitted_user ) {
|
238 |
+
wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
|
239 |
+
exit;
|
240 |
+
}
|
241 |
+
}
|
242 |
+
|
243 |
+
public function deny_admin_access()
|
244 |
+
{
|
245 |
+
return false;
|
246 |
+
}
|
247 |
+
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Request when load-edit.php
|
251 |
+
*/
|
252 |
+
public function edit_nonvendors()
|
253 |
+
{
|
254 |
+
add_action( 'request', array( $this, 'hide_nonvendor_products' ) );
|
255 |
+
}
|
256 |
+
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Hide links that don't matter anymore from vendors
|
260 |
+
*
|
261 |
+
* @param array $views
|
262 |
+
*
|
263 |
+
* @return array
|
264 |
+
*/
|
265 |
+
public function hide_nonvendor_links( $views )
|
266 |
+
{
|
267 |
+
return array();
|
268 |
+
}
|
269 |
+
|
270 |
+
|
271 |
+
/**
|
272 |
+
* Hide products that don't belong to the vendor
|
273 |
+
*
|
274 |
+
* @param array $query_vars
|
275 |
+
*
|
276 |
+
* @return array
|
277 |
+
*/
|
278 |
+
public function hide_nonvendor_products( $query_vars )
|
279 |
+
{
|
280 |
+
$query_vars[ 'author' ] = get_current_user_id();
|
281 |
+
|
282 |
+
return $query_vars;
|
283 |
+
}
|
284 |
+
|
285 |
+
|
286 |
+
/**
|
287 |
+
* Remove the media library menu
|
288 |
+
*/
|
289 |
+
public function remove_menu_page()
|
290 |
+
{
|
291 |
+
global $pagenow, $woocommerce;
|
292 |
+
|
293 |
+
remove_menu_page( 'index.php' ); /* Hides Dashboard menu */
|
294 |
+
remove_menu_page( 'separator1' ); /* Hides separator under Dashboard menu*/
|
295 |
+
remove_all_actions( 'admin_notices' );
|
296 |
+
|
297 |
+
if ( $pagenow == 'index.php' ) {
|
298 |
+
wp_redirect( admin_url( 'profile.php' ) );
|
299 |
+
}
|
300 |
+
}
|
301 |
+
|
302 |
+
|
303 |
+
/**
|
304 |
+
*
|
305 |
+
*/
|
306 |
+
public function remove_meta_boxes()
|
307 |
+
{
|
308 |
+
remove_meta_box( 'postcustom', 'product', 'normal' );
|
309 |
+
remove_meta_box( 'wpseo_meta', 'product', 'normal' );
|
310 |
+
remove_meta_box( 'expirationdatediv', 'product', 'side' );
|
311 |
+
}
|
312 |
+
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Update the vendor PayPal email
|
316 |
+
*
|
317 |
+
* @param int $vendor_id
|
318 |
+
*
|
319 |
+
* @return bool
|
320 |
+
*/
|
321 |
+
public function save_extra_profile_fields( $vendor_id )
|
322 |
+
{
|
323 |
+
if ( !current_user_can( 'edit_user', $vendor_id ) ) return false;
|
324 |
+
|
325 |
+
$users = get_users( array( 'meta_key' => 'pv_shop_slug', 'meta_value' => sanitize_title( $_POST[ 'pv_shop_name' ] ) ) );
|
326 |
+
if ( empty( $users ) || $users[ 0 ]->ID == $vendor_id ) {
|
327 |
+
update_user_meta( $vendor_id, 'pv_shop_name', $_POST[ 'pv_shop_name' ] );
|
328 |
+
update_user_meta( $vendor_id, 'pv_shop_slug', sanitize_title( $_POST[ 'pv_shop_name' ] ) );
|
329 |
+
}
|
330 |
+
|
331 |
+
update_user_meta( $vendor_id, 'pv_paypal', $_POST[ 'pv_paypal' ] );
|
332 |
+
update_user_meta( $vendor_id, 'pv_shop_html_enabled', isset( $_POST[ 'pv_shop_html_enabled' ] ) );
|
333 |
+
update_user_meta( $vendor_id, 'pv_custom_commission_rate', $_POST[ 'pv_custom_commission_rate' ] );
|
334 |
+
update_user_meta( $vendor_id, 'pv_shop_description', $_POST[ 'pv_shop_description' ] );
|
335 |
+
update_user_meta( $vendor_id, 'pv_seller_info', $_POST[ 'pv_seller_info' ] );
|
336 |
+
|
337 |
+
do_action( 'wcvendors_update_admin_user', $vendor_id );
|
338 |
+
}
|
339 |
+
|
340 |
+
|
341 |
+
/**
|
342 |
+
* Show the PayPal field and commision due table
|
343 |
+
*
|
344 |
+
* @param unknown $user
|
345 |
+
*/
|
346 |
+
public function show_extra_profile_fields( $user )
|
347 |
+
{
|
348 |
+
?>
|
349 |
+
<h3><?php _e( 'WC Vendors', 'wcvendors' ); ?></h3>
|
350 |
+
<table class="form-table">
|
351 |
+
<tbody>
|
352 |
+
<?php do_action( 'wcvendors_admin_before_shop_html', $user ); ?>
|
353 |
+
<tr>
|
354 |
+
<th scope="row">Shop HTML</th>
|
355 |
+
<td>
|
356 |
+
<label for="pv_shop_html_enabled">
|
357 |
+
<input name="pv_shop_html_enabled" type="checkbox"
|
358 |
+
id="pv_shop_html_enabled" <?php checked( true, get_user_meta( $user->ID, 'pv_shop_html_enabled', true ), $echo = true ) ?>/>
|
359 |
+
<?php _e( 'Enable HTML for the shop description', 'wcvendors' ); ?>
|
360 |
+
</label>
|
361 |
+
</td>
|
362 |
+
</tr>
|
363 |
+
<?php do_action( 'wcvendors_admin_after_shop_html', $user ); ?>
|
364 |
+
<tr>
|
365 |
+
<th><label for="pv_shop_name"><?php _e( 'Shop name', 'wcvendors' ); ?></label></th>
|
366 |
+
<td><input type="text" name="pv_shop_name" id="pv_shop_name"
|
367 |
+
value="<?php echo get_user_meta( $user->ID, 'pv_shop_name', true ); ?>" class="regular-text">
|
368 |
+
</td>
|
369 |
+
</tr>
|
370 |
+
<?php do_action( 'wcvendors_admin_after_shop_name', $user ); ?>
|
371 |
+
<tr>
|
372 |
+
<th><label for="pv_paypal"><?php _e( 'PayPal E-mail', 'wcvendors' ); ?> <span
|
373 |
+
class="description">(<?php _e( 'required', 'wcvendors' ); ?>)</span></label></th>
|
374 |
+
<td><input type="email" name="pv_paypal" id="pv_paypal"
|
375 |
+
value="<?php echo get_user_meta( $user->ID, 'pv_paypal', true ); ?>" class="regular-text">
|
376 |
+
</td>
|
377 |
+
</tr>
|
378 |
+
<?php do_action( 'wcvendors_admin_after_paypal', $user ); ?>
|
379 |
+
<tr>
|
380 |
+
<th><label for="pv_custom_commission_rate"><?php _e( 'Commission rate', 'wcvendors' ); ?> (%)</label></th>
|
381 |
+
<td><input type="number" step="0.01" max="100" min="0" name="pv_custom_commission_rate" placeholder="<?php _e( 'Leave blank for default', 'wcvendors' ); ?>" id="pv_custom_commission_rate"
|
382 |
+
value="<?php echo get_user_meta( $user->ID, 'pv_custom_commission_rate', true ); ?>" class="regular-text">
|
383 |
+
</td>
|
384 |
+
</tr>
|
385 |
+
<?php do_action( 'wcvendors_admin_after_commission_due', $user ); ?>
|
386 |
+
<tr>
|
387 |
+
<th><label for="pv_seller_info"><?php _e( 'Seller info', 'wcvendors' ); ?></label></th>
|
388 |
+
<td><?php wp_editor( get_user_meta( $user->ID, 'pv_seller_info', true ), 'pv_seller_info' ); ?></td>
|
389 |
+
</tr>
|
390 |
+
<?php do_action( 'wcvendors_admin_after_seller_info', $user ); ?>
|
391 |
+
<tr>
|
392 |
+
<th><label for="pv_shop_description"><?php _e( 'Shop description', 'wcvendors' ); ?></label>
|
393 |
+
</th>
|
394 |
+
<td><?php wp_editor( get_user_meta( $user->ID, 'pv_shop_description', true ), 'pv_shop_description' ); ?></td>
|
395 |
+
</tr>
|
396 |
+
<?php do_action( 'wcvendors_admin_after_shop_description', $user ); ?>
|
397 |
+
</tbody>
|
398 |
+
</table>
|
399 |
+
<?php
|
400 |
+
}
|
401 |
+
|
402 |
+
/*
|
403 |
+
Remove featured check box from the product listing
|
404 |
+
*/
|
405 |
+
public function manage_product_columns( $columns ){
|
406 |
+
global $woocommerce;
|
407 |
+
unset($columns['featured']);
|
408 |
+
return $columns;
|
409 |
+
}
|
410 |
+
|
411 |
+
}
|
{WCVendors/classes → classes}/admin/class-product-meta.php
RENAMED
@@ -1,265 +1,265 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Product meta configurations
|
5 |
-
*
|
6 |
-
* @package ProductVendor
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
class WCV_Product_Meta
|
11 |
-
{
|
12 |
-
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Constructor
|
16 |
-
*/
|
17 |
-
function __construct()
|
18 |
-
{
|
19 |
-
if ( !current_user_can( 'manage_woocommerce' ) ) return;
|
20 |
-
|
21 |
-
// Allow products to have authors
|
22 |
-
add_post_type_support( 'product', 'author' );
|
23 |
-
|
24 |
-
add_action( 'add_meta_boxes', array( $this, 'change_author_meta_box_title' ) );
|
25 |
-
add_action( 'wp_dropdown_users', array( $this, 'author_vendor_roles' ), 0, 1 );
|
26 |
-
add_action( 'woocommerce_product_write_panel_tabs', array( $this, 'add_tab' ) );
|
27 |
-
add_action( 'woocommerce_product_write_panels', array( $this, 'add_panel' ) );
|
28 |
-
add_action( 'woocommerce_process_product_meta', array( $this, 'save_panel' ) );
|
29 |
-
|
30 |
-
add_action( 'woocommerce_product_quick_edit_end', array($this, 'display_vendor_dd_quick_edit') );
|
31 |
-
add_action( 'woocommerce_product_quick_edit_save', array($this, 'save_vendor_quick_edit'), 2, 99 );
|
32 |
-
add_action( 'manage_product_posts_custom_column', array($this, 'display_vendor_column'), 2, 99 );
|
33 |
-
add_filter( 'manage_product_posts_columns', array($this, 'vendor_column_quickedit') );
|
34 |
-
|
35 |
-
}
|
36 |
-
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Change the "Author" metabox to "Vendor"
|
40 |
-
*/
|
41 |
-
public function change_author_meta_box_title()
|
42 |
-
{
|
43 |
-
global $wp_meta_boxes;
|
44 |
-
$wp_meta_boxes[ 'product' ][ 'normal' ][ 'core' ][ 'authordiv' ][ 'title' ] = __( 'Vendor', 'wcvendors' );;
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Override the authors selectbox with +vendor roles
|
50 |
-
*
|
51 |
-
* @param html $output
|
52 |
-
*
|
53 |
-
* @return html
|
54 |
-
*/
|
55 |
-
public function author_vendor_roles( $output )
|
56 |
-
{
|
57 |
-
global $post;
|
58 |
-
|
59 |
-
if ( empty( $post ) ) return $output;
|
60 |
-
|
61 |
-
// Return if this isn't a WooCommerce product post type
|
62 |
-
if ( $post->post_type != 'product' ) return $output;
|
63 |
-
|
64 |
-
// Return if this isn't the vendor author override dropdown
|
65 |
-
if ( !strpos( $output, 'post_author_override' ) ) return $output;
|
66 |
-
|
67 |
-
$args = array(
|
68 |
-
'selected' => $post->post_author,
|
69 |
-
'id' => 'post_author_override',
|
70 |
-
);
|
71 |
-
|
72 |
-
$output = $this->vendor_selectbox( $args );
|
73 |
-
|
74 |
-
return $output;
|
75 |
-
}
|
76 |
-
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Create a selectbox to display vendor & administrator roles
|
80 |
-
*
|
81 |
-
* @param array $args
|
82 |
-
*
|
83 |
-
* @return html
|
84 |
-
*/
|
85 |
-
public function vendor_selectbox( $args )
|
86 |
-
{
|
87 |
-
$default_args = array(
|
88 |
-
'placeholder',
|
89 |
-
'id',
|
90 |
-
'class',
|
91 |
-
);
|
92 |
-
|
93 |
-
foreach ( $default_args as $key ) {
|
94 |
-
if ( !is_array( $key ) && empty( $args[ $key ] ) ) $args[ $key ] = '';
|
95 |
-
else if ( is_array( $key ) ) foreach ( $key as $val ) $args[ $key ][ $val ] = esc_attr( $args[ $key ][ $val ] );
|
96 |
-
}
|
97 |
-
extract( $args );
|
98 |
-
|
99 |
-
$roles = array( 'vendor', 'administrator' );
|
100 |
-
$user_args = array( 'fields' => array( 'ID', 'user_login' ) );
|
101 |
-
|
102 |
-
$output = "<select style='width:200px;' name='$id' id='$id' class='$class' data-placeholder='$placeholder'>\n";
|
103 |
-
$output .= "\t<option value=''></option>\n";
|
104 |
-
|
105 |
-
foreach ( $roles as $role ) {
|
106 |
-
|
107 |
-
$new_args = $user_args;
|
108 |
-
$new_args[ 'role' ] = $role;
|
109 |
-
$users = get_users( $new_args );
|
110 |
-
|
111 |
-
if ( empty( $users ) ) continue;
|
112 |
-
foreach ( (array) $users as $user ) {
|
113 |
-
$select = selected( $user->ID, $selected, false );
|
114 |
-
$output .= "\t<option value='$user->ID' $select>$user->user_login</option>\n";
|
115 |
-
}
|
116 |
-
|
117 |
-
}
|
118 |
-
$output .= "</select>";
|
119 |
-
|
120 |
-
// Convert this selectbox with select2
|
121 |
-
$output .= '
|
122 |
-
<script type="text/javascript">jQuery(function() { jQuery("#' . $id . '").select2().focus(); } );</script>';
|
123 |
-
|
124 |
-
return $output;
|
125 |
-
}
|
126 |
-
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Save commission rate of a product
|
130 |
-
*
|
131 |
-
* @param int $post_id
|
132 |
-
*/
|
133 |
-
public function save_panel( $post_id )
|
134 |
-
{
|
135 |
-
if ( isset( $_POST[ 'pv_commission_rate' ] ) ) {
|
136 |
-
update_post_meta( $post_id, 'pv_commission_rate', is_numeric( $_POST[ 'pv_commission_rate' ] ) ? (float) $_POST[ 'pv_commission_rate' ] : false );
|
137 |
-
}
|
138 |
-
|
139 |
-
}
|
140 |
-
|
141 |
-
|
142 |
-
/**
|
143 |
-
* Add the Commission tab to a product
|
144 |
-
*/
|
145 |
-
public function add_tab()
|
146 |
-
{
|
147 |
-
?>
|
148 |
-
<li class="commission_tab">
|
149 |
-
<a href="#commission"><?php _e( 'Commission', 'wcvendors' ) ?></a>
|
150 |
-
</li> <?php
|
151 |
-
}
|
152 |
-
|
153 |
-
|
154 |
-
/**
|
155 |
-
* Add the Commission panel to a product
|
156 |
-
*/
|
157 |
-
public function add_panel()
|
158 |
-
{
|
159 |
-
global $post; ?>
|
160 |
-
|
161 |
-
<div id="commission" class="panel woocommerce_options_panel">
|
162 |
-
<fieldset>
|
163 |
-
|
164 |
-
<p class='form-field commission_rate_field'>
|
165 |
-
<label for='pv_commission_rate'><?php _e( 'Commission', 'wcvendors' ); ?> (%)</label>
|
166 |
-
<input type='number' id='pv_commission_rate'
|
167 |
-
name='pv_commission_rate'
|
168 |
-
class='short'
|
169 |
-
max="100"
|
170 |
-
min="0"
|
171 |
-
step='any'
|
172 |
-
placeholder='<?php _e( 'Leave blank for default', 'wcvendors' ); ?>'
|
173 |
-
value="<?php echo get_post_meta( $post->ID, 'pv_commission_rate', true ); ?>"/>
|
174 |
-
</p>
|
175 |
-
|
176 |
-
</fieldset>
|
177 |
-
</div> <?php
|
178 |
-
|
179 |
-
}
|
180 |
-
|
181 |
-
/*
|
182 |
-
* Rename the Authors column to Vendor on products page
|
183 |
-
*/
|
184 |
-
public function vendor_column_quickedit($posts_columns) {
|
185 |
-
$posts_columns['author'] = __( 'Vendor', 'wcvendors' );
|
186 |
-
|
187 |
-
return $posts_columns;
|
188 |
-
}
|
189 |
-
|
190 |
-
/*
|
191 |
-
* Display the vendor drop down on the quick edit screen
|
192 |
-
*/
|
193 |
-
public function display_vendor_dd_quick_edit() {
|
194 |
-
|
195 |
-
global $post;
|
196 |
-
$selected = $post->post_author;
|
197 |
-
|
198 |
-
$roles = array( 'vendor', 'administrator' );
|
199 |
-
$user_args = array( 'fields' => array( 'ID', 'display_name' ) );
|
200 |
-
|
201 |
-
$output = "<select style='width:200px;' name='post_author-new' class='select'>\n";
|
202 |
-
|
203 |
-
foreach ( $roles as $role ) {
|
204 |
-
|
205 |
-
$new_args = $user_args;
|
206 |
-
$new_args[ 'role' ] = $role;
|
207 |
-
$users = get_users( $new_args );
|
208 |
-
|
209 |
-
if ( empty( $users ) ) continue;
|
210 |
-
foreach ( (array) $users as $user ) {
|
211 |
-
$select = selected( $user->ID, $selected, false );
|
212 |
-
$output .= "\t<option value='$user->ID' $select>$user->display_name</option>\n";
|
213 |
-
}
|
214 |
-
|
215 |
-
}
|
216 |
-
$output .= "</select>";
|
217 |
-
|
218 |
-
?>
|
219 |
-
<br class="clear" />
|
220 |
-
<label class="inline-edit-author-new">
|
221 |
-
<span class="title"><?php _e('Vendor', 'wcvendors' ); ?></span>
|
222 |
-
<?php echo $output; ?>
|
223 |
-
</label>
|
224 |
-
<?php
|
225 |
-
}
|
226 |
-
|
227 |
-
|
228 |
-
/*
|
229 |
-
* Save the vendor on the quick edit screen
|
230 |
-
*/
|
231 |
-
public function save_vendor_quick_edit( $product ) {
|
232 |
-
|
233 |
-
if ( $product->is_type('simple') || $product->is_type('external') ) {
|
234 |
-
if ( isset( $_REQUEST['_vendor'] ) ) {
|
235 |
-
$vendor = wc_clean($_REQUEST['_vendor']);
|
236 |
-
$product->post->post_author = $vendor;
|
237 |
-
}
|
238 |
-
}
|
239 |
-
return $product;
|
240 |
-
}
|
241 |
-
|
242 |
-
/*
|
243 |
-
* Display hidden column data for js
|
244 |
-
*/
|
245 |
-
public function display_vendor_column( $column, $post_id ){
|
246 |
-
|
247 |
-
$vendor = get_post_field( 'post_author', $post_id );
|
248 |
-
|
249 |
-
switch ( $column ) {
|
250 |
-
case 'name' :
|
251 |
-
|
252 |
-
?>
|
253 |
-
<div class="hidden vendor" id="vendor_<?php echo $post_id; ?>">
|
254 |
-
<div id="post_author"><?php echo $vendor; ?></div>
|
255 |
-
</div>
|
256 |
-
<?php
|
257 |
-
|
258 |
-
break;
|
259 |
-
|
260 |
-
default :
|
261 |
-
break;
|
262 |
-
}
|
263 |
-
|
264 |
-
}
|
265 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Product meta configurations
|
5 |
+
*
|
6 |
+
* @package ProductVendor
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
class WCV_Product_Meta
|
11 |
+
{
|
12 |
+
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Constructor
|
16 |
+
*/
|
17 |
+
function __construct()
|
18 |
+
{
|
19 |
+
if ( !current_user_can( 'manage_woocommerce' ) ) return;
|
20 |
+
|
21 |
+
// Allow products to have authors
|
22 |
+
add_post_type_support( 'product', 'author' );
|
23 |
+
|
24 |
+
add_action( 'add_meta_boxes', array( $this, 'change_author_meta_box_title' ) );
|
25 |
+
add_action( 'wp_dropdown_users', array( $this, 'author_vendor_roles' ), 0, 1 );
|
26 |
+
add_action( 'woocommerce_product_write_panel_tabs', array( $this, 'add_tab' ) );
|
27 |
+
add_action( 'woocommerce_product_write_panels', array( $this, 'add_panel' ) );
|
28 |
+
add_action( 'woocommerce_process_product_meta', array( $this, 'save_panel' ) );
|
29 |
+
|
30 |
+
add_action( 'woocommerce_product_quick_edit_end', array($this, 'display_vendor_dd_quick_edit') );
|
31 |
+
add_action( 'woocommerce_product_quick_edit_save', array($this, 'save_vendor_quick_edit'), 2, 99 );
|
32 |
+
add_action( 'manage_product_posts_custom_column', array($this, 'display_vendor_column'), 2, 99 );
|
33 |
+
add_filter( 'manage_product_posts_columns', array($this, 'vendor_column_quickedit') );
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Change the "Author" metabox to "Vendor"
|
40 |
+
*/
|
41 |
+
public function change_author_meta_box_title()
|
42 |
+
{
|
43 |
+
global $wp_meta_boxes;
|
44 |
+
$wp_meta_boxes[ 'product' ][ 'normal' ][ 'core' ][ 'authordiv' ][ 'title' ] = __( 'Vendor', 'wcvendors' );;
|
45 |
+
}
|
46 |
+
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Override the authors selectbox with +vendor roles
|
50 |
+
*
|
51 |
+
* @param html $output
|
52 |
+
*
|
53 |
+
* @return html
|
54 |
+
*/
|
55 |
+
public function author_vendor_roles( $output )
|
56 |
+
{
|
57 |
+
global $post;
|
58 |
+
|
59 |
+
if ( empty( $post ) ) return $output;
|
60 |
+
|
61 |
+
// Return if this isn't a WooCommerce product post type
|
62 |
+
if ( $post->post_type != 'product' ) return $output;
|
63 |
+
|
64 |
+
// Return if this isn't the vendor author override dropdown
|
65 |
+
if ( !strpos( $output, 'post_author_override' ) ) return $output;
|
66 |
+
|
67 |
+
$args = array(
|
68 |
+
'selected' => $post->post_author,
|
69 |
+
'id' => 'post_author_override',
|
70 |
+
);
|
71 |
+
|
72 |
+
$output = $this->vendor_selectbox( $args );
|
73 |
+
|
74 |
+
return $output;
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Create a selectbox to display vendor & administrator roles
|
80 |
+
*
|
81 |
+
* @param array $args
|
82 |
+
*
|
83 |
+
* @return html
|
84 |
+
*/
|
85 |
+
public function vendor_selectbox( $args )
|
86 |
+
{
|
87 |
+
$default_args = array(
|
88 |
+
'placeholder',
|
89 |
+
'id',
|
90 |
+
'class',
|
91 |
+
);
|
92 |
+
|
93 |
+
foreach ( $default_args as $key ) {
|
94 |
+
if ( !is_array( $key ) && empty( $args[ $key ] ) ) $args[ $key ] = '';
|
95 |
+
else if ( is_array( $key ) ) foreach ( $key as $val ) $args[ $key ][ $val ] = esc_attr( $args[ $key ][ $val ] );
|
96 |
+
}
|
97 |
+
extract( $args );
|
98 |
+
|
99 |
+
$roles = array( 'vendor', 'administrator' );
|
100 |
+
$user_args = array( 'fields' => array( 'ID', 'user_login' ) );
|
101 |
+
|
102 |
+
$output = "<select style='width:200px;' name='$id' id='$id' class='$class' data-placeholder='$placeholder'>\n";
|
103 |
+
$output .= "\t<option value=''></option>\n";
|
104 |
+
|
105 |
+
foreach ( $roles as $role ) {
|
106 |
+
|
107 |
+
$new_args = $user_args;
|
108 |
+
$new_args[ 'role' ] = $role;
|
109 |
+
$users = get_users( $new_args );
|
110 |
+
|
111 |
+
if ( empty( $users ) ) continue;
|
112 |
+
foreach ( (array) $users as $user ) {
|
113 |
+
$select = selected( $user->ID, $selected, false );
|
114 |
+
$output .= "\t<option value='$user->ID' $select>$user->user_login</option>\n";
|
115 |
+
}
|
116 |
+
|
117 |
+
}
|
118 |
+
$output .= "</select>";
|
119 |
+
|
120 |
+
// Convert this selectbox with select2
|
121 |
+
$output .= '
|
122 |
+
<script type="text/javascript">jQuery(function() { jQuery("#' . $id . '").select2().focus(); } );</script>';
|
123 |
+
|
124 |
+
return $output;
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Save commission rate of a product
|
130 |
+
*
|
131 |
+
* @param int $post_id
|
132 |
+
*/
|
133 |
+
public function save_panel( $post_id )
|
134 |
+
{
|
135 |
+
if ( isset( $_POST[ 'pv_commission_rate' ] ) ) {
|
136 |
+
update_post_meta( $post_id, 'pv_commission_rate', is_numeric( $_POST[ 'pv_commission_rate' ] ) ? (float) $_POST[ 'pv_commission_rate' ] : false );
|
137 |
+
}
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
/**
|
143 |
+
* Add the Commission tab to a product
|
144 |
+
*/
|
145 |
+
public function add_tab()
|
146 |
+
{
|
147 |
+
?>
|
148 |
+
<li class="commission_tab">
|
149 |
+
<a href="#commission"><?php _e( 'Commission', 'wcvendors' ) ?></a>
|
150 |
+
</li> <?php
|
151 |
+
}
|
152 |
+
|
153 |
+
|
154 |
+
/**
|
155 |
+
* Add the Commission panel to a product
|
156 |
+
*/
|
157 |
+
public function add_panel()
|
158 |
+
{
|
159 |
+
global $post; ?>
|
160 |
+
|
161 |
+
<div id="commission" class="panel woocommerce_options_panel">
|
162 |
+
<fieldset>
|
163 |
+
|
164 |
+
<p class='form-field commission_rate_field'>
|
165 |
+
<label for='pv_commission_rate'><?php _e( 'Commission', 'wcvendors' ); ?> (%)</label>
|
166 |
+
<input type='number' id='pv_commission_rate'
|
167 |
+
name='pv_commission_rate'
|
168 |
+
class='short'
|
169 |
+
max="100"
|
170 |
+
min="0"
|
171 |
+
step='any'
|
172 |
+
placeholder='<?php _e( 'Leave blank for default', 'wcvendors' ); ?>'
|
173 |
+
value="<?php echo get_post_meta( $post->ID, 'pv_commission_rate', true ); ?>"/>
|
174 |
+
</p>
|
175 |
+
|
176 |
+
</fieldset>
|
177 |
+
</div> <?php
|
178 |
+
|
179 |
+
}
|
180 |
+
|
181 |
+
/*
|
182 |
+
* Rename the Authors column to Vendor on products page
|
183 |
+
*/
|
184 |
+
public function vendor_column_quickedit($posts_columns) {
|
185 |
+
$posts_columns['author'] = __( 'Vendor', 'wcvendors' );
|
186 |
+
|
187 |
+
return $posts_columns;
|
188 |
+
}
|
189 |
+
|
190 |
+
/*
|
191 |
+
* Display the vendor drop down on the quick edit screen
|
192 |
+
*/
|
193 |
+
public function display_vendor_dd_quick_edit() {
|
194 |
+
|
195 |
+
global $post;
|
196 |
+
$selected = $post->post_author;
|
197 |
+
|
198 |
+
$roles = array( 'vendor', 'administrator' );
|
199 |
+
$user_args = array( 'fields' => array( 'ID', 'display_name' ) );
|
200 |
+
|
201 |
+
$output = "<select style='width:200px;' name='post_author-new' class='select'>\n";
|
202 |
+
|
203 |
+
foreach ( $roles as $role ) {
|
204 |
+
|
205 |
+
$new_args = $user_args;
|
206 |
+
$new_args[ 'role' ] = $role;
|
207 |
+
$users = get_users( $new_args );
|
208 |
+
|
209 |
+
if ( empty( $users ) ) continue;
|
210 |
+
foreach ( (array) $users as $user ) {
|
211 |
+
$select = selected( $user->ID, $selected, false );
|
212 |
+
$output .= "\t<option value='$user->ID' $select>$user->display_name</option>\n";
|
213 |
+
}
|
214 |
+
|
215 |
+
}
|
216 |
+
$output .= "</select>";
|
217 |
+
|
218 |
+
?>
|
219 |
+
<br class="clear" />
|
220 |
+
<label class="inline-edit-author-new">
|
221 |
+
<span class="title"><?php _e('Vendor', 'wcvendors' ); ?></span>
|
222 |
+
<?php echo $output; ?>
|
223 |
+
</label>
|
224 |
+
<?php
|
225 |
+
}
|
226 |
+
|
227 |
+
|
228 |
+
/*
|
229 |
+
* Save the vendor on the quick edit screen
|
230 |
+
*/
|
231 |
+
public function save_vendor_quick_edit( $product ) {
|
232 |
+
|
233 |
+
if ( $product->is_type('simple') || $product->is_type('external') ) {
|
234 |
+
if ( isset( $_REQUEST['_vendor'] ) ) {
|
235 |
+
$vendor = wc_clean($_REQUEST['_vendor']);
|
236 |
+
$product->post->post_author = $vendor;
|
237 |
+
}
|
238 |
+
}
|
239 |
+
return $product;
|
240 |
+
}
|
241 |
+
|
242 |
+
/*
|
243 |
+
* Display hidden column data for js
|
244 |
+
*/
|
245 |
+
public function display_vendor_column( $column, $post_id ){
|
246 |
+
|
247 |
+
$vendor = get_post_field( 'post_author', $post_id );
|
248 |
+
|
249 |
+
switch ( $column ) {
|
250 |
+
case 'name' :
|
251 |
+
|
252 |
+
?>
|
253 |
+
<div class="hidden vendor" id="vendor_<?php echo $post_id; ?>">
|
254 |
+
<div id="post_author"><?php echo $vendor; ?></div>
|
255 |
+
</div>
|
256 |
+
<?php
|
257 |
+
|
258 |
+
break;
|
259 |
+
|
260 |
+
default :
|
261 |
+
break;
|
262 |
+
}
|
263 |
+
|
264 |
+
}
|
265 |
+
}
|
{WCVendors/classes → classes}/admin/class-vendor-applicants.php
RENAMED
@@ -1,101 +1,101 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
*/
|
6 |
-
class WCV_Vendor_Applicants
|
7 |
-
{
|
8 |
-
|
9 |
-
function __construct()
|
10 |
-
{
|
11 |
-
add_filter( 'user_row_actions', array( $this, 'user_row_actions' ), 10, 2 );
|
12 |
-
add_filter( 'load-users.php', array( $this, 'user_row_actions_commit' ) );
|
13 |
-
}
|
14 |
-
|
15 |
-
/**
|
16 |
-
*
|
17 |
-
*
|
18 |
-
* @param unknown $actions
|
19 |
-
* @param unknown $user_object
|
20 |
-
*
|
21 |
-
* @return unknown
|
22 |
-
*/
|
23 |
-
function user_row_actions( $actions, $user_object )
|
24 |
-
{
|
25 |
-
if ( !empty( $_GET[ 'role' ] ) && $_GET[ 'role' ] == 'pending_vendor' ) {
|
26 |
-
$actions[ 'approve_vendor' ] = "<a href='?role=pending_vendor&action=approve_vendor&user_id=" . $user_object->ID . "'>" . __( 'Approve', 'cgc_ub' ) . "</a>";
|
27 |
-
$actions[ 'deny_vendor' ] = "<a href='?role=pending_vendor&action=deny_vendor&user_id=" . $user_object->ID . "'>" . __( 'Deny', 'cgc_ub' ) . "</a>";
|
28 |
-
}
|
29 |
-
|
30 |
-
return $actions;
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
/**
|
35 |
-
*
|
36 |
-
*/
|
37 |
-
public function user_row_actions_commit()
|
38 |
-
{
|
39 |
-
if ( !empty( $_GET[ 'action' ] ) && !empty( $_GET[ 'user_id' ] ) ) {
|
40 |
-
|
41 |
-
$wp_user_object = new WP_User( (int) $_GET[ 'user_id' ] );
|
42 |
-
|
43 |
-
switch ( $_GET[ 'action' ] ) {
|
44 |
-
case 'approve_vendor':
|
45 |
-
$role = 'vendor';
|
46 |
-
add_action( 'admin_notices', array( $this, 'approved' ) );
|
47 |
-
break;
|
48 |
-
|
49 |
-
case 'deny_vendor':
|
50 |
-
$role = 'subscriber';
|
51 |
-
add_action( 'admin_notices', array( $this, 'denied' ) );
|
52 |
-
break;
|
53 |
-
|
54 |
-
default:
|
55 |
-
// code...
|
56 |
-
break;
|
57 |
-
}
|
58 |
-
|
59 |
-
$wp_user_object->set_role( $role );
|
60 |
-
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
/**
|
66 |
-
*
|
67 |
-
*/
|
68 |
-
public function denied()
|
69 |
-
{
|
70 |
-
echo '<div class="updated">';
|
71 |
-
echo '<p>' . __( 'Vendor has been <b>denied</b>.', 'wcvendors' ) . '</p>';
|
72 |
-
echo '</div>';
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
/**
|
77 |
-
*
|
78 |
-
*/
|
79 |
-
public function approved()
|
80 |
-
{
|
81 |
-
echo '<div class="updated">';
|
82 |
-
echo '<p>' . __( 'Vendor has been <b>approved</b>.', 'wcvendors' ) . '</p>';
|
83 |
-
echo '</div>';
|
84 |
-
}
|
85 |
-
|
86 |
-
|
87 |
-
/**
|
88 |
-
*
|
89 |
-
*
|
90 |
-
* @param unknown $values
|
91 |
-
*
|
92 |
-
* @return unknown
|
93 |
-
*/
|
94 |
-
public function show_pending_vendors_link( $values )
|
95 |
-
{
|
96 |
-
$values[ 'pending_vendors' ] = '<a href="?role=asd">' . __( 'Pending Vendors', 'wcvendors' ) . ' <span class="count">(3)</span></a>';
|
97 |
-
|
98 |
-
return $values;
|
99 |
-
}
|
100 |
-
|
101 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
*/
|
6 |
+
class WCV_Vendor_Applicants
|
7 |
+
{
|
8 |
+
|
9 |
+
function __construct()
|
10 |
+
{
|
11 |
+
add_filter( 'user_row_actions', array( $this, 'user_row_actions' ), 10, 2 );
|
12 |
+
add_filter( 'load-users.php', array( $this, 'user_row_actions_commit' ) );
|
13 |
+
}
|
14 |
+
|
15 |
+
/**
|
16 |
+
*
|
17 |
+
*
|
18 |
+
* @param unknown $actions
|
19 |
+
* @param unknown $user_object
|
20 |
+
*
|
21 |
+
* @return unknown
|
22 |
+
*/
|
23 |
+
function user_row_actions( $actions, $user_object )
|
24 |
+
{
|
25 |
+
if ( !empty( $_GET[ 'role' ] ) && $_GET[ 'role' ] == 'pending_vendor' ) {
|
26 |
+
$actions[ 'approve_vendor' ] = "<a href='?role=pending_vendor&action=approve_vendor&user_id=" . $user_object->ID . "'>" . __( 'Approve', 'cgc_ub' ) . "</a>";
|
27 |
+
$actions[ 'deny_vendor' ] = "<a href='?role=pending_vendor&action=deny_vendor&user_id=" . $user_object->ID . "'>" . __( 'Deny', 'cgc_ub' ) . "</a>";
|
28 |
+
}
|
29 |
+
|
30 |
+
return $actions;
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
*
|
36 |
+
*/
|
37 |
+
public function user_row_actions_commit()
|
38 |
+
{
|
39 |
+
if ( !empty( $_GET[ 'action' ] ) && !empty( $_GET[ 'user_id' ] ) ) {
|
40 |
+
|
41 |
+
$wp_user_object = new WP_User( (int) $_GET[ 'user_id' ] );
|
42 |
+
|
43 |
+
switch ( $_GET[ 'action' ] ) {
|
44 |
+
case 'approve_vendor':
|
45 |
+
$role = 'vendor';
|
46 |
+
add_action( 'admin_notices', array( $this, 'approved' ) );
|
47 |
+
break;
|
48 |
+
|
49 |
+
case 'deny_vendor':
|
50 |
+
$role = 'subscriber';
|
51 |
+
add_action( 'admin_notices', array( $this, 'denied' ) );
|
52 |
+
break;
|
53 |
+
|
54 |
+
default:
|
55 |
+
// code...
|
56 |
+
break;
|
57 |
+
}
|
58 |
+
|
59 |
+
$wp_user_object->set_role( $role );
|
60 |
+
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
*
|
67 |
+
*/
|
68 |
+
public function denied()
|
69 |
+
{
|
70 |
+
echo '<div class="updated">';
|
71 |
+
echo '<p>' . __( 'Vendor has been <b>denied</b>.', 'wcvendors' ) . '</p>';
|
72 |
+
echo '</div>';
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
/**
|
77 |
+
*
|
78 |
+
*/
|
79 |
+
public function approved()
|
80 |
+
{
|
81 |
+
echo '<div class="updated">';
|
82 |
+
echo '<p>' . __( 'Vendor has been <b>approved</b>.', 'wcvendors' ) . '</p>';
|
83 |
+
echo '</div>';
|
84 |
+
}
|
85 |
+
|
86 |
+
|
87 |
+
/**
|
88 |
+
*
|
89 |
+
*
|
90 |
+
* @param unknown $values
|
91 |
+
*
|
92 |
+
* @return unknown
|
93 |
+
*/
|
94 |
+
public function show_pending_vendors_link( $values )
|
95 |
+
{
|
96 |
+
$values[ 'pending_vendors' ] = '<a href="?role=asd">' . __( 'Pending Vendors', 'wcvendors' ) . ' <span class="count">(3)</span></a>';
|
97 |
+
|
98 |
+
return $values;
|
99 |
+
}
|
100 |
+
|
101 |
+
}
|
{WCVendors/classes → classes}/admin/class-vendor-reports.php
RENAMED
@@ -1,121 +1,121 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Report views
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package ProductVendor
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Vendor_Reports
|
12 |
-
{
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Constructor
|
17 |
-
*/
|
18 |
-
function __construct()
|
19 |
-
{
|
20 |
-
$this->vendor_id = !current_user_can( 'manage_woocommerce' ) ? wp_get_current_user()->ID : '';
|
21 |
-
if ( !empty ( $this->vendor_id ) ) {
|
22 |
-
add_filter( 'woocommerce_reports_charts', array( $this, 'filter_tabs' ), 99 );
|
23 |
-
add_filter( 'woocommerce_json_search_found_products', array( $this, 'filter_products_json' ) );
|
24 |
-
add_filter( 'woocommerce_reports_product_sales_order_items', array( $this, 'filter_products' ) );
|
25 |
-
add_filter( 'woocommerce_reports_top_sellers_order_items', array( $this, 'filter_products' ) );
|
26 |
-
add_filter( 'woocommerce_reports_top_earners_order_items', array( $this, 'filter_products' ) );
|
27 |
-
}
|
28 |
-
|
29 |
-
}
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Show only reports that are useful to a vendor
|
33 |
-
*
|
34 |
-
* @param array $tabs
|
35 |
-
*
|
36 |
-
* @return array
|
37 |
-
*/
|
38 |
-
public function filter_tabs( $tabs )
|
39 |
-
{
|
40 |
-
global $woocommerce;
|
41 |
-
|
42 |
-
$remove = array(
|
43 |
-
'woocommerce_sales_overview',
|
44 |
-
'woocommerce_daily_sales',
|
45 |
-
'woocommerce_monthly_sales',
|
46 |
-
'woocommerce_monthly_taxes',
|
47 |
-
'woocommerce_category_sales',
|
48 |
-
'woocommerce_coupon_sales',
|
49 |
-
);
|
50 |
-
|
51 |
-
$reports = $tabs[ 'orders' ][ 'reports' ];
|
52 |
-
|
53 |
-
foreach ( $reports as $key => $chart ) {
|
54 |
-
if ( $key == 'coupon_usage' ) {
|
55 |
-
unset( $tabs[ 'orders' ][ 'reports' ][ $key ] );
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
// These are admin tabs
|
60 |
-
$return = array(
|
61 |
-
'orders' => $tabs[ 'orders' ]
|
62 |
-
);
|
63 |
-
|
64 |
-
return $return;
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Filter products based on current vendor
|
70 |
-
*
|
71 |
-
* @param unknown $orders
|
72 |
-
*
|
73 |
-
* @return unknown
|
74 |
-
*/
|
75 |
-
public function filter_products( $orders )
|
76 |
-
{
|
77 |
-
$products = WCV_Vendors::get_vendor_products( $this->vendor_id );
|
78 |
-
|
79 |
-
$ids = array();
|
80 |
-
foreach ( $products as $product ) {
|
81 |
-
$ids[ ] = ( $product->ID );
|
82 |
-
}
|
83 |
-
|
84 |
-
foreach ( $orders as $key => $order ) {
|
85 |
-
|
86 |
-
if ( !in_array( $order->product_id, $ids ) ) {
|
87 |
-
unset( $orders[ $key ] );
|
88 |
-
continue;
|
89 |
-
} else {
|
90 |
-
if ( !empty( $order->line_total ) ) {
|
91 |
-
$orders[ $key ]->line_total = WCV_Commission::calculate_commission( $order->line_total, $order->product_id, $order );
|
92 |
-
}
|
93 |
-
}
|
94 |
-
|
95 |
-
}
|
96 |
-
|
97 |
-
return $orders;
|
98 |
-
}
|
99 |
-
|
100 |
-
|
101 |
-
/**
|
102 |
-
*
|
103 |
-
*
|
104 |
-
* @param unknown $products
|
105 |
-
*
|
106 |
-
* @return unknown
|
107 |
-
*/
|
108 |
-
public function filter_products_json( $products )
|
109 |
-
{
|
110 |
-
$vendor_products = WCV_Vendors::get_vendor_products( $this->vendor_id );
|
111 |
-
|
112 |
-
$ids = array();
|
113 |
-
foreach ( $vendor_products as $vendor_product ) {
|
114 |
-
$ids[ $vendor_product->ID ] = $vendor_product->post_title;
|
115 |
-
}
|
116 |
-
|
117 |
-
return array_intersect_key( $products, $ids );
|
118 |
-
}
|
119 |
-
|
120 |
-
|
121 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Report views
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package ProductVendor
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Vendor_Reports
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Constructor
|
17 |
+
*/
|
18 |
+
function __construct()
|
19 |
+
{
|
20 |
+
$this->vendor_id = !current_user_can( 'manage_woocommerce' ) ? wp_get_current_user()->ID : '';
|
21 |
+
if ( !empty ( $this->vendor_id ) ) {
|
22 |
+
add_filter( 'woocommerce_reports_charts', array( $this, 'filter_tabs' ), 99 );
|
23 |
+
add_filter( 'woocommerce_json_search_found_products', array( $this, 'filter_products_json' ) );
|
24 |
+
add_filter( 'woocommerce_reports_product_sales_order_items', array( $this, 'filter_products' ) );
|
25 |
+
add_filter( 'woocommerce_reports_top_sellers_order_items', array( $this, 'filter_products' ) );
|
26 |
+
add_filter( 'woocommerce_reports_top_earners_order_items', array( $this, 'filter_products' ) );
|
27 |
+
}
|
28 |
+
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Show only reports that are useful to a vendor
|
33 |
+
*
|
34 |
+
* @param array $tabs
|
35 |
+
*
|
36 |
+
* @return array
|
37 |
+
*/
|
38 |
+
public function filter_tabs( $tabs )
|
39 |
+
{
|
40 |
+
global $woocommerce;
|
41 |
+
|
42 |
+
$remove = array(
|
43 |
+
'woocommerce_sales_overview',
|
44 |
+
'woocommerce_daily_sales',
|
45 |
+
'woocommerce_monthly_sales',
|
46 |
+
'woocommerce_monthly_taxes',
|
47 |
+
'woocommerce_category_sales',
|
48 |
+
'woocommerce_coupon_sales',
|
49 |
+
);
|
50 |
+
|
51 |
+
$reports = $tabs[ 'orders' ][ 'reports' ];
|
52 |
+
|
53 |
+
foreach ( $reports as $key => $chart ) {
|
54 |
+
if ( $key == 'coupon_usage' ) {
|
55 |
+
unset( $tabs[ 'orders' ][ 'reports' ][ $key ] );
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
// These are admin tabs
|
60 |
+
$return = array(
|
61 |
+
'orders' => $tabs[ 'orders' ]
|
62 |
+
);
|
63 |
+
|
64 |
+
return $return;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Filter products based on current vendor
|
70 |
+
*
|
71 |
+
* @param unknown $orders
|
72 |
+
*
|
73 |
+
* @return unknown
|
74 |
+
*/
|
75 |
+
public function filter_products( $orders )
|
76 |
+
{
|
77 |
+
$products = WCV_Vendors::get_vendor_products( $this->vendor_id );
|
78 |
+
|
79 |
+
$ids = array();
|
80 |
+
foreach ( $products as $product ) {
|
81 |
+
$ids[ ] = ( $product->ID );
|
82 |
+
}
|
83 |
+
|
84 |
+
foreach ( $orders as $key => $order ) {
|
85 |
+
|
86 |
+
if ( !in_array( $order->product_id, $ids ) ) {
|
87 |
+
unset( $orders[ $key ] );
|
88 |
+
continue;
|
89 |
+
} else {
|
90 |
+
if ( !empty( $order->line_total ) ) {
|
91 |
+
$orders[ $key ]->line_total = WCV_Commission::calculate_commission( $order->line_total, $order->product_id, $order );
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
}
|
96 |
+
|
97 |
+
return $orders;
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
*
|
103 |
+
*
|
104 |
+
* @param unknown $products
|
105 |
+
*
|
106 |
+
* @return unknown
|
107 |
+
*/
|
108 |
+
public function filter_products_json( $products )
|
109 |
+
{
|
110 |
+
$vendor_products = WCV_Vendors::get_vendor_products( $this->vendor_id );
|
111 |
+
|
112 |
+
$ids = array();
|
113 |
+
foreach ( $vendor_products as $vendor_product ) {
|
114 |
+
$ids[ $vendor_product->ID ] = $vendor_product->post_title;
|
115 |
+
}
|
116 |
+
|
117 |
+
return array_intersect_key( $products, $ids );
|
118 |
+
}
|
119 |
+
|
120 |
+
|
121 |
+
}
|
{WCVendors/classes → classes}/admin/emails/class-emails.php
RENAMED
@@ -1,131 +1,131 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
/**
|
6 |
-
*
|
7 |
-
*
|
8 |
-
* @author Matt Gates <http://mgates.me>
|
9 |
-
* @package
|
10 |
-
*/
|
11 |
-
|
12 |
-
|
13 |
-
class WCV_Emails
|
14 |
-
{
|
15 |
-
|
16 |
-
|
17 |
-
/**
|
18 |
-
*
|
19 |
-
*/
|
20 |
-
function __construct()
|
21 |
-
{
|
22 |
-
add_action( 'woocommerce_email_classes', array( $this, 'check_items' ) );
|
23 |
-
add_filter( 'woocommerce_resend_order_emails_available', array( $this, 'order_action' ) );
|
24 |
-
add_filter( 'woocommerce_order_product_title', array( 'WCV_Emails', 'show_vendor_in_email' ), 10, 2 );
|
25 |
-
add_action( 'set_user_role', array( $this, 'application_status_email' ), 10, 2 );
|
26 |
-
add_action( 'transition_post_status', array( $this, 'trigger_new_product' ), 10, 3 );
|
27 |
-
}
|
28 |
-
|
29 |
-
public function trigger_new_product( $from, $to, $post )
|
30 |
-
{
|
31 |
-
global $woocommerce;
|
32 |
-
|
33 |
-
if ( $from != $to && $post->post_status == 'pending' && WCV_Vendors::is_vendor( $post->post_author ) ) {
|
34 |
-
$mails = $woocommerce->mailer()->get_emails();
|
35 |
-
if ( !empty( $mails ) ) {
|
36 |
-
$mails[ 'WC_Email_Notify_Admin' ]->trigger( $post->post_id, $post );
|
37 |
-
}
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
|
42 |
-
/**
|
43 |
-
*
|
44 |
-
*
|
45 |
-
* @param unknown $user_id
|
46 |
-
* @param unknown $role
|
47 |
-
*/
|
48 |
-
function application_status_email( $user_id, $role )
|
49 |
-
{
|
50 |
-
global $woocommerce;
|
51 |
-
|
52 |
-
if ( !empty( $_POST[ 'apply_for_vendor' ] ) || ( !empty( $_GET[ 'action' ] ) && ( $_GET[ 'action' ] == 'approve_vendor' || $_GET[ 'action' ] == 'deny_vendor' ) ) ) {
|
53 |
-
|
54 |
-
if ( $role == 'pending_vendor' ) {
|
55 |
-
$status = __( 'pending', 'wcvendors' );
|
56 |
-
} else if ( $role == 'vendor' ) {
|
57 |
-
$status = __( 'approved', 'wcvendors' );
|
58 |
-
} else if ( !empty( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'deny_vendor' ) {
|
59 |
-
$status = __( 'denied', 'wcvendors' );
|
60 |
-
}
|
61 |
-
|
62 |
-
$mails = $woocommerce->mailer()->get_emails();
|
63 |
-
|
64 |
-
if ( isset( $status ) && !empty( $mails ) ) {
|
65 |
-
$mails[ 'WC_Email_Approve_Vendor' ]->trigger( $user_id, $status );
|
66 |
-
}
|
67 |
-
}
|
68 |
-
}
|
69 |
-
|
70 |
-
|
71 |
-
/**
|
72 |
-
*
|
73 |
-
*
|
74 |
-
* @param unknown $name
|
75 |
-
* @param unknown $_product
|
76 |
-
*
|
77 |
-
* @return unknown
|
78 |
-
*/
|
79 |
-
function show_vendor_in_email( $name, $_product )
|
80 |
-
{
|
81 |
-
$product = get_post( $_product->id );
|
82 |
-
|
83 |
-
$sold_by = WCV_Vendors::is_vendor( $product->post_author )
|
84 |
-
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $product->post_author ), WCV_Vendors::get_vendor_shop_name( $product->post_author ) )
|
85 |
-
: get_bloginfo( 'name' );
|
86 |
-
|
87 |
-
$name .= '<small class="wcvendors_sold_by_in_email"><br />' . apply_filters('wcvendors_sold_by_in_email', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small><br />';
|
88 |
-
|
89 |
-
return $name;
|
90 |
-
}
|
91 |
-
|
92 |
-
|
93 |
-
/**
|
94 |
-
*
|
95 |
-
*
|
96 |
-
* @param unknown $available_emails
|
97 |
-
*
|
98 |
-
* @return unknown
|
99 |
-
*/
|
100 |
-
public function order_action( $available_emails )
|
101 |
-
{
|
102 |
-
$available_emails[ ] = 'vendor_new_order';
|
103 |
-
|
104 |
-
return $available_emails;
|
105 |
-
}
|
106 |
-
|
107 |
-
|
108 |
-
/**
|
109 |
-
*
|
110 |
-
*
|
111 |
-
* @param unknown $emails
|
112 |
-
*
|
113 |
-
* @return unknown
|
114 |
-
*/
|
115 |
-
public function check_items( $emails )
|
116 |
-
{
|
117 |
-
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-admin.php';
|
118 |
-
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-vendor.php';
|
119 |
-
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-approve-vendor.php';
|
120 |
-
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-shipped.php';
|
121 |
-
|
122 |
-
$emails[ 'WC_Email_Notify_Vendor' ] = new WC_Email_Notify_Vendor();
|
123 |
-
$emails[ 'WC_Email_Approve_Vendor' ] = new WC_Email_Approve_Vendor();
|
124 |
-
$emails[ 'WC_Email_Notify_Admin' ] = new WC_Email_Notify_Admin();
|
125 |
-
$emails[ 'WC_Email_Notify_Shipped' ] = new WC_Email_Notify_Shipped();
|
126 |
-
|
127 |
-
return $emails;
|
128 |
-
}
|
129 |
-
|
130 |
-
|
131 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
+
|
5 |
+
/**
|
6 |
+
*
|
7 |
+
*
|
8 |
+
* @author Matt Gates <http://mgates.me>
|
9 |
+
* @package
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
class WCV_Emails
|
14 |
+
{
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
*
|
19 |
+
*/
|
20 |
+
function __construct()
|
21 |
+
{
|
22 |
+
add_action( 'woocommerce_email_classes', array( $this, 'check_items' ) );
|
23 |
+
add_filter( 'woocommerce_resend_order_emails_available', array( $this, 'order_action' ) );
|
24 |
+
add_filter( 'woocommerce_order_product_title', array( 'WCV_Emails', 'show_vendor_in_email' ), 10, 2 );
|
25 |
+
add_action( 'set_user_role', array( $this, 'application_status_email' ), 10, 2 );
|
26 |
+
add_action( 'transition_post_status', array( $this, 'trigger_new_product' ), 10, 3 );
|
27 |
+
}
|
28 |
+
|
29 |
+
public function trigger_new_product( $from, $to, $post )
|
30 |
+
{
|
31 |
+
global $woocommerce;
|
32 |
+
|
33 |
+
if ( $from != $to && $post->post_status == 'pending' && WCV_Vendors::is_vendor( $post->post_author ) ) {
|
34 |
+
$mails = $woocommerce->mailer()->get_emails();
|
35 |
+
if ( !empty( $mails ) ) {
|
36 |
+
$mails[ 'WC_Email_Notify_Admin' ]->trigger( $post->post_id, $post );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
/**
|
43 |
+
*
|
44 |
+
*
|
45 |
+
* @param unknown $user_id
|
46 |
+
* @param unknown $role
|
47 |
+
*/
|
48 |
+
function application_status_email( $user_id, $role )
|
49 |
+
{
|
50 |
+
global $woocommerce;
|
51 |
+
|
52 |
+
if ( !empty( $_POST[ 'apply_for_vendor' ] ) || ( !empty( $_GET[ 'action' ] ) && ( $_GET[ 'action' ] == 'approve_vendor' || $_GET[ 'action' ] == 'deny_vendor' ) ) ) {
|
53 |
+
|
54 |
+
if ( $role == 'pending_vendor' ) {
|
55 |
+
$status = __( 'pending', 'wcvendors' );
|
56 |
+
} else if ( $role == 'vendor' ) {
|
57 |
+
$status = __( 'approved', 'wcvendors' );
|
58 |
+
} else if ( !empty( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'deny_vendor' ) {
|
59 |
+
$status = __( 'denied', 'wcvendors' );
|
60 |
+
}
|
61 |
+
|
62 |
+
$mails = $woocommerce->mailer()->get_emails();
|
63 |
+
|
64 |
+
if ( isset( $status ) && !empty( $mails ) ) {
|
65 |
+
$mails[ 'WC_Email_Approve_Vendor' ]->trigger( $user_id, $status );
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
|
71 |
+
/**
|
72 |
+
*
|
73 |
+
*
|
74 |
+
* @param unknown $name
|
75 |
+
* @param unknown $_product
|
76 |
+
*
|
77 |
+
* @return unknown
|
78 |
+
*/
|
79 |
+
function show_vendor_in_email( $name, $_product )
|
80 |
+
{
|
81 |
+
$product = get_post( $_product->id );
|
82 |
+
|
83 |
+
$sold_by = WCV_Vendors::is_vendor( $product->post_author )
|
84 |
+
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $product->post_author ), WCV_Vendors::get_vendor_shop_name( $product->post_author ) )
|
85 |
+
: get_bloginfo( 'name' );
|
86 |
+
|
87 |
+
$name .= '<small class="wcvendors_sold_by_in_email"><br />' . apply_filters('wcvendors_sold_by_in_email', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small><br />';
|
88 |
+
|
89 |
+
return $name;
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
/**
|
94 |
+
*
|
95 |
+
*
|
96 |
+
* @param unknown $available_emails
|
97 |
+
*
|
98 |
+
* @return unknown
|
99 |
+
*/
|
100 |
+
public function order_action( $available_emails )
|
101 |
+
{
|
102 |
+
$available_emails[ ] = 'vendor_new_order';
|
103 |
+
|
104 |
+
return $available_emails;
|
105 |
+
}
|
106 |
+
|
107 |
+
|
108 |
+
/**
|
109 |
+
*
|
110 |
+
*
|
111 |
+
* @param unknown $emails
|
112 |
+
*
|
113 |
+
* @return unknown
|
114 |
+
*/
|
115 |
+
public function check_items( $emails )
|
116 |
+
{
|
117 |
+
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-admin.php';
|
118 |
+
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-vendor.php';
|
119 |
+
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-approve-vendor.php';
|
120 |
+
require_once wcv_plugin_dir . 'classes/admin/emails/class-wc-notify-shipped.php';
|
121 |
+
|
122 |
+
$emails[ 'WC_Email_Notify_Vendor' ] = new WC_Email_Notify_Vendor();
|
123 |
+
$emails[ 'WC_Email_Approve_Vendor' ] = new WC_Email_Approve_Vendor();
|
124 |
+
$emails[ 'WC_Email_Notify_Admin' ] = new WC_Email_Notify_Admin();
|
125 |
+
$emails[ 'WC_Email_Notify_Shipped' ] = new WC_Email_Notify_Shipped();
|
126 |
+
|
127 |
+
return $emails;
|
128 |
+
}
|
129 |
+
|
130 |
+
|
131 |
+
}
|
{WCVendors/classes → classes}/admin/emails/class-wc-approve-vendor.php
RENAMED
@@ -1,165 +1,165 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
/**
|
6 |
-
* New Order Email
|
7 |
-
*
|
8 |
-
* An email sent to the admin when a new order is received/paid for.
|
9 |
-
*
|
10 |
-
* @class WC_Email_Approve_Vendor
|
11 |
-
* @version 2.0.0
|
12 |
-
* @extends WC_Email
|
13 |
-
* @author WooThemes
|
14 |
-
* @package WooCommerce/Classes/Emails
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
class WC_Email_Approve_Vendor extends WC_Email
|
19 |
-
{
|
20 |
-
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Constructor
|
24 |
-
*/
|
25 |
-
function __construct()
|
26 |
-
{
|
27 |
-
$this->id = 'vendor_application';
|
28 |
-
$this->title = __( 'Vendor Application', 'wcvendors' );
|
29 |
-
$this->description = __( 'Vendor application will either be approved, denied, or pending.', 'wcvendors' );
|
30 |
-
|
31 |
-
$this->heading = __( 'Application {status}', 'wcvendors' );
|
32 |
-
$this->subject = __( '[{blogname}] Your vendor application has been {status}', 'wcvendors' );
|
33 |
-
|
34 |
-
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/
|
35 |
-
$this->template_html = 'application-status.php';
|
36 |
-
$this->template_plain = 'application-status.php';
|
37 |
-
|
38 |
-
// Call parent constuctor
|
39 |
-
parent::__construct();
|
40 |
-
|
41 |
-
// Other settings
|
42 |
-
$this->recipient = $this->get_option( 'recipient' );
|
43 |
-
|
44 |
-
if ( !$this->recipient )
|
45 |
-
$this->recipient = get_option( 'admin_email' );
|
46 |
-
}
|
47 |
-
|
48 |
-
/**
|
49 |
-
* trigger function.
|
50 |
-
*
|
51 |
-
* @access public
|
52 |
-
* @return void
|
53 |
-
*
|
54 |
-
* @param unknown $order_id
|
55 |
-
*/
|
56 |
-
function trigger( $user_id, $status )
|
57 |
-
{
|
58 |
-
if ( !$this->is_enabled() ) return;
|
59 |
-
|
60 |
-
$this->find[ ] = '{status}';
|
61 |
-
$this->replace[ ] = $status;
|
62 |
-
|
63 |
-
$this->status = $status;
|
64 |
-
|
65 |
-
$this->user = get_userdata( $user_id );
|
66 |
-
$user_email = $this->user->user_email;
|
67 |
-
|
68 |
-
$this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
69 |
-
|
70 |
-
if ( $status == __( 'pending', 'wcvendors' ) ) {
|
71 |
-
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
72 |
-
}
|
73 |
-
}
|
74 |
-
|
75 |
-
/**
|
76 |
-
* get_content_html function.
|
77 |
-
*
|
78 |
-
* @access public
|
79 |
-
* @return string
|
80 |
-
*/
|
81 |
-
function get_content_html()
|
82 |
-
{
|
83 |
-
ob_start();
|
84 |
-
wc_get_template( $this->template_html, array(
|
85 |
-
'status' => $this->status,
|
86 |
-
'user' => $this->user,
|
87 |
-
'email_heading' => $this->get_heading()
|
88 |
-
), 'woocommerce/', $this->template_base );
|
89 |
-
|
90 |
-
return ob_get_clean();
|
91 |
-
}
|
92 |
-
|
93 |
-
|
94 |
-
/**
|
95 |
-
* get_content_plain function.
|
96 |
-
*
|
97 |
-
* @access public
|
98 |
-
* @return string
|
99 |
-
*/
|
100 |
-
function get_content_plain()
|
101 |
-
{
|
102 |
-
ob_start();
|
103 |
-
wc_get_template( $this->template_plain, array(
|
104 |
-
'status' => $this->status,
|
105 |
-
'user' => $this->user,
|
106 |
-
'email_heading' => $this->get_heading()
|
107 |
-
), 'woocommerce/', $this->template_base );
|
108 |
-
|
109 |
-
return ob_get_clean();
|
110 |
-
}
|
111 |
-
|
112 |
-
|
113 |
-
/**
|
114 |
-
* Initialise Settings Form Fields
|
115 |
-
*
|
116 |
-
* @access public
|
117 |
-
* @return void
|
118 |
-
*/
|
119 |
-
function init_form_fields()
|
120 |
-
{
|
121 |
-
$this->form_fields = array(
|
122 |
-
'enabled' => array(
|
123 |
-
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
124 |
-
'type' => 'checkbox',
|
125 |
-
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
126 |
-
'default' => 'yes'
|
127 |
-
),
|
128 |
-
'recipient' => array(
|
129 |
-
'title' => __( 'Recipient(s)', 'woocommerce' ),
|
130 |
-
'type' => 'text',
|
131 |
-
'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'wcvendors' ), esc_attr( get_option( 'admin_email' ) ) ),
|
132 |
-
'placeholder' => '',
|
133 |
-
'default' => ''
|
134 |
-
),
|
135 |
-
'subject' => array(
|
136 |
-
'title' => __( 'Subject', 'wcvendors' ),
|
137 |
-
'type' => 'text',
|
138 |
-
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
139 |
-
'placeholder' => '',
|
140 |
-
'default' => ''
|
141 |
-
),
|
142 |
-
'heading' => array(
|
143 |
-
'title' => __( 'Email Heading', 'wcvendors' ),
|
144 |
-
'type' => 'text',
|
145 |
-
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
146 |
-
'placeholder' => '',
|
147 |
-
'default' => ''
|
148 |
-
),
|
149 |
-
'email_type' => array(
|
150 |
-
'title' => __( 'Email type', 'wcvendors' ),
|
151 |
-
'type' => 'select',
|
152 |
-
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
153 |
-
'default' => 'html',
|
154 |
-
'class' => 'email_type',
|
155 |
-
'options' => array(
|
156 |
-
'plain' => __( 'Plain text', 'wcvendors' ),
|
157 |
-
'html' => __( 'HTML', 'wcvendors' ),
|
158 |
-
'multipart' => __( 'Multipart', 'wcvendors' ),
|
159 |
-
)
|
160 |
-
)
|
161 |
-
);
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
+
|
5 |
+
/**
|
6 |
+
* New Order Email
|
7 |
+
*
|
8 |
+
* An email sent to the admin when a new order is received/paid for.
|
9 |
+
*
|
10 |
+
* @class WC_Email_Approve_Vendor
|
11 |
+
* @version 2.0.0
|
12 |
+
* @extends WC_Email
|
13 |
+
* @author WooThemes
|
14 |
+
* @package WooCommerce/Classes/Emails
|
15 |
+
*/
|
16 |
+
|
17 |
+
|
18 |
+
class WC_Email_Approve_Vendor extends WC_Email
|
19 |
+
{
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor
|
24 |
+
*/
|
25 |
+
function __construct()
|
26 |
+
{
|
27 |
+
$this->id = 'vendor_application';
|
28 |
+
$this->title = __( 'Vendor Application', 'wcvendors' );
|
29 |
+
$this->description = __( 'Vendor application will either be approved, denied, or pending.', 'wcvendors' );
|
30 |
+
|
31 |
+
$this->heading = __( 'Application {status}', 'wcvendors' );
|
32 |
+
$this->subject = __( '[{blogname}] Your vendor application has been {status}', 'wcvendors' );
|
33 |
+
|
34 |
+
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
|
35 |
+
$this->template_html = 'application-status.php';
|
36 |
+
$this->template_plain = 'application-status.php';
|
37 |
+
|
38 |
+
// Call parent constuctor
|
39 |
+
parent::__construct();
|
40 |
+
|
41 |
+
// Other settings
|
42 |
+
$this->recipient = $this->get_option( 'recipient' );
|
43 |
+
|
44 |
+
if ( !$this->recipient )
|
45 |
+
$this->recipient = get_option( 'admin_email' );
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* trigger function.
|
50 |
+
*
|
51 |
+
* @access public
|
52 |
+
* @return void
|
53 |
+
*
|
54 |
+
* @param unknown $order_id
|
55 |
+
*/
|
56 |
+
function trigger( $user_id, $status )
|
57 |
+
{
|
58 |
+
if ( !$this->is_enabled() ) return;
|
59 |
+
|
60 |
+
$this->find[ ] = '{status}';
|
61 |
+
$this->replace[ ] = $status;
|
62 |
+
|
63 |
+
$this->status = $status;
|
64 |
+
|
65 |
+
$this->user = get_userdata( $user_id );
|
66 |
+
$user_email = $this->user->user_email;
|
67 |
+
|
68 |
+
$this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
69 |
+
|
70 |
+
if ( $status == __( 'pending', 'wcvendors' ) ) {
|
71 |
+
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* get_content_html function.
|
77 |
+
*
|
78 |
+
* @access public
|
79 |
+
* @return string
|
80 |
+
*/
|
81 |
+
function get_content_html()
|
82 |
+
{
|
83 |
+
ob_start();
|
84 |
+
wc_get_template( $this->template_html, array(
|
85 |
+
'status' => $this->status,
|
86 |
+
'user' => $this->user,
|
87 |
+
'email_heading' => $this->get_heading()
|
88 |
+
), 'woocommerce/', $this->template_base );
|
89 |
+
|
90 |
+
return ob_get_clean();
|
91 |
+
}
|
92 |
+
|
93 |
+
|
94 |
+
/**
|
95 |
+
* get_content_plain function.
|
96 |
+
*
|
97 |
+
* @access public
|
98 |
+
* @return string
|
99 |
+
*/
|
100 |
+
function get_content_plain()
|
101 |
+
{
|
102 |
+
ob_start();
|
103 |
+
wc_get_template( $this->template_plain, array(
|
104 |
+
'status' => $this->status,
|
105 |
+
'user' => $this->user,
|
106 |
+
'email_heading' => $this->get_heading()
|
107 |
+
), 'woocommerce/', $this->template_base );
|
108 |
+
|
109 |
+
return ob_get_clean();
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Initialise Settings Form Fields
|
115 |
+
*
|
116 |
+
* @access public
|
117 |
+
* @return void
|
118 |
+
*/
|
119 |
+
function init_form_fields()
|
120 |
+
{
|
121 |
+
$this->form_fields = array(
|
122 |
+
'enabled' => array(
|
123 |
+
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
124 |
+
'type' => 'checkbox',
|
125 |
+
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
126 |
+
'default' => 'yes'
|
127 |
+
),
|
128 |
+
'recipient' => array(
|
129 |
+
'title' => __( 'Recipient(s)', 'woocommerce' ),
|
130 |
+
'type' => 'text',
|
131 |
+
'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'wcvendors' ), esc_attr( get_option( 'admin_email' ) ) ),
|
132 |
+
'placeholder' => '',
|
133 |
+
'default' => ''
|
134 |
+
),
|
135 |
+
'subject' => array(
|
136 |
+
'title' => __( 'Subject', 'wcvendors' ),
|
137 |
+
'type' => 'text',
|
138 |
+
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
139 |
+
'placeholder' => '',
|
140 |
+
'default' => ''
|
141 |
+
),
|
142 |
+
'heading' => array(
|
143 |
+
'title' => __( 'Email Heading', 'wcvendors' ),
|
144 |
+
'type' => 'text',
|
145 |
+
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
146 |
+
'placeholder' => '',
|
147 |
+
'default' => ''
|
148 |
+
),
|
149 |
+
'email_type' => array(
|
150 |
+
'title' => __( 'Email type', 'wcvendors' ),
|
151 |
+
'type' => 'select',
|
152 |
+
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
153 |
+
'default' => 'html',
|
154 |
+
'class' => 'email_type',
|
155 |
+
'options' => array(
|
156 |
+
'plain' => __( 'Plain text', 'wcvendors' ),
|
157 |
+
'html' => __( 'HTML', 'wcvendors' ),
|
158 |
+
'multipart' => __( 'Multipart', 'wcvendors' ),
|
159 |
+
)
|
160 |
+
)
|
161 |
+
);
|
162 |
+
}
|
163 |
+
|
164 |
+
|
165 |
+
}
|
{WCVendors/classes → classes}/admin/emails/class-wc-notify-admin.php
RENAMED
@@ -1,173 +1,173 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
/**
|
6 |
-
* New Order Email
|
7 |
-
*
|
8 |
-
* An email sent to the admin when a new product is created.
|
9 |
-
*
|
10 |
-
* @class WC_Email_Notify_Admin
|
11 |
-
* @version 2.0.0
|
12 |
-
* @extends WC_Email
|
13 |
-
* @author WooThemes
|
14 |
-
* @package WooCommerce/Classes/Emails
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
class WC_Email_Notify_Admin extends WC_Email
|
19 |
-
{
|
20 |
-
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Constructor
|
24 |
-
*/
|
25 |
-
function __construct()
|
26 |
-
{
|
27 |
-
$this->id = 'admin_new_vendor_product';
|
28 |
-
$this->title = __( 'New Vendor Product', 'wcvendors' );
|
29 |
-
$this->description = __( 'New order emails are sent when a new product is submitted by a vendor', 'wcvendors' );
|
30 |
-
|
31 |
-
$this->heading = __( 'New product submitted: {product_name}', 'wcvendors' );
|
32 |
-
$this->subject = __( '[{blogname}] New product submitted by {vendor_name} - {product_name}', 'wcvendors' );
|
33 |
-
|
34 |
-
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/
|
35 |
-
$this->template_html = 'new-product.php';
|
36 |
-
$this->template_plain = 'new-product.php';
|
37 |
-
|
38 |
-
// Triggers for this email
|
39 |
-
add_action( 'transition_post_status', array( $this, 'trigger' ), 10, 3 );
|
40 |
-
|
41 |
-
// Call parent constuctor
|
42 |
-
parent::__construct();
|
43 |
-
|
44 |
-
// Other settings
|
45 |
-
$this->recipient = $this->get_option( 'recipient' );
|
46 |
-
|
47 |
-
if ( !$this->recipient )
|
48 |
-
$this->recipient = get_option( 'admin_email' );
|
49 |
-
}
|
50 |
-
|
51 |
-
|
52 |
-
/**
|
53 |
-
* trigger function.
|
54 |
-
*
|
55 |
-
* @access public
|
56 |
-
* @return void
|
57 |
-
*
|
58 |
-
* @param unknown $order_id
|
59 |
-
*/
|
60 |
-
function trigger( $post_id, $post )
|
61 |
-
{
|
62 |
-
if ( !WCV_Vendors::is_vendor( $post->post_author ) ) {
|
63 |
-
return;
|
64 |
-
}
|
65 |
-
|
66 |
-
if ( !$this->is_enabled() ) return;
|
67 |
-
|
68 |
-
$this->find[ ] = '{product_name}';
|
69 |
-
$this->product_name = $post->post_title;
|
70 |
-
$this->replace[ ] = $this->product_name;
|
71 |
-
|
72 |
-
$this->find[ ] = '{vendor_name}';
|
73 |
-
$this->vendor_name = WCV_Vendors::get_vendor_shop_name( $post->post_author );
|
74 |
-
$this->replace[ ] = $this->vendor_name;
|
75 |
-
|
76 |
-
$this->post_id = $post->ID;
|
77 |
-
|
78 |
-
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
79 |
-
}
|
80 |
-
|
81 |
-
/**
|
82 |
-
* get_content_html function.
|
83 |
-
*
|
84 |
-
* @access public
|
85 |
-
* @return string
|
86 |
-
*/
|
87 |
-
function get_content_html()
|
88 |
-
{
|
89 |
-
ob_start();
|
90 |
-
wc_get_template( $this->template_html, array(
|
91 |
-
'product_name' => $this->product_name,
|
92 |
-
'vendor_name' => $this->vendor_name,
|
93 |
-
'post_id' => $this->post_id,
|
94 |
-
'email_heading' => $this->get_heading()
|
95 |
-
), 'woocommerce/', $this->template_base );
|
96 |
-
|
97 |
-
return ob_get_clean();
|
98 |
-
}
|
99 |
-
|
100 |
-
|
101 |
-
/**
|
102 |
-
* get_content_plain function.
|
103 |
-
*
|
104 |
-
* @access public
|
105 |
-
* @return string
|
106 |
-
*/
|
107 |
-
function get_content_plain()
|
108 |
-
{
|
109 |
-
ob_start();
|
110 |
-
wc_get_template( $this->template_plain, array(
|
111 |
-
'product_name' => $this->product_name,
|
112 |
-
'vendor_name' => $this->vendor_name,
|
113 |
-
'post_id' => $this->post_id,
|
114 |
-
'email_heading' => $this->get_heading()
|
115 |
-
), 'woocommerce/', $this->template_base );
|
116 |
-
|
117 |
-
return ob_get_clean();
|
118 |
-
}
|
119 |
-
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Initialise Settings Form Fields
|
123 |
-
*
|
124 |
-
* @access public
|
125 |
-
* @return void
|
126 |
-
*/
|
127 |
-
function init_form_fields()
|
128 |
-
{
|
129 |
-
$this->form_fields = array(
|
130 |
-
'enabled' => array(
|
131 |
-
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
132 |
-
'type' => 'checkbox',
|
133 |
-
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
134 |
-
'default' => 'yes'
|
135 |
-
),
|
136 |
-
'recipient' => array(
|
137 |
-
'title' => __( 'Recipient(s)', 'woocommerce' ),
|
138 |
-
'type' => 'text',
|
139 |
-
'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'woocommerce' ), esc_attr( get_option( 'admin_email' ) ) ),
|
140 |
-
'placeholder' => '',
|
141 |
-
'default' => ''
|
142 |
-
),
|
143 |
-
'subject' => array(
|
144 |
-
'title' => __( 'Subject', 'wcvendors' ),
|
145 |
-
'type' => 'text',
|
146 |
-
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
147 |
-
'placeholder' => '',
|
148 |
-
'default' => ''
|
149 |
-
),
|
150 |
-
'heading' => array(
|
151 |
-
'title' => __( 'Email Heading', 'wcvendors' ),
|
152 |
-
'type' => 'text',
|
153 |
-
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
154 |
-
'placeholder' => '',
|
155 |
-
'default' => ''
|
156 |
-
),
|
157 |
-
'email_type' => array(
|
158 |
-
'title' => __( 'Email type', 'wcvendors' ),
|
159 |
-
'type' => 'select',
|
160 |
-
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
161 |
-
'default' => 'html',
|
162 |
-
'class' => 'email_type',
|
163 |
-
'options' => array(
|
164 |
-
'plain' => __( 'Plain text', 'wcvendors' ),
|
165 |
-
'html' => __( 'HTML', 'wcvendors' ),
|
166 |
-
'multipart' => __( 'Multipart', 'wcvendors' ),
|
167 |
-
)
|
168 |
-
)
|
169 |
-
);
|
170 |
-
}
|
171 |
-
|
172 |
-
|
173 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
+
|
5 |
+
/**
|
6 |
+
* New Order Email
|
7 |
+
*
|
8 |
+
* An email sent to the admin when a new product is created.
|
9 |
+
*
|
10 |
+
* @class WC_Email_Notify_Admin
|
11 |
+
* @version 2.0.0
|
12 |
+
* @extends WC_Email
|
13 |
+
* @author WooThemes
|
14 |
+
* @package WooCommerce/Classes/Emails
|
15 |
+
*/
|
16 |
+
|
17 |
+
|
18 |
+
class WC_Email_Notify_Admin extends WC_Email
|
19 |
+
{
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor
|
24 |
+
*/
|
25 |
+
function __construct()
|
26 |
+
{
|
27 |
+
$this->id = 'admin_new_vendor_product';
|
28 |
+
$this->title = __( 'New Vendor Product', 'wcvendors' );
|
29 |
+
$this->description = __( 'New order emails are sent when a new product is submitted by a vendor', 'wcvendors' );
|
30 |
+
|
31 |
+
$this->heading = __( 'New product submitted: {product_name}', 'wcvendors' );
|
32 |
+
$this->subject = __( '[{blogname}] New product submitted by {vendor_name} - {product_name}', 'wcvendors' );
|
33 |
+
|
34 |
+
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
|
35 |
+
$this->template_html = 'new-product.php';
|
36 |
+
$this->template_plain = 'new-product.php';
|
37 |
+
|
38 |
+
// Triggers for this email
|
39 |
+
add_action( 'transition_post_status', array( $this, 'trigger' ), 10, 3 );
|
40 |
+
|
41 |
+
// Call parent constuctor
|
42 |
+
parent::__construct();
|
43 |
+
|
44 |
+
// Other settings
|
45 |
+
$this->recipient = $this->get_option( 'recipient' );
|
46 |
+
|
47 |
+
if ( !$this->recipient )
|
48 |
+
$this->recipient = get_option( 'admin_email' );
|
49 |
+
}
|
50 |
+
|
51 |
+
|
52 |
+
/**
|
53 |
+
* trigger function.
|
54 |
+
*
|
55 |
+
* @access public
|
56 |
+
* @return void
|
57 |
+
*
|
58 |
+
* @param unknown $order_id
|
59 |
+
*/
|
60 |
+
function trigger( $post_id, $post )
|
61 |
+
{
|
62 |
+
if ( !WCV_Vendors::is_vendor( $post->post_author ) ) {
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
+
if ( !$this->is_enabled() ) return;
|
67 |
+
|
68 |
+
$this->find[ ] = '{product_name}';
|
69 |
+
$this->product_name = $post->post_title;
|
70 |
+
$this->replace[ ] = $this->product_name;
|
71 |
+
|
72 |
+
$this->find[ ] = '{vendor_name}';
|
73 |
+
$this->vendor_name = WCV_Vendors::get_vendor_shop_name( $post->post_author );
|
74 |
+
$this->replace[ ] = $this->vendor_name;
|
75 |
+
|
76 |
+
$this->post_id = $post->ID;
|
77 |
+
|
78 |
+
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* get_content_html function.
|
83 |
+
*
|
84 |
+
* @access public
|
85 |
+
* @return string
|
86 |
+
*/
|
87 |
+
function get_content_html()
|
88 |
+
{
|
89 |
+
ob_start();
|
90 |
+
wc_get_template( $this->template_html, array(
|
91 |
+
'product_name' => $this->product_name,
|
92 |
+
'vendor_name' => $this->vendor_name,
|
93 |
+
'post_id' => $this->post_id,
|
94 |
+
'email_heading' => $this->get_heading()
|
95 |
+
), 'woocommerce/', $this->template_base );
|
96 |
+
|
97 |
+
return ob_get_clean();
|
98 |
+
}
|
99 |
+
|
100 |
+
|
101 |
+
/**
|
102 |
+
* get_content_plain function.
|
103 |
+
*
|
104 |
+
* @access public
|
105 |
+
* @return string
|
106 |
+
*/
|
107 |
+
function get_content_plain()
|
108 |
+
{
|
109 |
+
ob_start();
|
110 |
+
wc_get_template( $this->template_plain, array(
|
111 |
+
'product_name' => $this->product_name,
|
112 |
+
'vendor_name' => $this->vendor_name,
|
113 |
+
'post_id' => $this->post_id,
|
114 |
+
'email_heading' => $this->get_heading()
|
115 |
+
), 'woocommerce/', $this->template_base );
|
116 |
+
|
117 |
+
return ob_get_clean();
|
118 |
+
}
|
119 |
+
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Initialise Settings Form Fields
|
123 |
+
*
|
124 |
+
* @access public
|
125 |
+
* @return void
|
126 |
+
*/
|
127 |
+
function init_form_fields()
|
128 |
+
{
|
129 |
+
$this->form_fields = array(
|
130 |
+
'enabled' => array(
|
131 |
+
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
132 |
+
'type' => 'checkbox',
|
133 |
+
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
134 |
+
'default' => 'yes'
|
135 |
+
),
|
136 |
+
'recipient' => array(
|
137 |
+
'title' => __( 'Recipient(s)', 'woocommerce' ),
|
138 |
+
'type' => 'text',
|
139 |
+
'description' => sprintf( __( 'Enter recipients (comma separated) for this email. Defaults to <code>%s</code>.', 'woocommerce' ), esc_attr( get_option( 'admin_email' ) ) ),
|
140 |
+
'placeholder' => '',
|
141 |
+
'default' => ''
|
142 |
+
),
|
143 |
+
'subject' => array(
|
144 |
+
'title' => __( 'Subject', 'wcvendors' ),
|
145 |
+
'type' => 'text',
|
146 |
+
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
147 |
+
'placeholder' => '',
|
148 |
+
'default' => ''
|
149 |
+
),
|
150 |
+
'heading' => array(
|
151 |
+
'title' => __( 'Email Heading', 'wcvendors' ),
|
152 |
+
'type' => 'text',
|
153 |
+
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
154 |
+
'placeholder' => '',
|
155 |
+
'default' => ''
|
156 |
+
),
|
157 |
+
'email_type' => array(
|
158 |
+
'title' => __( 'Email type', 'wcvendors' ),
|
159 |
+
'type' => 'select',
|
160 |
+
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
161 |
+
'default' => 'html',
|
162 |
+
'class' => 'email_type',
|
163 |
+
'options' => array(
|
164 |
+
'plain' => __( 'Plain text', 'wcvendors' ),
|
165 |
+
'html' => __( 'HTML', 'wcvendors' ),
|
166 |
+
'multipart' => __( 'Multipart', 'wcvendors' ),
|
167 |
+
)
|
168 |
+
)
|
169 |
+
);
|
170 |
+
}
|
171 |
+
|
172 |
+
|
173 |
+
}
|
{WCVendors/classes → classes}/admin/emails/class-wc-notify-shipped.php
RENAMED
@@ -1,198 +1,198 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
/**
|
6 |
-
* New Order Email
|
7 |
-
*
|
8 |
-
* An email sent to the admin when a new product is created.
|
9 |
-
*
|
10 |
-
* @class WC_Email_Notify_Shipped
|
11 |
-
* @version 2.0.0
|
12 |
-
* @extends WC_Email
|
13 |
-
* @author WooThemes
|
14 |
-
* @package WooCommerce/Classes/Emails
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
class WC_Email_Notify_Shipped extends WC_Email
|
19 |
-
{
|
20 |
-
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Constructor
|
24 |
-
*/
|
25 |
-
function __construct()
|
26 |
-
{
|
27 |
-
$this->id = 'vendor_notify_shipped';
|
28 |
-
$this->title = __( 'Vendor has shipped', 'wcvendors' );
|
29 |
-
$this->description = __( 'An email is sent when a vendor has marked one of their orders as shipped.', 'wcvendors' );
|
30 |
-
|
31 |
-
$this->heading = __( 'Your order has been shipped', 'wcvendors' );
|
32 |
-
$this->subject = __( '[{blogname}] Your order has been shipped ({order_number}) - {order_date}', 'wcvendors' );
|
33 |
-
|
34 |
-
$this->template_html = 'notify-vendor-shipped.php';
|
35 |
-
$this->template_plain = 'notify-vendor-shipped.php';
|
36 |
-
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/
|
37 |
-
|
38 |
-
// Call parent constuctor
|
39 |
-
parent::__construct();
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
/**
|
44 |
-
* trigger function.
|
45 |
-
*
|
46 |
-
* @access public
|
47 |
-
* @return void
|
48 |
-
*
|
49 |
-
* @param unknown $order_id
|
50 |
-
*/
|
51 |
-
function trigger( $order_id, $vendor_id )
|
52 |
-
{
|
53 |
-
$this->object = new WC_Order( $order_id );
|
54 |
-
$this->current_vendor = $vendor_id;
|
55 |
-
|
56 |
-
$this->find[ ] = '{order_date}';
|
57 |
-
$this->replace[ ] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
|
58 |
-
|
59 |
-
$this->find[ ] = '{order_number}';
|
60 |
-
$this->replace[ ] = $this->object->get_order_number();
|
61 |
-
|
62 |
-
if ( !$this->is_enabled() ) return;
|
63 |
-
|
64 |
-
add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
65 |
-
add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
66 |
-
$this->send( $this->object->billing_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
67 |
-
remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
68 |
-
remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
69 |
-
}
|
70 |
-
|
71 |
-
|
72 |
-
/**
|
73 |
-
*
|
74 |
-
*
|
75 |
-
* @param unknown $items
|
76 |
-
* @param unknown $order
|
77 |
-
*
|
78 |
-
* @return unknown
|
79 |
-
*/
|
80 |
-
public function check_items( $items, $order )
|
81 |
-
{
|
82 |
-
foreach ( $items as $key => $product ) {
|
83 |
-
|
84 |
-
if ( empty( $product[ 'product_id' ] ) ) {
|
85 |
-
unset( $items[ $key ] );
|
86 |
-
continue;
|
87 |
-
}
|
88 |
-
|
89 |
-
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
90 |
-
|
91 |
-
if ( $this->current_vendor != $author ) {
|
92 |
-
unset( $items[ $key ] );
|
93 |
-
continue;
|
94 |
-
}
|
95 |
-
|
96 |
-
}
|
97 |
-
|
98 |
-
return $items;
|
99 |
-
}
|
100 |
-
|
101 |
-
/**
|
102 |
-
*
|
103 |
-
*
|
104 |
-
* @param unknown $total_rows
|
105 |
-
* @param unknown $order
|
106 |
-
*
|
107 |
-
* @return unknown
|
108 |
-
*/
|
109 |
-
public function check_order_totals( $total_rows, $order )
|
110 |
-
{
|
111 |
-
$return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
|
112 |
-
$return[ 'cart_subtotal' ][ 'label' ] = __( 'Subtotal:', 'wcvendors' );
|
113 |
-
|
114 |
-
return $return;
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* get_content_html function.
|
119 |
-
*
|
120 |
-
* @access public
|
121 |
-
* @return string
|
122 |
-
*/
|
123 |
-
function get_content_html()
|
124 |
-
{
|
125 |
-
ob_start();
|
126 |
-
wc_get_template( $this->template_html, array(
|
127 |
-
'order' => $this->object,
|
128 |
-
'email_heading' => $this->get_heading()
|
129 |
-
), 'woocommerce/', $this->template_base );
|
130 |
-
|
131 |
-
return ob_get_clean();
|
132 |
-
}
|
133 |
-
|
134 |
-
|
135 |
-
/**
|
136 |
-
* get_content_plain function.
|
137 |
-
*
|
138 |
-
* @access public
|
139 |
-
* @return string
|
140 |
-
*/
|
141 |
-
function get_content_plain()
|
142 |
-
{
|
143 |
-
ob_start();
|
144 |
-
wc_get_template( $this->template_plain, array(
|
145 |
-
'order' => $this->object,
|
146 |
-
'email_heading' => $this->get_heading()
|
147 |
-
), 'woocommerce/', $this->template_base );
|
148 |
-
|
149 |
-
return ob_get_clean();
|
150 |
-
}
|
151 |
-
|
152 |
-
|
153 |
-
/**
|
154 |
-
* Initialise Settings Form Fields
|
155 |
-
*
|
156 |
-
* @access public
|
157 |
-
* @return void
|
158 |
-
*/
|
159 |
-
function init_form_fields()
|
160 |
-
{
|
161 |
-
$this->form_fields = array(
|
162 |
-
'enabled' => array(
|
163 |
-
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
164 |
-
'type' => 'checkbox',
|
165 |
-
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
166 |
-
'default' => 'yes'
|
167 |
-
),
|
168 |
-
'subject' => array(
|
169 |
-
'title' => __( 'Subject', 'wcvendors' ),
|
170 |
-
'type' => 'text',
|
171 |
-
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
172 |
-
'placeholder' => '',
|
173 |
-
'default' => ''
|
174 |
-
),
|
175 |
-
'heading' => array(
|
176 |
-
'title' => __( 'Email Heading', 'wcvendors' ),
|
177 |
-
'type' => 'text',
|
178 |
-
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
179 |
-
'placeholder' => '',
|
180 |
-
'default' => ''
|
181 |
-
),
|
182 |
-
'email_type' => array(
|
183 |
-
'title' => __( 'Email type', 'wcvendors' ),
|
184 |
-
'type' => 'select',
|
185 |
-
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
186 |
-
'default' => 'html',
|
187 |
-
'class' => 'email_type',
|
188 |
-
'options' => array(
|
189 |
-
'plain' => __( 'Plain text', 'wcvendors' ),
|
190 |
-
'html' => __( 'HTML', 'wcvendors' ),
|
191 |
-
'multipart' => __( 'Multipart', 'wcvendors' ),
|
192 |
-
)
|
193 |
-
)
|
194 |
-
);
|
195 |
-
}
|
196 |
-
|
197 |
-
|
198 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
+
|
5 |
+
/**
|
6 |
+
* New Order Email
|
7 |
+
*
|
8 |
+
* An email sent to the admin when a new product is created.
|
9 |
+
*
|
10 |
+
* @class WC_Email_Notify_Shipped
|
11 |
+
* @version 2.0.0
|
12 |
+
* @extends WC_Email
|
13 |
+
* @author WooThemes
|
14 |
+
* @package WooCommerce/Classes/Emails
|
15 |
+
*/
|
16 |
+
|
17 |
+
|
18 |
+
class WC_Email_Notify_Shipped extends WC_Email
|
19 |
+
{
|
20 |
+
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Constructor
|
24 |
+
*/
|
25 |
+
function __construct()
|
26 |
+
{
|
27 |
+
$this->id = 'vendor_notify_shipped';
|
28 |
+
$this->title = __( 'Vendor has shipped', 'wcvendors' );
|
29 |
+
$this->description = __( 'An email is sent when a vendor has marked one of their orders as shipped.', 'wcvendors' );
|
30 |
+
|
31 |
+
$this->heading = __( 'Your order has been shipped', 'wcvendors' );
|
32 |
+
$this->subject = __( '[{blogname}] Your order has been shipped ({order_number}) - {order_date}', 'wcvendors' );
|
33 |
+
|
34 |
+
$this->template_html = 'notify-vendor-shipped.php';
|
35 |
+
$this->template_plain = 'notify-vendor-shipped.php';
|
36 |
+
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
|
37 |
+
|
38 |
+
// Call parent constuctor
|
39 |
+
parent::__construct();
|
40 |
+
}
|
41 |
+
|
42 |
+
|
43 |
+
/**
|
44 |
+
* trigger function.
|
45 |
+
*
|
46 |
+
* @access public
|
47 |
+
* @return void
|
48 |
+
*
|
49 |
+
* @param unknown $order_id
|
50 |
+
*/
|
51 |
+
function trigger( $order_id, $vendor_id )
|
52 |
+
{
|
53 |
+
$this->object = new WC_Order( $order_id );
|
54 |
+
$this->current_vendor = $vendor_id;
|
55 |
+
|
56 |
+
$this->find[ ] = '{order_date}';
|
57 |
+
$this->replace[ ] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
|
58 |
+
|
59 |
+
$this->find[ ] = '{order_number}';
|
60 |
+
$this->replace[ ] = $this->object->get_order_number();
|
61 |
+
|
62 |
+
if ( !$this->is_enabled() ) return;
|
63 |
+
|
64 |
+
add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
65 |
+
add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
66 |
+
$this->send( $this->object->billing_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
67 |
+
remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
68 |
+
remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
69 |
+
}
|
70 |
+
|
71 |
+
|
72 |
+
/**
|
73 |
+
*
|
74 |
+
*
|
75 |
+
* @param unknown $items
|
76 |
+
* @param unknown $order
|
77 |
+
*
|
78 |
+
* @return unknown
|
79 |
+
*/
|
80 |
+
public function check_items( $items, $order )
|
81 |
+
{
|
82 |
+
foreach ( $items as $key => $product ) {
|
83 |
+
|
84 |
+
if ( empty( $product[ 'product_id' ] ) ) {
|
85 |
+
unset( $items[ $key ] );
|
86 |
+
continue;
|
87 |
+
}
|
88 |
+
|
89 |
+
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
90 |
+
|
91 |
+
if ( $this->current_vendor != $author ) {
|
92 |
+
unset( $items[ $key ] );
|
93 |
+
continue;
|
94 |
+
}
|
95 |
+
|
96 |
+
}
|
97 |
+
|
98 |
+
return $items;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
*
|
103 |
+
*
|
104 |
+
* @param unknown $total_rows
|
105 |
+
* @param unknown $order
|
106 |
+
*
|
107 |
+
* @return unknown
|
108 |
+
*/
|
109 |
+
public function check_order_totals( $total_rows, $order )
|
110 |
+
{
|
111 |
+
$return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
|
112 |
+
$return[ 'cart_subtotal' ][ 'label' ] = __( 'Subtotal:', 'wcvendors' );
|
113 |
+
|
114 |
+
return $return;
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* get_content_html function.
|
119 |
+
*
|
120 |
+
* @access public
|
121 |
+
* @return string
|
122 |
+
*/
|
123 |
+
function get_content_html()
|
124 |
+
{
|
125 |
+
ob_start();
|
126 |
+
wc_get_template( $this->template_html, array(
|
127 |
+
'order' => $this->object,
|
128 |
+
'email_heading' => $this->get_heading()
|
129 |
+
), 'woocommerce/', $this->template_base );
|
130 |
+
|
131 |
+
return ob_get_clean();
|
132 |
+
}
|
133 |
+
|
134 |
+
|
135 |
+
/**
|
136 |
+
* get_content_plain function.
|
137 |
+
*
|
138 |
+
* @access public
|
139 |
+
* @return string
|
140 |
+
*/
|
141 |
+
function get_content_plain()
|
142 |
+
{
|
143 |
+
ob_start();
|
144 |
+
wc_get_template( $this->template_plain, array(
|
145 |
+
'order' => $this->object,
|
146 |
+
'email_heading' => $this->get_heading()
|
147 |
+
), 'woocommerce/', $this->template_base );
|
148 |
+
|
149 |
+
return ob_get_clean();
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Initialise Settings Form Fields
|
155 |
+
*
|
156 |
+
* @access public
|
157 |
+
* @return void
|
158 |
+
*/
|
159 |
+
function init_form_fields()
|
160 |
+
{
|
161 |
+
$this->form_fields = array(
|
162 |
+
'enabled' => array(
|
163 |
+
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
164 |
+
'type' => 'checkbox',
|
165 |
+
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
166 |
+
'default' => 'yes'
|
167 |
+
),
|
168 |
+
'subject' => array(
|
169 |
+
'title' => __( 'Subject', 'wcvendors' ),
|
170 |
+
'type' => 'text',
|
171 |
+
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
172 |
+
'placeholder' => '',
|
173 |
+
'default' => ''
|
174 |
+
),
|
175 |
+
'heading' => array(
|
176 |
+
'title' => __( 'Email Heading', 'wcvendors' ),
|
177 |
+
'type' => 'text',
|
178 |
+
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
179 |
+
'placeholder' => '',
|
180 |
+
'default' => ''
|
181 |
+
),
|
182 |
+
'email_type' => array(
|
183 |
+
'title' => __( 'Email type', 'wcvendors' ),
|
184 |
+
'type' => 'select',
|
185 |
+
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
186 |
+
'default' => 'html',
|
187 |
+
'class' => 'email_type',
|
188 |
+
'options' => array(
|
189 |
+
'plain' => __( 'Plain text', 'wcvendors' ),
|
190 |
+
'html' => __( 'HTML', 'wcvendors' ),
|
191 |
+
'multipart' => __( 'Multipart', 'wcvendors' ),
|
192 |
+
)
|
193 |
+
)
|
194 |
+
);
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
}
|
{WCVendors/classes → classes}/admin/emails/class-wc-notify-vendor.php
RENAMED
@@ -1,265 +1,265 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
/**
|
6 |
-
* New Order Email
|
7 |
-
*
|
8 |
-
* An email sent to the admin when a new order is received/paid for.
|
9 |
-
*
|
10 |
-
* @class WC_Email_Notify_Vendor
|
11 |
-
* @version 2.0.0
|
12 |
-
* @extends WC_Email
|
13 |
-
* @author WooThemes
|
14 |
-
* @package WooCommerce/Classes/Emails
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
class WC_Email_Notify_Vendor extends WC_Email
|
19 |
-
{
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Constructor
|
23 |
-
*/
|
24 |
-
function __construct()
|
25 |
-
{
|
26 |
-
$this->id = 'vendor_new_order';
|
27 |
-
$this->title = __( 'Notify vendors', 'wcvendors' );
|
28 |
-
$this->description = __( 'New order emails are sent when an order is received/paid by a customer.', 'wcvendors' );
|
29 |
-
|
30 |
-
$this->heading = __( 'New customer order', 'wcvendors' );
|
31 |
-
$this->subject = __( '[{blogname}] New customer order ({order_number}) - {order_date}', 'wcvendors' );
|
32 |
-
|
33 |
-
$this->template_html = 'admin-new-order.php';
|
34 |
-
$this->template_plain = 'plain/admin-new-order.php';
|
35 |
-
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/
|
36 |
-
|
37 |
-
// Triggers for this email
|
38 |
-
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ) );
|
39 |
-
add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'trigger' ) );
|
40 |
-
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ) );
|
41 |
-
add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'trigger' ) );
|
42 |
-
|
43 |
-
$this->recipient = get_option( 'admin_email' );
|
44 |
-
|
45 |
-
// Call parent constuctor
|
46 |
-
parent::__construct();
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
/**
|
52 |
-
* trigger function.
|
53 |
-
*
|
54 |
-
* @access public
|
55 |
-
* @return void
|
56 |
-
*
|
57 |
-
* @param unknown $order_id
|
58 |
-
*/
|
59 |
-
function trigger( $order_id )
|
60 |
-
{
|
61 |
-
global $woocommerce;
|
62 |
-
|
63 |
-
if ( $order_id ) {
|
64 |
-
$this->object = new WC_Order( $order_id );
|
65 |
-
|
66 |
-
$this->find[ ] = '{order_date}';
|
67 |
-
$this->replace[ ] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
|
68 |
-
|
69 |
-
$this->find[ ] = '{order_number}';
|
70 |
-
$this->replace[ ] = $this->object->get_order_number();
|
71 |
-
|
72 |
-
}
|
73 |
-
|
74 |
-
if ( !$this->is_enabled() ) return;
|
75 |
-
|
76 |
-
$vendors = $this->get_vendors( $this->object );
|
77 |
-
|
78 |
-
if ( empty( $vendors ) ) return;
|
79 |
-
|
80 |
-
add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
81 |
-
add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
82 |
-
foreach ( $vendors as $user_id => $user_email ) {
|
83 |
-
$this->current_vendor = $user_id;
|
84 |
-
$this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
85 |
-
}
|
86 |
-
remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
87 |
-
remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
88 |
-
|
89 |
-
}
|
90 |
-
|
91 |
-
|
92 |
-
/**
|
93 |
-
*
|
94 |
-
*
|
95 |
-
* @param unknown $total_rows
|
96 |
-
* @param unknown $order
|
97 |
-
*
|
98 |
-
* @return unknown
|
99 |
-
*/
|
100 |
-
function check_order_totals( $total_rows, $order )
|
101 |
-
{
|
102 |
-
$return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
|
103 |
-
$return[ 'cart_subtotal' ][ 'label' ] = __( 'Commission Subtotal:', 'wcvendors' );
|
104 |
-
|
105 |
-
$dues = WCV_Vendors::get_vendor_dues_from_order( $order );
|
106 |
-
|
107 |
-
foreach ( $dues as $due ) {
|
108 |
-
if ( $this->current_vendor == $due['vendor_id'] ) {
|
109 |
-
if (!empty($return[ 'shipping' ])) $return[ 'shipping' ] = $total_rows[ 'shipping' ];
|
110 |
-
$return[ 'shipping' ]['label'] = __( 'Shipping Subtotal:', 'wcvendors' );
|
111 |
-
$return[ 'shipping' ][ 'value' ] = woocommerce_price( $due['shipping'] );
|
112 |
-
break;
|
113 |
-
}
|
114 |
-
}
|
115 |
-
|
116 |
-
return $return;
|
117 |
-
}
|
118 |
-
|
119 |
-
|
120 |
-
/**
|
121 |
-
*
|
122 |
-
*
|
123 |
-
* @param unknown $order
|
124 |
-
*
|
125 |
-
* @return unknown
|
126 |
-
*/
|
127 |
-
public function get_vendors( $order )
|
128 |
-
{
|
129 |
-
$items = $order->get_items();
|
130 |
-
|
131 |
-
foreach ( $items as $key => $product ) {
|
132 |
-
|
133 |
-
if ( empty( $product[ 'product_id' ] ) ) continue;
|
134 |
-
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
135 |
-
|
136 |
-
// Only store the vendor authors
|
137 |
-
if ( !WCV_Vendors::is_vendor( $author ) ) {
|
138 |
-
unset( $items[ $key ] );
|
139 |
-
continue;
|
140 |
-
}
|
141 |
-
|
142 |
-
$vendors[ $author ] = get_userdata( $author )->user_email;
|
143 |
-
}
|
144 |
-
|
145 |
-
return $vendors;
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
*
|
150 |
-
*
|
151 |
-
* @param unknown $items
|
152 |
-
* @param unknown $order
|
153 |
-
*
|
154 |
-
* @return unknown
|
155 |
-
*/
|
156 |
-
function check_items( $items, $order )
|
157 |
-
{
|
158 |
-
foreach ( $items as $key => $product ) {
|
159 |
-
|
160 |
-
// If this is a line item
|
161 |
-
if ($product['type'] == 'line_item') {
|
162 |
-
|
163 |
-
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
164 |
-
|
165 |
-
if ( $this->current_vendor != $author) {
|
166 |
-
unset( $items[ $key ] );
|
167 |
-
continue;
|
168 |
-
} else {
|
169 |
-
$commission_due = WCV_Commission::calculate_commission( $product[ 'line_subtotal' ], $product[ 'product_id' ], $order );
|
170 |
-
|
171 |
-
$items[ $key ][ 'line_subtotal' ] = $commission_due;
|
172 |
-
$items[ $key ][ 'line_total' ] = $commission_due;
|
173 |
-
unset( $items[ $key ][ 'line_tax' ] );
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
}
|
178 |
-
|
179 |
-
|
180 |
-
return $items;
|
181 |
-
}
|
182 |
-
|
183 |
-
|
184 |
-
/**
|
185 |
-
* get_content_html function.
|
186 |
-
*
|
187 |
-
* @access public
|
188 |
-
* @return string
|
189 |
-
*/
|
190 |
-
function get_content_html()
|
191 |
-
{
|
192 |
-
ob_start();
|
193 |
-
wc_get_template( $this->template_html, array(
|
194 |
-
'order' => $this->object,
|
195 |
-
'email_heading' => $this->get_heading()
|
196 |
-
), 'woocommerce/', $this->template_base );
|
197 |
-
|
198 |
-
return ob_get_clean();
|
199 |
-
}
|
200 |
-
|
201 |
-
|
202 |
-
/**
|
203 |
-
* get_content_plain function.
|
204 |
-
*
|
205 |
-
* @access public
|
206 |
-
* @return string
|
207 |
-
*/
|
208 |
-
function get_content_plain()
|
209 |
-
{
|
210 |
-
ob_start();
|
211 |
-
wc_get_template( $this->template_plain, array(
|
212 |
-
'order' => $this->object,
|
213 |
-
'email_heading' => $this->get_heading()
|
214 |
-
), 'woocommerce/', $this->template_base );
|
215 |
-
|
216 |
-
return ob_get_clean();
|
217 |
-
}
|
218 |
-
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Initialise Settings Form Fields
|
222 |
-
*
|
223 |
-
* @access public
|
224 |
-
* @return void
|
225 |
-
*/
|
226 |
-
function init_form_fields()
|
227 |
-
{
|
228 |
-
$this->form_fields = array(
|
229 |
-
'enabled' => array(
|
230 |
-
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
231 |
-
'type' => 'checkbox',
|
232 |
-
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
233 |
-
'default' => 'yes'
|
234 |
-
),
|
235 |
-
'subject' => array(
|
236 |
-
'title' => __( 'Subject', 'wcvendors' ),
|
237 |
-
'type' => 'text',
|
238 |
-
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
239 |
-
'placeholder' => '',
|
240 |
-
'default' => ''
|
241 |
-
),
|
242 |
-
'heading' => array(
|
243 |
-
'title' => __( 'Email Heading', 'wcvendors' ),
|
244 |
-
'type' => 'text',
|
245 |
-
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
246 |
-
'placeholder' => '',
|
247 |
-
'default' => ''
|
248 |
-
),
|
249 |
-
'email_type' => array(
|
250 |
-
'title' => __( 'Email type', 'wcvendors' ),
|
251 |
-
'type' => 'select',
|
252 |
-
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
253 |
-
'default' => 'html',
|
254 |
-
'class' => 'email_type',
|
255 |
-
'options' => array(
|
256 |
-
'plain' => __( 'Plain text', 'wcvendors' ),
|
257 |
-
'html' => __( 'HTML', 'wcvendors' ),
|
258 |
-
'multipart' => __( 'Multipart', 'wcvendors' ),
|
259 |
-
)
|
260 |
-
)
|
261 |
-
);
|
262 |
-
}
|
263 |
-
|
264 |
-
|
265 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( !defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
+
|
5 |
+
/**
|
6 |
+
* New Order Email
|
7 |
+
*
|
8 |
+
* An email sent to the admin when a new order is received/paid for.
|
9 |
+
*
|
10 |
+
* @class WC_Email_Notify_Vendor
|
11 |
+
* @version 2.0.0
|
12 |
+
* @extends WC_Email
|
13 |
+
* @author WooThemes
|
14 |
+
* @package WooCommerce/Classes/Emails
|
15 |
+
*/
|
16 |
+
|
17 |
+
|
18 |
+
class WC_Email_Notify_Vendor extends WC_Email
|
19 |
+
{
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Constructor
|
23 |
+
*/
|
24 |
+
function __construct()
|
25 |
+
{
|
26 |
+
$this->id = 'vendor_new_order';
|
27 |
+
$this->title = __( 'Notify vendors', 'wcvendors' );
|
28 |
+
$this->description = __( 'New order emails are sent when an order is received/paid by a customer.', 'wcvendors' );
|
29 |
+
|
30 |
+
$this->heading = __( 'New customer order', 'wcvendors' );
|
31 |
+
$this->subject = __( '[{blogname}] New customer order ({order_number}) - {order_date}', 'wcvendors' );
|
32 |
+
|
33 |
+
$this->template_html = 'admin-new-order.php';
|
34 |
+
$this->template_plain = 'plain/admin-new-order.php';
|
35 |
+
$this->template_base = dirname( dirname( dirname( dirname( __FILE__ ) ) ) ) . '/templates/emails/';
|
36 |
+
|
37 |
+
// Triggers for this email
|
38 |
+
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ) );
|
39 |
+
add_action( 'woocommerce_order_status_pending_to_completed_notification', array( $this, 'trigger' ) );
|
40 |
+
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( $this, 'trigger' ) );
|
41 |
+
add_action( 'woocommerce_order_status_failed_to_completed_notification', array( $this, 'trigger' ) );
|
42 |
+
|
43 |
+
$this->recipient = get_option( 'admin_email' );
|
44 |
+
|
45 |
+
// Call parent constuctor
|
46 |
+
parent::__construct();
|
47 |
+
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* trigger function.
|
53 |
+
*
|
54 |
+
* @access public
|
55 |
+
* @return void
|
56 |
+
*
|
57 |
+
* @param unknown $order_id
|
58 |
+
*/
|
59 |
+
function trigger( $order_id )
|
60 |
+
{
|
61 |
+
global $woocommerce;
|
62 |
+
|
63 |
+
if ( $order_id ) {
|
64 |
+
$this->object = new WC_Order( $order_id );
|
65 |
+
|
66 |
+
$this->find[ ] = '{order_date}';
|
67 |
+
$this->replace[ ] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
|
68 |
+
|
69 |
+
$this->find[ ] = '{order_number}';
|
70 |
+
$this->replace[ ] = $this->object->get_order_number();
|
71 |
+
|
72 |
+
}
|
73 |
+
|
74 |
+
if ( !$this->is_enabled() ) return;
|
75 |
+
|
76 |
+
$vendors = $this->get_vendors( $this->object );
|
77 |
+
|
78 |
+
if ( empty( $vendors ) ) return;
|
79 |
+
|
80 |
+
add_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
81 |
+
add_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
82 |
+
foreach ( $vendors as $user_id => $user_email ) {
|
83 |
+
$this->current_vendor = $user_id;
|
84 |
+
$this->send( $user_email, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
|
85 |
+
}
|
86 |
+
remove_filter( 'woocommerce_get_order_item_totals', array( $this, 'check_order_totals' ), 10, 2 );
|
87 |
+
remove_filter( 'woocommerce_order_get_items', array( $this, 'check_items' ), 10, 2 );
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
*
|
94 |
+
*
|
95 |
+
* @param unknown $total_rows
|
96 |
+
* @param unknown $order
|
97 |
+
*
|
98 |
+
* @return unknown
|
99 |
+
*/
|
100 |
+
function check_order_totals( $total_rows, $order )
|
101 |
+
{
|
102 |
+
$return[ 'cart_subtotal' ] = $total_rows[ 'cart_subtotal' ];
|
103 |
+
$return[ 'cart_subtotal' ][ 'label' ] = __( 'Commission Subtotal:', 'wcvendors' );
|
104 |
+
|
105 |
+
$dues = WCV_Vendors::get_vendor_dues_from_order( $order );
|
106 |
+
|
107 |
+
foreach ( $dues as $due ) {
|
108 |
+
if ( $this->current_vendor == $due['vendor_id'] ) {
|
109 |
+
if (!empty($return[ 'shipping' ])) $return[ 'shipping' ] = $total_rows[ 'shipping' ];
|
110 |
+
$return[ 'shipping' ]['label'] = __( 'Shipping Subtotal:', 'wcvendors' );
|
111 |
+
$return[ 'shipping' ][ 'value' ] = woocommerce_price( $due['shipping'] );
|
112 |
+
break;
|
113 |
+
}
|
114 |
+
}
|
115 |
+
|
116 |
+
return $return;
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
/**
|
121 |
+
*
|
122 |
+
*
|
123 |
+
* @param unknown $order
|
124 |
+
*
|
125 |
+
* @return unknown
|
126 |
+
*/
|
127 |
+
public function get_vendors( $order )
|
128 |
+
{
|
129 |
+
$items = $order->get_items();
|
130 |
+
|
131 |
+
foreach ( $items as $key => $product ) {
|
132 |
+
|
133 |
+
if ( empty( $product[ 'product_id' ] ) ) continue;
|
134 |
+
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
135 |
+
|
136 |
+
// Only store the vendor authors
|
137 |
+
if ( !WCV_Vendors::is_vendor( $author ) ) {
|
138 |
+
unset( $items[ $key ] );
|
139 |
+
continue;
|
140 |
+
}
|
141 |
+
|
142 |
+
$vendors[ $author ] = get_userdata( $author )->user_email;
|
143 |
+
}
|
144 |
+
|
145 |
+
return $vendors;
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
*
|
150 |
+
*
|
151 |
+
* @param unknown $items
|
152 |
+
* @param unknown $order
|
153 |
+
*
|
154 |
+
* @return unknown
|
155 |
+
*/
|
156 |
+
function check_items( $items, $order )
|
157 |
+
{
|
158 |
+
foreach ( $items as $key => $product ) {
|
159 |
+
|
160 |
+
// If this is a line item
|
161 |
+
if ($product['type'] == 'line_item') {
|
162 |
+
|
163 |
+
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
164 |
+
|
165 |
+
if ( $this->current_vendor != $author) {
|
166 |
+
unset( $items[ $key ] );
|
167 |
+
continue;
|
168 |
+
} else {
|
169 |
+
$commission_due = WCV_Commission::calculate_commission( $product[ 'line_subtotal' ], $product[ 'product_id' ], $order );
|
170 |
+
|
171 |
+
$items[ $key ][ 'line_subtotal' ] = $commission_due;
|
172 |
+
$items[ $key ][ 'line_total' ] = $commission_due;
|
173 |
+
unset( $items[ $key ][ 'line_tax' ] );
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
}
|
178 |
+
|
179 |
+
|
180 |
+
return $items;
|
181 |
+
}
|
182 |
+
|
183 |
+
|
184 |
+
/**
|
185 |
+
* get_content_html function.
|
186 |
+
*
|
187 |
+
* @access public
|
188 |
+
* @return string
|
189 |
+
*/
|
190 |
+
function get_content_html()
|
191 |
+
{
|
192 |
+
ob_start();
|
193 |
+
wc_get_template( $this->template_html, array(
|
194 |
+
'order' => $this->object,
|
195 |
+
'email_heading' => $this->get_heading()
|
196 |
+
), 'woocommerce/', $this->template_base );
|
197 |
+
|
198 |
+
return ob_get_clean();
|
199 |
+
}
|
200 |
+
|
201 |
+
|
202 |
+
/**
|
203 |
+
* get_content_plain function.
|
204 |
+
*
|
205 |
+
* @access public
|
206 |
+
* @return string
|
207 |
+
*/
|
208 |
+
function get_content_plain()
|
209 |
+
{
|
210 |
+
ob_start();
|
211 |
+
wc_get_template( $this->template_plain, array(
|
212 |
+
'order' => $this->object,
|
213 |
+
'email_heading' => $this->get_heading()
|
214 |
+
), 'woocommerce/', $this->template_base );
|
215 |
+
|
216 |
+
return ob_get_clean();
|
217 |
+
}
|
218 |
+
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Initialise Settings Form Fields
|
222 |
+
*
|
223 |
+
* @access public
|
224 |
+
* @return void
|
225 |
+
*/
|
226 |
+
function init_form_fields()
|
227 |
+
{
|
228 |
+
$this->form_fields = array(
|
229 |
+
'enabled' => array(
|
230 |
+
'title' => __( 'Enable/Disable', 'wcvendors' ),
|
231 |
+
'type' => 'checkbox',
|
232 |
+
'label' => __( 'Enable this email notification', 'wcvendors' ),
|
233 |
+
'default' => 'yes'
|
234 |
+
),
|
235 |
+
'subject' => array(
|
236 |
+
'title' => __( 'Subject', 'wcvendors' ),
|
237 |
+
'type' => 'text',
|
238 |
+
'description' => sprintf( __( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', 'wcvendors' ), $this->subject ),
|
239 |
+
'placeholder' => '',
|
240 |
+
'default' => ''
|
241 |
+
),
|
242 |
+
'heading' => array(
|
243 |
+
'title' => __( 'Email Heading', 'wcvendors' ),
|
244 |
+
'type' => 'text',
|
245 |
+
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.', 'wcvendors' ), $this->heading ),
|
246 |
+
'placeholder' => '',
|
247 |
+
'default' => ''
|
248 |
+
),
|
249 |
+
'email_type' => array(
|
250 |
+
'title' => __( 'Email type', 'wcvendors' ),
|
251 |
+
'type' => 'select',
|
252 |
+
'description' => __( 'Choose which format of email to send.', 'wcvendors' ),
|
253 |
+
'default' => 'html',
|
254 |
+
'class' => 'email_type',
|
255 |
+
'options' => array(
|
256 |
+
'plain' => __( 'Plain text', 'wcvendors' ),
|
257 |
+
'html' => __( 'HTML', 'wcvendors' ),
|
258 |
+
'multipart' => __( 'Multipart', 'wcvendors' ),
|
259 |
+
)
|
260 |
+
)
|
261 |
+
);
|
262 |
+
}
|
263 |
+
|
264 |
+
|
265 |
+
}
|
{WCVendors/classes → classes}/admin/settings/README.md
RENAMED
@@ -1,126 +1,126 @@
|
|
1 |
-
WP Simple Settings Framework
|
2 |
-
================================
|
3 |
-
|
4 |
-
A minimalistic framework for Wordpress Settings API.
|
5 |
-
|
6 |
-
Quick start
|
7 |
-
------------
|
8 |
-
|
9 |
-
* [Download the latest release](https://github.com/Geczy/WP-Simple-Settings-Framework/zipball/master) (zip)
|
10 |
-
|
11 |
-
* Or, clone the repo, `git clone git://github.com/Geczy/WP-Simple-Settings-Framework.git`
|
12 |
-
|
13 |
-
Installation
|
14 |
-
------------
|
15 |
-
1. Include the framework in your Wordpress plugin by using:
|
16 |
-
|
17 |
-
```php
|
18 |
-
<?php
|
19 |
-
add_action( 'init', 'sf_load_settings' );
|
20 |
-
function sf_load_settings() {
|
21 |
-
require 'classes/sf-class-settings.php';
|
22 |
-
$settings_framework = new SF_Settings_API($id = 'my_plugin_name', $title = 'My Plugin Title', $menu = 'plugins.php', __FILE__);
|
23 |
-
}
|
24 |
-
```
|
25 |
-
|
26 |
-
Optionally, you might want to make `$settings_framework` a global variable so that you can use the [helper functions](#helpers).
|
27 |
-
|
28 |
-
2. Open `sf-options.php` to begin configuring your options.
|
29 |
-
|
30 |
-
Features
|
31 |
-
------------
|
32 |
-
|
33 |
-
### Automatic settings page
|
34 |
-
Don't want it under the Plugins tab like in the screenshot? No problem, you can choose where you want it!
|
35 |
-
|
36 |
-
You can also change "Simple Settings" submenu to be anything you'd like.
|
37 |
-
|
38 |
-
![settings page example](http://i.imgur.com/aEGUD.png)
|
39 |
-
|
40 |
-
---
|
41 |
-
|
42 |
-
### Tooltips
|
43 |
-
![tooltips example](http://i.imgur.com/Z3Pnk.png)
|
44 |
-
|
45 |
-
Optional tooltips using [Twitter Bootstrap](http://twitter.github.com/bootstrap/javascript.html#tooltips)!
|
46 |
-
|
47 |
-
---
|
48 |
-
|
49 |
-
### Select box replacement
|
50 |
-
![select box replacement](http://i.imgur.com/ikOXH.png)
|
51 |
-
|
52 |
-
Utilizing [Select2](http://ivaynberg.github.com/select2/) to display select boxes. It's pretty cool!
|
53 |
-
|
54 |
-
---
|
55 |
-
|
56 |
-
### Multiple tabs
|
57 |
-
![multiple tabs example](http://i.imgur.com/OUM4i.png)
|
58 |
-
|
59 |
-
Create multiple tabs for your options.
|
60 |
-
|
61 |
-
---
|
62 |
-
|
63 |
-
### Input types
|
64 |
-
|
65 |
-
* Text
|
66 |
-
* Number
|
67 |
-
* Textarea
|
68 |
-
* Checkbox
|
69 |
-
* Radio
|
70 |
-
* Select
|
71 |
-
* WP Pages
|
72 |
-
|
73 |
-
Helpers
|
74 |
-
------------
|
75 |
-
|
76 |
-
Update or add a new option
|
77 |
-
|
78 |
-
```php
|
79 |
-
<?php
|
80 |
-
$settings_framework->update_option('your_option', 'new_value');
|
81 |
-
```
|
82 |
-
|
83 |
-
Get an existing option's value
|
84 |
-
|
85 |
-
```php
|
86 |
-
<?php
|
87 |
-
$settings_framework->get_option('your_option');
|
88 |
-
```
|
89 |
-
|
90 |
-
Example configuration
|
91 |
-
------------
|
92 |
-
|
93 |
-
Check out the [example config](https://github.com/Geczy/WP-Simple-Settings-Framework/blob/master/sf-options.php) for an idea of how to use every input type.
|
94 |
-
|
95 |
-
Here's an example of one type, though:
|
96 |
-
|
97 |
-
```php
|
98 |
-
<?php
|
99 |
-
$options[] = array(
|
100 |
-
'name' => __( 'Name', 'geczy' ),
|
101 |
-
'desc' => __( 'Please tell me who you are.', 'geczy' ),
|
102 |
-
'id' => 'text_sample',
|
103 |
-
'type' => 'text',
|
104 |
-
);
|
105 |
-
```
|
106 |
-
|
107 |
-
|
108 |
-
Bug tracker
|
109 |
-
-----------
|
110 |
-
|
111 |
-
Have a bug? Please create an issue here on GitHub!
|
112 |
-
|
113 |
-
https://github.com/Geczy/WP-Simple-Settings-Framework/issues/
|
114 |
-
|
115 |
-
Copyright and License
|
116 |
-
---------------------
|
117 |
-
|
118 |
-
Copyright 2012 Matthew Gates
|
119 |
-
|
120 |
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
121 |
-
|
122 |
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
123 |
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
124 |
-
* Neither the names of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
125 |
-
|
126 |
-
http://www.opensource.org/licenses/bsd-license.php
|
1 |
+
WP Simple Settings Framework
|
2 |
+
================================
|
3 |
+
|
4 |
+
A minimalistic framework for Wordpress Settings API.
|
5 |
+
|
6 |
+
Quick start
|
7 |
+
------------
|
8 |
+
|
9 |
+
* [Download the latest release](https://github.com/Geczy/WP-Simple-Settings-Framework/zipball/master) (zip)
|
10 |
+
|
11 |
+
* Or, clone the repo, `git clone git://github.com/Geczy/WP-Simple-Settings-Framework.git`
|
12 |
+
|
13 |
+
Installation
|
14 |
+
------------
|
15 |
+
1. Include the framework in your Wordpress plugin by using:
|
16 |
+
|
17 |
+
```php
|
18 |
+
<?php
|
19 |
+
add_action( 'init', 'sf_load_settings' );
|
20 |
+
function sf_load_settings() {
|
21 |
+
require 'classes/sf-class-settings.php';
|
22 |
+
$settings_framework = new SF_Settings_API($id = 'my_plugin_name', $title = 'My Plugin Title', $menu = 'plugins.php', __FILE__);
|
23 |
+
}
|
24 |
+
```
|
25 |
+
|
26 |
+
Optionally, you might want to make `$settings_framework` a global variable so that you can use the [helper functions](#helpers).
|
27 |
+
|
28 |
+
2. Open `sf-options.php` to begin configuring your options.
|
29 |
+
|
30 |
+
Features
|
31 |
+
------------
|
32 |
+
|
33 |
+
### Automatic settings page
|
34 |
+
Don't want it under the Plugins tab like in the screenshot? No problem, you can choose where you want it!
|
35 |
+
|
36 |
+
You can also change "Simple Settings" submenu to be anything you'd like.
|
37 |
+
|
38 |
+
![settings page example](http://i.imgur.com/aEGUD.png)
|
39 |
+
|
40 |
+
---
|
41 |
+
|
42 |
+
### Tooltips
|
43 |
+
![tooltips example](http://i.imgur.com/Z3Pnk.png)
|
44 |
+
|
45 |
+
Optional tooltips using [Twitter Bootstrap](http://twitter.github.com/bootstrap/javascript.html#tooltips)!
|
46 |
+
|
47 |
+
---
|
48 |
+
|
49 |
+
### Select box replacement
|
50 |
+
![select box replacement](http://i.imgur.com/ikOXH.png)
|
51 |
+
|
52 |
+
Utilizing [Select2](http://ivaynberg.github.com/select2/) to display select boxes. It's pretty cool!
|
53 |
+
|
54 |
+
---
|
55 |
+
|
56 |
+
### Multiple tabs
|
57 |
+
![multiple tabs example](http://i.imgur.com/OUM4i.png)
|
58 |
+
|
59 |
+
Create multiple tabs for your options.
|
60 |
+
|
61 |
+
---
|
62 |
+
|
63 |
+
### Input types
|
64 |
+
|
65 |
+
* Text
|
66 |
+
* Number
|
67 |
+
* Textarea
|
68 |
+
* Checkbox
|
69 |
+
* Radio
|
70 |
+
* Select
|
71 |
+
* WP Pages
|
72 |
+
|
73 |
+
Helpers
|
74 |
+
------------
|
75 |
+
|
76 |
+
Update or add a new option
|
77 |
+
|
78 |
+
```php
|
79 |
+
<?php
|
80 |
+
$settings_framework->update_option('your_option', 'new_value');
|
81 |
+
```
|
82 |
+
|
83 |
+
Get an existing option's value
|
84 |
+
|
85 |
+
```php
|
86 |
+
<?php
|
87 |
+
$settings_framework->get_option('your_option');
|
88 |
+
```
|
89 |
+
|
90 |
+
Example configuration
|
91 |
+
------------
|
92 |
+
|
93 |
+
Check out the [example config](https://github.com/Geczy/WP-Simple-Settings-Framework/blob/master/sf-options.php) for an idea of how to use every input type.
|
94 |
+
|
95 |
+
Here's an example of one type, though:
|
96 |
+
|
97 |
+
```php
|
98 |
+
<?php
|
99 |
+
$options[] = array(
|
100 |
+
'name' => __( 'Name', 'geczy' ),
|
101 |
+
'desc' => __( 'Please tell me who you are.', 'geczy' ),
|
102 |
+
'id' => 'text_sample',
|
103 |
+
'type' => 'text',
|
104 |
+
);
|
105 |
+
```
|
106 |
+
|
107 |
+
|
108 |
+
Bug tracker
|
109 |
+
-----------
|
110 |
+
|
111 |
+
Have a bug? Please create an issue here on GitHub!
|
112 |
+
|
113 |
+
https://github.com/Geczy/WP-Simple-Settings-Framework/issues/
|
114 |
+
|
115 |
+
Copyright and License
|
116 |
+
---------------------
|
117 |
+
|
118 |
+
Copyright 2012 Matthew Gates
|
119 |
+
|
120 |
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
121 |
+
|
122 |
+
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
123 |
+
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
124 |
+
* Neither the names of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
125 |
+
|
126 |
+
http://www.opensource.org/licenses/bsd-license.php
|
{WCVendors/classes → classes}/admin/settings/assets/css/sf-styles.css
RENAMED
@@ -1,167 +1,167 @@
|
|
1 |
-
a.sf-tips {
|
2 |
-
height: 16px;
|
3 |
-
width: 16px;
|
4 |
-
margin-top: 0.2em;
|
5 |
-
float: right;
|
6 |
-
background: url(../img/tip.png) no-repeat top left;
|
7 |
-
}
|
8 |
-
|
9 |
-
/*!
|
10 |
-
* Bootstrap v2.3.1 [Styles for Tooltips]
|
11 |
-
*
|
12 |
-
* Copyright 2012 Twitter, Inc
|
13 |
-
* Licensed under the Apache License v2.0
|
14 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
15 |
-
*
|
16 |
-
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
17 |
-
*/
|
18 |
-
.clearfix {
|
19 |
-
*zoom: 1;
|
20 |
-
}
|
21 |
-
|
22 |
-
.clearfix:before, .clearfix:after {
|
23 |
-
display: table;
|
24 |
-
content: "";
|
25 |
-
line-height: 0;
|
26 |
-
}
|
27 |
-
|
28 |
-
.clearfix:after {
|
29 |
-
clear: both;
|
30 |
-
}
|
31 |
-
|
32 |
-
.hide-text {
|
33 |
-
font: 0/0 a;
|
34 |
-
color: transparent;
|
35 |
-
text-shadow: none;
|
36 |
-
background-color: transparent;
|
37 |
-
border: 0;
|
38 |
-
}
|
39 |
-
|
40 |
-
.input-block-level {
|
41 |
-
display: block;
|
42 |
-
width: 100%;
|
43 |
-
min-height: 30px;
|
44 |
-
-webkit-box-sizing: border-box;
|
45 |
-
-moz-box-sizing: border-box;
|
46 |
-
box-sizing: border-box;
|
47 |
-
}
|
48 |
-
|
49 |
-
/* Tooltips */
|
50 |
-
.tooltip {
|
51 |
-
text-shadow: none;
|
52 |
-
}
|
53 |
-
|
54 |
-
.tooltip {
|
55 |
-
position: absolute;
|
56 |
-
z-index: 1030;
|
57 |
-
display: block;
|
58 |
-
visibility: visible;
|
59 |
-
font-size: 11px;
|
60 |
-
line-height: 1.4;
|
61 |
-
opacity: 0;
|
62 |
-
filter: alpha(opacity=0);
|
63 |
-
}
|
64 |
-
|
65 |
-
.tooltip.in {
|
66 |
-
opacity: 0.8;
|
67 |
-
filter: alpha(opacity=80);
|
68 |
-
}
|
69 |
-
|
70 |
-
.tooltip.top {
|
71 |
-
margin-top: -3px;
|
72 |
-
padding: 5px 0;
|
73 |
-
}
|
74 |
-
|
75 |
-
.tooltip.right {
|
76 |
-
margin-left: 3px;
|
77 |
-
padding: 0 5px;
|
78 |
-
}
|
79 |
-
|
80 |
-
.tooltip.bottom {
|
81 |
-
margin-top: 3px;
|
82 |
-
padding: 5px 0;
|
83 |
-
}
|
84 |
-
|
85 |
-
.tooltip.left {
|
86 |
-
margin-left: -3px;
|
87 |
-
padding: 0 5px;
|
88 |
-
}
|
89 |
-
|
90 |
-
.tooltip-inner {
|
91 |
-
max-width: 200px;
|
92 |
-
padding: 8px;
|
93 |
-
color: #ffffff;
|
94 |
-
text-align: center;
|
95 |
-
text-decoration: none;
|
96 |
-
background-color: #000000;
|
97 |
-
-webkit-border-radius: 4px;
|
98 |
-
-moz-border-radius: 4px;
|
99 |
-
border-radius: 4px;
|
100 |
-
}
|
101 |
-
|
102 |
-
.tooltip-arrow {
|
103 |
-
position: absolute;
|
104 |
-
width: 0;
|
105 |
-
height: 0;
|
106 |
-
border-color: transparent;
|
107 |
-
border-style: solid;
|
108 |
-
}
|
109 |
-
|
110 |
-
.tooltip.top .tooltip-arrow {
|
111 |
-
bottom: 0;
|
112 |
-
left: 50%;
|
113 |
-
margin-left: -5px;
|
114 |
-
border-width: 5px 5px 0;
|
115 |
-
border-top-color: #000000;
|
116 |
-
}
|
117 |
-
|
118 |
-
.tooltip.right .tooltip-arrow {
|
119 |
-
top: 50%;
|
120 |
-
left: 0;
|
121 |
-
margin-top: -5px;
|
122 |
-
border-width: 5px 5px 5px 0;
|
123 |
-
border-right-color: #000000;
|
124 |
-
}
|
125 |
-
|
126 |
-
.tooltip.left .tooltip-arrow {
|
127 |
-
top: 50%;
|
128 |
-
right: 0;
|
129 |
-
margin-top: -5px;
|
130 |
-
border-width: 5px 0 5px 5px;
|
131 |
-
border-left-color: #000000;
|
132 |
-
}
|
133 |
-
|
134 |
-
.tooltip.bottom .tooltip-arrow {
|
135 |
-
top: 0;
|
136 |
-
left: 50%;
|
137 |
-
margin-left: -5px;
|
138 |
-
border-width: 0 5px 5px;
|
139 |
-
border-bottom-color: #000000;
|
140 |
-
}
|
141 |
-
|
142 |
-
/* Animation */
|
143 |
-
.fade {
|
144 |
-
opacity: 0;
|
145 |
-
-webkit-transition: opacity 0.15s linear;
|
146 |
-
-moz-transition: opacity 0.15s linear;
|
147 |
-
-o-transition: opacity 0.15s linear;
|
148 |
-
transition: opacity 0.15s linear;
|
149 |
-
}
|
150 |
-
|
151 |
-
.fade.in {
|
152 |
-
opacity: 1;
|
153 |
-
}
|
154 |
-
|
155 |
-
.collapse {
|
156 |
-
position: relative;
|
157 |
-
height: 0;
|
158 |
-
overflow: hidden;
|
159 |
-
-webkit-transition: height 0.35s ease;
|
160 |
-
-moz-transition: height 0.35s ease;
|
161 |
-
-o-transition: height 0.35s ease;
|
162 |
-
transition: height 0.35s ease;
|
163 |
-
}
|
164 |
-
|
165 |
-
.collapse.in {
|
166 |
-
height: auto;
|
167 |
-
}
|
1 |
+
a.sf-tips {
|
2 |
+
height: 16px;
|
3 |
+
width: 16px;
|
4 |
+
margin-top: 0.2em;
|
5 |
+
float: right;
|
6 |
+
background: url(../img/tip.png) no-repeat top left;
|
7 |
+
}
|
8 |
+
|
9 |
+
/*!
|
10 |
+
* Bootstrap v2.3.1 [Styles for Tooltips]
|
11 |
+
*
|
12 |
+
* Copyright 2012 Twitter, Inc
|
13 |
+
* Licensed under the Apache License v2.0
|
14 |
+
* http://www.apache.org/licenses/LICENSE-2.0
|
15 |
+
*
|
16 |
+
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
17 |
+
*/
|
18 |
+
.clearfix {
|
19 |
+
*zoom: 1;
|
20 |
+
}
|
21 |
+
|
22 |
+
.clearfix:before, .clearfix:after {
|
23 |
+
display: table;
|
24 |
+
content: "";
|
25 |
+
line-height: 0;
|
26 |
+
}
|
27 |
+
|
28 |
+
.clearfix:after {
|
29 |
+
clear: both;
|
30 |
+
}
|
31 |
+
|
32 |
+
.hide-text {
|
33 |
+
font: 0/0 a;
|
34 |
+
color: transparent;
|
35 |
+
text-shadow: none;
|
36 |
+
background-color: transparent;
|
37 |
+
border: 0;
|
38 |
+
}
|
39 |
+
|
40 |
+
.input-block-level {
|
41 |
+
display: block;
|
42 |
+
width: 100%;
|
43 |
+
min-height: 30px;
|
44 |
+
-webkit-box-sizing: border-box;
|
45 |
+
-moz-box-sizing: border-box;
|
46 |
+
box-sizing: border-box;
|
47 |
+
}
|
48 |
+
|
49 |
+
/* Tooltips */
|
50 |
+
.tooltip {
|
51 |
+
text-shadow: none;
|
52 |
+
}
|
53 |
+
|
54 |
+
.tooltip {
|
55 |
+
position: absolute;
|
56 |
+
z-index: 1030;
|
57 |
+
display: block;
|
58 |
+
visibility: visible;
|
59 |
+
font-size: 11px;
|
60 |
+
line-height: 1.4;
|
61 |
+
opacity: 0;
|
62 |
+
filter: alpha(opacity=0);
|
63 |
+
}
|
64 |
+
|
65 |
+
.tooltip.in {
|
66 |
+
opacity: 0.8;
|
67 |
+
filter: alpha(opacity=80);
|
68 |
+
}
|
69 |
+
|
70 |
+
.tooltip.top {
|
71 |
+
margin-top: -3px;
|
72 |
+
padding: 5px 0;
|
73 |
+
}
|
74 |
+
|
75 |
+
.tooltip.right {
|
76 |
+
margin-left: 3px;
|
77 |
+
padding: 0 5px;
|
78 |
+
}
|
79 |
+
|
80 |
+
.tooltip.bottom {
|
81 |
+
margin-top: 3px;
|
82 |
+
padding: 5px 0;
|
83 |
+
}
|
84 |
+
|
85 |
+
.tooltip.left {
|
86 |
+
margin-left: -3px;
|
87 |
+
padding: 0 5px;
|
88 |
+
}
|
89 |
+
|
90 |
+
.tooltip-inner {
|
91 |
+
max-width: 200px;
|
92 |
+
padding: 8px;
|
93 |
+
color: #ffffff;
|
94 |
+
text-align: center;
|
95 |
+
text-decoration: none;
|
96 |
+
background-color: #000000;
|
97 |
+
-webkit-border-radius: 4px;
|
98 |
+
-moz-border-radius: 4px;
|
99 |
+
border-radius: 4px;
|
100 |
+
}
|
101 |
+
|
102 |
+
.tooltip-arrow {
|
103 |
+
position: absolute;
|
104 |
+
width: 0;
|
105 |
+
height: 0;
|
106 |
+
border-color: transparent;
|
107 |
+
border-style: solid;
|
108 |
+
}
|
109 |
+
|
110 |
+
.tooltip.top .tooltip-arrow {
|
111 |
+
bottom: 0;
|
112 |
+
left: 50%;
|
113 |
+
margin-left: -5px;
|
114 |
+
border-width: 5px 5px 0;
|
115 |
+
border-top-color: #000000;
|
116 |
+
}
|
117 |
+
|
118 |
+
.tooltip.right .tooltip-arrow {
|
119 |
+
top: 50%;
|
120 |
+
left: 0;
|
121 |
+
margin-top: -5px;
|
122 |
+
border-width: 5px 5px 5px 0;
|
123 |
+
border-right-color: #000000;
|
124 |
+
}
|
125 |
+
|
126 |
+
.tooltip.left .tooltip-arrow {
|
127 |
+
top: 50%;
|
128 |
+
right: 0;
|
129 |
+
margin-top: -5px;
|
130 |
+
border-width: 5px 0 5px 5px;
|
131 |
+
border-left-color: #000000;
|
132 |
+
}
|
133 |
+
|
134 |
+
.tooltip.bottom .tooltip-arrow {
|
135 |
+
top: 0;
|
136 |
+
left: 50%;
|
137 |
+
margin-left: -5px;
|
138 |
+
border-width: 0 5px 5px;
|
139 |
+
border-bottom-color: #000000;
|
140 |
+
}
|
141 |
+
|
142 |
+
/* Animation */
|
143 |
+
.fade {
|
144 |
+
opacity: 0;
|
145 |
+
-webkit-transition: opacity 0.15s linear;
|
146 |
+
-moz-transition: opacity 0.15s linear;
|
147 |
+
-o-transition: opacity 0.15s linear;
|
148 |
+
transition: opacity 0.15s linear;
|
149 |
+
}
|
150 |
+
|
151 |
+
.fade.in {
|
152 |
+
opacity: 1;
|
153 |
+
}
|
154 |
+
|
155 |
+
.collapse {
|
156 |
+
position: relative;
|
157 |
+
height: 0;
|
158 |
+
overflow: hidden;
|
159 |
+
-webkit-transition: height 0.35s ease;
|
160 |
+
-moz-transition: height 0.35s ease;
|
161 |
+
-o-transition: height 0.35s ease;
|
162 |
+
transition: height 0.35s ease;
|
163 |
+
}
|
164 |
+
|
165 |
+
.collapse.in {
|
166 |
+
height: auto;
|
167 |
+
}
|
{WCVendors/classes → classes}/admin/settings/assets/img/tip.png
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/bootstrap-tooltip.js
RENAMED
@@ -1,126 +1,126 @@
|
|
1 |
-
/**
|
2 |
-
* Bootstrap.js by @fat & @mdo
|
3 |
-
* plugins: bootstrap-transition.js, bootstrap-tooltip.js
|
4 |
-
* 2.3.1
|
5 |
-
* Copyright 2012 Twitter, Inc.
|
6 |
-
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
7 |
-
*/
|
8 |
-
!function (a) {
|
9 |
-
a(function () {
|
10 |
-
a.support.transition = function () {
|
11 |
-
var a = function () {
|
12 |
-
var a = document.createElement("bootstrap"), b = {WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend"}, c;
|
13 |
-
for (c in b)if (a.style[c] !== undefined)return b[c]
|
14 |
-
}();
|
15 |
-
return a && {end: a}
|
16 |
-
}()
|
17 |
-
})
|
18 |
-
}(window.jQuery), !function (a) {
|
19 |
-
var b = function (a, b) {
|
20 |
-
this.init("tooltip", a, b)
|
21 |
-
};
|
22 |
-
b.prototype = {constructor: b, init: function (b, c, d) {
|
23 |
-
var e, f, g, h, i;
|
24 |
-
this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.enabled = !0, g = this.options.trigger.split(" ");
|
25 |
-
for (i = g.length; i--;)h = g[i], h == "click" ? this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)) : h != "manual" && (e = h == "hover" ? "mouseenter" : "focus", f = h == "hover" ? "mouseleave" : "blur", this.$element.on(e + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(f + "." + this.type, this.options.selector, a.proxy(this.leave, this)));
|
26 |
-
this.options.selector ? this._options = a.extend({}, this.options, {trigger: "manual", selector: ""}) : this.fixTitle()
|
27 |
-
}, getOptions: function (b) {
|
28 |
-
return b = a.extend({}, a.fn[this.type].defaults, this.$element.data(), b), b.delay && typeof b.delay == "number" && (b.delay = {show: b.delay, hide: b.delay}), b
|
29 |
-
}, enter: function (b) {
|
30 |
-
var c = a.fn[this.type].defaults, d = {}, e;
|
31 |
-
this._options && a.each(this._options, function (a, b) {
|
32 |
-
c[a] != b && (d[a] = b)
|
33 |
-
}, this), e = a(b.currentTarget)[this.type](d).data(this.type);
|
34 |
-
if (!e.options.delay || !e.options.delay.show)return e.show();
|
35 |
-
clearTimeout(this.timeout), e.hoverState = "in", this.timeout = setTimeout(function () {
|
36 |
-
e.hoverState == "in" && e.show()
|
37 |
-
}, e.options.delay.show)
|
38 |
-
}, leave: function (b) {
|
39 |
-
var c = a(b.currentTarget)[this.type](this._options).data(this.type);
|
40 |
-
this.timeout && clearTimeout(this.timeout);
|
41 |
-
if (!c.options.delay || !c.options.delay.hide)return c.hide();
|
42 |
-
c.hoverState = "out", this.timeout = setTimeout(function () {
|
43 |
-
c.hoverState == "out" && c.hide()
|
44 |
-
}, c.options.delay.hide)
|
45 |
-
}, show: function () {
|
46 |
-
var b, c, d, e, f, g, h = a.Event("show");
|
47 |
-
if (this.hasContent() && this.enabled) {
|
48 |
-
this.$element.trigger(h);
|
49 |
-
if (h.isDefaultPrevented())return;
|
50 |
-
b = this.tip(), this.setContent(), this.options.animation && b.addClass("fade"), f = typeof this.options.placement == "function" ? this.options.placement.call(this, b[0], this.$element[0]) : this.options.placement, b.detach().css({top: 0, left: 0, display: "block"}), this.options.container ? b.appendTo(this.options.container) : b.insertAfter(this.$element), c = this.getPosition(), d = b[0].offsetWidth, e = b[0].offsetHeight;
|
51 |
-
switch (f) {
|
52 |
-
case"bottom":
|
53 |
-
g = {top: c.top + c.height, left: c.left + c.width / 2 - d / 2};
|
54 |
-
break;
|
55 |
-
case"top":
|
56 |
-
g = {top: c.top - e, left: c.left + c.width / 2 - d / 2};
|
57 |
-
break;
|
58 |
-
case"left":
|
59 |
-
g = {top: c.top + c.height / 2 - e / 2, left: c.left - d};
|
60 |
-
break;
|
61 |
-
case"right":
|
62 |
-
g = {top: c.top + c.height / 2 - e / 2, left: c.left + c.width}
|
63 |
-
}
|
64 |
-
this.applyPlacement(g, f), this.$element.trigger("shown")
|
65 |
-
}
|
66 |
-
}, applyPlacement: function (a, b) {
|
67 |
-
var c = this.tip(), d = c[0].offsetWidth, e = c[0].offsetHeight, f, g, h, i;
|
68 |
-
c.offset(a).addClass(b).addClass("in"), f = c[0].offsetWidth, g = c[0].offsetHeight, b == "top" && g != e && (a.top = a.top + e - g, i = !0), b == "bottom" || b == "top" ? (h = 0, a.left < 0 && (h = a.left * -2, a.left = 0, c.offset(a), f = c[0].offsetWidth, g = c[0].offsetHeight), this.replaceArrow(h - d + f, f, "left")) : this.replaceArrow(g - e, g, "top"), i && c.offset(a)
|
69 |
-
}, replaceArrow: function (a, b, c) {
|
70 |
-
this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "")
|
71 |
-
}, setContent: function () {
|
72 |
-
var a = this.tip(), b = this.getTitle();
|
73 |
-
a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right")
|
74 |
-
}, hide: function () {
|
75 |
-
function e() {
|
76 |
-
var b = setTimeout(function () {
|
77 |
-
c.off(a.support.transition.end).detach()
|
78 |
-
}, 500);
|
79 |
-
c.one(a.support.transition.end, function () {
|
80 |
-
clearTimeout(b), c.detach()
|
81 |
-
})
|
82 |
-
}
|
83 |
-
|
84 |
-
var b = this, c = this.tip(), d = a.Event("hide");
|
85 |
-
this.$element.trigger(d);
|
86 |
-
if (d.isDefaultPrevented())return;
|
87 |
-
return c.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? e() : c.detach(), this.$element.trigger("hidden"), this
|
88 |
-
}, fixTitle: function () {
|
89 |
-
var a = this.$element;
|
90 |
-
(a.attr("title") || typeof a.attr("data-original-title") != "string") && a.attr("data-original-title", a.attr("title") || "").attr("title", "")
|
91 |
-
}, hasContent: function () {
|
92 |
-
return this.getTitle()
|
93 |
-
}, getPosition: function () {
|
94 |
-
var b = this.$element[0];
|
95 |
-
return a.extend({}, typeof b.getBoundingClientRect == "function" ? b.getBoundingClientRect() : {width: b.offsetWidth, height: b.offsetHeight}, this.$element.offset())
|
96 |
-
}, getTitle: function () {
|
97 |
-
var a, b = this.$element, c = this.options;
|
98 |
-
return a = b.attr("data-original-title") || (typeof c.title == "function" ? c.title.call(b[0]) : c.title), a
|
99 |
-
}, tip: function () {
|
100 |
-
return this.$tip = this.$tip || a(this.options.template)
|
101 |
-
}, arrow: function () {
|
102 |
-
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
103 |
-
}, validate: function () {
|
104 |
-
this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
|
105 |
-
}, enable: function () {
|
106 |
-
this.enabled = !0
|
107 |
-
}, disable: function () {
|
108 |
-
this.enabled = !1
|
109 |
-
}, toggleEnabled: function () {
|
110 |
-
this.enabled = !this.enabled
|
111 |
-
}, toggle: function (b) {
|
112 |
-
var c = b ? a(b.currentTarget)[this.type](this._options).data(this.type) : this;
|
113 |
-
c.tip().hasClass("in") ? c.hide() : c.show()
|
114 |
-
}, destroy: function () {
|
115 |
-
this.hide().$element.off("." + this.type).removeData(this.type)
|
116 |
-
}};
|
117 |
-
var c = a.fn.tooltip;
|
118 |
-
a.fn.tooltip = function (c) {
|
119 |
-
return this.each(function () {
|
120 |
-
var d = a(this), e = d.data("tooltip"), f = typeof c == "object" && c;
|
121 |
-
e || d.data("tooltip", e = new b(this, f)), typeof c == "string" && e[c]()
|
122 |
-
})
|
123 |
-
}, a.fn.tooltip.Constructor = b, a.fn.tooltip.defaults = {animation: !0, placement: "top", selector: !1, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1}, a.fn.tooltip.noConflict = function () {
|
124 |
-
return a.fn.tooltip = c, this
|
125 |
-
}
|
126 |
}(window.jQuery)
|
1 |
+
/**
|
2 |
+
* Bootstrap.js by @fat & @mdo
|
3 |
+
* plugins: bootstrap-transition.js, bootstrap-tooltip.js
|
4 |
+
* 2.3.1
|
5 |
+
* Copyright 2012 Twitter, Inc.
|
6 |
+
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
7 |
+
*/
|
8 |
+
!function (a) {
|
9 |
+
a(function () {
|
10 |
+
a.support.transition = function () {
|
11 |
+
var a = function () {
|
12 |
+
var a = document.createElement("bootstrap"), b = {WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend"}, c;
|
13 |
+
for (c in b)if (a.style[c] !== undefined)return b[c]
|
14 |
+
}();
|
15 |
+
return a && {end: a}
|
16 |
+
}()
|
17 |
+
})
|
18 |
+
}(window.jQuery), !function (a) {
|
19 |
+
var b = function (a, b) {
|
20 |
+
this.init("tooltip", a, b)
|
21 |
+
};
|
22 |
+
b.prototype = {constructor: b, init: function (b, c, d) {
|
23 |
+
var e, f, g, h, i;
|
24 |
+
this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.enabled = !0, g = this.options.trigger.split(" ");
|
25 |
+
for (i = g.length; i--;)h = g[i], h == "click" ? this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)) : h != "manual" && (e = h == "hover" ? "mouseenter" : "focus", f = h == "hover" ? "mouseleave" : "blur", this.$element.on(e + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(f + "." + this.type, this.options.selector, a.proxy(this.leave, this)));
|
26 |
+
this.options.selector ? this._options = a.extend({}, this.options, {trigger: "manual", selector: ""}) : this.fixTitle()
|
27 |
+
}, getOptions: function (b) {
|
28 |
+
return b = a.extend({}, a.fn[this.type].defaults, this.$element.data(), b), b.delay && typeof b.delay == "number" && (b.delay = {show: b.delay, hide: b.delay}), b
|
29 |
+
}, enter: function (b) {
|
30 |
+
var c = a.fn[this.type].defaults, d = {}, e;
|
31 |
+
this._options && a.each(this._options, function (a, b) {
|
32 |
+
c[a] != b && (d[a] = b)
|
33 |
+
}, this), e = a(b.currentTarget)[this.type](d).data(this.type);
|
34 |
+
if (!e.options.delay || !e.options.delay.show)return e.show();
|
35 |
+
clearTimeout(this.timeout), e.hoverState = "in", this.timeout = setTimeout(function () {
|
36 |
+
e.hoverState == "in" && e.show()
|
37 |
+
}, e.options.delay.show)
|
38 |
+
}, leave: function (b) {
|
39 |
+
var c = a(b.currentTarget)[this.type](this._options).data(this.type);
|
40 |
+
this.timeout && clearTimeout(this.timeout);
|
41 |
+
if (!c.options.delay || !c.options.delay.hide)return c.hide();
|
42 |
+
c.hoverState = "out", this.timeout = setTimeout(function () {
|
43 |
+
c.hoverState == "out" && c.hide()
|
44 |
+
}, c.options.delay.hide)
|
45 |
+
}, show: function () {
|
46 |
+
var b, c, d, e, f, g, h = a.Event("show");
|
47 |
+
if (this.hasContent() && this.enabled) {
|
48 |
+
this.$element.trigger(h);
|
49 |
+
if (h.isDefaultPrevented())return;
|
50 |
+
b = this.tip(), this.setContent(), this.options.animation && b.addClass("fade"), f = typeof this.options.placement == "function" ? this.options.placement.call(this, b[0], this.$element[0]) : this.options.placement, b.detach().css({top: 0, left: 0, display: "block"}), this.options.container ? b.appendTo(this.options.container) : b.insertAfter(this.$element), c = this.getPosition(), d = b[0].offsetWidth, e = b[0].offsetHeight;
|
51 |
+
switch (f) {
|
52 |
+
case"bottom":
|
53 |
+
g = {top: c.top + c.height, left: c.left + c.width / 2 - d / 2};
|
54 |
+
break;
|
55 |
+
case"top":
|
56 |
+
g = {top: c.top - e, left: c.left + c.width / 2 - d / 2};
|
57 |
+
break;
|
58 |
+
case"left":
|
59 |
+
g = {top: c.top + c.height / 2 - e / 2, left: c.left - d};
|
60 |
+
break;
|
61 |
+
case"right":
|
62 |
+
g = {top: c.top + c.height / 2 - e / 2, left: c.left + c.width}
|
63 |
+
}
|
64 |
+
this.applyPlacement(g, f), this.$element.trigger("shown")
|
65 |
+
}
|
66 |
+
}, applyPlacement: function (a, b) {
|
67 |
+
var c = this.tip(), d = c[0].offsetWidth, e = c[0].offsetHeight, f, g, h, i;
|
68 |
+
c.offset(a).addClass(b).addClass("in"), f = c[0].offsetWidth, g = c[0].offsetHeight, b == "top" && g != e && (a.top = a.top + e - g, i = !0), b == "bottom" || b == "top" ? (h = 0, a.left < 0 && (h = a.left * -2, a.left = 0, c.offset(a), f = c[0].offsetWidth, g = c[0].offsetHeight), this.replaceArrow(h - d + f, f, "left")) : this.replaceArrow(g - e, g, "top"), i && c.offset(a)
|
69 |
+
}, replaceArrow: function (a, b, c) {
|
70 |
+
this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "")
|
71 |
+
}, setContent: function () {
|
72 |
+
var a = this.tip(), b = this.getTitle();
|
73 |
+
a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right")
|
74 |
+
}, hide: function () {
|
75 |
+
function e() {
|
76 |
+
var b = setTimeout(function () {
|
77 |
+
c.off(a.support.transition.end).detach()
|
78 |
+
}, 500);
|
79 |
+
c.one(a.support.transition.end, function () {
|
80 |
+
clearTimeout(b), c.detach()
|
81 |
+
})
|
82 |
+
}
|
83 |
+
|
84 |
+
var b = this, c = this.tip(), d = a.Event("hide");
|
85 |
+
this.$element.trigger(d);
|
86 |
+
if (d.isDefaultPrevented())return;
|
87 |
+
return c.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? e() : c.detach(), this.$element.trigger("hidden"), this
|
88 |
+
}, fixTitle: function () {
|
89 |
+
var a = this.$element;
|
90 |
+
(a.attr("title") || typeof a.attr("data-original-title") != "string") && a.attr("data-original-title", a.attr("title") || "").attr("title", "")
|
91 |
+
}, hasContent: function () {
|
92 |
+
return this.getTitle()
|
93 |
+
}, getPosition: function () {
|
94 |
+
var b = this.$element[0];
|
95 |
+
return a.extend({}, typeof b.getBoundingClientRect == "function" ? b.getBoundingClientRect() : {width: b.offsetWidth, height: b.offsetHeight}, this.$element.offset())
|
96 |
+
}, getTitle: function () {
|
97 |
+
var a, b = this.$element, c = this.options;
|
98 |
+
return a = b.attr("data-original-title") || (typeof c.title == "function" ? c.title.call(b[0]) : c.title), a
|
99 |
+
}, tip: function () {
|
100 |
+
return this.$tip = this.$tip || a(this.options.template)
|
101 |
+
}, arrow: function () {
|
102 |
+
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
103 |
+
}, validate: function () {
|
104 |
+
this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
|
105 |
+
}, enable: function () {
|
106 |
+
this.enabled = !0
|
107 |
+
}, disable: function () {
|
108 |
+
this.enabled = !1
|
109 |
+
}, toggleEnabled: function () {
|
110 |
+
this.enabled = !this.enabled
|
111 |
+
}, toggle: function (b) {
|
112 |
+
var c = b ? a(b.currentTarget)[this.type](this._options).data(this.type) : this;
|
113 |
+
c.tip().hasClass("in") ? c.hide() : c.show()
|
114 |
+
}, destroy: function () {
|
115 |
+
this.hide().$element.off("." + this.type).removeData(this.type)
|
116 |
+
}};
|
117 |
+
var c = a.fn.tooltip;
|
118 |
+
a.fn.tooltip = function (c) {
|
119 |
+
return this.each(function () {
|
120 |
+
var d = a(this), e = d.data("tooltip"), f = typeof c == "object" && c;
|
121 |
+
e || d.data("tooltip", e = new b(this, f)), typeof c == "string" && e[c]()
|
122 |
+
})
|
123 |
+
}, a.fn.tooltip.Constructor = b, a.fn.tooltip.defaults = {animation: !0, placement: "top", selector: !1, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1}, a.fn.tooltip.noConflict = function () {
|
124 |
+
return a.fn.tooltip = c, this
|
125 |
+
}
|
126 |
}(window.jQuery)
|
{WCVendors/classes → classes}/admin/settings/assets/js/js.iml
RENAMED
@@ -1,10 +1,10 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<module type="WEB_MODULE" version="4">
|
3 |
-
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
4 |
-
<exclude-output />
|
5 |
-
<content url="file://$MODULE_DIR$" />
|
6 |
-
<orderEntry type="inheritedJdk" />
|
7 |
-
<orderEntry type="sourceFolder" forTests="false" />
|
8 |
-
</component>
|
9 |
-
</module>
|
10 |
-
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<module type="WEB_MODULE" version="4">
|
3 |
+
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
4 |
+
<exclude-output />
|
5 |
+
<content url="file://$MODULE_DIR$" />
|
6 |
+
<orderEntry type="inheritedJdk" />
|
7 |
+
<orderEntry type="sourceFolder" forTests="false" />
|
8 |
+
</component>
|
9 |
+
</module>
|
10 |
+
|
{WCVendors/classes → classes}/admin/settings/assets/js/select2/select2-bootstrap.css
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/select2/select2-spinner.gif
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.css
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.js
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.min.js
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/select2/select2.png
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/select2/select2x2.png
RENAMED
File without changes
|
{WCVendors/classes → classes}/admin/settings/assets/js/sf-jquery.js
RENAMED
@@ -1,23 +1,23 @@
|
|
1 |
-
jQuery(document).ready(function () {
|
2 |
-
|
3 |
-
jQuery(".sf-tips").tooltip({ animation: true, html: true, delay: { show: 300, hide: 100 } });
|
4 |
-
|
5 |
-
|
6 |
-
//This if statement checks if the color picker widget exists within jQuery UI
|
7 |
-
//If it does exist then we initialize the WordPress color picker on our text input field
|
8 |
-
if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
|
9 |
-
jQuery('.colorpick').wpColorPicker();
|
10 |
-
} else {
|
11 |
-
// Color picker
|
12 |
-
jQuery('.colorpick').each(function () {
|
13 |
-
jQuery('.colorpickdiv', jQuery(this).parent()).farbtastic(this);
|
14 |
-
jQuery(this).click(function () {
|
15 |
-
if (jQuery(this).val() == "") jQuery(this).val('#');
|
16 |
-
jQuery('.colorpickdiv', jQuery(this).parent()).show();
|
17 |
-
});
|
18 |
-
});
|
19 |
-
jQuery(document).mousedown(function () {
|
20 |
-
jQuery('.colorpickdiv').hide();
|
21 |
-
});
|
22 |
-
}
|
23 |
});
|
1 |
+
jQuery(document).ready(function () {
|
2 |
+
|
3 |
+
jQuery(".sf-tips").tooltip({ animation: true, html: true, delay: { show: 300, hide: 100 } });
|
4 |
+
|
5 |
+
|
6 |
+
//This if statement checks if the color picker widget exists within jQuery UI
|
7 |
+
//If it does exist then we initialize the WordPress color picker on our text input field
|
8 |
+
if (typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function') {
|
9 |
+
jQuery('.colorpick').wpColorPicker();
|
10 |
+
} else {
|
11 |
+
// Color picker
|
12 |
+
jQuery('.colorpick').each(function () {
|
13 |
+
jQuery('.colorpickdiv', jQuery(this).parent()).farbtastic(this);
|
14 |
+
jQuery(this).click(function () {
|
15 |
+
if (jQuery(this).val() == "") jQuery(this).val('#');
|
16 |
+
jQuery('.colorpickdiv', jQuery(this).parent()).show();
|
17 |
+
});
|
18 |
+
});
|
19 |
+
jQuery(document).mousedown(function () {
|
20 |
+
jQuery('.colorpickdiv').hide();
|
21 |
+
});
|
22 |
+
}
|
23 |
});
|
{WCVendors/classes → classes}/admin/settings/classes/sf-class-format-options.php
RENAMED
@@ -1,347 +1,347 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Format an options array into HTML
|
5 |
-
* This class has been deprecated
|
6 |
-
*
|
7 |
-
* @author Matt Gates <http://mgates.me>
|
8 |
-
* @package WordPress
|
9 |
-
*/
|
10 |
-
|
11 |
-
|
12 |
-
if ( !class_exists( 'SF_Format_Options' ) ) {
|
13 |
-
|
14 |
-
class SF_Format_Options extends SF_Settings_API
|
15 |
-
{
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Format an option array into HTML
|
19 |
-
*
|
20 |
-
*
|
21 |
-
* @access public
|
22 |
-
*
|
23 |
-
* @param unknown $setting
|
24 |
-
*
|
25 |
-
* @return string HTML.
|
26 |
-
*/
|
27 |
-
public function settings_options_format( $setting )
|
28 |
-
{
|
29 |
-
if ( empty( $setting ) ) return false;
|
30 |
-
|
31 |
-
$defaults = apply_filters( $this->id . '_options_defaults', array(
|
32 |
-
'name' => '',
|
33 |
-
'desc' => '',
|
34 |
-
'placeholder' => '',
|
35 |
-
'class' => '',
|
36 |
-
'tip' => '',
|
37 |
-
'id' => '',
|
38 |
-
'css' => '',
|
39 |
-
'type' => 'text',
|
40 |
-
'std' => '',
|
41 |
-
'select2' => false,
|
42 |
-
'multiple' => false,
|
43 |
-
'options' => array(),
|
44 |
-
'restrict' => array(),
|
45 |
-
'settings' => array()
|
46 |
-
) );
|
47 |
-
|
48 |
-
// Each to it's own variable for slim-ness' sakes.
|
49 |
-
$setting = shortcode_atts( $defaults, $setting );
|
50 |
-
|
51 |
-
$restrict_defaults = array(
|
52 |
-
'min' => 0,
|
53 |
-
'max' => '',
|
54 |
-
'step' => 'any',
|
55 |
-
);
|
56 |
-
|
57 |
-
$setting[ 'restrict' ] = shortcode_atts( $restrict_defaults, $setting[ 'restrict' ] );
|
58 |
-
|
59 |
-
$setting[ 'value' ] = $this->get_option( $setting[ 'id' ] );
|
60 |
-
$setting[ 'value' ] = $setting[ 'value' ] !== false ? maybe_unserialize( $setting[ 'value' ] ) : false;
|
61 |
-
$setting[ 'value' ] = SF_Format_Options::sanitize_value( $setting[ 'value' ], $setting );
|
62 |
-
|
63 |
-
$setting[ 'title' ] = $setting[ 'name' ];
|
64 |
-
$setting[ 'name' ] = $this->id . "_options[{$setting['id']}]";
|
65 |
-
|
66 |
-
$setting[ 'grouped' ] = !$setting[ 'title' ] ? ' style="padding-top:0px;"' : '';
|
67 |
-
$setting[ 'tip' ] = SF_Format_Options::get_formatted_tip( $setting[ 'tip' ] );
|
68 |
-
|
69 |
-
$header_types = apply_filters( $this->id . '_options_header_types', array( 'heading', 'title' ) );
|
70 |
-
|
71 |
-
extract( $setting );
|
72 |
-
|
73 |
-
$description = $desc && !$grouped && $type != 'checkbox'
|
74 |
-
? '<br /><small>' . $desc . '</small>'
|
75 |
-
: '<label for="' . $id . '"> ' . $desc . '</label>';
|
76 |
-
|
77 |
-
$description = ( ( in_array( $type, $header_types ) || $type == 'radio' ) && !empty( $desc ) )
|
78 |
-
? '<p>' . $desc . '</p>'
|
79 |
-
: $description;
|
80 |
-
|
81 |
-
?>
|
82 |
-
|
83 |
-
<?php if ( !in_array( $type, $header_types ) ) : ?>
|
84 |
-
<!-- Header of the option. -->
|
85 |
-
<tr valign="top">
|
86 |
-
<th scope="row"<?php echo $grouped; ?>>
|
87 |
-
|
88 |
-
<?php echo $tip; ?>
|
89 |
-
|
90 |
-
<?php if ( !$grouped ) : ?>
|
91 |
-
<label for="<?php echo $name; ?>" class="description"><?php echo $title; ?></label>
|
92 |
-
<?php endif; ?>
|
93 |
-
|
94 |
-
</th>
|
95 |
-
<td <?php echo $grouped; ?> >
|
96 |
-
<?php endif; ?>
|
97 |
-
|
98 |
-
<?php foreach ( $header_types as $header ) :
|
99 |
-
if ( $type != $header ) continue; ?>
|
100 |
-
<tr>
|
101 |
-
<th scope="col" colspan="2">
|
102 |
-
<h3 class="title"><?php echo $title; ?></h3>
|
103 |
-
<?php echo $description; ?>
|
104 |
-
</th>
|
105 |
-
</tr>
|
106 |
-
<?php endforeach; ?>
|
107 |
-
|
108 |
-
<?php switch ( $type ) :
|
109 |
-
|
110 |
-
case 'text' :
|
111 |
-
case 'color' :
|
112 |
-
case 'number' :
|
113 |
-
if ( $type == 'color' ) {
|
114 |
-
$type = 'text';
|
115 |
-
$class .= ' colorpick';
|
116 |
-
$description .= '<div id="colorPickerDiv_' . $id . '" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>';
|
117 |
-
}
|
118 |
-
?>
|
119 |
-
<input name="<?php echo $name; ?>"
|
120 |
-
id="<?php echo $id; ?>"
|
121 |
-
type="<?php echo $type; ?>"
|
122 |
-
|
123 |
-
<?php if ( $type == 'number' ): ?>
|
124 |
-
min="<?php echo $restrict[ 'min' ]; ?>"
|
125 |
-
max="<?php echo $restrict[ 'max' ]; ?>"
|
126 |
-
step="<?php echo $restrict[ 'step' ]; ?>"
|
127 |
-
<?php endif; ?>
|
128 |
-
|
129 |
-
class="regular-text <?php echo $class; ?>"
|
130 |
-
style="<?php echo $css; ?>"
|
131 |
-
placeholder="<?php echo $placeholder; ?>"
|
132 |
-
value="<?php echo $value !== false ? $value : $std; ?>"
|
133 |
-
/>
|
134 |
-
<?php echo $description;
|
135 |
-
break;
|
136 |
-
|
137 |
-
case 'checkbox':
|
138 |
-
|
139 |
-
$selected = ( $value !== false ) ? $value : $std;
|
140 |
-
|
141 |
-
if ( $multiple ) :
|
142 |
-
|
143 |
-
foreach ( $options as $key => $desc ) : ?>
|
144 |
-
|
145 |
-
<input name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
146 |
-
id="<?php echo $id . '_' . $key; ?>"
|
147 |
-
type="checkbox"
|
148 |
-
class="<?php echo $class; ?>"
|
149 |
-
style="<?php echo $css; ?>"
|
150 |
-
value="<?php echo $key; ?>"
|
151 |
-
<?php self::checked( $value, $key ); ?>
|
152 |
-
/>
|
153 |
-
<label for="<?php echo $id . '_' . $key; ?>">
|
154 |
-
<?php echo $desc; ?>
|
155 |
-
</label>
|
156 |
-
<br/>
|
157 |
-
<?php
|
158 |
-
|
159 |
-
endforeach;
|
160 |
-
|
161 |
-
else : ?>
|
162 |
-
|
163 |
-
<input name="<?php echo $name; ?>"
|
164 |
-
id="<?php echo $id ?>"
|
165 |
-
type="checkbox"
|
166 |
-
class="<?php echo $class; ?>"
|
167 |
-
style="<?php echo $css; ?>"
|
168 |
-
<?php checked( $selected, 1 ); ?>
|
169 |
-
/>
|
170 |
-
<?php echo $description;
|
171 |
-
endif;
|
172 |
-
break;
|
173 |
-
|
174 |
-
case 'radio':
|
175 |
-
|
176 |
-
$selected = ( $value !== false ) ? $value : $std;
|
177 |
-
|
178 |
-
foreach ( $options as $key => $val ) : ?>
|
179 |
-
<label class="radio">
|
180 |
-
<input type="radio"
|
181 |
-
name="<?php echo $name; ?>"
|
182 |
-
id="<?php echo $key; ?>"
|
183 |
-
value="<?php echo $key; ?>"
|
184 |
-
class="<?php echo $class; ?>"
|
185 |
-
<?php checked( $selected, $key ); ?>
|
186 |
-
/>
|
187 |
-
<?php echo $val; ?>
|
188 |
-
</label><br/>
|
189 |
-
<?php endforeach;
|
190 |
-
echo $description;
|
191 |
-
break;
|
192 |
-
|
193 |
-
case 'single_select_page':
|
194 |
-
|
195 |
-
$selected = ( $value !== false ) ? $value : $std;
|
196 |
-
|
197 |
-
$args = array(
|
198 |
-
'name' => $name,
|
199 |
-
'id' => $id,
|
200 |
-
'sort_order' => 'ASC',
|
201 |
-
'echo' => 0,
|
202 |
-
'selected' => $selected
|
203 |
-
);
|
204 |
-
|
205 |
-
echo str_replace( "'>", "'><option></option>", wp_dropdown_pages( $args ) );
|
206 |
-
|
207 |
-
echo $description;
|
208 |
-
|
209 |
-
if ( $select2 ) : ?>
|
210 |
-
<script type="text/javascript">jQuery(function () {
|
211 |
-
jQuery("#<?php echo $id; ?>").select2({ allowClear: true, placeholder: "<?php _e( 'Select a page...', 'geczy' ); ?>", width: '350px' });
|
212 |
-
});</script>
|
213 |
-
<?php endif;
|
214 |
-
|
215 |
-
break;
|
216 |
-
|
217 |
-
case 'select':
|
218 |
-
|
219 |
-
$selected = ( $value !== false ) ? $value : $std;
|
220 |
-
$options = apply_filters( $this->id . '_select_options', $options, $setting ); ?>
|
221 |
-
|
222 |
-
<select id="<?php echo $id; ?>"
|
223 |
-
class="<?php echo $class; ?>"
|
224 |
-
style="<?php echo $css; ?>"
|
225 |
-
name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
226 |
-
<?php echo $multiple ? 'multiple="multiple"' : ''; ?>>
|
227 |
-
|
228 |
-
<?php foreach ( $options as $key => $val ) : ?>
|
229 |
-
<option
|
230 |
-
value="<?php echo $key; ?>" <?php self::selected( $selected, $key ); ?>><?php echo $val; ?></option>
|
231 |
-
<?php endforeach; ?>
|
232 |
-
</select>
|
233 |
-
|
234 |
-
<?php echo $description;
|
235 |
-
|
236 |
-
if ( $select2 ) : ?>
|
237 |
-
<script type="text/javascript">jQuery(function () {
|
238 |
-
jQuery("#<?php echo $id; ?>").select2({ width: '350px' });
|
239 |
-
});</script>
|
240 |
-
<?php endif;
|
241 |
-
|
242 |
-
break;
|
243 |
-
|
244 |
-
case 'textarea':
|
245 |
-
?>
|
246 |
-
<textarea name="<?php echo $name; ?>"
|
247 |
-
id="<?php echo $id; ?>"
|
248 |
-
class="large-text <?php echo $class; ?>"
|
249 |
-
style="<?php if ( $css ) echo $css; else echo 'width:300px;'; ?>"
|
250 |
-
placeholder="<?php echo $placeholder; ?>"
|
251 |
-
rows="3"
|
252 |
-
><?php echo ( $value !== false ) ? $value : $std; ?></textarea>
|
253 |
-
<?php echo $description;
|
254 |
-
break;
|
255 |
-
|
256 |
-
case 'wysiwyg':
|
257 |
-
wp_editor( $value, $id, array( 'textarea_name' => $name ) );
|
258 |
-
echo $description;
|
259 |
-
break;
|
260 |
-
|
261 |
-
default :
|
262 |
-
do_action( $this->id . '_options_type_' . $type, $setting );
|
263 |
-
break;
|
264 |
-
|
265 |
-
endswitch;
|
266 |
-
|
267 |
-
/* Footer of the option. */
|
268 |
-
if ( !in_array( $type, $header_types ) ) echo '</td></tr>';
|
269 |
-
|
270 |
-
}
|
271 |
-
|
272 |
-
|
273 |
-
/**
|
274 |
-
*
|
275 |
-
*
|
276 |
-
* @param unknown $haystack
|
277 |
-
* @param unknown $current
|
278 |
-
*/
|
279 |
-
private function selected( $haystack, $current )
|
280 |
-
{
|
281 |
-
|
282 |
-
if ( is_array( $haystack ) && in_array( $current, $haystack ) ) {
|
283 |
-
$current = $haystack = 1;
|
284 |
-
}
|
285 |
-
|
286 |
-
selected( $haystack, $current );
|
287 |
-
}
|
288 |
-
|
289 |
-
|
290 |
-
/**
|
291 |
-
*
|
292 |
-
*
|
293 |
-
* @param unknown $haystack
|
294 |
-
* @param unknown $current
|
295 |
-
*/
|
296 |
-
private function checked( $haystack, $current )
|
297 |
-
{
|
298 |
-
|
299 |
-
if ( is_array( $haystack ) && !empty( $haystack[ $current ] ) ) {
|
300 |
-
$current = $haystack = 1;
|
301 |
-
}
|
302 |
-
|
303 |
-
checked( $haystack, $current );
|
304 |
-
}
|
305 |
-
|
306 |
-
|
307 |
-
/**
|
308 |
-
* Format a tooltip given a string
|
309 |
-
*
|
310 |
-
* @param string $tip
|
311 |
-
*
|
312 |
-
* @return string
|
313 |
-
*/
|
314 |
-
private function get_formatted_tip( $tip )
|
315 |
-
{
|
316 |
-
return $tip ? sprintf( '<a href="#" title="%s" class="sf-tips" tabindex="99"></a>', $tip ) : '';
|
317 |
-
}
|
318 |
-
|
319 |
-
|
320 |
-
/**
|
321 |
-
*
|
322 |
-
*
|
323 |
-
* @param unknown $value
|
324 |
-
* @param unknown $setting
|
325 |
-
*
|
326 |
-
* @return unknown
|
327 |
-
*/
|
328 |
-
private function sanitize_value( $value, $setting )
|
329 |
-
{
|
330 |
-
if ( $value !== false && $setting[ 'type' ] != 'wysiwyg' ) {
|
331 |
-
if ( is_array( $value ) ) {
|
332 |
-
foreach ( $value as $key => $output ) {
|
333 |
-
$value[ $key ] = esc_attr( $output );
|
334 |
-
}
|
335 |
-
} else {
|
336 |
-
$value = esc_attr( $value );
|
337 |
-
}
|
338 |
-
}
|
339 |
-
|
340 |
-
return apply_filters( $this->id . '_options_sanitize_value', $value, $setting );
|
341 |
-
}
|
342 |
-
|
343 |
-
|
344 |
-
}
|
345 |
-
|
346 |
-
|
347 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Format an options array into HTML
|
5 |
+
* This class has been deprecated
|
6 |
+
*
|
7 |
+
* @author Matt Gates <http://mgates.me>
|
8 |
+
* @package WordPress
|
9 |
+
*/
|
10 |
+
|
11 |
+
|
12 |
+
if ( !class_exists( 'SF_Format_Options' ) ) {
|
13 |
+
|
14 |
+
class SF_Format_Options extends SF_Settings_API
|
15 |
+
{
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Format an option array into HTML
|
19 |
+
*
|
20 |
+
*
|
21 |
+
* @access public
|
22 |
+
*
|
23 |
+
* @param unknown $setting
|
24 |
+
*
|
25 |
+
* @return string HTML.
|
26 |
+
*/
|
27 |
+
public function settings_options_format( $setting )
|
28 |
+
{
|
29 |
+
if ( empty( $setting ) ) return false;
|
30 |
+
|
31 |
+
$defaults = apply_filters( $this->id . '_options_defaults', array(
|
32 |
+
'name' => '',
|
33 |
+
'desc' => '',
|
34 |
+
'placeholder' => '',
|
35 |
+
'class' => '',
|
36 |
+
'tip' => '',
|
37 |
+
'id' => '',
|
38 |
+
'css' => '',
|
39 |
+
'type' => 'text',
|
40 |
+
'std' => '',
|
41 |
+
'select2' => false,
|
42 |
+
'multiple' => false,
|
43 |
+
'options' => array(),
|
44 |
+
'restrict' => array(),
|
45 |
+
'settings' => array()
|
46 |
+
) );
|
47 |
+
|
48 |
+
// Each to it's own variable for slim-ness' sakes.
|
49 |
+
$setting = shortcode_atts( $defaults, $setting );
|
50 |
+
|
51 |
+
$restrict_defaults = array(
|
52 |
+
'min' => 0,
|
53 |
+
'max' => '',
|
54 |
+
'step' => 'any',
|
55 |
+
);
|
56 |
+
|
57 |
+
$setting[ 'restrict' ] = shortcode_atts( $restrict_defaults, $setting[ 'restrict' ] );
|
58 |
+
|
59 |
+
$setting[ 'value' ] = $this->get_option( $setting[ 'id' ] );
|
60 |
+
$setting[ 'value' ] = $setting[ 'value' ] !== false ? maybe_unserialize( $setting[ 'value' ] ) : false;
|
61 |
+
$setting[ 'value' ] = SF_Format_Options::sanitize_value( $setting[ 'value' ], $setting );
|
62 |
+
|
63 |
+
$setting[ 'title' ] = $setting[ 'name' ];
|
64 |
+
$setting[ 'name' ] = $this->id . "_options[{$setting['id']}]";
|
65 |
+
|
66 |
+
$setting[ 'grouped' ] = !$setting[ 'title' ] ? ' style="padding-top:0px;"' : '';
|
67 |
+
$setting[ 'tip' ] = SF_Format_Options::get_formatted_tip( $setting[ 'tip' ] );
|
68 |
+
|
69 |
+
$header_types = apply_filters( $this->id . '_options_header_types', array( 'heading', 'title' ) );
|
70 |
+
|
71 |
+
extract( $setting );
|
72 |
+
|
73 |
+
$description = $desc && !$grouped && $type != 'checkbox'
|
74 |
+
? '<br /><small>' . $desc . '</small>'
|
75 |
+
: '<label for="' . $id . '"> ' . $desc . '</label>';
|
76 |
+
|
77 |
+
$description = ( ( in_array( $type, $header_types ) || $type == 'radio' ) && !empty( $desc ) )
|
78 |
+
? '<p>' . $desc . '</p>'
|
79 |
+
: $description;
|
80 |
+
|
81 |
+
?>
|
82 |
+
|
83 |
+
<?php if ( !in_array( $type, $header_types ) ) : ?>
|
84 |
+
<!-- Header of the option. -->
|
85 |
+
<tr valign="top">
|
86 |
+
<th scope="row"<?php echo $grouped; ?>>
|
87 |
+
|
88 |
+
<?php echo $tip; ?>
|
89 |
+
|
90 |
+
<?php if ( !$grouped ) : ?>
|
91 |
+
<label for="<?php echo $name; ?>" class="description"><?php echo $title; ?></label>
|
92 |
+
<?php endif; ?>
|
93 |
+
|
94 |
+
</th>
|
95 |
+
<td <?php echo $grouped; ?> >
|
96 |
+
<?php endif; ?>
|
97 |
+
|
98 |
+
<?php foreach ( $header_types as $header ) :
|
99 |
+
if ( $type != $header ) continue; ?>
|
100 |
+
<tr>
|
101 |
+
<th scope="col" colspan="2">
|
102 |
+
<h3 class="title"><?php echo $title; ?></h3>
|
103 |
+
<?php echo $description; ?>
|
104 |
+
</th>
|
105 |
+
</tr>
|
106 |
+
<?php endforeach; ?>
|
107 |
+
|
108 |
+
<?php switch ( $type ) :
|
109 |
+
|
110 |
+
case 'text' :
|
111 |
+
case 'color' :
|
112 |
+
case 'number' :
|
113 |
+
if ( $type == 'color' ) {
|
114 |
+
$type = 'text';
|
115 |
+
$class .= ' colorpick';
|
116 |
+
$description .= '<div id="colorPickerDiv_' . $id . '" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>';
|
117 |
+
}
|
118 |
+
?>
|
119 |
+
<input name="<?php echo $name; ?>"
|
120 |
+
id="<?php echo $id; ?>"
|
121 |
+
type="<?php echo $type; ?>"
|
122 |
+
|
123 |
+
<?php if ( $type == 'number' ): ?>
|
124 |
+
min="<?php echo $restrict[ 'min' ]; ?>"
|
125 |
+
max="<?php echo $restrict[ 'max' ]; ?>"
|
126 |
+
step="<?php echo $restrict[ 'step' ]; ?>"
|
127 |
+
<?php endif; ?>
|
128 |
+
|
129 |
+
class="regular-text <?php echo $class; ?>"
|
130 |
+
style="<?php echo $css; ?>"
|
131 |
+
placeholder="<?php echo $placeholder; ?>"
|
132 |
+
value="<?php echo $value !== false ? $value : $std; ?>"
|
133 |
+
/>
|
134 |
+
<?php echo $description;
|
135 |
+
break;
|
136 |
+
|
137 |
+
case 'checkbox':
|
138 |
+
|
139 |
+
$selected = ( $value !== false ) ? $value : $std;
|
140 |
+
|
141 |
+
if ( $multiple ) :
|
142 |
+
|
143 |
+
foreach ( $options as $key => $desc ) : ?>
|
144 |
+
|
145 |
+
<input name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
146 |
+
id="<?php echo $id . '_' . $key; ?>"
|
147 |
+
type="checkbox"
|
148 |
+
class="<?php echo $class; ?>"
|
149 |
+
style="<?php echo $css; ?>"
|
150 |
+
value="<?php echo $key; ?>"
|
151 |
+
<?php self::checked( $value, $key ); ?>
|
152 |
+
/>
|
153 |
+
<label for="<?php echo $id . '_' . $key; ?>">
|
154 |
+
<?php echo $desc; ?>
|
155 |
+
</label>
|
156 |
+
<br/>
|
157 |
+
<?php
|
158 |
+
|
159 |
+
endforeach;
|
160 |
+
|
161 |
+
else : ?>
|
162 |
+
|
163 |
+
<input name="<?php echo $name; ?>"
|
164 |
+
id="<?php echo $id ?>"
|
165 |
+
type="checkbox"
|
166 |
+
class="<?php echo $class; ?>"
|
167 |
+
style="<?php echo $css; ?>"
|
168 |
+
<?php checked( $selected, 1 ); ?>
|
169 |
+
/>
|
170 |
+
<?php echo $description;
|
171 |
+
endif;
|
172 |
+
break;
|
173 |
+
|
174 |
+
case 'radio':
|
175 |
+
|
176 |
+
$selected = ( $value !== false ) ? $value : $std;
|
177 |
+
|
178 |
+
foreach ( $options as $key => $val ) : ?>
|
179 |
+
<label class="radio">
|
180 |
+
<input type="radio"
|
181 |
+
name="<?php echo $name; ?>"
|
182 |
+
id="<?php echo $key; ?>"
|
183 |
+
value="<?php echo $key; ?>"
|
184 |
+
class="<?php echo $class; ?>"
|
185 |
+
<?php checked( $selected, $key ); ?>
|
186 |
+
/>
|
187 |
+
<?php echo $val; ?>
|
188 |
+
</label><br/>
|
189 |
+
<?php endforeach;
|
190 |
+
echo $description;
|
191 |
+
break;
|
192 |
+
|
193 |
+
case 'single_select_page':
|
194 |
+
|
195 |
+
$selected = ( $value !== false ) ? $value : $std;
|
196 |
+
|
197 |
+
$args = array(
|
198 |
+
'name' => $name,
|
199 |
+
'id' => $id,
|
200 |
+
'sort_order' => 'ASC',
|
201 |
+
'echo' => 0,
|
202 |
+
'selected' => $selected
|
203 |
+
);
|
204 |
+
|
205 |
+
echo str_replace( "'>", "'><option></option>", wp_dropdown_pages( $args ) );
|
206 |
+
|
207 |
+
echo $description;
|
208 |
+
|
209 |
+
if ( $select2 ) : ?>
|
210 |
+
<script type="text/javascript">jQuery(function () {
|
211 |
+
jQuery("#<?php echo $id; ?>").select2({ allowClear: true, placeholder: "<?php _e( 'Select a page...', 'geczy' ); ?>", width: '350px' });
|
212 |
+
});</script>
|
213 |
+
<?php endif;
|
214 |
+
|
215 |
+
break;
|
216 |
+
|
217 |
+
case 'select':
|
218 |
+
|
219 |
+
$selected = ( $value !== false ) ? $value : $std;
|
220 |
+
$options = apply_filters( $this->id . '_select_options', $options, $setting ); ?>
|
221 |
+
|
222 |
+
<select id="<?php echo $id; ?>"
|
223 |
+
class="<?php echo $class; ?>"
|
224 |
+
style="<?php echo $css; ?>"
|
225 |
+
name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
226 |
+
<?php echo $multiple ? 'multiple="multiple"' : ''; ?>>
|
227 |
+
|
228 |
+
<?php foreach ( $options as $key => $val ) : ?>
|
229 |
+
<option
|
230 |
+
value="<?php echo $key; ?>" <?php self::selected( $selected, $key ); ?>><?php echo $val; ?></option>
|
231 |
+
<?php endforeach; ?>
|
232 |
+
</select>
|
233 |
+
|
234 |
+
<?php echo $description;
|
235 |
+
|
236 |
+
if ( $select2 ) : ?>
|
237 |
+
<script type="text/javascript">jQuery(function () {
|
238 |
+
jQuery("#<?php echo $id; ?>").select2({ width: '350px' });
|
239 |
+
});</script>
|
240 |
+
<?php endif;
|
241 |
+
|
242 |
+
break;
|
243 |
+
|
244 |
+
case 'textarea':
|
245 |
+
?>
|
246 |
+
<textarea name="<?php echo $name; ?>"
|
247 |
+
id="<?php echo $id; ?>"
|
248 |
+
class="large-text <?php echo $class; ?>"
|
249 |
+
style="<?php if ( $css ) echo $css; else echo 'width:300px;'; ?>"
|
250 |
+
placeholder="<?php echo $placeholder; ?>"
|
251 |
+
rows="3"
|
252 |
+
><?php echo ( $value !== false ) ? $value : $std; ?></textarea>
|
253 |
+
<?php echo $description;
|
254 |
+
break;
|
255 |
+
|
256 |
+
case 'wysiwyg':
|
257 |
+
wp_editor( $value, $id, array( 'textarea_name' => $name ) );
|
258 |
+
echo $description;
|
259 |
+
break;
|
260 |
+
|
261 |
+
default :
|
262 |
+
do_action( $this->id . '_options_type_' . $type, $setting );
|
263 |
+
break;
|
264 |
+
|
265 |
+
endswitch;
|
266 |
+
|
267 |
+
/* Footer of the option. */
|
268 |
+
if ( !in_array( $type, $header_types ) ) echo '</td></tr>';
|
269 |
+
|
270 |
+
}
|
271 |
+
|
272 |
+
|
273 |
+
/**
|
274 |
+
*
|
275 |
+
*
|
276 |
+
* @param unknown $haystack
|
277 |
+
* @param unknown $current
|
278 |
+
*/
|
279 |
+
private function selected( $haystack, $current )
|
280 |
+
{
|
281 |
+
|
282 |
+
if ( is_array( $haystack ) && in_array( $current, $haystack ) ) {
|
283 |
+
$current = $haystack = 1;
|
284 |
+
}
|
285 |
+
|
286 |
+
selected( $haystack, $current );
|
287 |
+
}
|
288 |
+
|
289 |
+
|
290 |
+
/**
|
291 |
+
*
|
292 |
+
*
|
293 |
+
* @param unknown $haystack
|
294 |
+
* @param unknown $current
|
295 |
+
*/
|
296 |
+
private function checked( $haystack, $current )
|
297 |
+
{
|
298 |
+
|
299 |
+
if ( is_array( $haystack ) && !empty( $haystack[ $current ] ) ) {
|
300 |
+
$current = $haystack = 1;
|
301 |
+
}
|
302 |
+
|
303 |
+
checked( $haystack, $current );
|
304 |
+
}
|
305 |
+
|
306 |
+
|
307 |
+
/**
|
308 |
+
* Format a tooltip given a string
|
309 |
+
*
|
310 |
+
* @param string $tip
|
311 |
+
*
|
312 |
+
* @return string
|
313 |
+
*/
|
314 |
+
private function get_formatted_tip( $tip )
|
315 |
+
{
|
316 |
+
return $tip ? sprintf( '<a href="#" title="%s" class="sf-tips" tabindex="99"></a>', $tip ) : '';
|
317 |
+
}
|
318 |
+
|
319 |
+
|
320 |
+
/**
|
321 |
+
*
|
322 |
+
*
|
323 |
+
* @param unknown $value
|
324 |
+
* @param unknown $setting
|
325 |
+
*
|
326 |
+
* @return unknown
|
327 |
+
*/
|
328 |
+
private function sanitize_value( $value, $setting )
|
329 |
+
{
|
330 |
+
if ( $value !== false && $setting[ 'type' ] != 'wysiwyg' ) {
|
331 |
+
if ( is_array( $value ) ) {
|
332 |
+
foreach ( $value as $key => $output ) {
|
333 |
+
$value[ $key ] = esc_attr( $output );
|
334 |
+
}
|
335 |
+
} else {
|
336 |
+
$value = esc_attr( $value );
|
337 |
+
}
|
338 |
+
}
|
339 |
+
|
340 |
+
return apply_filters( $this->id . '_options_sanitize_value', $value, $setting );
|
341 |
+
}
|
342 |
+
|
343 |
+
|
344 |
+
}
|
345 |
+
|
346 |
+
|
347 |
+
}
|
{WCVendors/classes → classes}/admin/settings/classes/sf-class-sanitize.php
RENAMED
@@ -1,160 +1,160 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Sanitize filters
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package WordPress
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
if ( !class_exists( 'SF_Sanitize' ) ) {
|
12 |
-
|
13 |
-
class SF_Sanitize
|
14 |
-
{
|
15 |
-
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Hooks
|
19 |
-
*/
|
20 |
-
function __construct()
|
21 |
-
{
|
22 |
-
add_filter( 'geczy_sanitize_color', 'sanitize_text_field' );
|
23 |
-
add_filter( 'geczy_sanitize_text', 'sanitize_text_field' );
|
24 |
-
add_filter( 'geczy_sanitize_number', array( 'SF_Sanitize', 'sanitize_number_field' ) );
|
25 |
-
add_filter( 'geczy_sanitize_textarea', array( 'SF_Sanitize', 'sanitize_textarea' ) );
|
26 |
-
add_filter( 'geczy_sanitize_wysiwyg', array( 'SF_Sanitize', 'sanitize_wysiwyg' ) );
|
27 |
-
add_filter( 'geczy_sanitize_checkbox', array( 'SF_Sanitize', 'sanitize_checkbox' ), 10, 2 );
|
28 |
-
add_filter( 'geczy_sanitize_radio', array( 'SF_Sanitize', 'sanitize_enum' ), 10, 2 );
|
29 |
-
add_filter( 'geczy_sanitize_select', array( 'SF_Sanitize', 'sanitize_enum' ), 10, 2 );
|
30 |
-
add_filter( 'geczy_sanitize_single_select_page', array( 'SF_Sanitize', 'sanitize_select_pages' ), 10, 2 );
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Numeric sanitization
|
36 |
-
*
|
37 |
-
* @param int $input
|
38 |
-
*
|
39 |
-
* @return int
|
40 |
-
*/
|
41 |
-
public static function sanitize_number_field( $input )
|
42 |
-
{
|
43 |
-
$output = is_numeric( $input ) ? (float) $input : false;
|
44 |
-
|
45 |
-
return $input;
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Textarea sanitization
|
51 |
-
*
|
52 |
-
* @param string $input
|
53 |
-
*
|
54 |
-
* @return string
|
55 |
-
*/
|
56 |
-
public static function sanitize_textarea( $input )
|
57 |
-
{
|
58 |
-
global $allowedposttags;
|
59 |
-
$output = wp_kses( $input, $allowedposttags );
|
60 |
-
|
61 |
-
return $output;
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
/**
|
66 |
-
* WYSIWYG sanitization
|
67 |
-
*
|
68 |
-
* @param string $input
|
69 |
-
*
|
70 |
-
* @return string
|
71 |
-
*/
|
72 |
-
public static function sanitize_wysiwyg( $input )
|
73 |
-
{
|
74 |
-
return $input;
|
75 |
-
}
|
76 |
-
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Checkbox sanitization
|
80 |
-
*
|
81 |
-
* @param int $input
|
82 |
-
* @param unknown $option
|
83 |
-
*
|
84 |
-
* @return int
|
85 |
-
*/
|
86 |
-
public static function sanitize_checkbox( $input, $option )
|
87 |
-
{
|
88 |
-
if ( !empty( $option[ 'multiple' ] ) ) {
|
89 |
-
|
90 |
-
$defaults = array_keys( $option[ 'options' ] );
|
91 |
-
|
92 |
-
foreach ( $defaults as $value ) {
|
93 |
-
|
94 |
-
if ( !is_array( $input ) ) {
|
95 |
-
$output[ $value ] = 0;
|
96 |
-
} else {
|
97 |
-
$output[ $value ] = in_array( $value, $input ) ? 1 : 0;
|
98 |
-
}
|
99 |
-
|
100 |
-
}
|
101 |
-
|
102 |
-
$output = serialize( $output );
|
103 |
-
} else {
|
104 |
-
$output = $input ? 1 : 0;
|
105 |
-
}
|
106 |
-
|
107 |
-
return $output;
|
108 |
-
}
|
109 |
-
|
110 |
-
|
111 |
-
/**
|
112 |
-
* Array sanitization
|
113 |
-
*
|
114 |
-
* @param unknown $input
|
115 |
-
* @param array $option
|
116 |
-
*
|
117 |
-
* @return bool
|
118 |
-
*/
|
119 |
-
public static function sanitize_enum( $input, $option )
|
120 |
-
{
|
121 |
-
$output = $input;
|
122 |
-
|
123 |
-
$sfs = new SF_Sanitize();
|
124 |
-
|
125 |
-
if ( is_array( $input ) ) {
|
126 |
-
foreach ( $input as $value ) {
|
127 |
-
if ( !$sfs->sanitize_enum( $value, $option ) ) {
|
128 |
-
$output = false;
|
129 |
-
break;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
$output = $output ? serialize( $output ) : $output;
|
133 |
-
} else {
|
134 |
-
$output = array_key_exists( $input, $option[ 'options' ] ) ? $input : false;
|
135 |
-
}
|
136 |
-
|
137 |
-
return $output;
|
138 |
-
}
|
139 |
-
|
140 |
-
|
141 |
-
/**
|
142 |
-
* Select box for pages sanitize
|
143 |
-
*
|
144 |
-
* @param int $input
|
145 |
-
* @param int $option
|
146 |
-
*
|
147 |
-
* @return int
|
148 |
-
*/
|
149 |
-
public static function sanitize_select_pages( $input, $option )
|
150 |
-
{
|
151 |
-
$output = get_page( $input ) ? (int) $input : 0;
|
152 |
-
|
153 |
-
return $output;
|
154 |
-
}
|
155 |
-
|
156 |
-
|
157 |
-
}
|
158 |
-
|
159 |
-
|
160 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Sanitize filters
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package WordPress
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
if ( !class_exists( 'SF_Sanitize' ) ) {
|
12 |
+
|
13 |
+
class SF_Sanitize
|
14 |
+
{
|
15 |
+
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Hooks
|
19 |
+
*/
|
20 |
+
function __construct()
|
21 |
+
{
|
22 |
+
add_filter( 'geczy_sanitize_color', 'sanitize_text_field' );
|
23 |
+
add_filter( 'geczy_sanitize_text', 'sanitize_text_field' );
|
24 |
+
add_filter( 'geczy_sanitize_number', array( 'SF_Sanitize', 'sanitize_number_field' ) );
|
25 |
+
add_filter( 'geczy_sanitize_textarea', array( 'SF_Sanitize', 'sanitize_textarea' ) );
|
26 |
+
add_filter( 'geczy_sanitize_wysiwyg', array( 'SF_Sanitize', 'sanitize_wysiwyg' ) );
|
27 |
+
add_filter( 'geczy_sanitize_checkbox', array( 'SF_Sanitize', 'sanitize_checkbox' ), 10, 2 );
|
28 |
+
add_filter( 'geczy_sanitize_radio', array( 'SF_Sanitize', 'sanitize_enum' ), 10, 2 );
|
29 |
+
add_filter( 'geczy_sanitize_select', array( 'SF_Sanitize', 'sanitize_enum' ), 10, 2 );
|
30 |
+
add_filter( 'geczy_sanitize_single_select_page', array( 'SF_Sanitize', 'sanitize_select_pages' ), 10, 2 );
|
31 |
+
}
|
32 |
+
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Numeric sanitization
|
36 |
+
*
|
37 |
+
* @param int $input
|
38 |
+
*
|
39 |
+
* @return int
|
40 |
+
*/
|
41 |
+
public static function sanitize_number_field( $input )
|
42 |
+
{
|
43 |
+
$output = is_numeric( $input ) ? (float) $input : false;
|
44 |
+
|
45 |
+
return $input;
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Textarea sanitization
|
51 |
+
*
|
52 |
+
* @param string $input
|
53 |
+
*
|
54 |
+
* @return string
|
55 |
+
*/
|
56 |
+
public static function sanitize_textarea( $input )
|
57 |
+
{
|
58 |
+
global $allowedposttags;
|
59 |
+
$output = wp_kses( $input, $allowedposttags );
|
60 |
+
|
61 |
+
return $output;
|
62 |
+
}
|
63 |
+
|
64 |
+
|
65 |
+
/**
|
66 |
+
* WYSIWYG sanitization
|
67 |
+
*
|
68 |
+
* @param string $input
|
69 |
+
*
|
70 |
+
* @return string
|
71 |
+
*/
|
72 |
+
public static function sanitize_wysiwyg( $input )
|
73 |
+
{
|
74 |
+
return $input;
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Checkbox sanitization
|
80 |
+
*
|
81 |
+
* @param int $input
|
82 |
+
* @param unknown $option
|
83 |
+
*
|
84 |
+
* @return int
|
85 |
+
*/
|
86 |
+
public static function sanitize_checkbox( $input, $option )
|
87 |
+
{
|
88 |
+
if ( !empty( $option[ 'multiple' ] ) ) {
|
89 |
+
|
90 |
+
$defaults = array_keys( $option[ 'options' ] );
|
91 |
+
|
92 |
+
foreach ( $defaults as $value ) {
|
93 |
+
|
94 |
+
if ( !is_array( $input ) ) {
|
95 |
+
$output[ $value ] = 0;
|
96 |
+
} else {
|
97 |
+
$output[ $value ] = in_array( $value, $input ) ? 1 : 0;
|
98 |
+
}
|
99 |
+
|
100 |
+
}
|
101 |
+
|
102 |
+
$output = serialize( $output );
|
103 |
+
} else {
|
104 |
+
$output = $input ? 1 : 0;
|
105 |
+
}
|
106 |
+
|
107 |
+
return $output;
|
108 |
+
}
|
109 |
+
|
110 |
+
|
111 |
+
/**
|
112 |
+
* Array sanitization
|
113 |
+
*
|
114 |
+
* @param unknown $input
|
115 |
+
* @param array $option
|
116 |
+
*
|
117 |
+
* @return bool
|
118 |
+
*/
|
119 |
+
public static function sanitize_enum( $input, $option )
|
120 |
+
{
|
121 |
+
$output = $input;
|
122 |
+
|
123 |
+
$sfs = new SF_Sanitize();
|
124 |
+
|
125 |
+
if ( is_array( $input ) ) {
|
126 |
+
foreach ( $input as $value ) {
|
127 |
+
if ( !$sfs->sanitize_enum( $value, $option ) ) {
|
128 |
+
$output = false;
|
129 |
+
break;
|
130 |
+
}
|
131 |
+
}
|
132 |
+
$output = $output ? serialize( $output ) : $output;
|
133 |
+
} else {
|
134 |
+
$output = array_key_exists( $input, $option[ 'options' ] ) ? $input : false;
|
135 |
+
}
|
136 |
+
|
137 |
+
return $output;
|
138 |
+
}
|
139 |
+
|
140 |
+
|
141 |
+
/**
|
142 |
+
* Select box for pages sanitize
|
143 |
+
*
|
144 |
+
* @param int $input
|
145 |
+
* @param int $option
|
146 |
+
*
|
147 |
+
* @return int
|
148 |
+
*/
|
149 |
+
public static function sanitize_select_pages( $input, $option )
|
150 |
+
{
|
151 |
+
$output = get_page( $input ) ? (int) $input : 0;
|
152 |
+
|
153 |
+
return $output;
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
}
|
158 |
+
|
159 |
+
|
160 |
+
}
|
{WCVendors/classes → classes}/admin/settings/classes/sf-class-settings.php
RENAMED
@@ -1,913 +1,913 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* WP-Simple-Settings-Framework
|
5 |
-
*
|
6 |
-
* Copyright (c) 2012 Matt Gates.
|
7 |
-
* All rights reserved.
|
8 |
-
*
|
9 |
-
* Redistribution and use in source and binary forms, with or without
|
10 |
-
* modification, are permitted provided that the following conditions
|
11 |
-
* are met:
|
12 |
-
*
|
13 |
-
* * Redistributions of source code must retain the above copyright
|
14 |
-
* notice, this list of conditions and the following disclaimer.
|
15 |
-
*
|
16 |
-
* * Redistributions in binary form must reproduce the above copyright
|
17 |
-
* notice, this list of conditions and the following disclaimer in
|
18 |
-
* the documentation and/or other materials provided with the
|
19 |
-
* distribution.
|
20 |
-
*
|
21 |
-
* * Neither the names of the copyright holders nor the names of the
|
22 |
-
* contributors may be used to endorse or promote products derived
|
23 |
-
* from this software without specific prior written permission.
|
24 |
-
*
|
25 |
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
26 |
-
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
27 |
-
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
28 |
-
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
29 |
-
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
30 |
-
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
31 |
-
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
32 |
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
33 |
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
34 |
-
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
35 |
-
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
36 |
-
* POSSIBILITY OF SUCH DAMAGE.
|
37 |
-
*
|
38 |
-
* @subpackage WP-Simple-Settings-Framework
|
39 |
-
* @copyright 2012 Matt Gates.
|
40 |
-
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
41 |
-
* @link http://mgates.me
|
42 |
-
* @version 1.1
|
43 |
-
* @author Matt Gates <info@mgates.me>
|
44 |
-
* @package WordPress
|
45 |
-
*/
|
46 |
-
|
47 |
-
|
48 |
-
if ( !class_exists( 'SF_Settings_API' ) ) {
|
49 |
-
|
50 |
-
class SF_Settings_API
|
51 |
-
{
|
52 |
-
|
53 |
-
private $data = array();
|
54 |
-
|
55 |
-
/**
|
56 |
-
* Init
|
57 |
-
*
|
58 |
-
* @param string $id
|
59 |
-
* @param string $title
|
60 |
-
* @param string $menu (optional)
|
61 |
-
* @param string $file
|
62 |
-
*/
|
63 |
-
public function __construct( $id, $title, $menu = '', $file )
|
64 |
-
{
|
65 |
-
$this->assets_url = trailingslashit( plugins_url( 'assets/', dirname( __FILE__ ) ) );
|
66 |
-
$this->id = $id;
|
67 |
-
$this->title = $title;
|
68 |
-
$this->menu = empty( $menu ) ? 'plugins.php' : $menu;
|
69 |
-
|
70 |
-
$this->file = $file;
|
71 |
-
|
72 |
-
$this->includes();
|
73 |
-
$this->actions();
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
// ==================================================================
|
78 |
-
//
|
79 |
-
// Getter and setter.
|
80 |
-
//
|
81 |
-
// ------------------------------------------------------------------
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Setter
|
85 |
-
*
|
86 |
-
* @param unknown $name
|
87 |
-
* @param unknown $value
|
88 |
-
*/
|
89 |
-
public function __set( $name, $value )
|
90 |
-
{
|
91 |
-
if ( isset ( $this->data[ $name ] ) && is_array( $this->data[ $name ] ) ) {
|
92 |
-
$this->data[ $name ] = array_merge( $this->data[ $name ], $value );
|
93 |
-
} else {
|
94 |
-
$this->data[ $name ] = $value;
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
|
99 |
-
/**
|
100 |
-
* Getter
|
101 |
-
*
|
102 |
-
* @param unknown $name
|
103 |
-
*
|
104 |
-
* @return unknown
|
105 |
-
*/
|
106 |
-
public function __get( $name )
|
107 |
-
{
|
108 |
-
if ( array_key_exists( $name, $this->data ) ) {
|
109 |
-
return $this->data[ $name ];
|
110 |
-
}
|
111 |
-
|
112 |
-
return null;
|
113 |
-
}
|
114 |
-
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Isset
|
118 |
-
*
|
119 |
-
* @param unknown $name
|
120 |
-
*
|
121 |
-
* @return unknown
|
122 |
-
*/
|
123 |
-
public function __isset( $name )
|
124 |
-
{
|
125 |
-
return isset( $this->data[ $name ] );
|
126 |
-
}
|
127 |
-
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Unset
|
131 |
-
*
|
132 |
-
* @param unknown $name
|
133 |
-
*/
|
134 |
-
public function __unset( $name )
|
135 |
-
{
|
136 |
-
unset( $this->data[ $name ] );
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
/**
|
141 |
-
* Add a "Settings" link to the plugins.php page
|
142 |
-
*
|
143 |
-
* @param array $links
|
144 |
-
* @param array $file
|
145 |
-
*
|
146 |
-
* @return array
|
147 |
-
*/
|
148 |
-
public function add_settings_link( $links, $file )
|
149 |
-
{
|
150 |
-
$this_plugin = plugin_basename( $this->file );
|
151 |
-
$page = strpos( $this->menu, '.php' ) ? $this->menu : 'admin.php';
|
152 |
-
if ( $file == $this_plugin ) {
|
153 |
-
$settings_link = '<a href="' . $page . '?page=' . $this->id . '">' . __( 'Settings', 'geczy' ) . '</a>';
|
154 |
-
array_unshift( $links, $settings_link );
|
155 |
-
}
|
156 |
-
|
157 |
-
return $links;
|
158 |
-
}
|
159 |
-
|
160 |
-
|
161 |
-
// ==================================================================
|
162 |
-
//
|
163 |
-
// Begin initialization.
|
164 |
-
//
|
165 |
-
// ------------------------------------------------------------------
|
166 |
-
|
167 |
-
/**
|
168 |
-
* Core files
|
169 |
-
*/
|
170 |
-
private function includes()
|
171 |
-
{
|
172 |
-
require_once dirname( __FILE__ ) . '/sf-class-sanitize.php';
|
173 |
-
require_once dirname( __FILE__ ) . '/sf-class-format-options.php';
|
174 |
-
new SF_Sanitize;
|
175 |
-
}
|
176 |
-
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Hooks
|
180 |
-
*/
|
181 |
-
private function actions()
|
182 |
-
{
|
183 |
-
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
|
184 |
-
add_action( 'admin_init', array( &$this, 'register_options' ) );
|
185 |
-
add_action( 'admin_menu', array( &$this, 'create_menu' ) );
|
186 |
-
add_filter( 'plugin_action_links', array( &$this, 'add_settings_link' ), 10, 2 );
|
187 |
-
}
|
188 |
-
|
189 |
-
|
190 |
-
/**
|
191 |
-
* Admin scripts and styles
|
192 |
-
*/
|
193 |
-
public function admin_enqueue_scripts()
|
194 |
-
{
|
195 |
-
global $pagenow;
|
196 |
-
if (is_admin() || $pagenow === 'wc_prd_vendor') {
|
197 |
-
wp_register_script( 'bootstrap-tooltip', $this->assets_url . 'js/bootstrap-tooltip.js', array( 'jquery' ), '1.0' );
|
198 |
-
wp_register_script( 'select2', $this->assets_url . 'js/select2/select2.min.js', array( 'jquery' ), '3.5.2' );
|
199 |
-
wp_register_script( 'sf-scripts', $this->assets_url . 'js/sf-jquery.js', array( 'jquery' ), '1.0' );
|
200 |
-
wp_register_style( 'select2', $this->assets_url . 'js/select2/select2.css' );
|
201 |
-
wp_register_style( 'sf-styles', $this->assets_url . 'css/sf-styles.css' );
|
202 |
-
}
|
203 |
-
}
|
204 |
-
|
205 |
-
|
206 |
-
/**
|
207 |
-
* Admin scripts and styles
|
208 |
-
*/
|
209 |
-
public function admin_print_scripts()
|
210 |
-
{
|
211 |
-
global $wp_version;
|
212 |
-
|
213 |
-
//Check wp version and load appropriate scripts for colorpicker.
|
214 |
-
if ( 3.5 <= $wp_version ) {
|
215 |
-
wp_enqueue_style( 'wp-color-picker' );
|
216 |
-
wp_enqueue_script( 'wp-color-picker' );
|
217 |
-
} else {
|
218 |
-
wp_enqueue_style( 'farbtastic' );
|
219 |
-
wp_enqueue_script( 'farbtastic' );
|
220 |
-
}
|
221 |
-
|
222 |
-
wp_enqueue_script( 'bootstrap-tooltip' );
|
223 |
-
wp_enqueue_script( 'select2' );
|
224 |
-
wp_enqueue_script( 'sf-scripts' );
|
225 |
-
|
226 |
-
wp_enqueue_style( 'wp-color-picker' );
|
227 |
-
wp_enqueue_style( 'select2' );
|
228 |
-
wp_enqueue_style( 'sf-styles' );
|
229 |
-
}
|
230 |
-
|
231 |
-
|
232 |
-
/**
|
233 |
-
* Register setting
|
234 |
-
*/
|
235 |
-
public function register_options()
|
236 |
-
{
|
237 |
-
register_setting( $this->id . '_options_nonce', $this->id . '_options', array( &$this, 'validate_options' ) );
|
238 |
-
}
|
239 |
-
|
240 |
-
|
241 |
-
/**
|
242 |
-
* Create menu
|
243 |
-
*/
|
244 |
-
public function create_menu()
|
245 |
-
{
|
246 |
-
$page = add_submenu_page( $this->menu, $this->title, $this->title, apply_filters( $this->id . '_manage_options', 'manage_options' ), $this->id, array( &$this, 'init_settings_page' ) );
|
247 |
-
add_action( 'admin_print_scripts-' . $page, array( &$this, 'admin_print_scripts' ) );
|
248 |
-
}
|
249 |
-
|
250 |
-
|
251 |
-
/**
|
252 |
-
* Parse options into tabbed organization
|
253 |
-
*
|
254 |
-
* @return array
|
255 |
-
*/
|
256 |
-
private function parse_options()
|
257 |
-
{
|
258 |
-
$options = $this->options;
|
259 |
-
|
260 |
-
foreach ( $options as $option ) {
|
261 |
-
|
262 |
-
if ( $option[ 'type' ] == 'heading' ) {
|
263 |
-
$tab_name = sanitize_title( $option[ 'name' ] );
|
264 |
-
$this->tab_headers = array( $tab_name => $option[ 'name' ] );
|
265 |
-
|
266 |
-
continue;
|
267 |
-
}
|
268 |
-
|
269 |
-
$option[ 'tab' ] = $tab_name;
|
270 |
-
$tabs[ $tab_name ][ ] = $option;
|
271 |
-
|
272 |
-
}
|
273 |
-
|
274 |
-
$this->tabs = $tabs;
|
275 |
-
|
276 |
-
return $tabs;
|
277 |
-
}
|
278 |
-
|
279 |
-
|
280 |
-
/**
|
281 |
-
* Load the options array from a file
|
282 |
-
*
|
283 |
-
* @param string $option_file
|
284 |
-
*/
|
285 |
-
public function load_options( $option_file )
|
286 |
-
{
|
287 |
-
if ( !empty( $this->options ) ) return;
|
288 |
-
|
289 |
-
if ( file_exists( $option_file ) ) {
|
290 |
-
require $option_file;
|
291 |
-
$this->options = apply_filters( $this->id . '_options', $options );
|
292 |
-
$this->parse_options();
|
293 |
-
|
294 |
-
$this->current_options = $this->get_current_options();
|
295 |
-
|
296 |
-
/* If the option has no saved data, load the defaults. */
|
297 |
-
/* @TODO: Can prob add this to the activation hook. */
|
298 |
-
$this->set_defaults( $this->current_options );
|
299 |
-
} else {
|
300 |
-
wp_die( __( 'Could not load settings at: ', 'geczy' ) . '<br/><code>' . $option_file . '</code>', __( 'Error - WP Settings Framework', 'geczy' ) );
|
301 |
-
}
|
302 |
-
}
|
303 |
-
|
304 |
-
|
305 |
-
/**
|
306 |
-
*
|
307 |
-
*
|
308 |
-
* @return unknown
|
309 |
-
*/
|
310 |
-
public function get_current_options()
|
311 |
-
{
|
312 |
-
if ( !empty( $this->current_options ) )
|
313 |
-
return $this->current_options;
|
314 |
-
|
315 |
-
$options = get_option( $this->id . '_options' );
|
316 |
-
|
317 |
-
if ( $options ) {
|
318 |
-
$options = array_map( 'maybe_unserialize', $options );
|
319 |
-
}
|
320 |
-
|
321 |
-
return $options;
|
322 |
-
}
|
323 |
-
|
324 |
-
|
325 |
-
/**
|
326 |
-
* Sanitize and validate post fields
|
327 |
-
*
|
328 |
-
* @param unknown $input
|
329 |
-
*
|
330 |
-
* @return unknown
|
331 |
-
*/
|
332 |
-
public function validate_options( $input )
|
333 |
-
{
|
334 |
-
if ( !isset( $_POST[ 'update' ] ) )
|
335 |
-
return $this->get_defaults();
|
336 |
-
|
337 |
-
$clean = $this->current_options;
|
338 |
-
$tabname = $_POST[ 'currentTab' ];
|
339 |
-
|
340 |
-
foreach ( $this->tabs[ $tabname ] as $option ) :
|
341 |
-
|
342 |
-
if ( !isset( $option[ 'id' ] ) )
|
343 |
-
continue;
|
344 |
-
|
345 |
-
if ( !isset( $option[ 'type' ] ) )
|
346 |
-
continue;
|
347 |
-
|
348 |
-
if ( $option[ 'type' ] == 'select' ) {
|
349 |
-
$option[ 'options' ] = apply_filters( $this->id . '_select_options', $option[ 'options' ], $option );
|
350 |
-
}
|
351 |
-
|
352 |
-
$id = sanitize_text_field( strtolower( $option[ 'id' ] ) );
|
353 |
-
|
354 |
-
// Set checkbox to false if it wasn't sent in the $_POST
|
355 |
-
if ( 'checkbox' == $option[ 'type' ] && !isset( $input[ $id ] ) )
|
356 |
-
$input[ $id ] = 0;
|
357 |
-
|
358 |
-
// For a value to be submitted to database it must pass through a sanitization filter
|
359 |
-
if ( has_filter( 'geczy_sanitize_' . $option[ 'type' ] ) ) {
|
360 |
-
$clean[ $id ] = apply_filters( 'geczy_sanitize_' . $option[ 'type' ], $input[ $id ], $option );
|
361 |
-
}
|
362 |
-
|
363 |
-
endforeach;
|
364 |
-
|
365 |
-
do_action( $this->id . '_options_updated', $clean, $tabname );
|
366 |
-
add_settings_error( $this->id, 'save_options', __( 'Settings saved.', 'geczy' ), 'updated' );
|
367 |
-
|
368 |
-
return apply_filters( $this->id . '_options_on_update', $clean, $tabname );
|
369 |
-
}
|
370 |
-
|
371 |
-
|
372 |
-
/**
|
373 |
-
* Create default options
|
374 |
-
*
|
375 |
-
* @param unknown $current_options (optional)
|
376 |
-
*/
|
377 |
-
private function set_defaults( $current_options = array() )
|
378 |
-
{
|
379 |
-
$options = $this->get_defaults( $current_options );
|
380 |
-
if ( $options ) {
|
381 |
-
update_option( $this->id . '_options', $options );
|
382 |
-
}
|
383 |
-
}
|
384 |
-
|
385 |
-
|
386 |
-
/**
|
387 |
-
* Retrieve default options
|
388 |
-
*
|
389 |
-
* @param unknown $currents (optional)
|
390 |
-
*
|
391 |
-
* @return array
|
392 |
-
*/
|
393 |
-
private function get_defaults( $currents = array() )
|
394 |
-
{
|
395 |
-
$output = array();
|
396 |
-
$config = $this->options;
|
397 |
-
$flag = false;
|
398 |
-
|
399 |
-
if ( $currents ) {
|
400 |
-
foreach ( $config as $value ) {
|
401 |
-
if ( !isset( $value[ 'id' ] ) || !isset( $value[ 'std' ] ) || !isset( $value[ 'type' ] ) )
|
402 |
-
continue;
|
403 |
-
|
404 |
-
if ( !isset( $currents[ $value[ 'id' ] ] ) ) {
|
405 |
-
$flag = true;
|
406 |
-
}
|
407 |
-
}
|
408 |
-
}
|
409 |
-
|
410 |
-
foreach ( $config as $option ) {
|
411 |
-
if ( !isset( $option[ 'id' ] ) || !isset( $option[ 'std' ] ) || !isset( $option[ 'type' ] ) )
|
412 |
-
continue;
|
413 |
-
|
414 |
-
if ( $currents && isset( $currents[ $option[ 'id' ] ] ) ) {
|
415 |
-
$output[ $option[ 'id' ] ] = $currents[ $option[ 'id' ] ];
|
416 |
-
} else if ( has_filter( 'geczy_sanitize_' . $option[ 'type' ] ) ) {
|
417 |
-
$output[ $option[ 'id' ] ] = apply_filters( 'geczy_sanitize_' . $option[ 'type' ], $option[ 'std' ], $option );
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
if ( $currents ) {
|
422 |
-
$output = array_merge( $currents, $output );
|
423 |
-
}
|
424 |
-
|
425 |
-
return !$flag && $currents ? array() : $output;
|
426 |
-
}
|
427 |
-
|
428 |
-
|
429 |
-
/**
|
430 |
-
* HTML header
|
431 |
-
*/
|
432 |
-
private function template_header()
|
433 |
-
{
|
434 |
-
?>
|
435 |
-
<div class="wrap">
|
436 |
-
<?php screen_icon(); ?><h2><?php echo $this->title; ?></h2>
|
437 |
-
|
438 |
-
<h2 class="nav-tab-wrapper">
|
439 |
-
<?php echo $this->display_tabs(); ?>
|
440 |
-
</h2><?php
|
441 |
-
|
442 |
-
if ( !empty ( $_REQUEST[ 'settings-updated' ] ) )
|
443 |
-
settings_errors();
|
444 |
-
|
445 |
-
}
|
446 |
-
|
447 |
-
|
448 |
-
/**
|
449 |
-
* HTML body
|
450 |
-
*
|
451 |
-
* @return unknown
|
452 |
-
*/
|
453 |
-
private function template_body()
|
454 |
-
{
|
455 |
-
|
456 |
-
if ( empty( $this->options ) ) return false;
|
457 |
-
|
458 |
-
|
459 |
-
$options = $this->options;
|
460 |
-
$tabs = $this->get_tabs();
|
461 |
-
$tabname = !empty ( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : $tabs[ 0 ][ 'slug' ];
|
462 |
-
|
463 |
-
$options = apply_filters( $this->id . '_options_tab-' . $tabname, $this->tabs[ $tabname ] ); ?>
|
464 |
-
|
465 |
-
<form method="post" action="options.php">
|
466 |
-
<?php settings_fields( $this->id . '_options_nonce' ); ?>
|
467 |
-
<table class="form-table">
|
468 |
-
|
469 |
-
<?php
|
470 |
-
foreach ( $options as $value ) :
|
471 |
-
$this->settings_options_format( $value );
|
472 |
-
endforeach;
|
473 |
-
|
474 |
-
do_action( $this->id . '_options_tab-' . $tabname );
|
475 |
-
?>
|
476 |
-
|
477 |
-
</table>
|
478 |
-
|
479 |
-
<p class="submit">
|
480 |
-
<input type="hidden" name="currentTab" value="<?php echo $tabname; ?>">
|
481 |
-
<input type="submit" name="update" class="button-primary"
|
482 |
-
value="<?php echo sprintf( __( 'Save %s changes', 'geczy' ), $this->tab_headers[ $tabname ] ); ?>"/>
|
483 |
-
</p>
|
484 |
-
</form> <?php
|
485 |
-
|
486 |
-
}
|
487 |
-
|
488 |
-
|
489 |
-
/**
|
490 |
-
* HTML footer
|
491 |
-
*/
|
492 |
-
private function template_footer()
|
493 |
-
{
|
494 |
-
echo '</div>';
|
495 |
-
}
|
496 |
-
|
497 |
-
|
498 |
-
/**
|
499 |
-
* Create the settings page
|
500 |
-
*/
|
501 |
-
public function init_settings_page()
|
502 |
-
{
|
503 |
-
|
504 |
-
$this->template_header();
|
505 |
-
$this->template_body();
|
506 |
-
$this->template_footer();
|
507 |
-
|
508 |
-
}
|
509 |
-
|
510 |
-
|
511 |
-
/**
|
512 |
-
* Retrieve tabs
|
513 |
-
*
|
514 |
-
* @return array
|
515 |
-
*/
|
516 |
-
private function get_tabs()
|
517 |
-
{
|
518 |
-
$tabs = array();
|
519 |
-
foreach ( $this->options as $option ) {
|
520 |
-
|
521 |
-
if ( $option[ 'type' ] != 'heading' )
|
522 |
-
continue;
|
523 |
-
|
524 |
-
$option[ 'slug' ] = sanitize_title( $option[ 'name' ] );
|
525 |
-
unset( $option[ 'type' ] );
|
526 |
-
|
527 |
-
$tabs[ ] = $option;
|
528 |
-
}
|
529 |
-
|
530 |
-
return $tabs;
|
531 |
-
}
|
532 |
-
|
533 |
-
|
534 |
-
/**
|
535 |
-
* Heading for navigation
|
536 |
-
*
|
537 |
-
* @return string
|
538 |
-
*/
|
539 |
-
private function display_tabs()
|
540 |
-
{
|
541 |
-
$tabs = $this->get_tabs();
|
542 |
-
$tabname = !empty ( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : $tabs[ 0 ][ 'slug' ];
|
543 |
-
$menu = '';
|
544 |
-
|
545 |
-
foreach ( $tabs as $tab ) {
|
546 |
-
$class = $tabname == $tab[ 'slug' ] ? 'nav-tab-active' : '';
|
547 |
-
|
548 |
-
$fields = array(
|
549 |
-
'page' => $this->id,
|
550 |
-
'tab' => $tab[ 'slug' ],
|
551 |
-
);
|
552 |
-
|
553 |
-
$query = http_build_query( array_merge( $_GET, $fields ) );
|
554 |
-
$menu .= sprintf( '<a id="%s-tab" class="nav-tab %s" title="%s" href="?%s">%s</a>', $tab[ 'slug' ], $class, $tab[ 'name' ], $query, esc_html( $tab[ 'name' ] ) );
|
555 |
-
}
|
556 |
-
|
557 |
-
return $menu;
|
558 |
-
}
|
559 |
-
|
560 |
-
|
561 |
-
/**
|
562 |
-
* Update an option
|
563 |
-
*
|
564 |
-
* @param string $name
|
565 |
-
* @param string $value
|
566 |
-
*
|
567 |
-
* @return bool
|
568 |
-
*/
|
569 |
-
public function update_option( $name, $value )
|
570 |
-
{
|
571 |
-
// Overwrite the key/value pair
|
572 |
-
$this->current_options = array( $name => $value ) + (array) $this->current_options;
|
573 |
-
|
574 |
-
return update_option( $this->id . '_options', $this->current_options );
|
575 |
-
}
|
576 |
-
|
577 |
-
|
578 |
-
/**
|
579 |
-
* Get an option
|
580 |
-
*
|
581 |
-
* @param string $name
|
582 |
-
* @param string $default (optional)
|
583 |
-
*
|
584 |
-
* @return bool
|
585 |
-
*/
|
586 |
-
public function get_option( $name, $default = false )
|
587 |
-
{
|
588 |
-
return isset( $this->current_options[ $name ] ) ? maybe_unserialize( $this->current_options[ $name ] ) : $default;
|
589 |
-
}
|
590 |
-
|
591 |
-
|
592 |
-
public function settings_options_format( $setting )
|
593 |
-
{
|
594 |
-
if ( empty( $setting ) ) return false;
|
595 |
-
|
596 |
-
$defaults = apply_filters( $this->id . '_options_defaults', array(
|
597 |
-
'name' => '',
|
598 |
-
'desc' => '',
|
599 |
-
'placeholder' => '',
|
600 |
-
'class' => '',
|
601 |
-
'tip' => '',
|
602 |
-
'id' => '',
|
603 |
-
'css' => '',
|
604 |
-
'type' => 'text',
|
605 |
-
'std' => '',
|
606 |
-
'select2' => false,
|
607 |
-
'multiple' => false,
|
608 |
-
'options' => array(),
|
609 |
-
'restrict' => array(),
|
610 |
-
'settings' => array()
|
611 |
-
) );
|
612 |
-
|
613 |
-
// Each to it's own variable for slim-ness' sakes.
|
614 |
-
$setting = shortcode_atts( $defaults, $setting );
|
615 |
-
|
616 |
-
$restrict_defaults = array(
|
617 |
-
'min' => 0,
|
618 |
-
'max' => '',
|
619 |
-
'step' => 'any',
|
620 |
-
);
|
621 |
-
|
622 |
-
$setting[ 'restrict' ] = shortcode_atts( $restrict_defaults, $setting[ 'restrict' ] );
|
623 |
-
|
624 |
-
$setting[ 'value' ] = $this->get_option( $setting[ 'id' ] );
|
625 |
-
$setting[ 'value' ] = $setting[ 'value' ] !== false ? maybe_unserialize( $setting[ 'value' ] ) : false;
|
626 |
-
$setting[ 'value' ] = $this->sanitize_value( $setting[ 'value' ], $setting );
|
627 |
-
|
628 |
-
$setting[ 'title' ] = $setting[ 'name' ];
|
629 |
-
$setting[ 'name' ] = $this->id . "_options[{$setting['id']}]";
|
630 |
-
|
631 |
-
$setting[ 'grouped' ] = !$setting[ 'title' ] ? ' style="padding-top:0px;"' : '';
|
632 |
-
$setting[ 'tip' ] = $this->get_formatted_tip( $setting[ 'tip' ] );
|
633 |
-
|
634 |
-
$header_types = apply_filters( $this->id . '_options_header_types', array( 'heading', 'title' ) );
|
635 |
-
|
636 |
-
extract( $setting );
|
637 |
-
|
638 |
-
$description = $desc && !$grouped && $type != 'checkbox'
|
639 |
-
? '<br /><small>' . $desc . '</small>'
|
640 |
-
: '<label for="' . $id . '"> ' . $desc . '</label>';
|
641 |
-
|
642 |
-
$description = ( ( in_array( $type, $header_types ) || $type == 'radio' ) && !empty( $desc ) )
|
643 |
-
? '<p>' . $desc . '</p>'
|
644 |
-
: $description;
|
645 |
-
|
646 |
-
?>
|
647 |
-
|
648 |
-
<?php if ( !in_array( $type, $header_types ) ) : ?>
|
649 |
-
<!-- Header of the option. -->
|
650 |
-
<tr valign="top">
|
651 |
-
<th scope="row"<?php echo $grouped; ?>>
|
652 |
-
|
653 |
-
<?php echo $tip; ?>
|
654 |
-
|
655 |
-
<?php if ( !$grouped ) : ?>
|
656 |
-
<label for="<?php echo $name; ?>" class="description"><?php echo $title; ?></label>
|
657 |
-
<?php endif; ?>
|
658 |
-
|
659 |
-
</th>
|
660 |
-
<td <?php echo $grouped; ?> >
|
661 |
-
<?php endif; ?>
|
662 |
-
|
663 |
-
<?php foreach ( $header_types as $header ) :
|
664 |
-
if ( $type != $header ) continue; ?>
|
665 |
-
<tr>
|
666 |
-
<th scope="col" colspan="2">
|
667 |
-
<h3 class="title"><?php echo $title; ?></h3>
|
668 |
-
<?php echo $description; ?>
|
669 |
-
</th>
|
670 |
-
</tr>
|
671 |
-
<?php endforeach; ?>
|
672 |
-
|
673 |
-
<?php switch ( $type ) :
|
674 |
-
|
675 |
-
case 'text' :
|
676 |
-
case 'color' :
|
677 |
-
case 'number' :
|
678 |
-
if ( $type == 'color' ) {
|
679 |
-
$type = 'text';
|
680 |
-
$class .= ' colorpick';
|
681 |
-
$description .= '<div id="colorPickerDiv_' . $id . '" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>';
|
682 |
-
}
|
683 |
-
?>
|
684 |
-
<input name="<?php echo $name; ?>"
|
685 |
-
id="<?php echo $id; ?>"
|
686 |
-
type="<?php echo $type; ?>"
|
687 |
-
|
688 |
-
<?php if ( $type == 'number' ): ?>
|
689 |
-
min="<?php echo $restrict[ 'min' ]; ?>"
|
690 |
-
max="<?php echo $restrict[ 'max' ]; ?>"
|
691 |
-
step="<?php echo $restrict[ 'step' ]; ?>"
|
692 |
-
<?php endif; ?>
|
693 |
-
|
694 |
-
class="regular-text <?php echo $class; ?>"
|
695 |
-
style="<?php echo $css; ?>"
|
696 |
-
placeholder="<?php echo $placeholder; ?>"
|
697 |
-
value="<?php echo $value !== false ? $value : $std; ?>"
|
698 |
-
/>
|
699 |
-
<?php echo $description;
|
700 |
-
break;
|
701 |
-
|
702 |
-
case 'checkbox':
|
703 |
-
|
704 |
-
$selected = ( $value !== false ) ? $value : $std;
|
705 |
-
|
706 |
-
if ( $multiple ) :
|
707 |
-
|
708 |
-
foreach ( $options as $key => $desc ) : ?>
|
709 |
-
|
710 |
-
<input name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
711 |
-
id="<?php echo $id . '_' . $key; ?>"
|
712 |
-
type="checkbox"
|
713 |
-
class="<?php echo $class; ?>"
|
714 |
-
style="<?php echo $css; ?>"
|
715 |
-
value="<?php echo $key; ?>"
|
716 |
-
<?php @checked( $selected[$key], 1 ); ?>
|
717 |
-
/>
|
718 |
-
<label for="<?php echo $id . '_' . $key; ?>">
|
719 |
-
<?php echo $desc; ?>
|
720 |
-
</label>
|
721 |
-
<br/>
|
722 |
-
<?php
|
723 |
-
|
724 |
-
endforeach;
|
725 |
-
|
726 |
-
else : ?>
|
727 |
-
|
728 |
-
<input name="<?php echo $name; ?>"
|
729 |
-
id="<?php echo $id ?>"
|
730 |
-
type="checkbox"
|
731 |
-
class="<?php echo $class; ?>"
|
732 |
-
style="<?php echo $css; ?>"
|
733 |
-
<?php checked( $selected, 1 ); ?>
|
734 |
-
/>
|
735 |
-
<?php echo $description;
|
736 |
-
endif;
|
737 |
-
break;
|
738 |
-
|
739 |
-
case 'radio':
|
740 |
-
|
741 |
-
$selected = ( $value !== false ) ? $value : $std;
|
742 |
-
|
743 |
-
foreach ( $options as $key => $val ) : ?>
|
744 |
-
<label class="radio">
|
745 |
-
<input type="radio"
|
746 |
-
name="<?php echo $name; ?>"
|
747 |
-
id="<?php echo $key; ?>"
|
748 |
-
value="<?php echo $key; ?>"
|
749 |
-
class="<?php echo $class; ?>"
|
750 |
-
<?php checked( $selected, $key ); ?>
|
751 |
-
/>
|
752 |
-
<?php echo $val; ?>
|
753 |
-
</label><br/>
|
754 |
-
<?php endforeach;
|
755 |
-
echo $description;
|
756 |
-
break;
|
757 |
-
|
758 |
-
case 'single_select_page':
|
759 |
-
|
760 |
-
$selected = ( $value !== false ) ? $value : $std;
|
761 |
-
|
762 |
-
$args = array(
|
763 |
-
'name' => $name,
|
764 |
-
'id' => $id,
|
765 |
-
'sort_order' => 'ASC',
|
766 |
-
'echo' => 0,
|
767 |
-
'selected' => $selected
|
768 |
-
);
|
769 |
-
|
770 |
-
echo str_replace( "'>", "'><option></option>", wp_dropdown_pages( $args ) );
|
771 |
-
|
772 |
-
echo $description;
|
773 |
-
|
774 |
-
if ( $select2 ) : ?>
|
775 |
-
<script type="text/javascript">jQuery(function () {
|
776 |
-
jQuery("#<?php echo $id; ?>").select2({ allowClear: true, placeholder: "<?php _e( 'Select a page...', 'geczy' ); ?>", width: '350px' });
|
777 |
-
});</script>
|
778 |
-
<?php endif;
|
779 |
-
|
780 |
-
break;
|
781 |
-
|
782 |
-
case 'select':
|
783 |
-
|
784 |
-
$selected = ( $value !== false ) ? $value : $std;
|
785 |
-
$options = apply_filters( $this->id . '_select_options', $options, $setting ); ?>
|
786 |
-
|
787 |
-
<select id="<?php echo $id; ?>"
|
788 |
-
class="<?php echo $class; ?>"
|
789 |
-
style="<?php echo $css; ?>"
|
790 |
-
name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
791 |
-
<?php echo $multiple ? 'multiple="multiple"' : ''; ?>>
|
792 |
-
|
793 |
-
<?php foreach ( $options as $key => $val ) : ?>
|
794 |
-
<option
|
795 |
-
value="<?php echo $key; ?>" <?php self::selected( $selected, $key ); ?>><?php echo $val; ?></option>
|
796 |
-
<?php endforeach; ?>
|
797 |
-
</select>
|
798 |
-
|
799 |
-
<?php echo $description;
|
800 |
-
|
801 |
-
if ( $select2 ) : ?>
|
802 |
-
<script type="text/javascript">jQuery(function () {
|
803 |
-
jQuery("#<?php echo $id; ?>").select2({ width: '350px' });
|
804 |
-
});</script>
|
805 |
-
<?php endif;
|
806 |
-
|
807 |
-
break;
|
808 |
-
|
809 |
-
case 'textarea':
|
810 |
-
?>
|
811 |
-
<textarea name="<?php echo $name; ?>"
|
812 |
-
id="<?php echo $id; ?>"
|
813 |
-
class="large-text <?php echo $class; ?>"
|
814 |
-
style="<?php if ( $css ) echo $css; else echo 'width:300px;'; ?>"
|
815 |
-
placeholder="<?php echo $placeholder; ?>"
|
816 |
-
rows="3"
|
817 |
-
><?php echo ( $value !== false ) ? $value : $std; ?></textarea>
|
818 |
-
<?php echo $description;
|
819 |
-
break;
|
820 |
-
|
821 |
-
case 'wysiwyg':
|
822 |
-
wp_editor( $value, $id, array( 'textarea_name' => $name ) );
|
823 |
-
echo $description;
|
824 |
-
break;
|
825 |
-
|
826 |
-
default :
|
827 |
-
do_action( $this->id . '_options_type_' . $type, $setting );
|
828 |
-
break;
|
829 |
-
|
830 |
-
endswitch;
|
831 |
-
|
832 |
-
/* Footer of the option. */
|
833 |
-
if ( !in_array( $type, $header_types ) ) echo '</td></tr>';
|
834 |
-
|
835 |
-
}
|
836 |
-
|
837 |
-
|
838 |
-
/**
|
839 |
-
*
|
840 |
-
*
|
841 |
-
* @param unknown $haystack
|
842 |
-
* @param unknown $current
|
843 |
-
*/
|
844 |
-
private function selected( $haystack, $current )
|
845 |
-
{
|
846 |
-
|
847 |
-
if ( is_array( $haystack ) && in_array( $current, $haystack ) ) {
|
848 |
-
$current = $haystack = 1;
|
849 |
-
}
|
850 |
-
|
851 |
-
selected( $haystack, $current );
|
852 |
-
}
|
853 |
-
|
854 |
-
|
855 |
-
/**
|
856 |
-
*
|
857 |
-
*
|
858 |
-
* @param unknown $haystack
|
859 |
-
* @param unknown $current
|
860 |
-
*/
|
861 |
-
private function checked( $haystack, $current )
|
862 |
-
{
|
863 |
-
|
864 |
-
if ( is_array( $haystack ) && !empty( $haystack[ $current ] ) ) {
|
865 |
-
$current = $haystack = 1;
|
866 |
-
}
|
867 |
-
|
868 |
-
checked( $haystack, $current );
|
869 |
-
}
|
870 |
-
|
871 |
-
|
872 |
-
/**
|
873 |
-
* Format a tooltip given a string
|
874 |
-
*
|
875 |
-
* @param string $tip
|
876 |
-
*
|
877 |
-
* @return string
|
878 |
-
*/
|
879 |
-
private function get_formatted_tip( $tip )
|
880 |
-
{
|
881 |
-
return $tip ? sprintf( '<a href="#" title="%s" class="sf-tips" tabindex="99"></a>', $tip ) : '';
|
882 |
-
}
|
883 |
-
|
884 |
-
|
885 |
-
/**
|
886 |
-
*
|
887 |
-
*
|
888 |
-
* @param unknown $value
|
889 |
-
* @param unknown $setting
|
890 |
-
*
|
891 |
-
* @return unknown
|
892 |
-
*/
|
893 |
-
private function sanitize_value( $value, $setting )
|
894 |
-
{
|
895 |
-
if ( $value !== false && $setting[ 'type' ] != 'wysiwyg' ) {
|
896 |
-
if ( is_array( $value ) ) {
|
897 |
-
foreach ( $value as $key => $output ) {
|
898 |
-
$value[ $key ] = esc_attr( $output );
|
899 |
-
}
|
900 |
-
} else {
|
901 |
-
$value = esc_attr( $value );
|
902 |
-
}
|
903 |
-
}
|
904 |
-
|
905 |
-
return apply_filters( $this->id . '_options_sanitize_value', $value, $setting );
|
906 |
-
}
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
}
|
911 |
-
|
912 |
-
|
913 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* WP-Simple-Settings-Framework
|
5 |
+
*
|
6 |
+
* Copyright (c) 2012 Matt Gates.
|
7 |
+
* All rights reserved.
|
8 |
+
*
|
9 |
+
* Redistribution and use in source and binary forms, with or without
|
10 |
+
* modification, are permitted provided that the following conditions
|
11 |
+
* are met:
|
12 |
+
*
|
13 |
+
* * Redistributions of source code must retain the above copyright
|
14 |
+
* notice, this list of conditions and the following disclaimer.
|
15 |
+
*
|
16 |
+
* * Redistributions in binary form must reproduce the above copyright
|
17 |
+
* notice, this list of conditions and the following disclaimer in
|
18 |
+
* the documentation and/or other materials provided with the
|
19 |
+
* distribution.
|
20 |
+
*
|
21 |
+
* * Neither the names of the copyright holders nor the names of the
|
22 |
+
* contributors may be used to endorse or promote products derived
|
23 |
+
* from this software without specific prior written permission.
|
24 |
+
*
|
25 |
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
26 |
+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
27 |
+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
28 |
+
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
29 |
+
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
30 |
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
31 |
+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
32 |
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
33 |
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
34 |
+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
35 |
+
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
36 |
+
* POSSIBILITY OF SUCH DAMAGE.
|
37 |
+
*
|
38 |
+
* @subpackage WP-Simple-Settings-Framework
|
39 |
+
* @copyright 2012 Matt Gates.
|
40 |
+
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
|
41 |
+
* @link http://mgates.me
|
42 |
+
* @version 1.1
|
43 |
+
* @author Matt Gates <info@mgates.me>
|
44 |
+
* @package WordPress
|
45 |
+
*/
|
46 |
+
|
47 |
+
|
48 |
+
if ( !class_exists( 'SF_Settings_API' ) ) {
|
49 |
+
|
50 |
+
class SF_Settings_API
|
51 |
+
{
|
52 |
+
|
53 |
+
private $data = array();
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Init
|
57 |
+
*
|
58 |
+
* @param string $id
|
59 |
+
* @param string $title
|
60 |
+
* @param string $menu (optional)
|
61 |
+
* @param string $file
|
62 |
+
*/
|
63 |
+
public function __construct( $id, $title, $menu = '', $file )
|
64 |
+
{
|
65 |
+
$this->assets_url = trailingslashit( plugins_url( 'assets/', dirname( __FILE__ ) ) );
|
66 |
+
$this->id = $id;
|
67 |
+
$this->title = $title;
|
68 |
+
$this->menu = empty( $menu ) ? 'plugins.php' : $menu;
|
69 |
+
|
70 |
+
$this->file = $file;
|
71 |
+
|
72 |
+
$this->includes();
|
73 |
+
$this->actions();
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
// ==================================================================
|
78 |
+
//
|
79 |
+
// Getter and setter.
|
80 |
+
//
|
81 |
+
// ------------------------------------------------------------------
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Setter
|
85 |
+
*
|
86 |
+
* @param unknown $name
|
87 |
+
* @param unknown $value
|
88 |
+
*/
|
89 |
+
public function __set( $name, $value )
|
90 |
+
{
|
91 |
+
if ( isset ( $this->data[ $name ] ) && is_array( $this->data[ $name ] ) ) {
|
92 |
+
$this->data[ $name ] = array_merge( $this->data[ $name ], $value );
|
93 |
+
} else {
|
94 |
+
$this->data[ $name ] = $value;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Getter
|
101 |
+
*
|
102 |
+
* @param unknown $name
|
103 |
+
*
|
104 |
+
* @return unknown
|
105 |
+
*/
|
106 |
+
public function __get( $name )
|
107 |
+
{
|
108 |
+
if ( array_key_exists( $name, $this->data ) ) {
|
109 |
+
return $this->data[ $name ];
|
110 |
+
}
|
111 |
+
|
112 |
+
return null;
|
113 |
+
}
|
114 |
+
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Isset
|
118 |
+
*
|
119 |
+
* @param unknown $name
|
120 |
+
*
|
121 |
+
* @return unknown
|
122 |
+
*/
|
123 |
+
public function __isset( $name )
|
124 |
+
{
|
125 |
+
return isset( $this->data[ $name ] );
|
126 |
+
}
|
127 |
+
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Unset
|
131 |
+
*
|
132 |
+
* @param unknown $name
|
133 |
+
*/
|
134 |
+
public function __unset( $name )
|
135 |
+
{
|
136 |
+
unset( $this->data[ $name ] );
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Add a "Settings" link to the plugins.php page
|
142 |
+
*
|
143 |
+
* @param array $links
|
144 |
+
* @param array $file
|
145 |
+
*
|
146 |
+
* @return array
|
147 |
+
*/
|
148 |
+
public function add_settings_link( $links, $file )
|
149 |
+
{
|
150 |
+
$this_plugin = plugin_basename( $this->file );
|
151 |
+
$page = strpos( $this->menu, '.php' ) ? $this->menu : 'admin.php';
|
152 |
+
if ( $file == $this_plugin ) {
|
153 |
+
$settings_link = '<a href="' . $page . '?page=' . $this->id . '">' . __( 'Settings', 'geczy' ) . '</a>';
|
154 |
+
array_unshift( $links, $settings_link );
|
155 |
+
}
|
156 |
+
|
157 |
+
return $links;
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
// ==================================================================
|
162 |
+
//
|
163 |
+
// Begin initialization.
|
164 |
+
//
|
165 |
+
// ------------------------------------------------------------------
|
166 |
+
|
167 |
+
/**
|
168 |
+
* Core files
|
169 |
+
*/
|
170 |
+
private function includes()
|
171 |
+
{
|
172 |
+
require_once dirname( __FILE__ ) . '/sf-class-sanitize.php';
|
173 |
+
require_once dirname( __FILE__ ) . '/sf-class-format-options.php';
|
174 |
+
new SF_Sanitize;
|
175 |
+
}
|
176 |
+
|
177 |
+
|
178 |
+
/**
|
179 |
+
* Hooks
|
180 |
+
*/
|
181 |
+
private function actions()
|
182 |
+
{
|
183 |
+
add_action( 'admin_enqueue_scripts', array( &$this, 'admin_enqueue_scripts' ) );
|
184 |
+
add_action( 'admin_init', array( &$this, 'register_options' ) );
|
185 |
+
add_action( 'admin_menu', array( &$this, 'create_menu' ) );
|
186 |
+
add_filter( 'plugin_action_links', array( &$this, 'add_settings_link' ), 10, 2 );
|
187 |
+
}
|
188 |
+
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Admin scripts and styles
|
192 |
+
*/
|
193 |
+
public function admin_enqueue_scripts()
|
194 |
+
{
|
195 |
+
global $pagenow;
|
196 |
+
if (is_admin() || $pagenow === 'wc_prd_vendor') {
|
197 |
+
wp_register_script( 'bootstrap-tooltip', $this->assets_url . 'js/bootstrap-tooltip.js', array( 'jquery' ), '1.0' );
|
198 |
+
wp_register_script( 'select2', $this->assets_url . 'js/select2/select2.min.js', array( 'jquery' ), '3.5.2' );
|
199 |
+
wp_register_script( 'sf-scripts', $this->assets_url . 'js/sf-jquery.js', array( 'jquery' ), '1.0' );
|
200 |
+
wp_register_style( 'select2', $this->assets_url . 'js/select2/select2.css' );
|
201 |
+
wp_register_style( 'sf-styles', $this->assets_url . 'css/sf-styles.css' );
|
202 |
+
}
|
203 |
+
}
|
204 |
+
|
205 |
+
|
206 |
+
/**
|
207 |
+
* Admin scripts and styles
|
208 |
+
*/
|
209 |
+
public function admin_print_scripts()
|
210 |
+
{
|
211 |
+
global $wp_version;
|
212 |
+
|
213 |
+
//Check wp version and load appropriate scripts for colorpicker.
|
214 |
+
if ( 3.5 <= $wp_version ) {
|
215 |
+
wp_enqueue_style( 'wp-color-picker' );
|
216 |
+
wp_enqueue_script( 'wp-color-picker' );
|
217 |
+
} else {
|
218 |
+
wp_enqueue_style( 'farbtastic' );
|
219 |
+
wp_enqueue_script( 'farbtastic' );
|
220 |
+
}
|
221 |
+
|
222 |
+
wp_enqueue_script( 'bootstrap-tooltip' );
|
223 |
+
wp_enqueue_script( 'select2' );
|
224 |
+
wp_enqueue_script( 'sf-scripts' );
|
225 |
+
|
226 |
+
wp_enqueue_style( 'wp-color-picker' );
|
227 |
+
wp_enqueue_style( 'select2' );
|
228 |
+
wp_enqueue_style( 'sf-styles' );
|
229 |
+
}
|
230 |
+
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Register setting
|
234 |
+
*/
|
235 |
+
public function register_options()
|
236 |
+
{
|
237 |
+
register_setting( $this->id . '_options_nonce', $this->id . '_options', array( &$this, 'validate_options' ) );
|
238 |
+
}
|
239 |
+
|
240 |
+
|
241 |
+
/**
|
242 |
+
* Create menu
|
243 |
+
*/
|
244 |
+
public function create_menu()
|
245 |
+
{
|
246 |
+
$page = add_submenu_page( $this->menu, $this->title, $this->title, apply_filters( $this->id . '_manage_options', 'manage_options' ), $this->id, array( &$this, 'init_settings_page' ) );
|
247 |
+
add_action( 'admin_print_scripts-' . $page, array( &$this, 'admin_print_scripts' ) );
|
248 |
+
}
|
249 |
+
|
250 |
+
|
251 |
+
/**
|
252 |
+
* Parse options into tabbed organization
|
253 |
+
*
|
254 |
+
* @return array
|
255 |
+
*/
|
256 |
+
private function parse_options()
|
257 |
+
{
|
258 |
+
$options = $this->options;
|
259 |
+
|
260 |
+
foreach ( $options as $option ) {
|
261 |
+
|
262 |
+
if ( $option[ 'type' ] == 'heading' ) {
|
263 |
+
$tab_name = sanitize_title( $option[ 'name' ] );
|
264 |
+
$this->tab_headers = array( $tab_name => $option[ 'name' ] );
|
265 |
+
|
266 |
+
continue;
|
267 |
+
}
|
268 |
+
|
269 |
+
$option[ 'tab' ] = $tab_name;
|
270 |
+
$tabs[ $tab_name ][ ] = $option;
|
271 |
+
|
272 |
+
}
|
273 |
+
|
274 |
+
$this->tabs = $tabs;
|
275 |
+
|
276 |
+
return $tabs;
|
277 |
+
}
|
278 |
+
|
279 |
+
|
280 |
+
/**
|
281 |
+
* Load the options array from a file
|
282 |
+
*
|
283 |
+
* @param string $option_file
|
284 |
+
*/
|
285 |
+
public function load_options( $option_file )
|
286 |
+
{
|
287 |
+
if ( !empty( $this->options ) ) return;
|
288 |
+
|
289 |
+
if ( file_exists( $option_file ) ) {
|
290 |
+
require $option_file;
|
291 |
+
$this->options = apply_filters( $this->id . '_options', $options );
|
292 |
+
$this->parse_options();
|
293 |
+
|
294 |
+
$this->current_options = $this->get_current_options();
|
295 |
+
|
296 |
+
/* If the option has no saved data, load the defaults. */
|
297 |
+
/* @TODO: Can prob add this to the activation hook. */
|
298 |
+
$this->set_defaults( $this->current_options );
|
299 |
+
} else {
|
300 |
+
wp_die( __( 'Could not load settings at: ', 'geczy' ) . '<br/><code>' . $option_file . '</code>', __( 'Error - WP Settings Framework', 'geczy' ) );
|
301 |
+
}
|
302 |
+
}
|
303 |
+
|
304 |
+
|
305 |
+
/**
|
306 |
+
*
|
307 |
+
*
|
308 |
+
* @return unknown
|
309 |
+
*/
|
310 |
+
public function get_current_options()
|
311 |
+
{
|
312 |
+
if ( !empty( $this->current_options ) )
|
313 |
+
return $this->current_options;
|
314 |
+
|
315 |
+
$options = get_option( $this->id . '_options' );
|
316 |
+
|
317 |
+
if ( $options ) {
|
318 |
+
$options = array_map( 'maybe_unserialize', $options );
|
319 |
+
}
|
320 |
+
|
321 |
+
return $options;
|
322 |
+
}
|
323 |
+
|
324 |
+
|
325 |
+
/**
|
326 |
+
* Sanitize and validate post fields
|
327 |
+
*
|
328 |
+
* @param unknown $input
|
329 |
+
*
|
330 |
+
* @return unknown
|
331 |
+
*/
|
332 |
+
public function validate_options( $input )
|
333 |
+
{
|
334 |
+
if ( !isset( $_POST[ 'update' ] ) )
|
335 |
+
return $this->get_defaults();
|
336 |
+
|
337 |
+
$clean = $this->current_options;
|
338 |
+
$tabname = $_POST[ 'currentTab' ];
|
339 |
+
|
340 |
+
foreach ( $this->tabs[ $tabname ] as $option ) :
|
341 |
+
|
342 |
+
if ( !isset( $option[ 'id' ] ) )
|
343 |
+
continue;
|
344 |
+
|
345 |
+
if ( !isset( $option[ 'type' ] ) )
|
346 |
+
continue;
|
347 |
+
|
348 |
+
if ( $option[ 'type' ] == 'select' ) {
|
349 |
+
$option[ 'options' ] = apply_filters( $this->id . '_select_options', $option[ 'options' ], $option );
|
350 |
+
}
|
351 |
+
|
352 |
+
$id = sanitize_text_field( strtolower( $option[ 'id' ] ) );
|
353 |
+
|
354 |
+
// Set checkbox to false if it wasn't sent in the $_POST
|
355 |
+
if ( 'checkbox' == $option[ 'type' ] && !isset( $input[ $id ] ) )
|
356 |
+
$input[ $id ] = 0;
|
357 |
+
|
358 |
+
// For a value to be submitted to database it must pass through a sanitization filter
|
359 |
+
if ( has_filter( 'geczy_sanitize_' . $option[ 'type' ] ) ) {
|
360 |
+
$clean[ $id ] = apply_filters( 'geczy_sanitize_' . $option[ 'type' ], $input[ $id ], $option );
|
361 |
+
}
|
362 |
+
|
363 |
+
endforeach;
|
364 |
+
|
365 |
+
do_action( $this->id . '_options_updated', $clean, $tabname );
|
366 |
+
add_settings_error( $this->id, 'save_options', __( 'Settings saved.', 'geczy' ), 'updated' );
|
367 |
+
|
368 |
+
return apply_filters( $this->id . '_options_on_update', $clean, $tabname );
|
369 |
+
}
|
370 |
+
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Create default options
|
374 |
+
*
|
375 |
+
* @param unknown $current_options (optional)
|
376 |
+
*/
|
377 |
+
private function set_defaults( $current_options = array() )
|
378 |
+
{
|
379 |
+
$options = $this->get_defaults( $current_options );
|
380 |
+
if ( $options ) {
|
381 |
+
update_option( $this->id . '_options', $options );
|
382 |
+
}
|
383 |
+
}
|
384 |
+
|
385 |
+
|
386 |
+
/**
|
387 |
+
* Retrieve default options
|
388 |
+
*
|
389 |
+
* @param unknown $currents (optional)
|
390 |
+
*
|
391 |
+
* @return array
|
392 |
+
*/
|
393 |
+
private function get_defaults( $currents = array() )
|
394 |
+
{
|
395 |
+
$output = array();
|
396 |
+
$config = $this->options;
|
397 |
+
$flag = false;
|
398 |
+
|
399 |
+
if ( $currents ) {
|
400 |
+
foreach ( $config as $value ) {
|
401 |
+
if ( !isset( $value[ 'id' ] ) || !isset( $value[ 'std' ] ) || !isset( $value[ 'type' ] ) )
|
402 |
+
continue;
|
403 |
+
|
404 |
+
if ( !isset( $currents[ $value[ 'id' ] ] ) ) {
|
405 |
+
$flag = true;
|
406 |
+
}
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
foreach ( $config as $option ) {
|
411 |
+
if ( !isset( $option[ 'id' ] ) || !isset( $option[ 'std' ] ) || !isset( $option[ 'type' ] ) )
|
412 |
+
continue;
|
413 |
+
|
414 |
+
if ( $currents && isset( $currents[ $option[ 'id' ] ] ) ) {
|
415 |
+
$output[ $option[ 'id' ] ] = $currents[ $option[ 'id' ] ];
|
416 |
+
} else if ( has_filter( 'geczy_sanitize_' . $option[ 'type' ] ) ) {
|
417 |
+
$output[ $option[ 'id' ] ] = apply_filters( 'geczy_sanitize_' . $option[ 'type' ], $option[ 'std' ], $option );
|
418 |
+
}
|
419 |
+
}
|
420 |
+
|
421 |
+
if ( $currents ) {
|
422 |
+
$output = array_merge( $currents, $output );
|
423 |
+
}
|
424 |
+
|
425 |
+
return !$flag && $currents ? array() : $output;
|
426 |
+
}
|
427 |
+
|
428 |
+
|
429 |
+
/**
|
430 |
+
* HTML header
|
431 |
+
*/
|
432 |
+
private function template_header()
|
433 |
+
{
|
434 |
+
?>
|
435 |
+
<div class="wrap">
|
436 |
+
<?php screen_icon(); ?><h2><?php echo $this->title; ?></h2>
|
437 |
+
|
438 |
+
<h2 class="nav-tab-wrapper">
|
439 |
+
<?php echo $this->display_tabs(); ?>
|
440 |
+
</h2><?php
|
441 |
+
|
442 |
+
if ( !empty ( $_REQUEST[ 'settings-updated' ] ) )
|
443 |
+
settings_errors();
|
444 |
+
|
445 |
+
}
|
446 |
+
|
447 |
+
|
448 |
+
/**
|
449 |
+
* HTML body
|
450 |
+
*
|
451 |
+
* @return unknown
|
452 |
+
*/
|
453 |
+
private function template_body()
|
454 |
+
{
|
455 |
+
|
456 |
+
if ( empty( $this->options ) ) return false;
|
457 |
+
|
458 |
+
|
459 |
+
$options = $this->options;
|
460 |
+
$tabs = $this->get_tabs();
|
461 |
+
$tabname = !empty ( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : $tabs[ 0 ][ 'slug' ];
|
462 |
+
|
463 |
+
$options = apply_filters( $this->id . '_options_tab-' . $tabname, $this->tabs[ $tabname ] ); ?>
|
464 |
+
|
465 |
+
<form method="post" action="options.php">
|
466 |
+
<?php settings_fields( $this->id . '_options_nonce' ); ?>
|
467 |
+
<table class="form-table">
|
468 |
+
|
469 |
+
<?php
|
470 |
+
foreach ( $options as $value ) :
|
471 |
+
$this->settings_options_format( $value );
|
472 |
+
endforeach;
|
473 |
+
|
474 |
+
do_action( $this->id . '_options_tab-' . $tabname );
|
475 |
+
?>
|
476 |
+
|
477 |
+
</table>
|
478 |
+
|
479 |
+
<p class="submit">
|
480 |
+
<input type="hidden" name="currentTab" value="<?php echo $tabname; ?>">
|
481 |
+
<input type="submit" name="update" class="button-primary"
|
482 |
+
value="<?php echo sprintf( __( 'Save %s changes', 'geczy' ), $this->tab_headers[ $tabname ] ); ?>"/>
|
483 |
+
</p>
|
484 |
+
</form> <?php
|
485 |
+
|
486 |
+
}
|
487 |
+
|
488 |
+
|
489 |
+
/**
|
490 |
+
* HTML footer
|
491 |
+
*/
|
492 |
+
private function template_footer()
|
493 |
+
{
|
494 |
+
echo '</div>';
|
495 |
+
}
|
496 |
+
|
497 |
+
|
498 |
+
/**
|
499 |
+
* Create the settings page
|
500 |
+
*/
|
501 |
+
public function init_settings_page()
|
502 |
+
{
|
503 |
+
|
504 |
+
$this->template_header();
|
505 |
+
$this->template_body();
|
506 |
+
$this->template_footer();
|
507 |
+
|
508 |
+
}
|
509 |
+
|
510 |
+
|
511 |
+
/**
|
512 |
+
* Retrieve tabs
|
513 |
+
*
|
514 |
+
* @return array
|
515 |
+
*/
|
516 |
+
private function get_tabs()
|
517 |
+
{
|
518 |
+
$tabs = array();
|
519 |
+
foreach ( $this->options as $option ) {
|
520 |
+
|
521 |
+
if ( $option[ 'type' ] != 'heading' )
|
522 |
+
continue;
|
523 |
+
|
524 |
+
$option[ 'slug' ] = sanitize_title( $option[ 'name' ] );
|
525 |
+
unset( $option[ 'type' ] );
|
526 |
+
|
527 |
+
$tabs[ ] = $option;
|
528 |
+
}
|
529 |
+
|
530 |
+
return $tabs;
|
531 |
+
}
|
532 |
+
|
533 |
+
|
534 |
+
/**
|
535 |
+
* Heading for navigation
|
536 |
+
*
|
537 |
+
* @return string
|
538 |
+
*/
|
539 |
+
private function display_tabs()
|
540 |
+
{
|
541 |
+
$tabs = $this->get_tabs();
|
542 |
+
$tabname = !empty ( $_GET[ 'tab' ] ) ? $_GET[ 'tab' ] : $tabs[ 0 ][ 'slug' ];
|
543 |
+
$menu = '';
|
544 |
+
|
545 |
+
foreach ( $tabs as $tab ) {
|
546 |
+
$class = $tabname == $tab[ 'slug' ] ? 'nav-tab-active' : '';
|
547 |
+
|
548 |
+
$fields = array(
|
549 |
+
'page' => $this->id,
|
550 |
+
'tab' => $tab[ 'slug' ],
|
551 |
+
);
|
552 |
+
|
553 |
+
$query = http_build_query( array_merge( $_GET, $fields ) );
|
554 |
+
$menu .= sprintf( '<a id="%s-tab" class="nav-tab %s" title="%s" href="?%s">%s</a>', $tab[ 'slug' ], $class, $tab[ 'name' ], $query, esc_html( $tab[ 'name' ] ) );
|
555 |
+
}
|
556 |
+
|
557 |
+
return $menu;
|
558 |
+
}
|
559 |
+
|
560 |
+
|
561 |
+
/**
|
562 |
+
* Update an option
|
563 |
+
*
|
564 |
+
* @param string $name
|
565 |
+
* @param string $value
|
566 |
+
*
|
567 |
+
* @return bool
|
568 |
+
*/
|
569 |
+
public function update_option( $name, $value )
|
570 |
+
{
|
571 |
+
// Overwrite the key/value pair
|
572 |
+
$this->current_options = array( $name => $value ) + (array) $this->current_options;
|
573 |
+
|
574 |
+
return update_option( $this->id . '_options', $this->current_options );
|
575 |
+
}
|
576 |
+
|
577 |
+
|
578 |
+
/**
|
579 |
+
* Get an option
|
580 |
+
*
|
581 |
+
* @param string $name
|
582 |
+
* @param string $default (optional)
|
583 |
+
*
|
584 |
+
* @return bool
|
585 |
+
*/
|
586 |
+
public function get_option( $name, $default = false )
|
587 |
+
{
|
588 |
+
return isset( $this->current_options[ $name ] ) ? maybe_unserialize( $this->current_options[ $name ] ) : $default;
|
589 |
+
}
|
590 |
+
|
591 |
+
|
592 |
+
public function settings_options_format( $setting )
|
593 |
+
{
|
594 |
+
if ( empty( $setting ) ) return false;
|
595 |
+
|
596 |
+
$defaults = apply_filters( $this->id . '_options_defaults', array(
|
597 |
+
'name' => '',
|
598 |
+
'desc' => '',
|
599 |
+
'placeholder' => '',
|
600 |
+
'class' => '',
|
601 |
+
'tip' => '',
|
602 |
+
'id' => '',
|
603 |
+
'css' => '',
|
604 |
+
'type' => 'text',
|
605 |
+
'std' => '',
|
606 |
+
'select2' => false,
|
607 |
+
'multiple' => false,
|
608 |
+
'options' => array(),
|
609 |
+
'restrict' => array(),
|
610 |
+
'settings' => array()
|
611 |
+
) );
|
612 |
+
|
613 |
+
// Each to it's own variable for slim-ness' sakes.
|
614 |
+
$setting = shortcode_atts( $defaults, $setting );
|
615 |
+
|
616 |
+
$restrict_defaults = array(
|
617 |
+
'min' => 0,
|
618 |
+
'max' => '',
|
619 |
+
'step' => 'any',
|
620 |
+
);
|
621 |
+
|
622 |
+
$setting[ 'restrict' ] = shortcode_atts( $restrict_defaults, $setting[ 'restrict' ] );
|
623 |
+
|
624 |
+
$setting[ 'value' ] = $this->get_option( $setting[ 'id' ] );
|
625 |
+
$setting[ 'value' ] = $setting[ 'value' ] !== false ? maybe_unserialize( $setting[ 'value' ] ) : false;
|
626 |
+
$setting[ 'value' ] = $this->sanitize_value( $setting[ 'value' ], $setting );
|
627 |
+
|
628 |
+
$setting[ 'title' ] = $setting[ 'name' ];
|
629 |
+
$setting[ 'name' ] = $this->id . "_options[{$setting['id']}]";
|
630 |
+
|
631 |
+
$setting[ 'grouped' ] = !$setting[ 'title' ] ? ' style="padding-top:0px;"' : '';
|
632 |
+
$setting[ 'tip' ] = $this->get_formatted_tip( $setting[ 'tip' ] );
|
633 |
+
|
634 |
+
$header_types = apply_filters( $this->id . '_options_header_types', array( 'heading', 'title' ) );
|
635 |
+
|
636 |
+
extract( $setting );
|
637 |
+
|
638 |
+
$description = $desc && !$grouped && $type != 'checkbox'
|
639 |
+
? '<br /><small>' . $desc . '</small>'
|
640 |
+
: '<label for="' . $id . '"> ' . $desc . '</label>';
|
641 |
+
|
642 |
+
$description = ( ( in_array( $type, $header_types ) || $type == 'radio' ) && !empty( $desc ) )
|
643 |
+
? '<p>' . $desc . '</p>'
|
644 |
+
: $description;
|
645 |
+
|
646 |
+
?>
|
647 |
+
|
648 |
+
<?php if ( !in_array( $type, $header_types ) ) : ?>
|
649 |
+
<!-- Header of the option. -->
|
650 |
+
<tr valign="top">
|
651 |
+
<th scope="row"<?php echo $grouped; ?>>
|
652 |
+
|
653 |
+
<?php echo $tip; ?>
|
654 |
+
|
655 |
+
<?php if ( !$grouped ) : ?>
|
656 |
+
<label for="<?php echo $name; ?>" class="description"><?php echo $title; ?></label>
|
657 |
+
<?php endif; ?>
|
658 |
+
|
659 |
+
</th>
|
660 |
+
<td <?php echo $grouped; ?> >
|
661 |
+
<?php endif; ?>
|
662 |
+
|
663 |
+
<?php foreach ( $header_types as $header ) :
|
664 |
+
if ( $type != $header ) continue; ?>
|
665 |
+
<tr>
|
666 |
+
<th scope="col" colspan="2">
|
667 |
+
<h3 class="title"><?php echo $title; ?></h3>
|
668 |
+
<?php echo $description; ?>
|
669 |
+
</th>
|
670 |
+
</tr>
|
671 |
+
<?php endforeach; ?>
|
672 |
+
|
673 |
+
<?php switch ( $type ) :
|
674 |
+
|
675 |
+
case 'text' :
|
676 |
+
case 'color' :
|
677 |
+
case 'number' :
|
678 |
+
if ( $type == 'color' ) {
|
679 |
+
$type = 'text';
|
680 |
+
$class .= ' colorpick';
|
681 |
+
$description .= '<div id="colorPickerDiv_' . $id . '" class="colorpickdiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"></div>';
|
682 |
+
}
|
683 |
+
?>
|
684 |
+
<input name="<?php echo $name; ?>"
|
685 |
+
id="<?php echo $id; ?>"
|
686 |
+
type="<?php echo $type; ?>"
|
687 |
+
|
688 |
+
<?php if ( $type == 'number' ): ?>
|
689 |
+
min="<?php echo $restrict[ 'min' ]; ?>"
|
690 |
+
max="<?php echo $restrict[ 'max' ]; ?>"
|
691 |
+
step="<?php echo $restrict[ 'step' ]; ?>"
|
692 |
+
<?php endif; ?>
|
693 |
+
|
694 |
+
class="regular-text <?php echo $class; ?>"
|
695 |
+
style="<?php echo $css; ?>"
|
696 |
+
placeholder="<?php echo $placeholder; ?>"
|
697 |
+
value="<?php echo $value !== false ? $value : $std; ?>"
|
698 |
+
/>
|
699 |
+
<?php echo $description;
|
700 |
+
break;
|
701 |
+
|
702 |
+
case 'checkbox':
|
703 |
+
|
704 |
+
$selected = ( $value !== false ) ? $value : $std;
|
705 |
+
|
706 |
+
if ( $multiple ) :
|
707 |
+
|
708 |
+
foreach ( $options as $key => $desc ) : ?>
|
709 |
+
|
710 |
+
<input name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
711 |
+
id="<?php echo $id . '_' . $key; ?>"
|
712 |
+
type="checkbox"
|
713 |
+
class="<?php echo $class; ?>"
|
714 |
+
style="<?php echo $css; ?>"
|
715 |
+
value="<?php echo $key; ?>"
|
716 |
+
<?php @checked( $selected[$key], 1 ); ?>
|
717 |
+
/>
|
718 |
+
<label for="<?php echo $id . '_' . $key; ?>">
|
719 |
+
<?php echo $desc; ?>
|
720 |
+
</label>
|
721 |
+
<br/>
|
722 |
+
<?php
|
723 |
+
|
724 |
+
endforeach;
|
725 |
+
|
726 |
+
else : ?>
|
727 |
+
|
728 |
+
<input name="<?php echo $name; ?>"
|
729 |
+
id="<?php echo $id ?>"
|
730 |
+
type="checkbox"
|
731 |
+
class="<?php echo $class; ?>"
|
732 |
+
style="<?php echo $css; ?>"
|
733 |
+
<?php checked( $selected, 1 ); ?>
|
734 |
+
/>
|
735 |
+
<?php echo $description;
|
736 |
+
endif;
|
737 |
+
break;
|
738 |
+
|
739 |
+
case 'radio':
|
740 |
+
|
741 |
+
$selected = ( $value !== false ) ? $value : $std;
|
742 |
+
|
743 |
+
foreach ( $options as $key => $val ) : ?>
|
744 |
+
<label class="radio">
|
745 |
+
<input type="radio"
|
746 |
+
name="<?php echo $name; ?>"
|
747 |
+
id="<?php echo $key; ?>"
|
748 |
+
value="<?php echo $key; ?>"
|
749 |
+
class="<?php echo $class; ?>"
|
750 |
+
<?php checked( $selected, $key ); ?>
|
751 |
+
/>
|
752 |
+
<?php echo $val; ?>
|
753 |
+
</label><br/>
|
754 |
+
<?php endforeach;
|
755 |
+
echo $description;
|
756 |
+
break;
|
757 |
+
|
758 |
+
case 'single_select_page':
|
759 |
+
|
760 |
+
$selected = ( $value !== false ) ? $value : $std;
|
761 |
+
|
762 |
+
$args = array(
|
763 |
+
'name' => $name,
|
764 |
+
'id' => $id,
|
765 |
+
'sort_order' => 'ASC',
|
766 |
+
'echo' => 0,
|
767 |
+
'selected' => $selected
|
768 |
+
);
|
769 |
+
|
770 |
+
echo str_replace( "'>", "'><option></option>", wp_dropdown_pages( $args ) );
|
771 |
+
|
772 |
+
echo $description;
|
773 |
+
|
774 |
+
if ( $select2 ) : ?>
|
775 |
+
<script type="text/javascript">jQuery(function () {
|
776 |
+
jQuery("#<?php echo $id; ?>").select2({ allowClear: true, placeholder: "<?php _e( 'Select a page...', 'geczy' ); ?>", width: '350px' });
|
777 |
+
});</script>
|
778 |
+
<?php endif;
|
779 |
+
|
780 |
+
break;
|
781 |
+
|
782 |
+
case 'select':
|
783 |
+
|
784 |
+
$selected = ( $value !== false ) ? $value : $std;
|
785 |
+
$options = apply_filters( $this->id . '_select_options', $options, $setting ); ?>
|
786 |
+
|
787 |
+
<select id="<?php echo $id; ?>"
|
788 |
+
class="<?php echo $class; ?>"
|
789 |
+
style="<?php echo $css; ?>"
|
790 |
+
name="<?php echo $name; ?><?php echo $multiple ? '[]' : ''; ?>"
|
791 |
+
<?php echo $multiple ? 'multiple="multiple"' : ''; ?>>
|
792 |
+
|
793 |
+
<?php foreach ( $options as $key => $val ) : ?>
|
794 |
+
<option
|
795 |
+
value="<?php echo $key; ?>" <?php self::selected( $selected, $key ); ?>><?php echo $val; ?></option>
|
796 |
+
<?php endforeach; ?>
|
797 |
+
</select>
|
798 |
+
|
799 |
+
<?php echo $description;
|
800 |
+
|
801 |
+
if ( $select2 ) : ?>
|
802 |
+
<script type="text/javascript">jQuery(function () {
|
803 |
+
jQuery("#<?php echo $id; ?>").select2({ width: '350px' });
|
804 |
+
});</script>
|
805 |
+
<?php endif;
|
806 |
+
|
807 |
+
break;
|
808 |
+
|
809 |
+
case 'textarea':
|
810 |
+
?>
|
811 |
+
<textarea name="<?php echo $name; ?>"
|
812 |
+
id="<?php echo $id; ?>"
|
813 |
+
class="large-text <?php echo $class; ?>"
|
814 |
+
style="<?php if ( $css ) echo $css; else echo 'width:300px;'; ?>"
|
815 |
+
placeholder="<?php echo $placeholder; ?>"
|
816 |
+
rows="3"
|
817 |
+
><?php echo ( $value !== false ) ? $value : $std; ?></textarea>
|
818 |
+
<?php echo $description;
|
819 |
+
break;
|
820 |
+
|
821 |
+
case 'wysiwyg':
|
822 |
+
wp_editor( $value, $id, array( 'textarea_name' => $name ) );
|
823 |
+
echo $description;
|
824 |
+
break;
|
825 |
+
|
826 |
+
default :
|
827 |
+
do_action( $this->id . '_options_type_' . $type, $setting );
|
828 |
+
break;
|
829 |
+
|
830 |
+
endswitch;
|
831 |
+
|
832 |
+
/* Footer of the option. */
|
833 |
+
if ( !in_array( $type, $header_types ) ) echo '</td></tr>';
|
834 |
+
|
835 |
+
}
|
836 |
+
|
837 |
+
|
838 |
+
/**
|
839 |
+
*
|
840 |
+
*
|
841 |
+
* @param unknown $haystack
|
842 |
+
* @param unknown $current
|
843 |
+
*/
|
844 |
+
private function selected( $haystack, $current )
|
845 |
+
{
|
846 |
+
|
847 |
+
if ( is_array( $haystack ) && in_array( $current, $haystack ) ) {
|
848 |
+
$current = $haystack = 1;
|
849 |
+
}
|
850 |
+
|
851 |
+
selected( $haystack, $current );
|
852 |
+
}
|
853 |
+
|
854 |
+
|
855 |
+
/**
|
856 |
+
*
|
857 |
+
*
|
858 |
+
* @param unknown $haystack
|
859 |
+
* @param unknown $current
|
860 |
+
*/
|
861 |
+
private function checked( $haystack, $current )
|
862 |
+
{
|
863 |
+
|
864 |
+
if ( is_array( $haystack ) && !empty( $haystack[ $current ] ) ) {
|
865 |
+
$current = $haystack = 1;
|
866 |
+
}
|
867 |
+
|
868 |
+
checked( $haystack, $current );
|
869 |
+
}
|
870 |
+
|
871 |
+
|
872 |
+
/**
|
873 |
+
* Format a tooltip given a string
|
874 |
+
*
|
875 |
+
* @param string $tip
|
876 |
+
*
|
877 |
+
* @return string
|
878 |
+
*/
|
879 |
+
private function get_formatted_tip( $tip )
|
880 |
+
{
|
881 |
+
return $tip ? sprintf( '<a href="#" title="%s" class="sf-tips" tabindex="99"></a>', $tip ) : '';
|
882 |
+
}
|
883 |
+
|
884 |
+
|
885 |
+
/**
|
886 |
+
*
|
887 |
+
*
|
888 |
+
* @param unknown $value
|
889 |
+
* @param unknown $setting
|
890 |
+
*
|
891 |
+
* @return unknown
|
892 |
+
*/
|
893 |
+
private function sanitize_value( $value, $setting )
|
894 |
+
{
|
895 |
+
if ( $value !== false && $setting[ 'type' ] != 'wysiwyg' ) {
|
896 |
+
if ( is_array( $value ) ) {
|
897 |
+
foreach ( $value as $key => $output ) {
|
898 |
+
$value[ $key ] = esc_attr( $output );
|
899 |
+
}
|
900 |
+
} else {
|
901 |
+
$value = esc_attr( $value );
|
902 |
+
}
|
903 |
+
}
|
904 |
+
|
905 |
+
return apply_filters( $this->id . '_options_sanitize_value', $value, $setting );
|
906 |
+
}
|
907 |
+
|
908 |
+
|
909 |
+
|
910 |
+
}
|
911 |
+
|
912 |
+
|
913 |
+
}
|
{WCVendors/classes → classes}/admin/settings/sf-options.php
RENAMED
@@ -1,315 +1,315 @@
|
|
1 |
-
<?php
|
2 |
-
$options = array();
|
3 |
-
|
4 |
-
$options[ ] = array( 'name' => __( 'General', 'wcvendors' ), 'type' => 'heading' );
|
5 |
-
$options[ ] = array( 'name' => __( 'General options', 'wcvendors' ), 'type' => 'title', 'desc' => __( ' ', 'wcvendors' ) );
|
6 |
-
|
7 |
-
$options[ ] = array(
|
8 |
-
'name' => __( 'Default commission (%)', 'wcvendors' ),
|
9 |
-
'desc' => __( 'The default rate you pay each vendor for a product sale. If a product has a commission rate already set, this value will be ignored for that product.', 'wcvendors' ),
|
10 |
-
'id' => 'default_commission',
|
11 |
-
'css' => 'width:70px;',
|
12 |
-
'type' => 'number',
|
13 |
-
'restrict' => array(
|
14 |
-
'min' => 0,
|
15 |
-
'max' => 100
|
16 |
-
)
|
17 |
-
);
|
18 |
-
|
19 |
-
$options[ ] = array(
|
20 |
-
'name' => __( 'Registration', 'wcvendors' ),
|
21 |
-
'desc' => __( 'Allow users or guests to apply to become a vendor', 'wcvendors' ),
|
22 |
-
'tip' => __( 'This will show a checkbox on the My Account page\'s registration form asking if the user would like to apply to be a vendor. Also, on the Vendor Dashboard, users can still apply to become a vendor even if this is disabled.', 'wcvendors' ),
|
23 |
-
'id' => 'show_vendor_registration',
|
24 |
-
'type' => 'checkbox',
|
25 |
-
'std' => true,
|
26 |
-
);
|
27 |
-
|
28 |
-
$options[ ] = array(
|
29 |
-
'desc' => __( 'Approve vendor applications manually', 'wcvendors' ),
|
30 |
-
'tip' => __( 'With this unchecked, all vendor applications are automatically accepted. Otherwise, you must approve each manually.', 'wcvendors' ),
|
31 |
-
'id' => 'manual_vendor_registration',
|
32 |
-
'type' => 'checkbox',
|
33 |
-
'std' => true,
|
34 |
-
);
|
35 |
-
|
36 |
-
$options[ ] = array(
|
37 |
-
'name' => __( 'Taxes', 'wcvendors' ),
|
38 |
-
'desc' => __( 'Give vendors any tax collected per-product', 'wcvendors' ),
|
39 |
-
'tip' => __( 'The tax collected on a vendor\'s product will be given in its entirety', 'wcvendors' ),
|
40 |
-
'id' => 'give_tax',
|
41 |
-
'type' => 'checkbox',
|
42 |
-
'std' => false,
|
43 |
-
);
|
44 |
-
|
45 |
-
$options[ ] = array(
|
46 |
-
'name' => __( 'Shipping', 'wcvendors' ),
|
47 |
-
'desc' => __( 'Give vendors any shipping collected per-product', 'wcvendors' ),
|
48 |
-
'tip' => __( 'The shipping collected on a vendor\'s product will be given in its entirety', 'wcvendors' ),
|
49 |
-
'id' => 'give_shipping',
|
50 |
-
'type' => 'checkbox',
|
51 |
-
'std' => true,
|
52 |
-
);
|
53 |
-
|
54 |
-
$options[ ] = array( 'name' => __( 'Shop options', 'wcvendors' ), 'type' => 'title', 'desc' => __( ' ', 'wcvendors' ) );
|
55 |
-
|
56 |
-
$options[ ] = array(
|
57 |
-
'name' => __( 'Shop HTML', 'wcvendors' ),
|
58 |
-
'desc' => __( 'Enable HTML for a vendor\'s shop description by default. You can enable or disable this per vendor by editing the vendors username.', 'wcvendors' ),
|
59 |
-
'id' => 'shop_html_enabled',
|
60 |
-
'type' => 'checkbox',
|
61 |
-
'std' => true,
|
62 |
-
);
|
63 |
-
|
64 |
-
$options[ ] = array(
|
65 |
-
'name' => __( 'Vendor shop page', 'wcvendors' ),
|
66 |
-
'desc' => __( 'Eg: <code>yoursite.com/[your_setting_here]/[vendor_name_here]</code>', 'wcvendors' ),
|
67 |
-
'id' => 'vendor_shop_permalink',
|
68 |
-
'type' => 'text',
|
69 |
-
'std' => 'vendors/',
|
70 |
-
);
|
71 |
-
|
72 |
-
$options[ ] = array(
|
73 |
-
'name' => __( 'Shop Headers', 'wcvendors' ),
|
74 |
-
'desc' => __( 'Enable vendor shop headers', 'wcvendors' ),
|
75 |
-
'tip' => __( 'This will override the HTML Shop description output on product-archive pages. In order to customize the shop headers visit wcvendors.com and read the article in the Knowledgebase titled Changing the Vendor Templates.', 'wcvendors' ),
|
76 |
-
'id' => 'shop_headers_enabled',
|
77 |
-
'type' => 'checkbox',
|
78 |
-
'std' => false,
|
79 |
-
);
|
80 |
-
|
81 |
-
$options[ ] = array( 'name' => __( 'Products', 'wcvendors' ), 'type' => 'heading' );
|
82 |
-
$options[ ] = array( 'name' => __( 'Product Add Page', 'wcvendors' ), 'type' => 'title', 'desc' => __( 'Configure what to hide from all vendors when adding a product', 'wcvendors' ) );
|
83 |
-
|
84 |
-
$options[ ] = array(
|
85 |
-
'name' => __( 'Left side panel', 'wcvendors' ),
|
86 |
-
'desc' => __( 'CHECKING these boxes will HIDE these areas of the add product page for vendors', 'wcvendors' ),
|
87 |
-
'id' => 'hide_product_panel',
|
88 |
-
'options' => array(
|
89 |
-
'inventory' => 'Inventory',
|
90 |
-
'shipping' => 'Shipping',
|
91 |
-
'linked_product' => 'Linked Products',
|
92 |
-
'attribute' => 'Attributes',
|
93 |
-
'advanced' => 'Advanced',
|
94 |
-
),
|
95 |
-
'type' => 'checkbox',
|
96 |
-
'multiple' => true,
|
97 |
-
);
|
98 |
-
|
99 |
-
$options[ ] = array(
|
100 |
-
'name' => __( 'Types', 'wcvendors' ),
|
101 |
-
'desc' => __( 'CHECKING these boxes will HIDE these product types from the vendor', 'wcvendors' ),
|
102 |
-
'id' => 'hide_product_types',
|
103 |
-
'options' => array(
|
104 |
-
'simple' => 'Simple',
|
105 |
-
'variable' => 'Variable',
|
106 |
-
'grouped' => 'Grouped',
|
107 |
-
'external' => 'External / affiliate',
|
108 |
-
),
|
109 |
-
'type' => 'checkbox',
|
110 |
-
'multiple' => true,
|
111 |
-
);
|
112 |
-
|
113 |
-
$options[ ] = array(
|
114 |
-
'name' => __( 'Type options', 'wcvendors' ),
|
115 |
-
'desc' => __( 'CHECKING these boxes will HIDE these product options from the vendor', 'wcvendors' ),
|
116 |
-
'id' => 'hide_product_type_options',
|
117 |
-
'options' => array(
|
118 |
-
'virtual' => 'Virtual',
|
119 |
-
'downloadable' => 'Downloadable',
|
120 |
-
),
|
121 |
-
'type' => 'checkbox',
|
122 |
-
'multiple' => true,
|
123 |
-
);
|
124 |
-
|
125 |
-
$options[ ] = array(
|
126 |
-
'name' => __( 'Miscellaneous', 'wcvendors' ),
|
127 |
-
'id' => 'hide_product_misc',
|
128 |
-
'options' => array(
|
129 |
-
'taxes' => 'Taxes',
|
130 |
-
'sku' => 'SKU',
|
131 |
-
'featured' => 'Featured',
|
132 |
-
),
|
133 |
-
'type' => 'checkbox',
|
134 |
-
'multiple' => true,
|
135 |
-
);
|
136 |
-
|
137 |
-
$options[ ] = array(
|
138 |
-
'name' => __( 'Stylesheet', 'wcvendors' ),
|
139 |
-
'desc' => __( 'You can add CSS in this textarea, which will be loaded on the product add/edit page for vendors.', 'wcvendors' ),
|
140 |
-
'id' => 'product_page_css',
|
141 |
-
'type' => 'textarea',
|
142 |
-
);
|
143 |
-
|
144 |
-
|
145 |
-
$options[ ] = array( 'name' => __( 'Capabilities', 'wcvendors' ), 'type' => 'heading', 'id' => 'capabilities' );
|
146 |
-
$options[ ] = array( 'name' => __( 'Permissions', 'wcvendors' ), 'id' => 'permissions', 'type' => 'title', 'desc' => __( 'General permissions used around the shop', 'wcvendors' ) );
|
147 |
-
|
148 |
-
$options[ ] = array(
|
149 |
-
'name' => __( 'Orders', 'wcvendors' ),
|
150 |
-
'desc' => __( 'View orders', 'wcvendors' ),
|
151 |
-
'tip' => __( 'Show customer details such as email, address, name, etc, for each order', 'wcvendors' ),
|
152 |
-
'id' => 'can_show_orders',
|
153 |
-
'type' => 'checkbox',
|
154 |
-
'std' => true,
|
155 |
-
);
|
156 |
-
|
157 |
-
$options[ ] = array(
|
158 |
-
'desc' => __( 'View comments', 'wcvendors' ),
|
159 |
-
'tip' => __( 'View all vendor comments for an order on the frontend', 'wcvendors' ),
|
160 |
-
'id' => 'can_view_order_comments',
|
161 |
-
'type' => 'checkbox',
|
162 |
-
'std' => true,
|
163 |
-
);
|
164 |
-
|
165 |
-
$options[ ] = array(
|
166 |
-
'desc' => __( 'Submit comments', 'wcvendors' ),
|
167 |
-
'tip' => __( 'Submit comments for an order on the frontend. Eg, tracking ID for a product', 'wcvendors' ),
|
168 |
-
'id' => 'can_submit_order_comments',
|
169 |
-
'type' => 'checkbox',
|
170 |
-
'std' => true,
|
171 |
-
);
|
172 |
-
|
173 |
-
$options[ ] = array(
|
174 |
-
'desc' => __( 'View email addresses', 'wcvendors' ),
|
175 |
-
'tip' => __( 'While viewing order details on the frontend, you can disable or enable email addresses', 'wcvendors' ),
|
176 |
-
'id' => 'can_view_order_emails',
|
177 |
-
'type' => 'checkbox',
|
178 |
-
'std' => true,
|
179 |
-
);
|
180 |
-
|
181 |
-
$options[ ] = array(
|
182 |
-
'desc' => __( 'Export a CSV file of orders for a product', 'wcvendors' ),
|
183 |
-
'tip' => __( 'Vendors could export orders for a product on the frontend', 'wcvendors' ),
|
184 |
-
'id' => 'can_export_csv',
|
185 |
-
'type' => 'checkbox',
|
186 |
-
'std' => true,
|
187 |
-
);
|
188 |
-
|
189 |
-
$options[ ] = array(
|
190 |
-
'name' => __( 'Reports', 'wcvendors' ),
|
191 |
-
'desc' => __( 'View backend sales reports', 'wcvendors' ),
|
192 |
-
'tip' => __( 'Graphs and tables via the Reports page in backend. The reports will only display sales data that pertain to their products', 'wcvendors' ),
|
193 |
-
'id' => 'can_view_backend_reports',
|
194 |
-
'type' => 'checkbox',
|
195 |
-
'std' => true,
|
196 |
-
);
|
197 |
-
|
198 |
-
$options[ ] = array(
|
199 |
-
'desc' => __( 'View Frontend sales reports', 'wcvendors' ),
|
200 |
-
'tip' => __( 'Sales table on the frontend on the My Account page. The table will only display sales data that pertain to their products', 'wcvendors' ),
|
201 |
-
'id' => 'can_view_frontend_reports',
|
202 |
-
'type' => 'checkbox',
|
203 |
-
'std' => true,
|
204 |
-
);
|
205 |
-
|
206 |
-
$options[ ] = array(
|
207 |
-
'name' => __( 'Products', 'wcvendors' ),
|
208 |
-
'desc' => __( 'Submit products', 'wcvendors' ),
|
209 |
-
'tip' => __( 'Vendors could submit a product through the backend, and an admin would approve or deny it', 'wcvendors' ),
|
210 |
-
'id' => 'can_submit_products',
|
211 |
-
'type' => 'checkbox',
|
212 |
-
'std' => true,
|
213 |
-
);
|
214 |
-
|
215 |
-
$options[ ] = array(
|
216 |
-
'desc' => __( 'Edit live products', 'wcvendors' ),
|
217 |
-
'tip' => __( 'Vendors could edit an approved product after it has already gone live. There is no approval or review after editing a live product. This could be dangerous with malicious vendors, so take caution.', 'wcvendors' ),
|
218 |
-
'id' => 'can_edit_published_products',
|
219 |
-
'type' => 'checkbox',
|
220 |
-
'std' => false,
|
221 |
-
);
|
222 |
-
|
223 |
-
$options[ ] = array(
|
224 |
-
'desc' => __( 'Submit products live without requiring approval', 'wcvendors' ),
|
225 |
-
'tip' => __( 'Vendors can submit products without review or approval from a shop admin. This could be dangerous with malicious vendors, so take caution.', 'wcvendors' ),
|
226 |
-
'id' => 'can_submit_live_products',
|
227 |
-
'type' => 'checkbox',
|
228 |
-
'std' => false,
|
229 |
-
);
|
230 |
-
|
231 |
-
$options[ ] = array( 'name' => __( 'Pages', 'wcvendors' ), 'type' => 'heading' );
|
232 |
-
$options[ ] = array( 'name' => __( 'Page configuration', 'wcvendors' ), 'type' => 'title', 'desc' => __( ' ', 'wcvendors' ) );
|
233 |
-
|
234 |
-
$options[ ] = array(
|
235 |
-
'name' => __( 'Vendor dashboard', 'wcvendors' ),
|
236 |
-
'desc' => __( 'Choose the page that has the shortcode <code>[wcv_vendor_dashboard]</code><br/>By default, My Account > Vendor Dashboard should have the shortcode.', 'wcvendors' ),
|
237 |
-
'id' => 'vendor_dashboard_page',
|
238 |
-
'type' => 'single_select_page',
|
239 |
-
'select2' => true,
|
240 |
-
);
|
241 |
-
|
242 |
-
$options[ ] = array(
|
243 |
-
'name' => __( 'Shop settings', 'wcvendors' ),
|
244 |
-
'desc' => __( 'Choose the page that has the shortcode <code>[wcv_shop_settings]</code><br/>These are the shop settings a vendor can configure.', 'wcvendors' ),
|
245 |
-
'id' => 'shop_settings_page',
|
246 |
-
'type' => 'single_select_page',
|
247 |
-
'select2' => true,
|
248 |
-
);
|
249 |
-
|
250 |
-
$options[ ] = array(
|
251 |
-
'name' => __( 'Orders page', 'wcvendors' ),
|
252 |
-
'desc' => __( 'Choose the page that has the shortcode <code>[wcv_orders]</code><br/>By default, My Account > Orders should have the shortcode.', 'wcvendors' ),
|
253 |
-
'id' => 'orders_page',
|
254 |
-
'type' => 'single_select_page',
|
255 |
-
'select2' => true,
|
256 |
-
);
|
257 |
-
|
258 |
-
$options[ ] = array(
|
259 |
-
'name' => __( 'Vendor terms', 'wcvendors' ),
|
260 |
-
'desc' => __( 'These terms are shown to a user when submitting an application to become a vendor.<br/>If left blank, no terms will be shown to the applicant.', 'wcvendors' ),
|
261 |
-
'id' => 'terms_to_apply_page',
|
262 |
-
'type' => 'single_select_page',
|
263 |
-
'select2' => true,
|
264 |
-
);
|
265 |
-
|
266 |
-
$total_due = 0;
|
267 |
-
if ( !empty( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] == 'payments' ) {
|
268 |
-
global $wpdb;
|
269 |
-
|
270 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
271 |
-
$query = "SELECT sum(total_due + total_shipping + tax) as total
|
272 |
-
FROM `{$table_name}`
|
273 |
-
WHERE status = %s";
|
274 |
-
$results = $wpdb->get_results( $wpdb->prepare( $query, 'due' ) );
|
275 |
-
|
276 |
-
$total_due = array_shift( $results )->total;
|
277 |
-
}
|
278 |
-
$options[ ] = array( 'name' => __( 'Payments', 'wcvendors' ), 'type' => 'heading' );
|
279 |
-
$options[ ] = array(
|
280 |
-
'name' => __( 'User payments', 'wcvendors' ), 'type' => 'title', 'desc' =>
|
281 |
-
sprintf( __( 'Total commission currently due: %s. <a href="%s">View details</a>.', 'wcvendors' ), !function_exists( 'woocommerce_price' ) ? $total_due : woocommerce_price( $total_due ), '?page=pv_admin_commissions' ) .
|
282 |
-
'<br/><br/>' . sprintf( __( 'Make sure you update your PayPal Adaptive Payments settings <a href="%s">here</a>.', 'wcvendors' ), 'admin.php?page=wc-settings&tab=checkout§ion=wc_paypalap' )
|
283 |
-
);
|
284 |
-
|
285 |
-
$options[ ] = array(
|
286 |
-
'name' => __( 'Instant pay', 'wcvendors' ),
|
287 |
-
'desc' => __( 'Instantly pay vendors their commission when an order is made', 'wcvendors' ),
|
288 |
-
'tip' => __( 'For this to work, customers must checkout with the PayPal Adaptive Payments gateway. Using any other gateways will not pay vendors instantly', 'wcvendors' ),
|
289 |
-
'id' => 'instapay',
|
290 |
-
'type' => 'checkbox',
|
291 |
-
'std' => true,
|
292 |
-
);
|
293 |
-
|
294 |
-
$options[ ] = array(
|
295 |
-
'name' => __( 'Payment schedule', 'wcvendors' ),
|
296 |
-
'desc' => __( 'Note: Schedule will only work if instant pay is unchecked', 'wcvendors' ),
|
297 |
-
'id' => 'schedule',
|
298 |
-
'type' => 'radio',
|
299 |
-
'std' => 'manual',
|
300 |
-
'options' => array(
|
301 |
-
'weekly' => __( 'Weekly', 'wcvendors' ),
|
302 |
-
'biweekly' => __( 'Biweekly', 'wcvendors' ),
|
303 |
-
'monthly' => __( 'Monthly', 'wcvendors' ),
|
304 |
-
'manual' => __( 'Manual', 'wcvendors' ),
|
305 |
-
'now' => '<span style="color:green;"><strong>' . __( 'Now', 'wcvendors' ) . '</strong></span>',
|
306 |
-
)
|
307 |
-
);
|
308 |
-
|
309 |
-
$options[ ] = array(
|
310 |
-
'name' => __( 'Email notification', 'wcvendors' ),
|
311 |
-
'desc' => __( 'Send the WooCommerce admin an email each time a payment has been made via the payment schedule options above', 'wcvendors' ),
|
312 |
-
'id' => 'mail_mass_pay_results',
|
313 |
-
'type' => 'checkbox',
|
314 |
-
'std' => true,
|
315 |
-
);
|
1 |
+
<?php
|
2 |
+
$options = array();
|
3 |
+
|
4 |
+
$options[ ] = array( 'name' => __( 'General', 'wcvendors' ), 'type' => 'heading' );
|
5 |
+
$options[ ] = array( 'name' => __( 'General options', 'wcvendors' ), 'type' => 'title', 'desc' => __( ' ', 'wcvendors' ) );
|
6 |
+
|
7 |
+
$options[ ] = array(
|
8 |
+
'name' => __( 'Default commission (%)', 'wcvendors' ),
|
9 |
+
'desc' => __( 'The default rate you pay each vendor for a product sale. If a product has a commission rate already set, this value will be ignored for that product.', 'wcvendors' ),
|
10 |
+
'id' => 'default_commission',
|
11 |
+
'css' => 'width:70px;',
|
12 |
+
'type' => 'number',
|
13 |
+
'restrict' => array(
|
14 |
+
'min' => 0,
|
15 |
+
'max' => 100
|
16 |
+
)
|
17 |
+
);
|
18 |
+
|
19 |
+
$options[ ] = array(
|
20 |
+
'name' => __( 'Registration', 'wcvendors' ),
|
21 |
+
'desc' => __( 'Allow users or guests to apply to become a vendor', 'wcvendors' ),
|
22 |
+
'tip' => __( 'This will show a checkbox on the My Account page\'s registration form asking if the user would like to apply to be a vendor. Also, on the Vendor Dashboard, users can still apply to become a vendor even if this is disabled.', 'wcvendors' ),
|
23 |
+
'id' => 'show_vendor_registration',
|
24 |
+
'type' => 'checkbox',
|
25 |
+
'std' => true,
|
26 |
+
);
|
27 |
+
|
28 |
+
$options[ ] = array(
|
29 |
+
'desc' => __( 'Approve vendor applications manually', 'wcvendors' ),
|
30 |
+
'tip' => __( 'With this unchecked, all vendor applications are automatically accepted. Otherwise, you must approve each manually.', 'wcvendors' ),
|
31 |
+
'id' => 'manual_vendor_registration',
|
32 |
+
'type' => 'checkbox',
|
33 |
+
'std' => true,
|
34 |
+
);
|
35 |
+
|
36 |
+
$options[ ] = array(
|
37 |
+
'name' => __( 'Taxes', 'wcvendors' ),
|
38 |
+
'desc' => __( 'Give vendors any tax collected per-product', 'wcvendors' ),
|
39 |
+
'tip' => __( 'The tax collected on a vendor\'s product will be given in its entirety', 'wcvendors' ),
|
40 |
+
'id' => 'give_tax',
|
41 |
+
'type' => 'checkbox',
|
42 |
+
'std' => false,
|
43 |
+
);
|
44 |
+
|
45 |
+
$options[ ] = array(
|
46 |
+
'name' => __( 'Shipping', 'wcvendors' ),
|
47 |
+
'desc' => __( 'Give vendors any shipping collected per-product', 'wcvendors' ),
|
48 |
+
'tip' => __( 'The shipping collected on a vendor\'s product will be given in its entirety', 'wcvendors' ),
|
49 |
+
'id' => 'give_shipping',
|
50 |
+
'type' => 'checkbox',
|
51 |
+
'std' => true,
|
52 |
+
);
|
53 |
+
|
54 |
+
$options[ ] = array( 'name' => __( 'Shop options', 'wcvendors' ), 'type' => 'title', 'desc' => __( ' ', 'wcvendors' ) );
|
55 |
+
|
56 |
+
$options[ ] = array(
|
57 |
+
'name' => __( 'Shop HTML', 'wcvendors' ),
|
58 |
+
'desc' => __( 'Enable HTML for a vendor\'s shop description by default. You can enable or disable this per vendor by editing the vendors username.', 'wcvendors' ),
|
59 |
+
'id' => 'shop_html_enabled',
|
60 |
+
'type' => 'checkbox',
|
61 |
+
'std' => true,
|
62 |
+
);
|
63 |
+
|
64 |
+
$options[ ] = array(
|
65 |
+
'name' => __( 'Vendor shop page', 'wcvendors' ),
|
66 |
+
'desc' => __( 'Eg: <code>yoursite.com/[your_setting_here]/[vendor_name_here]</code>', 'wcvendors' ),
|
67 |
+
'id' => 'vendor_shop_permalink',
|
68 |
+
'type' => 'text',
|
69 |
+
'std' => 'vendors/',
|
70 |
+
);
|
71 |
+
|
72 |
+
$options[ ] = array(
|
73 |
+
'name' => __( 'Shop Headers', 'wcvendors' ),
|
74 |
+
'desc' => __( 'Enable vendor shop headers', 'wcvendors' ),
|
75 |
+
'tip' => __( 'This will override the HTML Shop description output on product-archive pages. In order to customize the shop headers visit wcvendors.com and read the article in the Knowledgebase titled Changing the Vendor Templates.', 'wcvendors' ),
|
76 |
+
'id' => 'shop_headers_enabled',
|
77 |
+
'type' => 'checkbox',
|
78 |
+
'std' => false,
|
79 |
+
);
|
80 |
+
|
81 |
+
$options[ ] = array( 'name' => __( 'Products', 'wcvendors' ), 'type' => 'heading' );
|
82 |
+
$options[ ] = array( 'name' => __( 'Product Add Page', 'wcvendors' ), 'type' => 'title', 'desc' => __( 'Configure what to hide from all vendors when adding a product', 'wcvendors' ) );
|
83 |
+
|
84 |
+
$options[ ] = array(
|
85 |
+
'name' => __( 'Left side panel', 'wcvendors' ),
|
86 |
+
'desc' => __( 'CHECKING these boxes will HIDE these areas of the add product page for vendors', 'wcvendors' ),
|
87 |
+
'id' => 'hide_product_panel',
|
88 |
+
'options' => array(
|
89 |
+
'inventory' => 'Inventory',
|
90 |
+
'shipping' => 'Shipping',
|
91 |
+
'linked_product' => 'Linked Products',
|
92 |
+
'attribute' => 'Attributes',
|
93 |
+
'advanced' => 'Advanced',
|
94 |
+
),
|
95 |
+
'type' => 'checkbox',
|
96 |
+
'multiple' => true,
|
97 |
+
);
|
98 |
+
|
99 |
+
$options[ ] = array(
|
100 |
+
'name' => __( 'Types', 'wcvendors' ),
|
101 |
+
'desc' => __( 'CHECKING these boxes will HIDE these product types from the vendor', 'wcvendors' ),
|
102 |
+
'id' => 'hide_product_types',
|
103 |
+
'options' => array(
|
104 |
+
'simple' => 'Simple',
|
105 |
+
'variable' => 'Variable',
|
106 |
+
'grouped' => 'Grouped',
|
107 |
+
'external' => 'External / affiliate',
|
108 |
+
),
|
109 |
+
'type' => 'checkbox',
|
110 |
+
'multiple' => true,
|
111 |
+
);
|
112 |
+
|
113 |
+
$options[ ] = array(
|
114 |
+
'name' => __( 'Type options', 'wcvendors' ),
|
115 |
+
'desc' => __( 'CHECKING these boxes will HIDE these product options from the vendor', 'wcvendors' ),
|
116 |
+
'id' => 'hide_product_type_options',
|
117 |
+
'options' => array(
|
118 |
+
'virtual' => 'Virtual',
|
119 |
+
'downloadable' => 'Downloadable',
|
120 |
+
),
|
121 |
+
'type' => 'checkbox',
|
122 |
+
'multiple' => true,
|
123 |
+
);
|
124 |
+
|
125 |
+
$options[ ] = array(
|
126 |
+
'name' => __( 'Miscellaneous', 'wcvendors' ),
|
127 |
+
'id' => 'hide_product_misc',
|
128 |
+
'options' => array(
|
129 |
+
'taxes' => 'Taxes',
|
130 |
+
'sku' => 'SKU',
|
131 |
+
'featured' => 'Featured',
|
132 |
+
),
|
133 |
+
'type' => 'checkbox',
|
134 |
+
'multiple' => true,
|
135 |
+
);
|
136 |
+
|
137 |
+
$options[ ] = array(
|
138 |
+
'name' => __( 'Stylesheet', 'wcvendors' ),
|
139 |
+
'desc' => __( 'You can add CSS in this textarea, which will be loaded on the product add/edit page for vendors.', 'wcvendors' ),
|
140 |
+
'id' => 'product_page_css',
|
141 |
+
'type' => 'textarea',
|
142 |
+
);
|
143 |
+
|
144 |
+
|
145 |
+
$options[ ] = array( 'name' => __( 'Capabilities', 'wcvendors' ), 'type' => 'heading', 'id' => 'capabilities' );
|
146 |
+
$options[ ] = array( 'name' => __( 'Permissions', 'wcvendors' ), 'id' => 'permissions', 'type' => 'title', 'desc' => __( 'General permissions used around the shop', 'wcvendors' ) );
|
147 |
+
|
148 |
+
$options[ ] = array(
|
149 |
+
'name' => __( 'Orders', 'wcvendors' ),
|
150 |
+
'desc' => __( 'View orders', 'wcvendors' ),
|
151 |
+
'tip' => __( 'Show customer details such as email, address, name, etc, for each order', 'wcvendors' ),
|
152 |
+
'id' => 'can_show_orders',
|
153 |
+
'type' => 'checkbox',
|
154 |
+
'std' => true,
|
155 |
+
);
|
156 |
+
|
157 |
+
$options[ ] = array(
|
158 |
+
'desc' => __( 'View comments', 'wcvendors' ),
|
159 |
+
'tip' => __( 'View all vendor comments for an order on the frontend', 'wcvendors' ),
|
160 |
+
'id' => 'can_view_order_comments',
|
161 |
+
'type' => 'checkbox',
|
162 |
+
'std' => true,
|
163 |
+
);
|
164 |
+
|
165 |
+
$options[ ] = array(
|
166 |
+
'desc' => __( 'Submit comments', 'wcvendors' ),
|
167 |
+
'tip' => __( 'Submit comments for an order on the frontend. Eg, tracking ID for a product', 'wcvendors' ),
|
168 |
+
'id' => 'can_submit_order_comments',
|
169 |
+
'type' => 'checkbox',
|
170 |
+
'std' => true,
|
171 |
+
);
|
172 |
+
|
173 |
+
$options[ ] = array(
|
174 |
+
'desc' => __( 'View email addresses', 'wcvendors' ),
|
175 |
+
'tip' => __( 'While viewing order details on the frontend, you can disable or enable email addresses', 'wcvendors' ),
|
176 |
+
'id' => 'can_view_order_emails',
|
177 |
+
'type' => 'checkbox',
|
178 |
+
'std' => true,
|
179 |
+
);
|
180 |
+
|
181 |
+
$options[ ] = array(
|
182 |
+
'desc' => __( 'Export a CSV file of orders for a product', 'wcvendors' ),
|
183 |
+
'tip' => __( 'Vendors could export orders for a product on the frontend', 'wcvendors' ),
|
184 |
+
'id' => 'can_export_csv',
|
185 |
+
'type' => 'checkbox',
|
186 |
+
'std' => true,
|
187 |
+
);
|
188 |
+
|
189 |
+
$options[ ] = array(
|
190 |
+
'name' => __( 'Reports', 'wcvendors' ),
|
191 |
+
'desc' => __( 'View backend sales reports', 'wcvendors' ),
|
192 |
+
'tip' => __( 'Graphs and tables via the Reports page in backend. The reports will only display sales data that pertain to their products', 'wcvendors' ),
|
193 |
+
'id' => 'can_view_backend_reports',
|
194 |
+
'type' => 'checkbox',
|
195 |
+
'std' => true,
|
196 |
+
);
|
197 |
+
|
198 |
+
$options[ ] = array(
|
199 |
+
'desc' => __( 'View Frontend sales reports', 'wcvendors' ),
|
200 |
+
'tip' => __( 'Sales table on the frontend on the My Account page. The table will only display sales data that pertain to their products', 'wcvendors' ),
|
201 |
+
'id' => 'can_view_frontend_reports',
|
202 |
+
'type' => 'checkbox',
|
203 |
+
'std' => true,
|
204 |
+
);
|
205 |
+
|
206 |
+
$options[ ] = array(
|
207 |
+
'name' => __( 'Products', 'wcvendors' ),
|
208 |
+
'desc' => __( 'Submit products', 'wcvendors' ),
|
209 |
+
'tip' => __( 'Vendors could submit a product through the backend, and an admin would approve or deny it', 'wcvendors' ),
|
210 |
+
'id' => 'can_submit_products',
|
211 |
+
'type' => 'checkbox',
|
212 |
+
'std' => true,
|
213 |
+
);
|
214 |
+
|
215 |
+
$options[ ] = array(
|
216 |
+
'desc' => __( 'Edit live products', 'wcvendors' ),
|
217 |
+
'tip' => __( 'Vendors could edit an approved product after it has already gone live. There is no approval or review after editing a live product. This could be dangerous with malicious vendors, so take caution.', 'wcvendors' ),
|
218 |
+
'id' => 'can_edit_published_products',
|
219 |
+
'type' => 'checkbox',
|
220 |
+
'std' => false,
|
221 |
+
);
|
222 |
+
|
223 |
+
$options[ ] = array(
|
224 |
+
'desc' => __( 'Submit products live without requiring approval', 'wcvendors' ),
|
225 |
+
'tip' => __( 'Vendors can submit products without review or approval from a shop admin. This could be dangerous with malicious vendors, so take caution.', 'wcvendors' ),
|
226 |
+
'id' => 'can_submit_live_products',
|
227 |
+
'type' => 'checkbox',
|
228 |
+
'std' => false,
|
229 |
+
);
|
230 |
+
|
231 |
+
$options[ ] = array( 'name' => __( 'Pages', 'wcvendors' ), 'type' => 'heading' );
|
232 |
+
$options[ ] = array( 'name' => __( 'Page configuration', 'wcvendors' ), 'type' => 'title', 'desc' => __( ' ', 'wcvendors' ) );
|
233 |
+
|
234 |
+
$options[ ] = array(
|
235 |
+
'name' => __( 'Vendor dashboard', 'wcvendors' ),
|
236 |
+
'desc' => __( 'Choose the page that has the shortcode <code>[wcv_vendor_dashboard]</code><br/>By default, My Account > Vendor Dashboard should have the shortcode.', 'wcvendors' ),
|
237 |
+
'id' => 'vendor_dashboard_page',
|
238 |
+
'type' => 'single_select_page',
|
239 |
+
'select2' => true,
|
240 |
+
);
|
241 |
+
|
242 |
+
$options[ ] = array(
|
243 |
+
'name' => __( 'Shop settings', 'wcvendors' ),
|
244 |
+
'desc' => __( 'Choose the page that has the shortcode <code>[wcv_shop_settings]</code><br/>These are the shop settings a vendor can configure.', 'wcvendors' ),
|
245 |
+
'id' => 'shop_settings_page',
|
246 |
+
'type' => 'single_select_page',
|
247 |
+
'select2' => true,
|
248 |
+
);
|
249 |
+
|
250 |
+
$options[ ] = array(
|
251 |
+
'name' => __( 'Orders page', 'wcvendors' ),
|
252 |
+
'desc' => __( 'Choose the page that has the shortcode <code>[wcv_orders]</code><br/>By default, My Account > Orders should have the shortcode.', 'wcvendors' ),
|
253 |
+
'id' => 'orders_page',
|
254 |
+
'type' => 'single_select_page',
|
255 |
+
'select2' => true,
|
256 |
+
);
|
257 |
+
|
258 |
+
$options[ ] = array(
|
259 |
+
'name' => __( 'Vendor terms', 'wcvendors' ),
|
260 |
+
'desc' => __( 'These terms are shown to a user when submitting an application to become a vendor.<br/>If left blank, no terms will be shown to the applicant.', 'wcvendors' ),
|
261 |
+
'id' => 'terms_to_apply_page',
|
262 |
+
'type' => 'single_select_page',
|
263 |
+
'select2' => true,
|
264 |
+
);
|
265 |
+
|
266 |
+
$total_due = 0;
|
267 |
+
if ( !empty( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] == 'payments' ) {
|
268 |
+
global $wpdb;
|
269 |
+
|
270 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
271 |
+
$query = "SELECT sum(total_due + total_shipping + tax) as total
|
272 |
+
FROM `{$table_name}`
|
273 |
+
WHERE status = %s";
|
274 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, 'due' ) );
|
275 |
+
|
276 |
+
$total_due = array_shift( $results )->total;
|
277 |
+
}
|
278 |
+
$options[ ] = array( 'name' => __( 'Payments', 'wcvendors' ), 'type' => 'heading' );
|
279 |
+
$options[ ] = array(
|
280 |
+
'name' => __( 'User payments', 'wcvendors' ), 'type' => 'title', 'desc' =>
|
281 |
+
sprintf( __( 'Total commission currently due: %s. <a href="%s">View details</a>.', 'wcvendors' ), !function_exists( 'woocommerce_price' ) ? $total_due : woocommerce_price( $total_due ), '?page=pv_admin_commissions' ) .
|
282 |
+
'<br/><br/>' . sprintf( __( 'Make sure you update your PayPal Adaptive Payments settings <a href="%s">here</a>.', 'wcvendors' ), 'admin.php?page=wc-settings&tab=checkout§ion=wc_paypalap' )
|
283 |
+
);
|
284 |
+
|
285 |
+
$options[ ] = array(
|
286 |
+
'name' => __( 'Instant pay', 'wcvendors' ),
|
287 |
+
'desc' => __( 'Instantly pay vendors their commission when an order is made', 'wcvendors' ),
|
288 |
+
'tip' => __( 'For this to work, customers must checkout with the PayPal Adaptive Payments gateway. Using any other gateways will not pay vendors instantly', 'wcvendors' ),
|
289 |
+
'id' => 'instapay',
|
290 |
+
'type' => 'checkbox',
|
291 |
+
'std' => true,
|
292 |
+
);
|
293 |
+
|
294 |
+
$options[ ] = array(
|
295 |
+
'name' => __( 'Payment schedule', 'wcvendors' ),
|
296 |
+
'desc' => __( 'Note: Schedule will only work if instant pay is unchecked', 'wcvendors' ),
|
297 |
+
'id' => 'schedule',
|
298 |
+
'type' => 'radio',
|
299 |
+
'std' => 'manual',
|
300 |
+
'options' => array(
|
301 |
+
'weekly' => __( 'Weekly', 'wcvendors' ),
|
302 |
+
'biweekly' => __( 'Biweekly', 'wcvendors' ),
|
303 |
+
'monthly' => __( 'Monthly', 'wcvendors' ),
|
304 |
+
'manual' => __( 'Manual', 'wcvendors' ),
|
305 |
+
'now' => '<span style="color:green;"><strong>' . __( 'Now', 'wcvendors' ) . '</strong></span>',
|
306 |
+
)
|
307 |
+
);
|
308 |
+
|
309 |
+
$options[ ] = array(
|
310 |
+
'name' => __( 'Email notification', 'wcvendors' ),
|
311 |
+
'desc' => __( 'Send the WooCommerce admin an email each time a payment has been made via the payment schedule options above', 'wcvendors' ),
|
312 |
+
'id' => 'mail_mass_pay_results',
|
313 |
+
'type' => 'checkbox',
|
314 |
+
'std' => true,
|
315 |
+
);
|
{WCVendors/classes → classes}/class-commission.php
RENAMED
@@ -1,341 +1,341 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Commission functions
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package ProductVendor
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Commission
|
12 |
-
{
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Constructor
|
17 |
-
*/
|
18 |
-
function __construct()
|
19 |
-
{
|
20 |
-
$this->completed_statuses = apply_filters( 'wcvendors_completed_statuses', array(
|
21 |
-
'completed',
|
22 |
-
'processing',
|
23 |
-
) );
|
24 |
-
|
25 |
-
$this->reverse_statuses = apply_filters( 'wcvendors_reversed_statuses', array(
|
26 |
-
'pending',
|
27 |
-
'refunded',
|
28 |
-
'cancelled',
|
29 |
-
'failed',
|
30 |
-
) );
|
31 |
-
|
32 |
-
$this->check_order_reverse();
|
33 |
-
$this->check_order_complete();
|
34 |
-
}
|
35 |
-
|
36 |
-
|
37 |
-
/**
|
38 |
-
* Run actions when an order is reversed
|
39 |
-
*/
|
40 |
-
public function check_order_reverse()
|
41 |
-
{
|
42 |
-
foreach ( $this->completed_statuses as $completed ) {
|
43 |
-
foreach ( $this->reverse_statuses as $reversed ) {
|
44 |
-
add_action( "woocommerce_order_status_{$completed}_to_{$reversed}", array( 'WCV_Commission', 'reverse_due_commission' ) );
|
45 |
-
}
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
/**
|
51 |
-
* Runs only on a manual order update by a human
|
52 |
-
*/
|
53 |
-
public function check_order_complete()
|
54 |
-
{
|
55 |
-
foreach ( $this->completed_statuses as $completed ) {
|
56 |
-
add_action( 'woocommerce_order_status_' . $completed, array( 'WCV_Commission', 'log_commission_due' ) );
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
/**
|
62 |
-
* Reverse commission for an entire order
|
63 |
-
*
|
64 |
-
* Only runs if the order has been logged in pv_commission table
|
65 |
-
*
|
66 |
-
* @param int $order_id
|
67 |
-
*
|
68 |
-
* @return unknown
|
69 |
-
*/
|
70 |
-
public function reverse_due_commission( $order_id )
|
71 |
-
{
|
72 |
-
global $wpdb;
|
73 |
-
|
74 |
-
// Check if this order exists
|
75 |
-
$count = WCV_Commission::count_commission_by_order( $order_id );
|
76 |
-
if ( !$count ) return false;
|
77 |
-
|
78 |
-
// Deduct this amount from the vendor's total due
|
79 |
-
$results = WCV_Commission::sum_total_due_for_order( $order_id );
|
80 |
-
$ids = implode( ',', $results[ 'ids' ] );
|
81 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
82 |
-
|
83 |
-
$query = "UPDATE `{$table_name}` SET `status` = '%s' WHERE id IN ({$ids})";
|
84 |
-
$results = $wpdb->query( $wpdb->prepare( $query, 'reversed' ) );
|
85 |
-
|
86 |
-
return $results;
|
87 |
-
}
|
88 |
-
|
89 |
-
|
90 |
-
/**
|
91 |
-
* Store all commission due for an order
|
92 |
-
*
|
93 |
-
* @return bool
|
94 |
-
*
|
95 |
-
* @param int $order_id
|
96 |
-
*/
|
97 |
-
public static function log_commission_due( $order_id )
|
98 |
-
{
|
99 |
-
global $woocommerce;
|
100 |
-
|
101 |
-
$order = new WC_Order( $order_id );
|
102 |
-
$dues = WCV_Vendors::get_vendor_dues_from_order( $order, false );
|
103 |
-
|
104 |
-
foreach ( $dues as $vendor_id => $details ) {
|
105 |
-
|
106 |
-
// Only process vendor commission
|
107 |
-
if ( !WCV_Vendors::is_vendor( $vendor_id ) ) continue;
|
108 |
-
|
109 |
-
// See if they currently have an amount due
|
110 |
-
$due = WCV_Vendors::count_due_by_vendor( $vendor_id, $order_id );
|
111 |
-
if ( $due > 0 ) continue;
|
112 |
-
|
113 |
-
// Get the dues in an easy format for inserting to our table
|
114 |
-
$insert_due = array();
|
115 |
-
|
116 |
-
foreach ( $details as $key => $detail ) {
|
117 |
-
$product_id = $detail['product_id'];
|
118 |
-
|
119 |
-
$insert_due[ $product_id ] = array(
|
120 |
-
'order_id' => $order_id,
|
121 |
-
'vendor_id' => $vendor_id,
|
122 |
-
'product_id' => $product_id,
|
123 |
-
'total_due' => !empty( $insert_due[ $product_id ][ 'total_due' ] ) ? ( $detail[ 'commission' ] + $insert_due[ $product_id ][ 'total_due' ] ) : $detail[ 'commission' ],
|
124 |
-
'total_shipping' => !empty( $insert_due[ $product_id ][ 'total_shipping' ] ) ? ( $detail[ 'shipping' ] + $insert_due[ $product_id ][ 'total_shipping' ] ) : $detail[ 'shipping' ],
|
125 |
-
'tax' => !empty( $insert_due[ $product_id ][ 'tax' ] ) ? ( $detail[ 'tax' ] + $insert_due[ $product_id ][ 'tax' ] ) : $detail[ 'tax' ],
|
126 |
-
'qty' => !empty( $insert_due[ $product_id ][ 'qty' ] ) ? ( $detail[ 'qty' ] + $insert_due[ $product_id ][ 'qty' ] ) : $detail[ 'qty' ],
|
127 |
-
'time' => $order->order_date,
|
128 |
-
);
|
129 |
-
}
|
130 |
-
|
131 |
-
if ( !empty( $insert_due ) ) {
|
132 |
-
WCV_Commission::insert_new_commission( array_values( $insert_due ) );
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
}
|
137 |
-
|
138 |
-
|
139 |
-
/**
|
140 |
-
* Add up the totals for an order for each vendor
|
141 |
-
*
|
142 |
-
* @param int $order_id
|
143 |
-
*
|
144 |
-
* @return array
|
145 |
-
*/
|
146 |
-
public function sum_total_due_for_order( $order_id )
|
147 |
-
{
|
148 |
-
global $wpdb;
|
149 |
-
|
150 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
151 |
-
$query = "SELECT `id`, `total_due`, `total_shipping`, `tax`, `vendor_id`
|
152 |
-
FROM `{$table_name}`
|
153 |
-
WHERE `order_id` = %d
|
154 |
-
AND `status` = %s";
|
155 |
-
|
156 |
-
$results = $wpdb->get_results( $wpdb->prepare( $query, $order_id, 'due' ) );
|
157 |
-
|
158 |
-
foreach ( $results as $commission ) {
|
159 |
-
$commission_ids[ ] = $commission->id;
|
160 |
-
|
161 |
-
$pay[ $commission->vendor_id ] = !empty( $pay[ $commission->vendor_id ] )
|
162 |
-
? ( $pay[ $commission->vendor_id ] + ( $commission->total_due + $commission->total_shipping + $commission->tax ) )
|
163 |
-
: ( $commission->total_due + $commission->total_shipping + $commission->tax );
|
164 |
-
}
|
165 |
-
|
166 |
-
$return = array(
|
167 |
-
'vendors' => $pay,
|
168 |
-
'ids' => $commission_ids,
|
169 |
-
);
|
170 |
-
|
171 |
-
return $return;
|
172 |
-
}
|
173 |
-
|
174 |
-
|
175 |
-
/**
|
176 |
-
* Return all commission outstanding with a 'due' status
|
177 |
-
*
|
178 |
-
* @return object
|
179 |
-
*/
|
180 |
-
public static function get_all_due()
|
181 |
-
{
|
182 |
-
global $wpdb;
|
183 |
-
|
184 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
185 |
-
$query = "SELECT id, vendor_id, total_due
|
186 |
-
FROM `{$table_name}`
|
187 |
-
WHERE status = %s";
|
188 |
-
$results = $wpdb->get_results( $wpdb->prepare( $query, 'due' ) );
|
189 |
-
|
190 |
-
return $results;
|
191 |
-
}
|
192 |
-
|
193 |
-
|
194 |
-
/**
|
195 |
-
* Check if this order has commission logged already
|
196 |
-
*
|
197 |
-
* @param int $order_id
|
198 |
-
*
|
199 |
-
* @return int
|
200 |
-
*/
|
201 |
-
public function count_commission_by_order( $order_id )
|
202 |
-
{
|
203 |
-
global $wpdb;
|
204 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
205 |
-
|
206 |
-
if ( is_array( $order_id ) )
|
207 |
-
$order_id = implode( ',', $order_id );
|
208 |
-
|
209 |
-
$query = "SELECT COUNT(order_id) AS order_count
|
210 |
-
FROM {$table_name}
|
211 |
-
WHERE order_id IN ($order_id)
|
212 |
-
AND status <> %s";
|
213 |
-
$count = $wpdb->get_var( $wpdb->prepare( $query, 'reversed' ) );
|
214 |
-
|
215 |
-
return $count;
|
216 |
-
}
|
217 |
-
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Product's commission rate in percentage form
|
221 |
-
*
|
222 |
-
* Eg: 50 for 50%
|
223 |
-
*
|
224 |
-
* @param int $product_id
|
225 |
-
*
|
226 |
-
* @return float
|
227 |
-
*/
|
228 |
-
public static function get_commission_rate( $product_id )
|
229 |
-
{
|
230 |
-
|
231 |
-
$commission = 0;
|
232 |
-
|
233 |
-
$parent = get_post_ancestors( $product_id );
|
234 |
-
if ( $parent ) $product_id = $parent[ 0 ];
|
235 |
-
|
236 |
-
$vendor_id = WCV_Vendors::get_vendor_from_product( $product_id );
|
237 |
-
|
238 |
-
$product_commission = get_post_meta( $product_id, 'pv_commission_rate', true );
|
239 |
-
$vendor_commission = WCV_Vendors::get_default_commission( $vendor_id );
|
240 |
-
$default_commission = WC_Vendors::$pv_options->get_option( 'default_commission' );
|
241 |
-
|
242 |
-
if ( $product_commission != '' && $product_commission !== false ) {
|
243 |
-
$commission = $product_commission;
|
244 |
-
}
|
245 |
-
|
246 |
-
else if ( $vendor_commission != '' && $vendor_commission !== false ) {
|
247 |
-
$commission = $vendor_commission;
|
248 |
-
}
|
249 |
-
|
250 |
-
else if ( $default_commission != '' && $default_commission !== false ) {
|
251 |
-
$commission = $default_commission;
|
252 |
-
}
|
253 |
-
|
254 |
-
return apply_filters( 'wcv_commission_rate_percent', $commission, $product_id );
|
255 |
-
}
|
256 |
-
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Commission due for a product based on a rate and price
|
260 |
-
*
|
261 |
-
* @param float $product_price
|
262 |
-
* @param unknown $product_id
|
263 |
-
*
|
264 |
-
* @return float
|
265 |
-
*/
|
266 |
-
public static function calculate_commission( $product_price, $product_id, $order )
|
267 |
-
{
|
268 |
-
$commission_rate = WCV_Commission::get_commission_rate( $product_id );
|
269 |
-
$commission = $product_price * ( $commission_rate / 100 );
|
270 |
-
$commission = round( $commission, 2 );
|
271 |
-
|
272 |
-
return apply_filters( 'wcv_commission_rate', $commission, $product_id, $product_price, $order );
|
273 |
-
}
|
274 |
-
|
275 |
-
|
276 |
-
/**
|
277 |
-
* Log commission to the pv_commission table
|
278 |
-
*
|
279 |
-
* Will either update or insert to the database
|
280 |
-
*
|
281 |
-
* @param array $orders
|
282 |
-
*
|
283 |
-
* @return unknown
|
284 |
-
*/
|
285 |
-
public static function insert_new_commission( $orders = array() )
|
286 |
-
{
|
287 |
-
global $wpdb;
|
288 |
-
|
289 |
-
if ( empty( $orders ) ) return false;
|
290 |
-
|
291 |
-
$table = $wpdb->prefix . "pv_commission";
|
292 |
-
|
293 |
-
// Insert the time and default status 'due'
|
294 |
-
foreach ( $orders as $key => $order ) {
|
295 |
-
$orders[ $key ][ 'time' ] = $order['time'];
|
296 |
-
$orders[ $key ][ 'status' ] = 'due';
|
297 |
-
}
|
298 |
-
|
299 |
-
foreach ( $orders as $key => $order ) {
|
300 |
-
$where = array(
|
301 |
-
'order_id' => $order[ 'order_id' ],
|
302 |
-
'product_id' => $order[ 'product_id' ],
|
303 |
-
'vendor_id' => $order[ 'vendor_id' ],
|
304 |
-
'qty' => $order[ 'qty' ],
|
305 |
-
);
|
306 |
-
$update = $wpdb->update( $table, $order, $where );
|
307 |
-
if ( !$update ) $insert = $wpdb->insert( $table, $order );
|
308 |
-
}
|
309 |
-
|
310 |
-
do_action( 'wcv_commissions_inserted', $orders );
|
311 |
-
}
|
312 |
-
|
313 |
-
|
314 |
-
/**
|
315 |
-
* Set commission to 'paid' for an entire order
|
316 |
-
*
|
317 |
-
*
|
318 |
-
* @access public
|
319 |
-
*
|
320 |
-
* @param mixed $order_id An array of Order IDs or an int.
|
321 |
-
* @param unknown $column_ids (optional)
|
322 |
-
*
|
323 |
-
* @return bool.
|
324 |
-
*/
|
325 |
-
public function set_order_commission_paid( $order_id, $column_ids = false )
|
326 |
-
{
|
327 |
-
global $wpdb;
|
328 |
-
|
329 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
330 |
-
|
331 |
-
if ( is_array( $order_id ) )
|
332 |
-
$order_id = implode( ',', $order_id );
|
333 |
-
|
334 |
-
$query = "UPDATE `{$table_name}` SET `status` = 'paid' WHERE order_id IN ($order_id)";
|
335 |
-
$result = $wpdb->query( $query );
|
336 |
-
|
337 |
-
return $result;
|
338 |
-
}
|
339 |
-
|
340 |
-
|
341 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Commission functions
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package ProductVendor
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Commission
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Constructor
|
17 |
+
*/
|
18 |
+
function __construct()
|
19 |
+
{
|
20 |
+
$this->completed_statuses = apply_filters( 'wcvendors_completed_statuses', array(
|
21 |
+
'completed',
|
22 |
+
'processing',
|
23 |
+
) );
|
24 |
+
|
25 |
+
$this->reverse_statuses = apply_filters( 'wcvendors_reversed_statuses', array(
|
26 |
+
'pending',
|
27 |
+
'refunded',
|
28 |
+
'cancelled',
|
29 |
+
'failed',
|
30 |
+
) );
|
31 |
+
|
32 |
+
$this->check_order_reverse();
|
33 |
+
$this->check_order_complete();
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Run actions when an order is reversed
|
39 |
+
*/
|
40 |
+
public function check_order_reverse()
|
41 |
+
{
|
42 |
+
foreach ( $this->completed_statuses as $completed ) {
|
43 |
+
foreach ( $this->reverse_statuses as $reversed ) {
|
44 |
+
add_action( "woocommerce_order_status_{$completed}_to_{$reversed}", array( 'WCV_Commission', 'reverse_due_commission' ) );
|
45 |
+
}
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Runs only on a manual order update by a human
|
52 |
+
*/
|
53 |
+
public function check_order_complete()
|
54 |
+
{
|
55 |
+
foreach ( $this->completed_statuses as $completed ) {
|
56 |
+
add_action( 'woocommerce_order_status_' . $completed, array( 'WCV_Commission', 'log_commission_due' ) );
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
/**
|
62 |
+
* Reverse commission for an entire order
|
63 |
+
*
|
64 |
+
* Only runs if the order has been logged in pv_commission table
|
65 |
+
*
|
66 |
+
* @param int $order_id
|
67 |
+
*
|
68 |
+
* @return unknown
|
69 |
+
*/
|
70 |
+
public function reverse_due_commission( $order_id )
|
71 |
+
{
|
72 |
+
global $wpdb;
|
73 |
+
|
74 |
+
// Check if this order exists
|
75 |
+
$count = WCV_Commission::count_commission_by_order( $order_id );
|
76 |
+
if ( !$count ) return false;
|
77 |
+
|
78 |
+
// Deduct this amount from the vendor's total due
|
79 |
+
$results = WCV_Commission::sum_total_due_for_order( $order_id );
|
80 |
+
$ids = implode( ',', $results[ 'ids' ] );
|
81 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
82 |
+
|
83 |
+
$query = "UPDATE `{$table_name}` SET `status` = '%s' WHERE id IN ({$ids})";
|
84 |
+
$results = $wpdb->query( $wpdb->prepare( $query, 'reversed' ) );
|
85 |
+
|
86 |
+
return $results;
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Store all commission due for an order
|
92 |
+
*
|
93 |
+
* @return bool
|
94 |
+
*
|
95 |
+
* @param int $order_id
|
96 |
+
*/
|
97 |
+
public static function log_commission_due( $order_id )
|
98 |
+
{
|
99 |
+
global $woocommerce;
|
100 |
+
|
101 |
+
$order = new WC_Order( $order_id );
|
102 |
+
$dues = WCV_Vendors::get_vendor_dues_from_order( $order, false );
|
103 |
+
|
104 |
+
foreach ( $dues as $vendor_id => $details ) {
|
105 |
+
|
106 |
+
// Only process vendor commission
|
107 |
+
if ( !WCV_Vendors::is_vendor( $vendor_id ) ) continue;
|
108 |
+
|
109 |
+
// See if they currently have an amount due
|
110 |
+
$due = WCV_Vendors::count_due_by_vendor( $vendor_id, $order_id );
|
111 |
+
if ( $due > 0 ) continue;
|
112 |
+
|
113 |
+
// Get the dues in an easy format for inserting to our table
|
114 |
+
$insert_due = array();
|
115 |
+
|
116 |
+
foreach ( $details as $key => $detail ) {
|
117 |
+
$product_id = $detail['product_id'];
|
118 |
+
|
119 |
+
$insert_due[ $product_id ] = array(
|
120 |
+
'order_id' => $order_id,
|
121 |
+
'vendor_id' => $vendor_id,
|
122 |
+
'product_id' => $product_id,
|
123 |
+
'total_due' => !empty( $insert_due[ $product_id ][ 'total_due' ] ) ? ( $detail[ 'commission' ] + $insert_due[ $product_id ][ 'total_due' ] ) : $detail[ 'commission' ],
|
124 |
+
'total_shipping' => !empty( $insert_due[ $product_id ][ 'total_shipping' ] ) ? ( $detail[ 'shipping' ] + $insert_due[ $product_id ][ 'total_shipping' ] ) : $detail[ 'shipping' ],
|
125 |
+
'tax' => !empty( $insert_due[ $product_id ][ 'tax' ] ) ? ( $detail[ 'tax' ] + $insert_due[ $product_id ][ 'tax' ] ) : $detail[ 'tax' ],
|
126 |
+
'qty' => !empty( $insert_due[ $product_id ][ 'qty' ] ) ? ( $detail[ 'qty' ] + $insert_due[ $product_id ][ 'qty' ] ) : $detail[ 'qty' ],
|
127 |
+
'time' => $order->order_date,
|
128 |
+
);
|
129 |
+
}
|
130 |
+
|
131 |
+
if ( !empty( $insert_due ) ) {
|
132 |
+
WCV_Commission::insert_new_commission( array_values( $insert_due ) );
|
133 |
+
}
|
134 |
+
}
|
135 |
+
|
136 |
+
}
|
137 |
+
|
138 |
+
|
139 |
+
/**
|
140 |
+
* Add up the totals for an order for each vendor
|
141 |
+
*
|
142 |
+
* @param int $order_id
|
143 |
+
*
|
144 |
+
* @return array
|
145 |
+
*/
|
146 |
+
public function sum_total_due_for_order( $order_id )
|
147 |
+
{
|
148 |
+
global $wpdb;
|
149 |
+
|
150 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
151 |
+
$query = "SELECT `id`, `total_due`, `total_shipping`, `tax`, `vendor_id`
|
152 |
+
FROM `{$table_name}`
|
153 |
+
WHERE `order_id` = %d
|
154 |
+
AND `status` = %s";
|
155 |
+
|
156 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $order_id, 'due' ) );
|
157 |
+
|
158 |
+
foreach ( $results as $commission ) {
|
159 |
+
$commission_ids[ ] = $commission->id;
|
160 |
+
|
161 |
+
$pay[ $commission->vendor_id ] = !empty( $pay[ $commission->vendor_id ] )
|
162 |
+
? ( $pay[ $commission->vendor_id ] + ( $commission->total_due + $commission->total_shipping + $commission->tax ) )
|
163 |
+
: ( $commission->total_due + $commission->total_shipping + $commission->tax );
|
164 |
+
}
|
165 |
+
|
166 |
+
$return = array(
|
167 |
+
'vendors' => $pay,
|
168 |
+
'ids' => $commission_ids,
|
169 |
+
);
|
170 |
+
|
171 |
+
return $return;
|
172 |
+
}
|
173 |
+
|
174 |
+
|
175 |
+
/**
|
176 |
+
* Return all commission outstanding with a 'due' status
|
177 |
+
*
|
178 |
+
* @return object
|
179 |
+
*/
|
180 |
+
public static function get_all_due()
|
181 |
+
{
|
182 |
+
global $wpdb;
|
183 |
+
|
184 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
185 |
+
$query = "SELECT id, vendor_id, total_due
|
186 |
+
FROM `{$table_name}`
|
187 |
+
WHERE status = %s";
|
188 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, 'due' ) );
|
189 |
+
|
190 |
+
return $results;
|
191 |
+
}
|
192 |
+
|
193 |
+
|
194 |
+
/**
|
195 |
+
* Check if this order has commission logged already
|
196 |
+
*
|
197 |
+
* @param int $order_id
|
198 |
+
*
|
199 |
+
* @return int
|
200 |
+
*/
|
201 |
+
public function count_commission_by_order( $order_id )
|
202 |
+
{
|
203 |
+
global $wpdb;
|
204 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
205 |
+
|
206 |
+
if ( is_array( $order_id ) )
|
207 |
+
$order_id = implode( ',', $order_id );
|
208 |
+
|
209 |
+
$query = "SELECT COUNT(order_id) AS order_count
|
210 |
+
FROM {$table_name}
|
211 |
+
WHERE order_id IN ($order_id)
|
212 |
+
AND status <> %s";
|
213 |
+
$count = $wpdb->get_var( $wpdb->prepare( $query, 'reversed' ) );
|
214 |
+
|
215 |
+
return $count;
|
216 |
+
}
|
217 |
+
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Product's commission rate in percentage form
|
221 |
+
*
|
222 |
+
* Eg: 50 for 50%
|
223 |
+
*
|
224 |
+
* @param int $product_id
|
225 |
+
*
|
226 |
+
* @return float
|
227 |
+
*/
|
228 |
+
public static function get_commission_rate( $product_id )
|
229 |
+
{
|
230 |
+
|
231 |
+
$commission = 0;
|
232 |
+
|
233 |
+
$parent = get_post_ancestors( $product_id );
|
234 |
+
if ( $parent ) $product_id = $parent[ 0 ];
|
235 |
+
|
236 |
+
$vendor_id = WCV_Vendors::get_vendor_from_product( $product_id );
|
237 |
+
|
238 |
+
$product_commission = get_post_meta( $product_id, 'pv_commission_rate', true );
|
239 |
+
$vendor_commission = WCV_Vendors::get_default_commission( $vendor_id );
|
240 |
+
$default_commission = WC_Vendors::$pv_options->get_option( 'default_commission' );
|
241 |
+
|
242 |
+
if ( $product_commission != '' && $product_commission !== false ) {
|
243 |
+
$commission = $product_commission;
|
244 |
+
}
|
245 |
+
|
246 |
+
else if ( $vendor_commission != '' && $vendor_commission !== false ) {
|
247 |
+
$commission = $vendor_commission;
|
248 |
+
}
|
249 |
+
|
250 |
+
else if ( $default_commission != '' && $default_commission !== false ) {
|
251 |
+
$commission = $default_commission;
|
252 |
+
}
|
253 |
+
|
254 |
+
return apply_filters( 'wcv_commission_rate_percent', $commission, $product_id );
|
255 |
+
}
|
256 |
+
|
257 |
+
|
258 |
+
/**
|
259 |
+
* Commission due for a product based on a rate and price
|
260 |
+
*
|
261 |
+
* @param float $product_price
|
262 |
+
* @param unknown $product_id
|
263 |
+
*
|
264 |
+
* @return float
|
265 |
+
*/
|
266 |
+
public static function calculate_commission( $product_price, $product_id, $order )
|
267 |
+
{
|
268 |
+
$commission_rate = WCV_Commission::get_commission_rate( $product_id );
|
269 |
+
$commission = $product_price * ( $commission_rate / 100 );
|
270 |
+
$commission = round( $commission, 2 );
|
271 |
+
|
272 |
+
return apply_filters( 'wcv_commission_rate', $commission, $product_id, $product_price, $order );
|
273 |
+
}
|
274 |
+
|
275 |
+
|
276 |
+
/**
|
277 |
+
* Log commission to the pv_commission table
|
278 |
+
*
|
279 |
+
* Will either update or insert to the database
|
280 |
+
*
|
281 |
+
* @param array $orders
|
282 |
+
*
|
283 |
+
* @return unknown
|
284 |
+
*/
|
285 |
+
public static function insert_new_commission( $orders = array() )
|
286 |
+
{
|
287 |
+
global $wpdb;
|
288 |
+
|
289 |
+
if ( empty( $orders ) ) return false;
|
290 |
+
|
291 |
+
$table = $wpdb->prefix . "pv_commission";
|
292 |
+
|
293 |
+
// Insert the time and default status 'due'
|
294 |
+
foreach ( $orders as $key => $order ) {
|
295 |
+
$orders[ $key ][ 'time' ] = $order['time'];
|
296 |
+
$orders[ $key ][ 'status' ] = 'due';
|
297 |
+
}
|
298 |
+
|
299 |
+
foreach ( $orders as $key => $order ) {
|
300 |
+
$where = array(
|
301 |
+
'order_id' => $order[ 'order_id' ],
|
302 |
+
'product_id' => $order[ 'product_id' ],
|
303 |
+
'vendor_id' => $order[ 'vendor_id' ],
|
304 |
+
'qty' => $order[ 'qty' ],
|
305 |
+
);
|
306 |
+
$update = $wpdb->update( $table, $order, $where );
|
307 |
+
if ( !$update ) $insert = $wpdb->insert( $table, $order );
|
308 |
+
}
|
309 |
+
|
310 |
+
do_action( 'wcv_commissions_inserted', $orders );
|
311 |
+
}
|
312 |
+
|
313 |
+
|
314 |
+
/**
|
315 |
+
* Set commission to 'paid' for an entire order
|
316 |
+
*
|
317 |
+
*
|
318 |
+
* @access public
|
319 |
+
*
|
320 |
+
* @param mixed $order_id An array of Order IDs or an int.
|
321 |
+
* @param unknown $column_ids (optional)
|
322 |
+
*
|
323 |
+
* @return bool.
|
324 |
+
*/
|
325 |
+
public function set_order_commission_paid( $order_id, $column_ids = false )
|
326 |
+
{
|
327 |
+
global $wpdb;
|
328 |
+
|
329 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
330 |
+
|
331 |
+
if ( is_array( $order_id ) )
|
332 |
+
$order_id = implode( ',', $order_id );
|
333 |
+
|
334 |
+
$query = "UPDATE `{$table_name}` SET `status` = 'paid' WHERE order_id IN ($order_id)";
|
335 |
+
$result = $wpdb->query( $query );
|
336 |
+
|
337 |
+
return $result;
|
338 |
+
}
|
339 |
+
|
340 |
+
|
341 |
+
}
|
{WCVendors/classes → classes}/class-cron.php
RENAMED
@@ -1,165 +1,165 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Cron class
|
4 |
-
*
|
5 |
-
* @package ProductVendor
|
6 |
-
*/
|
7 |
-
|
8 |
-
|
9 |
-
class WCV_Cron
|
10 |
-
{
|
11 |
-
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Constructor
|
15 |
-
*/
|
16 |
-
function __construct()
|
17 |
-
{
|
18 |
-
add_filter( 'cron_schedules', array( 'WCV_Cron', 'custom_cron_intervals' ) );
|
19 |
-
add_action( WC_Vendors::$id . '_options_updated', array( 'WCV_Cron', 'check_schedule' ) );
|
20 |
-
add_filter( WC_Vendors::$id . '_options_on_update', array( 'WCV_Cron', 'check_schedule_now' ) );
|
21 |
-
}
|
22 |
-
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Re-add cron schedule when the settings have been updated
|
26 |
-
*
|
27 |
-
* @param array
|
28 |
-
* @param unknown $options
|
29 |
-
*/
|
30 |
-
public static function check_schedule( $options )
|
31 |
-
{
|
32 |
-
$old_interval = wp_get_schedule( 'pv_schedule_mass_payments' );
|
33 |
-
$new_interval = $options[ 'schedule' ];
|
34 |
-
$instapay = $options[ 'instapay' ];
|
35 |
-
|
36 |
-
/**
|
37 |
-
* 1. The user actually changed the schedule
|
38 |
-
* 2. Instapay is turned off
|
39 |
-
* 3. Manual was not selected
|
40 |
-
*/
|
41 |
-
if ( ( $old_interval != $new_interval ) && !$instapay && $new_interval != 'manual' ) {
|
42 |
-
WCV_Cron::remove_cron_schedule( $options );
|
43 |
-
WCV_Cron::schedule_cron( $new_interval );
|
44 |
-
}
|
45 |
-
|
46 |
-
if ( $new_interval == 'manual' || $instapay ) {
|
47 |
-
WCV_Cron::remove_cron_schedule( $options );
|
48 |
-
}
|
49 |
-
|
50 |
-
}
|
51 |
-
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Check if the user chose "Now" on the Schedule settings
|
55 |
-
*
|
56 |
-
* @param array $options
|
57 |
-
*
|
58 |
-
* @return array
|
59 |
-
*/
|
60 |
-
public static function check_schedule_now( $options )
|
61 |
-
{
|
62 |
-
$old_schedule = WC_Vendors::$pv_options->get_option( 'schedule' );
|
63 |
-
$new_schedule = $options[ 'schedule' ];
|
64 |
-
|
65 |
-
if ( $new_schedule == 'now' ) {
|
66 |
-
$return = WCV_Cron::pay_now();
|
67 |
-
$options[ 'schedule' ] = $old_schedule;
|
68 |
-
WCV_Cron::schedule_cron( $old_schedule );
|
69 |
-
add_settings_error( WC_Vendors::$pv_options->id, 'save_options', $return[ 'message' ], $return[ 'status' ] );
|
70 |
-
}
|
71 |
-
|
72 |
-
return $options;
|
73 |
-
}
|
74 |
-
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Pay all outstanding commission using Paypal Mass Pay
|
78 |
-
*
|
79 |
-
* @return array
|
80 |
-
*/
|
81 |
-
public static function pay_now()
|
82 |
-
{
|
83 |
-
$mass_pay = new WCV_Mass_Pay;
|
84 |
-
$mass_pay = $mass_pay->do_payments();
|
85 |
-
|
86 |
-
$message = !empty( $mass_pay[ 'total' ] )
|
87 |
-
? $mass_pay[ 'msg' ] . '<br/>' . sprintf( __( 'Payment total: %s', 'wcvendors' ), woocommerce_price( $mass_pay[ 'total' ] ) )
|
88 |
-
: $mass_pay[ 'msg' ];
|
89 |
-
|
90 |
-
return array(
|
91 |
-
'message' => $message,
|
92 |
-
'status' => $mass_pay[ 'status' ]
|
93 |
-
);
|
94 |
-
}
|
95 |
-
|
96 |
-
|
97 |
-
/**
|
98 |
-
* Remove the mass payments schedule
|
99 |
-
*
|
100 |
-
* @return bool
|
101 |
-
*/
|
102 |
-
private static function remove_cron_schedule()
|
103 |
-
{
|
104 |
-
$timestamp = wp_next_scheduled( 'pv_schedule_mass_payments' );
|
105 |
-
|
106 |
-
return wp_unschedule_event( $timestamp, 'pv_schedule_mass_payments' );
|
107 |
-
}
|
108 |
-
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Schedule a cron event on a specified interval
|
112 |
-
*
|
113 |
-
* @param string $interval
|
114 |
-
*
|
115 |
-
* @return bool
|
116 |
-
*/
|
117 |
-
public static function schedule_cron( $interval )
|
118 |
-
{
|
119 |
-
// Scheduled event
|
120 |
-
add_action( 'pv_schedule_mass_payments', array( 'WCV_Cron', 'pay_now' ) );
|
121 |
-
|
122 |
-
// Schedule the event
|
123 |
-
if ( !wp_next_scheduled( 'pv_schedule_mass_payments' ) ) {
|
124 |
-
wp_schedule_event( time(), $interval, 'pv_schedule_mass_payments' );
|
125 |
-
|
126 |
-
return true;
|
127 |
-
}
|
128 |
-
|
129 |
-
return false;
|
130 |
-
}
|
131 |
-
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Add new schedule intervals to WP
|
135 |
-
*
|
136 |
-
* Weekly
|
137 |
-
* Biweekly
|
138 |
-
* Monthly
|
139 |
-
*
|
140 |
-
* @param array $schedules
|
141 |
-
*
|
142 |
-
* @return array
|
143 |
-
*/
|
144 |
-
public static function custom_cron_intervals( $schedules )
|
145 |
-
{
|
146 |
-
$schedules[ 'weekly' ] = array(
|
147 |
-
'interval' => 604800,
|
148 |
-
'display' => __( 'Once Weekly' )
|
149 |
-
);
|
150 |
-
|
151 |
-
$schedules[ 'biweekly' ] = array(
|
152 |
-
'interval' => 1209600,
|
153 |
-
'display' => __( 'Once every two weeks' )
|
154 |
-
);
|
155 |
-
|
156 |
-
$schedules[ 'monthly' ] = array(
|
157 |
-
'interval' => 2635200,
|
158 |
-
'display' => __( 'Once a month' )
|
159 |
-
);
|
160 |
-
|
161 |
-
return $schedules;
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Cron class
|
4 |
+
*
|
5 |
+
* @package ProductVendor
|
6 |
+
*/
|
7 |
+
|
8 |
+
|
9 |
+
class WCV_Cron
|
10 |
+
{
|
11 |
+
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Constructor
|
15 |
+
*/
|
16 |
+
function __construct()
|
17 |
+
{
|
18 |
+
add_filter( 'cron_schedules', array( 'WCV_Cron', 'custom_cron_intervals' ) );
|
19 |
+
add_action( WC_Vendors::$id . '_options_updated', array( 'WCV_Cron', 'check_schedule' ) );
|
20 |
+
add_filter( WC_Vendors::$id . '_options_on_update', array( 'WCV_Cron', 'check_schedule_now' ) );
|
21 |
+
}
|
22 |
+
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Re-add cron schedule when the settings have been updated
|
26 |
+
*
|
27 |
+
* @param array
|
28 |
+
* @param unknown $options
|
29 |
+
*/
|
30 |
+
public static function check_schedule( $options )
|
31 |
+
{
|
32 |
+
$old_interval = wp_get_schedule( 'pv_schedule_mass_payments' );
|
33 |
+
$new_interval = $options[ 'schedule' ];
|
34 |
+
$instapay = $options[ 'instapay' ];
|
35 |
+
|
36 |
+
/**
|
37 |
+
* 1. The user actually changed the schedule
|
38 |
+
* 2. Instapay is turned off
|
39 |
+
* 3. Manual was not selected
|
40 |
+
*/
|
41 |
+
if ( ( $old_interval != $new_interval ) && !$instapay && $new_interval != 'manual' ) {
|
42 |
+
WCV_Cron::remove_cron_schedule( $options );
|
43 |
+
WCV_Cron::schedule_cron( $new_interval );
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( $new_interval == 'manual' || $instapay ) {
|
47 |
+
WCV_Cron::remove_cron_schedule( $options );
|
48 |
+
}
|
49 |
+
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
/**
|
54 |
+
* Check if the user chose "Now" on the Schedule settings
|
55 |
+
*
|
56 |
+
* @param array $options
|
57 |
+
*
|
58 |
+
* @return array
|
59 |
+
*/
|
60 |
+
public static function check_schedule_now( $options )
|
61 |
+
{
|
62 |
+
$old_schedule = WC_Vendors::$pv_options->get_option( 'schedule' );
|
63 |
+
$new_schedule = $options[ 'schedule' ];
|
64 |
+
|
65 |
+
if ( $new_schedule == 'now' ) {
|
66 |
+
$return = WCV_Cron::pay_now();
|
67 |
+
$options[ 'schedule' ] = $old_schedule;
|
68 |
+
WCV_Cron::schedule_cron( $old_schedule );
|
69 |
+
add_settings_error( WC_Vendors::$pv_options->id, 'save_options', $return[ 'message' ], $return[ 'status' ] );
|
70 |
+
}
|
71 |
+
|
72 |
+
return $options;
|
73 |
+
}
|
74 |
+
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Pay all outstanding commission using Paypal Mass Pay
|
78 |
+
*
|
79 |
+
* @return array
|
80 |
+
*/
|
81 |
+
public static function pay_now()
|
82 |
+
{
|
83 |
+
$mass_pay = new WCV_Mass_Pay;
|
84 |
+
$mass_pay = $mass_pay->do_payments();
|
85 |
+
|
86 |
+
$message = !empty( $mass_pay[ 'total' ] )
|
87 |
+
? $mass_pay[ 'msg' ] . '<br/>' . sprintf( __( 'Payment total: %s', 'wcvendors' ), woocommerce_price( $mass_pay[ 'total' ] ) )
|
88 |
+
: $mass_pay[ 'msg' ];
|
89 |
+
|
90 |
+
return array(
|
91 |
+
'message' => $message,
|
92 |
+
'status' => $mass_pay[ 'status' ]
|
93 |
+
);
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Remove the mass payments schedule
|
99 |
+
*
|
100 |
+
* @return bool
|
101 |
+
*/
|
102 |
+
private static function remove_cron_schedule()
|
103 |
+
{
|
104 |
+
$timestamp = wp_next_scheduled( 'pv_schedule_mass_payments' );
|
105 |
+
|
106 |
+
return wp_unschedule_event( $timestamp, 'pv_schedule_mass_payments' );
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
/**
|
111 |
+
* Schedule a cron event on a specified interval
|
112 |
+
*
|
113 |
+
* @param string $interval
|
114 |
+
*
|
115 |
+
* @return bool
|
116 |
+
*/
|
117 |
+
public static function schedule_cron( $interval )
|
118 |
+
{
|
119 |
+
// Scheduled event
|
120 |
+
add_action( 'pv_schedule_mass_payments', array( 'WCV_Cron', 'pay_now' ) );
|
121 |
+
|
122 |
+
// Schedule the event
|
123 |
+
if ( !wp_next_scheduled( 'pv_schedule_mass_payments' ) ) {
|
124 |
+
wp_schedule_event( time(), $interval, 'pv_schedule_mass_payments' );
|
125 |
+
|
126 |
+
return true;
|
127 |
+
}
|
128 |
+
|
129 |
+
return false;
|
130 |
+
}
|
131 |
+
|
132 |
+
|
133 |
+
/**
|
134 |
+
* Add new schedule intervals to WP
|
135 |
+
*
|
136 |
+
* Weekly
|
137 |
+
* Biweekly
|
138 |
+
* Monthly
|
139 |
+
*
|
140 |
+
* @param array $schedules
|
141 |
+
*
|
142 |
+
* @return array
|
143 |
+
*/
|
144 |
+
public static function custom_cron_intervals( $schedules )
|
145 |
+
{
|
146 |
+
$schedules[ 'weekly' ] = array(
|
147 |
+
'interval' => 604800,
|
148 |
+
'display' => __( 'Once Weekly' )
|
149 |
+
);
|
150 |
+
|
151 |
+
$schedules[ 'biweekly' ] = array(
|
152 |
+
'interval' => 1209600,
|
153 |
+
'display' => __( 'Once every two weeks' )
|
154 |
+
);
|
155 |
+
|
156 |
+
$schedules[ 'monthly' ] = array(
|
157 |
+
'interval' => 2635200,
|
158 |
+
'display' => __( 'Once a month' )
|
159 |
+
);
|
160 |
+
|
161 |
+
return $schedules;
|
162 |
+
}
|
163 |
+
|
164 |
+
|
165 |
+
}
|
{WCVendors/classes → classes}/class-install.php
RENAMED
@@ -1,245 +1,245 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Install class on activation.
|
4 |
-
*
|
5 |
-
* @author Matt Gates <http://mgates.me>
|
6 |
-
* @package ProductVendor
|
7 |
-
*/
|
8 |
-
|
9 |
-
|
10 |
-
class WCV_Install
|
11 |
-
{
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Checks if install is requierd
|
15 |
-
*
|
16 |
-
* @return unknown
|
17 |
-
*/
|
18 |
-
public function init()
|
19 |
-
{
|
20 |
-
$db_version = WC_Vendors::$pv_options->get_option( 'db_version' );
|
21 |
-
|
22 |
-
// Initial Install
|
23 |
-
if ( version_compare( $db_version, '1.0', '<' ) ) {
|
24 |
-
$this->install_wcvendor();
|
25 |
-
WC_Vendors::$pv_options->update_option( 'db_version', '1.5.0' );
|
26 |
-
}
|
27 |
-
|
28 |
-
}
|
29 |
-
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Grouped functions for installing the WC Vendor plugin
|
33 |
-
*/
|
34 |
-
private function install_wcvendor()
|
35 |
-
{
|
36 |
-
// Clear the cron
|
37 |
-
wp_clear_scheduled_hook( 'pv_schedule_mass_payments' );
|
38 |
-
|
39 |
-
// Add the vendors role
|
40 |
-
$this->add_new_roles();
|
41 |
-
|
42 |
-
// Create tables
|
43 |
-
$this->create_new_tables();
|
44 |
-
|
45 |
-
// Create the Orders page if it doesn't exist
|
46 |
-
$orders_page = WC_Vendors::$pv_options->get_option( 'orders_page' );
|
47 |
-
if ( empty( $orders_page ) ) $this->create_new_pages();
|
48 |
-
}
|
49 |
-
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Add the new Vendor role
|
53 |
-
*
|
54 |
-
* @return bool
|
55 |
-
*/
|
56 |
-
private function add_new_roles()
|
57 |
-
{
|
58 |
-
remove_role( 'pending_vendor' );
|
59 |
-
add_role( 'pending_vendor', __( 'Pending Vendor', 'wcvendors' ), array(
|
60 |
-
'read' => true,
|
61 |
-
'edit_posts' => false,
|
62 |
-
'delete_posts' => false
|
63 |
-
) );
|
64 |
-
|
65 |
-
remove_role( 'vendor' );
|
66 |
-
add_role( 'vendor', 'Vendor', array(
|
67 |
-
'assign_product_terms' => true,
|
68 |
-
'edit_products' => true,
|
69 |
-
'edit_published_products' => false,
|
70 |
-
'manage_product' => true,
|
71 |
-
'publish_products' => false,
|
72 |
-
'read' => true,
|
73 |
-
'upload_files' => true,
|
74 |
-
'view_woocommerce_reports' => true,
|
75 |
-
) );
|
76 |
-
}
|
77 |
-
|
78 |
-
|
79 |
-
/**
|
80 |
-
* Create the pv_commission table
|
81 |
-
*/
|
82 |
-
private function create_new_tables()
|
83 |
-
{
|
84 |
-
global $wpdb;
|
85 |
-
|
86 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
87 |
-
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
88 |
-
|
89 |
-
$sql = "CREATE TABLE $table_name (
|
90 |
-
id bigint(20) NOT NULL AUTO_INCREMENT,
|
91 |
-
product_id bigint(20) NOT NULL,
|
92 |
-
order_id bigint(20) NOT NULL,
|
93 |
-
vendor_id bigint(20) NOT NULL,
|
94 |
-
total_due decimal(20,2) NOT NULL,
|
95 |
-
qty BIGINT( 20 ) NOT NULL,
|
96 |
-
total_shipping decimal(20,2) NOT NULL,
|
97 |
-
tax decimal(20,2) NOT NULL,
|
98 |
-
status varchar(20) NOT NULL DEFAULT 'due',
|
99 |
-
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
100 |
-
UNIQUE KEY id (id)
|
101 |
-
);";
|
102 |
-
dbDelta( $sql );
|
103 |
-
}
|
104 |
-
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Create a page
|
108 |
-
*
|
109 |
-
* @access public
|
110 |
-
* @return void
|
111 |
-
*
|
112 |
-
* @param mixed $slug Slug for the new page
|
113 |
-
* @param mixed $option Option name to store the page's ID
|
114 |
-
* @param string $page_title (optional) (default: '') Title for the new page
|
115 |
-
* @param string $page_content (optional) (default: '') Content for the new page
|
116 |
-
* @param int $post_parent (optional) (default: 0) Parent for the new page
|
117 |
-
*/
|
118 |
-
function create_page( $slug, $page_title = '', $page_content = '', $post_parent = 0 )
|
119 |
-
{
|
120 |
-
global $wpdb;
|
121 |
-
|
122 |
-
$page_id = WC_Vendors::$pv_options->get_option( $slug . '_page' );
|
123 |
-
|
124 |
-
if ( $page_id > 0 && get_post( $page_id ) ) {
|
125 |
-
return $page_id;
|
126 |
-
}
|
127 |
-
|
128 |
-
$page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", $slug ) );
|
129 |
-
if ( $page_found ) {
|
130 |
-
if ( !$page_id ) {
|
131 |
-
WC_Vendors::$pv_options->update_option( $slug . '_page', $page_found );
|
132 |
-
|
133 |
-
return $page_found;
|
134 |
-
}
|
135 |
-
|
136 |
-
return $page_id;
|
137 |
-
}
|
138 |
-
|
139 |
-
$page_data = array(
|
140 |
-
'post_status' => 'publish',
|
141 |
-
'post_type' => 'page',
|
142 |
-
'post_author' => 1,
|
143 |
-
'post_name' => $slug,
|
144 |
-
'post_title' => $page_title,
|
145 |
-
'post_content' => $page_content,
|
146 |
-
'post_parent' => $post_parent,
|
147 |
-
'comment_status' => 'closed'
|
148 |
-
);
|
149 |
-
|
150 |
-
$page_id = wp_insert_post( $page_data );
|
151 |
-
WC_Vendors::$pv_options->update_option( $slug . '_page', $page_id );
|
152 |
-
|
153 |
-
return $page_id;
|
154 |
-
}
|
155 |
-
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Create the Orders page for the frontend
|
159 |
-
*/
|
160 |
-
private function create_new_pages()
|
161 |
-
{
|
162 |
-
global $wpdb;
|
163 |
-
|
164 |
-
$vendor_page_id = $this->create_page( 'vendor_dashboard', __( 'Vendor Dashboard', 'wcvendors' ), '[wcv_vendor_dashboard]' );
|
165 |
-
$this->create_page( 'orders', __( 'Orders', 'wcvendors' ), '[wcv_orders]', $vendor_page_id );
|
166 |
-
$this->create_page( 'shop_settings', __( 'Shop Settings', 'wcvendors' ), '[wcv_shop_settings]', $vendor_page_id );
|
167 |
-
}
|
168 |
-
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Depreciated
|
172 |
-
*
|
173 |
-
* @param unknown $version
|
174 |
-
*/
|
175 |
-
public function update_to( $version )
|
176 |
-
{
|
177 |
-
global $wpdb;
|
178 |
-
|
179 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
180 |
-
|
181 |
-
switch ( $version ) {
|
182 |
-
|
183 |
-
case '1.3.2':
|
184 |
-
|
185 |
-
$sql = "ALTER TABLE `{$table_name}` ADD `qty` BIGINT( 20 ) NOT NULL AFTER `total_due`";
|
186 |
-
$wpdb->query( $sql );
|
187 |
-
|
188 |
-
$sql = "SELECT * FROM `{$table_name}`";
|
189 |
-
$results = $wpdb->get_results( $sql );
|
190 |
-
foreach ( $results as $key => $value ) {
|
191 |
-
|
192 |
-
$order = new WC_Order( $value->order_id );
|
193 |
-
|
194 |
-
foreach ( $order->get_items() as $o_key => $o_value ) {
|
195 |
-
|
196 |
-
if ( $value->product_id == $o_value[ 'product_id' ] || ( !empty( $o_value[ 'variation_id' ] ) && $value->product_id == $o_value[ 'variation_id' ] ) ) {
|
197 |
-
$wpdb->update(
|
198 |
-
$table_name,
|
199 |
-
array( 'qty' => $o_value[ 'qty' ] ),
|
200 |
-
array( 'id' => $value->id ),
|
201 |
-
array( '%d' ),
|
202 |
-
array( '%d' )
|
203 |
-
);
|
204 |
-
}
|
205 |
-
}
|
206 |
-
|
207 |
-
}
|
208 |
-
|
209 |
-
break;
|
210 |
-
|
211 |
-
case '1.4.0':
|
212 |
-
|
213 |
-
add_role( 'pending_vendor', __( 'Pending Vendor', 'wcvendors' ), array(
|
214 |
-
'read' => true,
|
215 |
-
'edit_posts' => false,
|
216 |
-
'delete_posts' => false
|
217 |
-
) );
|
218 |
-
|
219 |
-
$this->create_new_pages();
|
220 |
-
|
221 |
-
break;
|
222 |
-
|
223 |
-
case '1.4.2':
|
224 |
-
|
225 |
-
$sql = "ALTER TABLE `{$table_name}` ADD `total_shipping` decimal(20,2) NOT NULL AFTER `total_due`";
|
226 |
-
$wpdb->query( $sql );
|
227 |
-
|
228 |
-
case '1.4.3':
|
229 |
-
|
230 |
-
$sql = "ALTER TABLE `{$table_name}` ADD `tax` decimal(20,2) NOT NULL AFTER `total_shipping`";
|
231 |
-
$wpdb->query( $sql );
|
232 |
-
|
233 |
-
case '1.4.5':
|
234 |
-
|
235 |
-
// Flush rules to fix the /page/2/ issue on vendor shop pages
|
236 |
-
update_option( WC_Vendors::$id . '_flush_rules', true );
|
237 |
-
|
238 |
-
default:
|
239 |
-
// code...
|
240 |
-
break;
|
241 |
-
}
|
242 |
-
}
|
243 |
-
|
244 |
-
|
245 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Install class on activation.
|
4 |
+
*
|
5 |
+
* @author Matt Gates <http://mgates.me>
|
6 |
+
* @package ProductVendor
|
7 |
+
*/
|
8 |
+
|
9 |
+
|
10 |
+
class WCV_Install
|
11 |
+
{
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Checks if install is requierd
|
15 |
+
*
|
16 |
+
* @return unknown
|
17 |
+
*/
|
18 |
+
public function init()
|
19 |
+
{
|
20 |
+
$db_version = WC_Vendors::$pv_options->get_option( 'db_version' );
|
21 |
+
|
22 |
+
// Initial Install
|
23 |
+
if ( version_compare( $db_version, '1.0', '<' ) ) {
|
24 |
+
$this->install_wcvendor();
|
25 |
+
WC_Vendors::$pv_options->update_option( 'db_version', '1.5.0' );
|
26 |
+
}
|
27 |
+
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Grouped functions for installing the WC Vendor plugin
|
33 |
+
*/
|
34 |
+
private function install_wcvendor()
|
35 |
+
{
|
36 |
+
// Clear the cron
|
37 |
+
wp_clear_scheduled_hook( 'pv_schedule_mass_payments' );
|
38 |
+
|
39 |
+
// Add the vendors role
|
40 |
+
$this->add_new_roles();
|
41 |
+
|
42 |
+
// Create tables
|
43 |
+
$this->create_new_tables();
|
44 |
+
|
45 |
+
// Create the Orders page if it doesn't exist
|
46 |
+
$orders_page = WC_Vendors::$pv_options->get_option( 'orders_page' );
|
47 |
+
if ( empty( $orders_page ) ) $this->create_new_pages();
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Add the new Vendor role
|
53 |
+
*
|
54 |
+
* @return bool
|
55 |
+
*/
|
56 |
+
private function add_new_roles()
|
57 |
+
{
|
58 |
+
remove_role( 'pending_vendor' );
|
59 |
+
add_role( 'pending_vendor', __( 'Pending Vendor', 'wcvendors' ), array(
|
60 |
+
'read' => true,
|
61 |
+
'edit_posts' => false,
|
62 |
+
'delete_posts' => false
|
63 |
+
) );
|
64 |
+
|
65 |
+
remove_role( 'vendor' );
|
66 |
+
add_role( 'vendor', 'Vendor', array(
|
67 |
+
'assign_product_terms' => true,
|
68 |
+
'edit_products' => true,
|
69 |
+
'edit_published_products' => false,
|
70 |
+
'manage_product' => true,
|
71 |
+
'publish_products' => false,
|
72 |
+
'read' => true,
|
73 |
+
'upload_files' => true,
|
74 |
+
'view_woocommerce_reports' => true,
|
75 |
+
) );
|
76 |
+
}
|
77 |
+
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Create the pv_commission table
|
81 |
+
*/
|
82 |
+
private function create_new_tables()
|
83 |
+
{
|
84 |
+
global $wpdb;
|
85 |
+
|
86 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
87 |
+
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
88 |
+
|
89 |
+
$sql = "CREATE TABLE $table_name (
|
90 |
+
id bigint(20) NOT NULL AUTO_INCREMENT,
|
91 |
+
product_id bigint(20) NOT NULL,
|
92 |
+
order_id bigint(20) NOT NULL,
|
93 |
+
vendor_id bigint(20) NOT NULL,
|
94 |
+
total_due decimal(20,2) NOT NULL,
|
95 |
+
qty BIGINT( 20 ) NOT NULL,
|
96 |
+
total_shipping decimal(20,2) NOT NULL,
|
97 |
+
tax decimal(20,2) NOT NULL,
|
98 |
+
status varchar(20) NOT NULL DEFAULT 'due',
|
99 |
+
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
100 |
+
UNIQUE KEY id (id)
|
101 |
+
);";
|
102 |
+
dbDelta( $sql );
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Create a page
|
108 |
+
*
|
109 |
+
* @access public
|
110 |
+
* @return void
|
111 |
+
*
|
112 |
+
* @param mixed $slug Slug for the new page
|
113 |
+
* @param mixed $option Option name to store the page's ID
|
114 |
+
* @param string $page_title (optional) (default: '') Title for the new page
|
115 |
+
* @param string $page_content (optional) (default: '') Content for the new page
|
116 |
+
* @param int $post_parent (optional) (default: 0) Parent for the new page
|
117 |
+
*/
|
118 |
+
function create_page( $slug, $page_title = '', $page_content = '', $post_parent = 0 )
|
119 |
+
{
|
120 |
+
global $wpdb;
|
121 |
+
|
122 |
+
$page_id = WC_Vendors::$pv_options->get_option( $slug . '_page' );
|
123 |
+
|
124 |
+
if ( $page_id > 0 && get_post( $page_id ) ) {
|
125 |
+
return $page_id;
|
126 |
+
}
|
127 |
+
|
128 |
+
$page_found = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;", $slug ) );
|
129 |
+
if ( $page_found ) {
|
130 |
+
if ( !$page_id ) {
|
131 |
+
WC_Vendors::$pv_options->update_option( $slug . '_page', $page_found );
|
132 |
+
|
133 |
+
return $page_found;
|
134 |
+
}
|
135 |
+
|
136 |
+
return $page_id;
|
137 |
+
}
|
138 |
+
|
139 |
+
$page_data = array(
|
140 |
+
'post_status' => 'publish',
|
141 |
+
'post_type' => 'page',
|
142 |
+
'post_author' => 1,
|
143 |
+
'post_name' => $slug,
|
144 |
+
'post_title' => $page_title,
|
145 |
+
'post_content' => $page_content,
|
146 |
+
'post_parent' => $post_parent,
|
147 |
+
'comment_status' => 'closed'
|
148 |
+
);
|
149 |
+
|
150 |
+
$page_id = wp_insert_post( $page_data );
|
151 |
+
WC_Vendors::$pv_options->update_option( $slug . '_page', $page_id );
|
152 |
+
|
153 |
+
return $page_id;
|
154 |
+
}
|
155 |
+
|
156 |
+
|
157 |
+
/**
|
158 |
+
* Create the Orders page for the frontend
|
159 |
+
*/
|
160 |
+
private function create_new_pages()
|
161 |
+
{
|
162 |
+
global $wpdb;
|
163 |
+
|
164 |
+
$vendor_page_id = $this->create_page( 'vendor_dashboard', __( 'Vendor Dashboard', 'wcvendors' ), '[wcv_vendor_dashboard]' );
|
165 |
+
$this->create_page( 'orders', __( 'Orders', 'wcvendors' ), '[wcv_orders]', $vendor_page_id );
|
166 |
+
$this->create_page( 'shop_settings', __( 'Shop Settings', 'wcvendors' ), '[wcv_shop_settings]', $vendor_page_id );
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Depreciated
|
172 |
+
*
|
173 |
+
* @param unknown $version
|
174 |
+
*/
|
175 |
+
public function update_to( $version )
|
176 |
+
{
|
177 |
+
global $wpdb;
|
178 |
+
|
179 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
180 |
+
|
181 |
+
switch ( $version ) {
|
182 |
+
|
183 |
+
case '1.3.2':
|
184 |
+
|
185 |
+
$sql = "ALTER TABLE `{$table_name}` ADD `qty` BIGINT( 20 ) NOT NULL AFTER `total_due`";
|
186 |
+
$wpdb->query( $sql );
|
187 |
+
|
188 |
+
$sql = "SELECT * FROM `{$table_name}`";
|
189 |
+
$results = $wpdb->get_results( $sql );
|
190 |
+
foreach ( $results as $key => $value ) {
|
191 |
+
|
192 |
+
$order = new WC_Order( $value->order_id );
|
193 |
+
|
194 |
+
foreach ( $order->get_items() as $o_key => $o_value ) {
|
195 |
+
|
196 |
+
if ( $value->product_id == $o_value[ 'product_id' ] || ( !empty( $o_value[ 'variation_id' ] ) && $value->product_id == $o_value[ 'variation_id' ] ) ) {
|
197 |
+
$wpdb->update(
|
198 |
+
$table_name,
|
199 |
+
array( 'qty' => $o_value[ 'qty' ] ),
|
200 |
+
array( 'id' => $value->id ),
|
201 |
+
array( '%d' ),
|
202 |
+
array( '%d' )
|
203 |
+
);
|
204 |
+
}
|
205 |
+
}
|
206 |
+
|
207 |
+
}
|
208 |
+
|
209 |
+
break;
|
210 |
+
|
211 |
+
case '1.4.0':
|
212 |
+
|
213 |
+
add_role( 'pending_vendor', __( 'Pending Vendor', 'wcvendors' ), array(
|
214 |
+
'read' => true,
|
215 |
+
'edit_posts' => false,
|
216 |
+
'delete_posts' => false
|
217 |
+
) );
|
218 |
+
|
219 |
+
$this->create_new_pages();
|
220 |
+
|
221 |
+
break;
|
222 |
+
|
223 |
+
case '1.4.2':
|
224 |
+
|
225 |
+
$sql = "ALTER TABLE `{$table_name}` ADD `total_shipping` decimal(20,2) NOT NULL AFTER `total_due`";
|
226 |
+
$wpdb->query( $sql );
|
227 |
+
|
228 |
+
case '1.4.3':
|
229 |
+
|
230 |
+
$sql = "ALTER TABLE `{$table_name}` ADD `tax` decimal(20,2) NOT NULL AFTER `total_shipping`";
|
231 |
+
$wpdb->query( $sql );
|
232 |
+
|
233 |
+
case '1.4.5':
|
234 |
+
|
235 |
+
// Flush rules to fix the /page/2/ issue on vendor shop pages
|
236 |
+
update_option( WC_Vendors::$id . '_flush_rules', true );
|
237 |
+
|
238 |
+
default:
|
239 |
+
// code...
|
240 |
+
break;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
|
244 |
+
|
245 |
+
}
|
{WCVendors/classes → classes}/class-queries.php
RENAMED
@@ -1,278 +1,278 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WCV_Queries
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
*
|
8 |
-
*
|
9 |
-
* @param unknown $user_id
|
10 |
-
*
|
11 |
-
* @return unknown
|
12 |
-
*/
|
13 |
-
|
14 |
-
|
15 |
-
public static function get_commission_products( $user_id )
|
16 |
-
{
|
17 |
-
global $wpdb;
|
18 |
-
|
19 |
-
$dates = WCV_Queries::orders_within_range();
|
20 |
-
$vendor_products = array();
|
21 |
-
|
22 |
-
$results = $wpdb->get_results( "
|
23 |
-
SELECT product_id
|
24 |
-
FROM {$wpdb->prefix}pv_commission
|
25 |
-
WHERE vendor_id = {$user_id}
|
26 |
-
AND time >= '" . $dates[ 'after' ] . "'
|
27 |
-
AND time <= '" . $dates[ 'before' ] . "'
|
28 |
-
AND status != 'reversed'
|
29 |
-
GROUP BY product_id" );
|
30 |
-
|
31 |
-
foreach ( $results as $value ) {
|
32 |
-
$ids[ ] = $value->product_id;
|
33 |
-
}
|
34 |
-
|
35 |
-
if ( !empty( $ids ) ) {
|
36 |
-
$vendor_products = get_posts( array(
|
37 |
-
'numberposts' => -1,
|
38 |
-
'orderby' => 'post_date',
|
39 |
-
'post_type' => array( 'product', 'product_variation' ),
|
40 |
-
'order' => 'DESC',
|
41 |
-
'include' => $ids
|
42 |
-
)
|
43 |
-
);
|
44 |
-
}
|
45 |
-
|
46 |
-
return $vendor_products;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
*
|
51 |
-
*
|
52 |
-
* @param unknown $order_id
|
53 |
-
*
|
54 |
-
* @return unknown
|
55 |
-
*/
|
56 |
-
|
57 |
-
|
58 |
-
public static function get_products_for_order( $order_id )
|
59 |
-
{
|
60 |
-
global $wpdb;
|
61 |
-
|
62 |
-
$vendor_products = array();
|
63 |
-
|
64 |
-
$results = $wpdb->get_results( "
|
65 |
-
SELECT product_id
|
66 |
-
FROM {$wpdb->prefix}pv_commission
|
67 |
-
WHERE order_id = {$order_id}
|
68 |
-
AND status != 'reversed'
|
69 |
-
AND vendor_id = " . get_current_user_id() . "
|
70 |
-
GROUP BY product_id" );
|
71 |
-
|
72 |
-
foreach ( $results as $value ) {
|
73 |
-
$ids[ ] = $value->product_id;
|
74 |
-
}
|
75 |
-
|
76 |
-
return $ids;
|
77 |
-
}
|
78 |
-
|
79 |
-
|
80 |
-
/**
|
81 |
-
* All orders for a specific product
|
82 |
-
*
|
83 |
-
* @param array $product_ids
|
84 |
-
* @param array $args (optional)
|
85 |
-
*
|
86 |
-
* @return object
|
87 |
-
*/
|
88 |
-
public static function get_orders_for_products( array $product_ids, array $args = array() )
|
89 |
-
{
|
90 |
-
global $wpdb;
|
91 |
-
|
92 |
-
if ( empty( $product_ids ) ) return false;
|
93 |
-
|
94 |
-
$dates = WCV_Queries::orders_within_range();
|
95 |
-
|
96 |
-
$defaults = array(
|
97 |
-
'status' => apply_filters( 'wcvendors_completed_statuses', array( 'completed', 'processing' ) ),
|
98 |
-
'dates' => array( 'before' => $dates[ 'before' ], 'after' => $dates[ 'after' ] ),
|
99 |
-
);
|
100 |
-
|
101 |
-
$args = wp_parse_args( $args, $defaults );
|
102 |
-
|
103 |
-
|
104 |
-
$sql = "
|
105 |
-
SELECT order_id
|
106 |
-
FROM {$wpdb->prefix}pv_commission as order_items
|
107 |
-
WHERE product_id IN ('" . implode( "','", $product_ids ) . "')
|
108 |
-
AND time >= '" . $args[ 'dates' ][ 'after' ] . "'
|
109 |
-
AND time <= '" . $args[ 'dates' ][ 'before' ] . "'
|
110 |
-
AND status != 'reversed'
|
111 |
-
";
|
112 |
-
|
113 |
-
if ( !empty( $args[ 'vendor_id' ] ) ) {
|
114 |
-
$sql .= "
|
115 |
-
AND vendor_id = {$args['vendor_id']}
|
116 |
-
";
|
117 |
-
}
|
118 |
-
|
119 |
-
$sql .= "
|
120 |
-
GROUP BY order_id
|
121 |
-
ORDER BY time DESC
|
122 |
-
";
|
123 |
-
|
124 |
-
$orders = $wpdb->get_results( $sql );
|
125 |
-
|
126 |
-
return $orders;
|
127 |
-
}
|
128 |
-
|
129 |
-
|
130 |
-
/**
|
131 |
-
* Sum of orders for a specific product
|
132 |
-
*
|
133 |
-
* @param array $product_ids
|
134 |
-
* @param array $args (optional)
|
135 |
-
*
|
136 |
-
* @return object
|
137 |
-
*/
|
138 |
-
public static function sum_orders_for_products( array $product_ids, array $args = array() )
|
139 |
-
{
|
140 |
-
global $wpdb;
|
141 |
-
|
142 |
-
$dates = WCV_Queries::orders_within_range();
|
143 |
-
|
144 |
-
$defaults = array(
|
145 |
-
'status' => apply_filters( 'wcvendors_completed_statuses', array( 'completed', 'processing' ) ),
|
146 |
-
'dates' => array( 'before' => $dates[ 'before' ], 'after' => $dates[ 'after' ] ),
|
147 |
-
);
|
148 |
-
|
149 |
-
foreach ( $product_ids as $id ) {
|
150 |
-
$posts = get_posts( array(
|
151 |
-
'numberposts' => -1,
|
152 |
-
'post_type' => 'product_variation',
|
153 |
-
'post_parent' => $id,
|
154 |
-
)
|
155 |
-
);
|
156 |
-
|
157 |
-
if ( !empty( $posts ) ) {
|
158 |
-
foreach ( $posts as $post ) {
|
159 |
-
$product_ids[ ] = $post->ID;
|
160 |
-
}
|
161 |
-
}
|
162 |
-
}
|
163 |
-
|
164 |
-
$args = wp_parse_args( $args, $defaults );
|
165 |
-
|
166 |
-
$sql = "
|
167 |
-
SELECT COUNT(order_id) as total_orders,
|
168 |
-
SUM(total_due + total_shipping + tax) as line_total,
|
169 |
-
SUM(qty) as qty,
|
170 |
-
product_id
|
171 |
-
|
172 |
-
FROM {$wpdb->prefix}pv_commission
|
173 |
-
|
174 |
-
WHERE product_id IN ('" . implode( "','", $product_ids ) . "')
|
175 |
-
AND time >= '" . $args[ 'dates' ][ 'after' ] . "'
|
176 |
-
AND time <= '" . $args[ 'dates' ][ 'before' ] . "'
|
177 |
-
AND status != 'reversed'
|
178 |
-
";
|
179 |
-
|
180 |
-
if ( !empty( $args[ 'vendor_id' ] ) ) {
|
181 |
-
$sql .= "
|
182 |
-
AND vendor_id = {$args['vendor_id']}
|
183 |
-
";
|
184 |
-
}
|
185 |
-
|
186 |
-
$sql .= "
|
187 |
-
GROUP BY product_id
|
188 |
-
ORDER BY time DESC;
|
189 |
-
";
|
190 |
-
|
191 |
-
$orders = $wpdb->get_results( $sql );
|
192 |
-
|
193 |
-
return $orders;
|
194 |
-
}
|
195 |
-
|
196 |
-
|
197 |
-
/**
|
198 |
-
* Sum of orders for a specific order
|
199 |
-
*
|
200 |
-
* @param array $order_ids
|
201 |
-
* @param array $args (optional)
|
202 |
-
*
|
203 |
-
* @return object
|
204 |
-
*/
|
205 |
-
public static function sum_for_orders( array $order_ids, array $args = array() )
|
206 |
-
{
|
207 |
-
global $wpdb;
|
208 |
-
|
209 |
-
$dates = WCV_Queries::orders_within_range();
|
210 |
-
|
211 |
-
$defaults = array(
|
212 |
-
'status' => apply_filters( 'wcvendors_completed_statuses', array( 'completed', 'processing' ) ),
|
213 |
-
'dates' => array( 'before' => $dates[ 'before' ], 'after' => $dates[ 'after' ] ),
|
214 |
-
);
|
215 |
-
|
216 |
-
$args = wp_parse_args( $args, $defaults );
|
217 |
-
|
218 |
-
$sql = "
|
219 |
-
SELECT COUNT(order_id) as total_orders,
|
220 |
-
SUM(total_due + total_shipping + tax) as line_total,
|
221 |
-
SUM(qty) as qty,
|
222 |
-
product_id
|
223 |
-
|
224 |
-
FROM {$wpdb->prefix}pv_commission
|
225 |
-
|
226 |
-
WHERE order_id IN ('" . implode( "','", $order_ids ) . "')
|
227 |
-
AND time >= '" . $args[ 'dates' ][ 'after' ] . "'
|
228 |
-
AND time <= '" . $args[ 'dates' ][ 'before' ] . "'
|
229 |
-
AND status != 'reversed'
|
230 |
-
";
|
231 |
-
|
232 |
-
if ( !empty( $args[ 'vendor_id' ] ) ) {
|
233 |
-
$sql .= "
|
234 |
-
AND vendor_id = {$args['vendor_id']}
|
235 |
-
";
|
236 |
-
}
|
237 |
-
|
238 |
-
$sql .= "
|
239 |
-
GROUP BY order_id
|
240 |
-
ORDER BY time DESC;
|
241 |
-
";
|
242 |
-
|
243 |
-
$orders = $wpdb->get_results( $sql );
|
244 |
-
|
245 |
-
return $orders;
|
246 |
-
}
|
247 |
-
|
248 |
-
|
249 |
-
/**
|
250 |
-
* Orders for range filter function
|
251 |
-
*
|
252 |
-
* @return array
|
253 |
-
*/
|
254 |
-
public static function orders_within_range()
|
255 |
-
{
|
256 |
-
global $start_date, $end_date;
|
257 |
-
|
258 |
-
$start_date = !empty( $_SESSION[ 'PV_Session' ][ 'start_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
|
259 |
-
$end_date = !empty( $_SESSION[ 'PV_Session' ][ 'end_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
|
260 |
-
|
261 |
-
if ( !empty( $_POST[ 'start_date' ] ) ) {
|
262 |
-
$start_date = strtotime( $_POST[ 'start_date' ] );
|
263 |
-
$_SESSION[ 'PV_Session' ][ 'start_date' ] = $start_date;
|
264 |
-
}
|
265 |
-
|
266 |
-
if ( !empty( $_POST[ 'end_date' ] ) ) {
|
267 |
-
$end_date = strtotime( $_POST[ 'end_date' ] );
|
268 |
-
$_SESSION[ 'PV_Session' ][ 'end_date' ] = $end_date;
|
269 |
-
}
|
270 |
-
|
271 |
-
$after = date( 'Y-m-d', $start_date );
|
272 |
-
$before = date( 'Y-m-d', strtotime( '+1 day', $end_date ) );
|
273 |
-
|
274 |
-
return array( 'after' => $after, 'before' => $before );
|
275 |
-
}
|
276 |
-
|
277 |
-
|
278 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WCV_Queries
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
*
|
8 |
+
*
|
9 |
+
* @param unknown $user_id
|
10 |
+
*
|
11 |
+
* @return unknown
|
12 |
+
*/
|
13 |
+
|
14 |
+
|
15 |
+
public static function get_commission_products( $user_id )
|
16 |
+
{
|
17 |
+
global $wpdb;
|
18 |
+
|
19 |
+
$dates = WCV_Queries::orders_within_range();
|
20 |
+
$vendor_products = array();
|
21 |
+
|
22 |
+
$results = $wpdb->get_results( "
|
23 |
+
SELECT product_id
|
24 |
+
FROM {$wpdb->prefix}pv_commission
|
25 |
+
WHERE vendor_id = {$user_id}
|
26 |
+
AND time >= '" . $dates[ 'after' ] . "'
|
27 |
+
AND time <= '" . $dates[ 'before' ] . "'
|
28 |
+
AND status != 'reversed'
|
29 |
+
GROUP BY product_id" );
|
30 |
+
|
31 |
+
foreach ( $results as $value ) {
|
32 |
+
$ids[ ] = $value->product_id;
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( !empty( $ids ) ) {
|
36 |
+
$vendor_products = get_posts( array(
|
37 |
+
'numberposts' => -1,
|
38 |
+
'orderby' => 'post_date',
|
39 |
+
'post_type' => array( 'product', 'product_variation' ),
|
40 |
+
'order' => 'DESC',
|
41 |
+
'include' => $ids
|
42 |
+
)
|
43 |
+
);
|
44 |
+
}
|
45 |
+
|
46 |
+
return $vendor_products;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
*
|
51 |
+
*
|
52 |
+
* @param unknown $order_id
|
53 |
+
*
|
54 |
+
* @return unknown
|
55 |
+
*/
|
56 |
+
|
57 |
+
|
58 |
+
public static function get_products_for_order( $order_id )
|
59 |
+
{
|
60 |
+
global $wpdb;
|
61 |
+
|
62 |
+
$vendor_products = array();
|
63 |
+
|
64 |
+
$results = $wpdb->get_results( "
|
65 |
+
SELECT product_id
|
66 |
+
FROM {$wpdb->prefix}pv_commission
|
67 |
+
WHERE order_id = {$order_id}
|
68 |
+
AND status != 'reversed'
|
69 |
+
AND vendor_id = " . get_current_user_id() . "
|
70 |
+
GROUP BY product_id" );
|
71 |
+
|
72 |
+
foreach ( $results as $value ) {
|
73 |
+
$ids[ ] = $value->product_id;
|
74 |
+
}
|
75 |
+
|
76 |
+
return $ids;
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
/**
|
81 |
+
* All orders for a specific product
|
82 |
+
*
|
83 |
+
* @param array $product_ids
|
84 |
+
* @param array $args (optional)
|
85 |
+
*
|
86 |
+
* @return object
|
87 |
+
*/
|
88 |
+
public static function get_orders_for_products( array $product_ids, array $args = array() )
|
89 |
+
{
|
90 |
+
global $wpdb;
|
91 |
+
|
92 |
+
if ( empty( $product_ids ) ) return false;
|
93 |
+
|
94 |
+
$dates = WCV_Queries::orders_within_range();
|
95 |
+
|
96 |
+
$defaults = array(
|
97 |
+
'status' => apply_filters( 'wcvendors_completed_statuses', array( 'completed', 'processing' ) ),
|
98 |
+
'dates' => array( 'before' => $dates[ 'before' ], 'after' => $dates[ 'after' ] ),
|
99 |
+
);
|
100 |
+
|
101 |
+
$args = wp_parse_args( $args, $defaults );
|
102 |
+
|
103 |
+
|
104 |
+
$sql = "
|
105 |
+
SELECT order_id
|
106 |
+
FROM {$wpdb->prefix}pv_commission as order_items
|
107 |
+
WHERE product_id IN ('" . implode( "','", $product_ids ) . "')
|
108 |
+
AND time >= '" . $args[ 'dates' ][ 'after' ] . "'
|
109 |
+
AND time <= '" . $args[ 'dates' ][ 'before' ] . "'
|
110 |
+
AND status != 'reversed'
|
111 |
+
";
|
112 |
+
|
113 |
+
if ( !empty( $args[ 'vendor_id' ] ) ) {
|
114 |
+
$sql .= "
|
115 |
+
AND vendor_id = {$args['vendor_id']}
|
116 |
+
";
|
117 |
+
}
|
118 |
+
|
119 |
+
$sql .= "
|
120 |
+
GROUP BY order_id
|
121 |
+
ORDER BY time DESC
|
122 |
+
";
|
123 |
+
|
124 |
+
$orders = $wpdb->get_results( $sql );
|
125 |
+
|
126 |
+
return $orders;
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
/**
|
131 |
+
* Sum of orders for a specific product
|
132 |
+
*
|
133 |
+
* @param array $product_ids
|
134 |
+
* @param array $args (optional)
|
135 |
+
*
|
136 |
+
* @return object
|
137 |
+
*/
|
138 |
+
public static function sum_orders_for_products( array $product_ids, array $args = array() )
|
139 |
+
{
|
140 |
+
global $wpdb;
|
141 |
+
|
142 |
+
$dates = WCV_Queries::orders_within_range();
|
143 |
+
|
144 |
+
$defaults = array(
|
145 |
+
'status' => apply_filters( 'wcvendors_completed_statuses', array( 'completed', 'processing' ) ),
|
146 |
+
'dates' => array( 'before' => $dates[ 'before' ], 'after' => $dates[ 'after' ] ),
|
147 |
+
);
|
148 |
+
|
149 |
+
foreach ( $product_ids as $id ) {
|
150 |
+
$posts = get_posts( array(
|
151 |
+
'numberposts' => -1,
|
152 |
+
'post_type' => 'product_variation',
|
153 |
+
'post_parent' => $id,
|
154 |
+
)
|
155 |
+
);
|
156 |
+
|
157 |
+
if ( !empty( $posts ) ) {
|
158 |
+
foreach ( $posts as $post ) {
|
159 |
+
$product_ids[ ] = $post->ID;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
$args = wp_parse_args( $args, $defaults );
|
165 |
+
|
166 |
+
$sql = "
|
167 |
+
SELECT COUNT(order_id) as total_orders,
|
168 |
+
SUM(total_due + total_shipping + tax) as line_total,
|
169 |
+
SUM(qty) as qty,
|
170 |
+
product_id
|
171 |
+
|
172 |
+
FROM {$wpdb->prefix}pv_commission
|
173 |
+
|
174 |
+
WHERE product_id IN ('" . implode( "','", $product_ids ) . "')
|
175 |
+
AND time >= '" . $args[ 'dates' ][ 'after' ] . "'
|
176 |
+
AND time <= '" . $args[ 'dates' ][ 'before' ] . "'
|
177 |
+
AND status != 'reversed'
|
178 |
+
";
|
179 |
+
|
180 |
+
if ( !empty( $args[ 'vendor_id' ] ) ) {
|
181 |
+
$sql .= "
|
182 |
+
AND vendor_id = {$args['vendor_id']}
|
183 |
+
";
|
184 |
+
}
|
185 |
+
|
186 |
+
$sql .= "
|
187 |
+
GROUP BY product_id
|
188 |
+
ORDER BY time DESC;
|
189 |
+
";
|
190 |
+
|
191 |
+
$orders = $wpdb->get_results( $sql );
|
192 |
+
|
193 |
+
return $orders;
|
194 |
+
}
|
195 |
+
|
196 |
+
|
197 |
+
/**
|
198 |
+
* Sum of orders for a specific order
|
199 |
+
*
|
200 |
+
* @param array $order_ids
|
201 |
+
* @param array $args (optional)
|
202 |
+
*
|
203 |
+
* @return object
|
204 |
+
*/
|
205 |
+
public static function sum_for_orders( array $order_ids, array $args = array() )
|
206 |
+
{
|
207 |
+
global $wpdb;
|
208 |
+
|
209 |
+
$dates = WCV_Queries::orders_within_range();
|
210 |
+
|
211 |
+
$defaults = array(
|
212 |
+
'status' => apply_filters( 'wcvendors_completed_statuses', array( 'completed', 'processing' ) ),
|
213 |
+
'dates' => array( 'before' => $dates[ 'before' ], 'after' => $dates[ 'after' ] ),
|
214 |
+
);
|
215 |
+
|
216 |
+
$args = wp_parse_args( $args, $defaults );
|
217 |
+
|
218 |
+
$sql = "
|
219 |
+
SELECT COUNT(order_id) as total_orders,
|
220 |
+
SUM(total_due + total_shipping + tax) as line_total,
|
221 |
+
SUM(qty) as qty,
|
222 |
+
product_id
|
223 |
+
|
224 |
+
FROM {$wpdb->prefix}pv_commission
|
225 |
+
|
226 |
+
WHERE order_id IN ('" . implode( "','", $order_ids ) . "')
|
227 |
+
AND time >= '" . $args[ 'dates' ][ 'after' ] . "'
|
228 |
+
AND time <= '" . $args[ 'dates' ][ 'before' ] . "'
|
229 |
+
AND status != 'reversed'
|
230 |
+
";
|
231 |
+
|
232 |
+
if ( !empty( $args[ 'vendor_id' ] ) ) {
|
233 |
+
$sql .= "
|
234 |
+
AND vendor_id = {$args['vendor_id']}
|
235 |
+
";
|
236 |
+
}
|
237 |
+
|
238 |
+
$sql .= "
|
239 |
+
GROUP BY order_id
|
240 |
+
ORDER BY time DESC;
|
241 |
+
";
|
242 |
+
|
243 |
+
$orders = $wpdb->get_results( $sql );
|
244 |
+
|
245 |
+
return $orders;
|
246 |
+
}
|
247 |
+
|
248 |
+
|
249 |
+
/**
|
250 |
+
* Orders for range filter function
|
251 |
+
*
|
252 |
+
* @return array
|
253 |
+
*/
|
254 |
+
public static function orders_within_range()
|
255 |
+
{
|
256 |
+
global $start_date, $end_date;
|
257 |
+
|
258 |
+
$start_date = !empty( $_SESSION[ 'PV_Session' ][ 'start_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
|
259 |
+
$end_date = !empty( $_SESSION[ 'PV_Session' ][ 'end_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
|
260 |
+
|
261 |
+
if ( !empty( $_POST[ 'start_date' ] ) ) {
|
262 |
+
$start_date = strtotime( $_POST[ 'start_date' ] );
|
263 |
+
$_SESSION[ 'PV_Session' ][ 'start_date' ] = $start_date;
|
264 |
+
}
|
265 |
+
|
266 |
+
if ( !empty( $_POST[ 'end_date' ] ) ) {
|
267 |
+
$end_date = strtotime( $_POST[ 'end_date' ] );
|
268 |
+
$_SESSION[ 'PV_Session' ][ 'end_date' ] = $end_date;
|
269 |
+
}
|
270 |
+
|
271 |
+
$after = date( 'Y-m-d', $start_date );
|
272 |
+
$before = date( 'Y-m-d', strtotime( '+1 day', $end_date ) );
|
273 |
+
|
274 |
+
return array( 'after' => $after, 'before' => $before );
|
275 |
+
}
|
276 |
+
|
277 |
+
|
278 |
+
}
|
{WCVendors/classes → classes}/class-shipping.php
RENAMED
@@ -1,250 +1,250 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Shipping functions
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>, WC Vendors <http://wcvendors.com>
|
7 |
-
* @package ProductVendor
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Shipping
|
12 |
-
{
|
13 |
-
public static $trs2_shipping_rates;
|
14 |
-
public static $trs2_shipping_calc_type;
|
15 |
-
public static $pps_shipping_costs = array();
|
16 |
-
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Constructor
|
20 |
-
*/
|
21 |
-
function __construct()
|
22 |
-
{
|
23 |
-
// Table Rate Shipping 2 by WooThemes
|
24 |
-
if ( function_exists( 'woocommerce_get_shipping_method_table_rate' ) ) {
|
25 |
-
// add_action( 'wp', array( $this, 'trs2_clear_transients' ) );
|
26 |
-
add_action( 'woocommerce_checkout_update_order_meta', array( 'WCV_Shipping', 'trs2_add_shipping_data' ), 1, 2 );
|
27 |
-
add_action( 'wc_trs2_matched_rates', array( 'WCV_Shipping', 'trs2_store_shipping_data' ), 10, 3 );
|
28 |
-
}
|
29 |
-
}
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
*
|
34 |
-
*
|
35 |
-
* @param unknown $order_id
|
36 |
-
* @param unknown $product
|
37 |
-
* @param unknown $author
|
38 |
-
*
|
39 |
-
* @return unknown
|
40 |
-
*/
|
41 |
-
public static function get_shipping_due( $order_id, $product, $author )
|
42 |
-
{
|
43 |
-
global $woocommerce;
|
44 |
-
|
45 |
-
$shipping_due = 0;
|
46 |
-
$method = '';
|
47 |
-
$_product = get_product( $product[ 'product_id' ] );
|
48 |
-
$order = wc_get_order( $order_id );
|
49 |
-
|
50 |
-
if ( $_product && $_product->needs_shipping() && !$_product->is_downloadable() ) {
|
51 |
-
|
52 |
-
// Get Shipping methods.
|
53 |
-
$shipping_methods = $order->get_shipping_methods();
|
54 |
-
|
55 |
-
// TODO: Currently this only allows one shipping method per order, this definitely needs changing
|
56 |
-
foreach ($shipping_methods as $shipping_method) {
|
57 |
-
$method = $shipping_method['method_id'];
|
58 |
-
break;
|
59 |
-
}
|
60 |
-
|
61 |
-
// Table Rate Shipping 2
|
62 |
-
if ( strstr( $method, 'table_rate' ) !== false ) {
|
63 |
-
// $shipping_due = WCV_Shipping::trs2_get_due( $order_id, $product[ 'product_id' ] );
|
64 |
-
|
65 |
-
// Per Product Shipping 2
|
66 |
-
} else if ( function_exists( 'woocommerce_per_product_shipping' ) && $method == 'per_product' ) {
|
67 |
-
$shipping_due = WCV_Shipping::pps_get_due( $order_id, $product );
|
68 |
-
|
69 |
-
// Local Delivery
|
70 |
-
} else if ( $method == 'local_delivery' ) {
|
71 |
-
$local_delivery = get_option( 'woocommerce_local_delivery_settings' );
|
72 |
-
|
73 |
-
if ( $local_delivery[ 'type' ] == 'product' ) {
|
74 |
-
$shipping_due = $product[ 'qty' ] * $local_delivery[ 'fee' ];
|
75 |
-
}
|
76 |
-
|
77 |
-
// International Delivery
|
78 |
-
} else if ( $method == 'international_delivery' ) {
|
79 |
-
$int_delivery = get_option( 'woocommerce_international_delivery_settings' );
|
80 |
-
|
81 |
-
if ( $int_delivery[ 'type' ] == 'item' ) {
|
82 |
-
$WC_Shipping_International_Delivery = new WC_Shipping_International_Delivery();
|
83 |
-
$fee = $WC_Shipping_International_Delivery->get_fee( $int_delivery[ 'fee' ], $_product->get_price() );
|
84 |
-
$shipping_due = ( $int_delivery[ 'cost' ] + $fee ) * $product[ 'qty' ];
|
85 |
-
}
|
86 |
-
|
87 |
-
}
|
88 |
-
}
|
89 |
-
|
90 |
-
$shipping_due = apply_filters( 'wcvendors_shipping_due', $shipping_due, $order_id, $product );
|
91 |
-
|
92 |
-
return $shipping_due;
|
93 |
-
}
|
94 |
-
|
95 |
-
|
96 |
-
/**
|
97 |
-
*
|
98 |
-
*
|
99 |
-
* @param unknown $order_id
|
100 |
-
* @param unknown $product
|
101 |
-
*
|
102 |
-
* @return unknown
|
103 |
-
*/
|
104 |
-
public function pps_get_due( $order_id, $product )
|
105 |
-
{
|
106 |
-
global $woocommerce;
|
107 |
-
|
108 |
-
$item_shipping_cost = 0;
|
109 |
-
|
110 |
-
$order = new WC_Order( $order_id );
|
111 |
-
$package[ 'destination' ][ 'country' ] = $order->shipping_country;
|
112 |
-
$package[ 'destination' ][ 'state' ] = $order->shipping_state;
|
113 |
-
$package[ 'destination' ][ 'postcode' ] = $order->shipping_postcode;
|
114 |
-
$product_id = !empty( $product['variation_id'] ) ? $product['variation_id'] : $product['product_id'];
|
115 |
-
|
116 |
-
if ( !empty( $product['variation_id'] ) ) {
|
117 |
-
$rule = woocommerce_per_product_shipping_get_matching_rule( $product['variation_id'], $package );
|
118 |
-
}
|
119 |
-
|
120 |
-
if ( empty( $rule ) ) {
|
121 |
-
$rule = woocommerce_per_product_shipping_get_matching_rule( $product['product_id'], $package );
|
122 |
-
}
|
123 |
-
|
124 |
-
if ( !empty( $rule ) ) {
|
125 |
-
$item_shipping_cost += $rule->rule_item_cost * $product[ 'qty' ];
|
126 |
-
|
127 |
-
if ( !empty(self::$pps_shipping_costs[$order_id]) && ! in_array( $rule->rule_id, self::$pps_shipping_costs[$order_id] ) ) {
|
128 |
-
$item_shipping_cost += $rule->rule_cost;
|
129 |
-
} else if ( empty( self::$pps_shipping_costs[$order_id] ) ) {
|
130 |
-
$item_shipping_cost += $rule->rule_cost;
|
131 |
-
}
|
132 |
-
|
133 |
-
self::$pps_shipping_costs[$order_id][] = $rule->rule_id;
|
134 |
-
}
|
135 |
-
|
136 |
-
return $item_shipping_cost;
|
137 |
-
}
|
138 |
-
|
139 |
-
|
140 |
-
/**
|
141 |
-
*
|
142 |
-
*/
|
143 |
-
public function trs2_clear_transients()
|
144 |
-
{
|
145 |
-
global $woocommerce;
|
146 |
-
|
147 |
-
if ( is_checkout() ) {
|
148 |
-
wc_delete_product_transients();
|
149 |
-
}
|
150 |
-
}
|
151 |
-
|
152 |
-
|
153 |
-
/**
|
154 |
-
*
|
155 |
-
*
|
156 |
-
* @param unknown $order_id
|
157 |
-
* @param unknown $product_id
|
158 |
-
*
|
159 |
-
* @return unknown
|
160 |
-
*/
|
161 |
-
public function trs2_get_due( $order_id, $product_id )
|
162 |
-
{
|
163 |
-
if ( !function_exists( 'woocommerce_get_shipping_method_table_rate' ) ) return;
|
164 |
-
|
165 |
-
$shipping_due = 0;
|
166 |
-
|
167 |
-
WCV_Shipping::trs2_retrieve_shipping_data( $order_id );
|
168 |
-
if ( !empty( WCV_Shipping::$trs2_shipping_calc_type ) ) {
|
169 |
-
|
170 |
-
$ship_id = ( WCV_Shipping::$trs2_shipping_calc_type == 'class' ) ? get_product( $product_id )->get_shipping_class_id() : $product_id;
|
171 |
-
|
172 |
-
if ( !empty( WCV_Shipping::$trs2_shipping_rates[ $ship_id ] ) ) {
|
173 |
-
$shipping_due = WCV_Shipping::$trs2_shipping_rates[ $ship_id ];
|
174 |
-
unset( WCV_Shipping::$trs2_shipping_rates[ $ship_id ] );
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
return $shipping_due;
|
179 |
-
}
|
180 |
-
|
181 |
-
|
182 |
-
/**
|
183 |
-
*
|
184 |
-
*
|
185 |
-
* @param unknown $order_id
|
186 |
-
*/
|
187 |
-
public function trs2_retrieve_shipping_data( $order_id )
|
188 |
-
{
|
189 |
-
global $woocommerce;
|
190 |
-
|
191 |
-
if ( !empty( WCV_Shipping::$trs2_shipping_rates ) ) return;
|
192 |
-
|
193 |
-
WCV_Shipping::$trs2_shipping_rates = array_filter( (array) get_post_meta( $order_id, '_wcvendors_trs2_shipping_rates', true ) );
|
194 |
-
WCV_Shipping::$trs2_shipping_calc_type = get_post_meta( $order_id, '_wcvendors_trs2_shipping_calc_type', true );
|
195 |
-
}
|
196 |
-
|
197 |
-
|
198 |
-
/**
|
199 |
-
*
|
200 |
-
*
|
201 |
-
* @param unknown $type
|
202 |
-
* @param unknown $rates
|
203 |
-
* @param unknown $per_item
|
204 |
-
*/
|
205 |
-
public function trs2_store_shipping_data( $type, $rates, $per_item )
|
206 |
-
{
|
207 |
-
global $woocommerce;
|
208 |
-
|
209 |
-
$types = (array) $woocommerce->session->trs2_shipping_class_type;
|
210 |
-
$types[ ] = $type;
|
211 |
-
$woocommerce->session->trs2_shipping_class_type = $types;
|
212 |
-
|
213 |
-
$items = (array) $woocommerce->session->trs2_shipping_rates;
|
214 |
-
$items[ ] = $per_item;
|
215 |
-
$woocommerce->session->trs2_shipping_rates = $items;
|
216 |
-
}
|
217 |
-
|
218 |
-
|
219 |
-
/**
|
220 |
-
*
|
221 |
-
*
|
222 |
-
* @param unknown $order_id
|
223 |
-
* @param unknown $post
|
224 |
-
*
|
225 |
-
* @return unknown
|
226 |
-
*/
|
227 |
-
public function trs2_add_shipping_data( $order_id, $post )
|
228 |
-
{
|
229 |
-
global $woocommerce;
|
230 |
-
|
231 |
-
if ( empty( $woocommerce->session->trs2_shipping_rates ) ) {
|
232 |
-
return false;
|
233 |
-
}
|
234 |
-
|
235 |
-
$order = new WC_Order( $order_id );
|
236 |
-
|
237 |
-
foreach ( $woocommerce->session->trs2_shipping_rates as $key => $shipping_rates ) {
|
238 |
-
|
239 |
-
if ( is_array( $shipping_rates ) && array_sum( $shipping_rates ) == $order->order_shipping ) {
|
240 |
-
$shipping_calc_type = $woocommerce->session->trs2_shipping_class_type[ $key ];
|
241 |
-
update_post_meta( $order_id, '_wcvendors_trs2_shipping_rates', $shipping_rates );
|
242 |
-
update_post_meta( $order_id, '_wcvendors_trs2_shipping_calc_type', $shipping_calc_type );
|
243 |
-
|
244 |
-
break;
|
245 |
-
}
|
246 |
-
}
|
247 |
-
|
248 |
-
unset( $woocommerce->session->trs2_shipping_rates, $woocommerce->session->trs2_shipping_class_type );
|
249 |
-
}
|
250 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Shipping functions
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>, WC Vendors <http://wcvendors.com>
|
7 |
+
* @package ProductVendor
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Shipping
|
12 |
+
{
|
13 |
+
public static $trs2_shipping_rates;
|
14 |
+
public static $trs2_shipping_calc_type;
|
15 |
+
public static $pps_shipping_costs = array();
|
16 |
+
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Constructor
|
20 |
+
*/
|
21 |
+
function __construct()
|
22 |
+
{
|
23 |
+
// Table Rate Shipping 2 by WooThemes
|
24 |
+
if ( function_exists( 'woocommerce_get_shipping_method_table_rate' ) ) {
|
25 |
+
// add_action( 'wp', array( $this, 'trs2_clear_transients' ) );
|
26 |
+
add_action( 'woocommerce_checkout_update_order_meta', array( 'WCV_Shipping', 'trs2_add_shipping_data' ), 1, 2 );
|
27 |
+
add_action( 'wc_trs2_matched_rates', array( 'WCV_Shipping', 'trs2_store_shipping_data' ), 10, 3 );
|
28 |
+
}
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
/**
|
33 |
+
*
|
34 |
+
*
|
35 |
+
* @param unknown $order_id
|
36 |
+
* @param unknown $product
|
37 |
+
* @param unknown $author
|
38 |
+
*
|
39 |
+
* @return unknown
|
40 |
+
*/
|
41 |
+
public static function get_shipping_due( $order_id, $product, $author )
|
42 |
+
{
|
43 |
+
global $woocommerce;
|
44 |
+
|
45 |
+
$shipping_due = 0;
|
46 |
+
$method = '';
|
47 |
+
$_product = get_product( $product[ 'product_id' ] );
|
48 |
+
$order = wc_get_order( $order_id );
|
49 |
+
|
50 |
+
if ( $_product && $_product->needs_shipping() && !$_product->is_downloadable() ) {
|
51 |
+
|
52 |
+
// Get Shipping methods.
|
53 |
+
$shipping_methods = $order->get_shipping_methods();
|
54 |
+
|
55 |
+
// TODO: Currently this only allows one shipping method per order, this definitely needs changing
|
56 |
+
foreach ($shipping_methods as $shipping_method) {
|
57 |
+
$method = $shipping_method['method_id'];
|
58 |
+
break;
|
59 |
+
}
|
60 |
+
|
61 |
+
// Table Rate Shipping 2
|
62 |
+
if ( strstr( $method, 'table_rate' ) !== false ) {
|
63 |
+
// $shipping_due = WCV_Shipping::trs2_get_due( $order_id, $product[ 'product_id' ] );
|
64 |
+
|
65 |
+
// Per Product Shipping 2
|
66 |
+
} else if ( ( class_exists('WC_Shipping_Per_Product_Init') || function_exists( 'woocommerce_per_product_shipping' ) ) && $method == 'per_product' ) {
|
67 |
+
$shipping_due = WCV_Shipping::pps_get_due( $order_id, $product );
|
68 |
+
|
69 |
+
// Local Delivery
|
70 |
+
} else if ( $method == 'local_delivery' ) {
|
71 |
+
$local_delivery = get_option( 'woocommerce_local_delivery_settings' );
|
72 |
+
|
73 |
+
if ( $local_delivery[ 'type' ] == 'product' ) {
|
74 |
+
$shipping_due = $product[ 'qty' ] * $local_delivery[ 'fee' ];
|
75 |
+
}
|
76 |
+
|
77 |
+
// International Delivery
|
78 |
+
} else if ( $method == 'international_delivery' ) {
|
79 |
+
$int_delivery = get_option( 'woocommerce_international_delivery_settings' );
|
80 |
+
|
81 |
+
if ( $int_delivery[ 'type' ] == 'item' ) {
|
82 |
+
$WC_Shipping_International_Delivery = new WC_Shipping_International_Delivery();
|
83 |
+
$fee = $WC_Shipping_International_Delivery->get_fee( $int_delivery[ 'fee' ], $_product->get_price() );
|
84 |
+
$shipping_due = ( $int_delivery[ 'cost' ] + $fee ) * $product[ 'qty' ];
|
85 |
+
}
|
86 |
+
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
$shipping_due = apply_filters( 'wcvendors_shipping_due', $shipping_due, $order_id, $product );
|
91 |
+
|
92 |
+
return $shipping_due;
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
/**
|
97 |
+
*
|
98 |
+
*
|
99 |
+
* @param unknown $order_id
|
100 |
+
* @param unknown $product
|
101 |
+
*
|
102 |
+
* @return unknown
|
103 |
+
*/
|
104 |
+
public static function pps_get_due( $order_id, $product )
|
105 |
+
{
|
106 |
+
global $woocommerce;
|
107 |
+
|
108 |
+
$item_shipping_cost = 0;
|
109 |
+
|
110 |
+
$order = new WC_Order( $order_id );
|
111 |
+
$package[ 'destination' ][ 'country' ] = $order->shipping_country;
|
112 |
+
$package[ 'destination' ][ 'state' ] = $order->shipping_state;
|
113 |
+
$package[ 'destination' ][ 'postcode' ] = $order->shipping_postcode;
|
114 |
+
$product_id = !empty( $product['variation_id'] ) ? $product['variation_id'] : $product['product_id'];
|
115 |
+
|
116 |
+
if ( !empty( $product['variation_id'] ) ) {
|
117 |
+
$rule = woocommerce_per_product_shipping_get_matching_rule( $product['variation_id'], $package );
|
118 |
+
}
|
119 |
+
|
120 |
+
if ( empty( $rule ) ) {
|
121 |
+
$rule = woocommerce_per_product_shipping_get_matching_rule( $product['product_id'], $package );
|
122 |
+
}
|
123 |
+
|
124 |
+
if ( !empty( $rule ) ) {
|
125 |
+
$item_shipping_cost += $rule->rule_item_cost * $product[ 'qty' ];
|
126 |
+
|
127 |
+
if ( !empty(self::$pps_shipping_costs[$order_id]) && ! in_array( $rule->rule_id, self::$pps_shipping_costs[$order_id] ) ) {
|
128 |
+
$item_shipping_cost += $rule->rule_cost;
|
129 |
+
} else if ( empty( self::$pps_shipping_costs[$order_id] ) ) {
|
130 |
+
$item_shipping_cost += $rule->rule_cost;
|
131 |
+
}
|
132 |
+
|
133 |
+
self::$pps_shipping_costs[$order_id][] = $rule->rule_id;
|
134 |
+
}
|
135 |
+
|
136 |
+
return $item_shipping_cost;
|
137 |
+
}
|
138 |
+
|
139 |
+
|
140 |
+
/**
|
141 |
+
*
|
142 |
+
*/
|
143 |
+
public function trs2_clear_transients()
|
144 |
+
{
|
145 |
+
global $woocommerce;
|
146 |
+
|
147 |
+
if ( is_checkout() ) {
|
148 |
+
wc_delete_product_transients();
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
|
153 |
+
/**
|
154 |
+
*
|
155 |
+
*
|
156 |
+
* @param unknown $order_id
|
157 |
+
* @param unknown $product_id
|
158 |
+
*
|
159 |
+
* @return unknown
|
160 |
+
*/
|
161 |
+
public function trs2_get_due( $order_id, $product_id )
|
162 |
+
{
|
163 |
+
if ( !function_exists( 'woocommerce_get_shipping_method_table_rate' ) ) return;
|
164 |
+
|
165 |
+
$shipping_due = 0;
|
166 |
+
|
167 |
+
WCV_Shipping::trs2_retrieve_shipping_data( $order_id );
|
168 |
+
if ( !empty( WCV_Shipping::$trs2_shipping_calc_type ) ) {
|
169 |
+
|
170 |
+
$ship_id = ( WCV_Shipping::$trs2_shipping_calc_type == 'class' ) ? get_product( $product_id )->get_shipping_class_id() : $product_id;
|
171 |
+
|
172 |
+
if ( !empty( WCV_Shipping::$trs2_shipping_rates[ $ship_id ] ) ) {
|
173 |
+
$shipping_due = WCV_Shipping::$trs2_shipping_rates[ $ship_id ];
|
174 |
+
unset( WCV_Shipping::$trs2_shipping_rates[ $ship_id ] );
|
175 |
+
}
|
176 |
+
}
|
177 |
+
|
178 |
+
return $shipping_due;
|
179 |
+
}
|
180 |
+
|
181 |
+
|
182 |
+
/**
|
183 |
+
*
|
184 |
+
*
|
185 |
+
* @param unknown $order_id
|
186 |
+
*/
|
187 |
+
public function trs2_retrieve_shipping_data( $order_id )
|
188 |
+
{
|
189 |
+
global $woocommerce;
|
190 |
+
|
191 |
+
if ( !empty( WCV_Shipping::$trs2_shipping_rates ) ) return;
|
192 |
+
|
193 |
+
WCV_Shipping::$trs2_shipping_rates = array_filter( (array) get_post_meta( $order_id, '_wcvendors_trs2_shipping_rates', true ) );
|
194 |
+
WCV_Shipping::$trs2_shipping_calc_type = get_post_meta( $order_id, '_wcvendors_trs2_shipping_calc_type', true );
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
/**
|
199 |
+
*
|
200 |
+
*
|
201 |
+
* @param unknown $type
|
202 |
+
* @param unknown $rates
|
203 |
+
* @param unknown $per_item
|
204 |
+
*/
|
205 |
+
public function trs2_store_shipping_data( $type, $rates, $per_item )
|
206 |
+
{
|
207 |
+
global $woocommerce;
|
208 |
+
|
209 |
+
$types = (array) $woocommerce->session->trs2_shipping_class_type;
|
210 |
+
$types[ ] = $type;
|
211 |
+
$woocommerce->session->trs2_shipping_class_type = $types;
|
212 |
+
|
213 |
+
$items = (array) $woocommerce->session->trs2_shipping_rates;
|
214 |
+
$items[ ] = $per_item;
|
215 |
+
$woocommerce->session->trs2_shipping_rates = $items;
|
216 |
+
}
|
217 |
+
|
218 |
+
|
219 |
+
/**
|
220 |
+
*
|
221 |
+
*
|
222 |
+
* @param unknown $order_id
|
223 |
+
* @param unknown $post
|
224 |
+
*
|
225 |
+
* @return unknown
|
226 |
+
*/
|
227 |
+
public function trs2_add_shipping_data( $order_id, $post )
|
228 |
+
{
|
229 |
+
global $woocommerce;
|
230 |
+
|
231 |
+
if ( empty( $woocommerce->session->trs2_shipping_rates ) ) {
|
232 |
+
return false;
|
233 |
+
}
|
234 |
+
|
235 |
+
$order = new WC_Order( $order_id );
|
236 |
+
|
237 |
+
foreach ( $woocommerce->session->trs2_shipping_rates as $key => $shipping_rates ) {
|
238 |
+
|
239 |
+
if ( is_array( $shipping_rates ) && array_sum( $shipping_rates ) == $order->order_shipping ) {
|
240 |
+
$shipping_calc_type = $woocommerce->session->trs2_shipping_class_type[ $key ];
|
241 |
+
update_post_meta( $order_id, '_wcvendors_trs2_shipping_rates', $shipping_rates );
|
242 |
+
update_post_meta( $order_id, '_wcvendors_trs2_shipping_calc_type', $shipping_calc_type );
|
243 |
+
|
244 |
+
break;
|
245 |
+
}
|
246 |
+
}
|
247 |
+
|
248 |
+
unset( $woocommerce->session->trs2_shipping_rates, $woocommerce->session->trs2_shipping_class_type );
|
249 |
+
}
|
250 |
}
|
{WCVendors/classes → classes}/class-vendors.php
RENAMED
@@ -1,414 +1,418 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Vendor functions
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>, WC Vendors <http://wcvendors.com>
|
7 |
-
* @package WCVendors
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Vendors
|
12 |
-
{
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Retrieve all products for a vendor
|
16 |
-
*
|
17 |
-
* @param int $vendor_id
|
18 |
-
*
|
19 |
-
* @return object
|
20 |
-
*/
|
21 |
-
public static function get_vendor_products( $vendor_id )
|
22 |
-
{
|
23 |
-
$args = array(
|
24 |
-
'numberposts' => -1,
|
25 |
-
'post_type' => 'product',
|
26 |
-
'author' => $vendor_id,
|
27 |
-
'post_status' => 'publish',
|
28 |
-
);
|
29 |
-
|
30 |
-
$args = apply_filters( 'pv_get_vendor_products_args', $args );
|
31 |
-
|
32 |
-
return get_posts( $args );
|
33 |
-
}
|
34 |
-
|
35 |
-
public static function get_default_commission( $vendor_id )
|
36 |
-
{
|
37 |
-
return get_user_meta( $vendor_id, 'pv_custom_commission_rate', true );
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Vendor IDs and PayPal addresses from an order
|
43 |
-
*
|
44 |
-
* @param object $order
|
45 |
-
* @param unknown $items (optional)
|
46 |
-
*
|
47 |
-
* @return array
|
48 |
-
*/
|
49 |
-
public static function get_vendors_from_order( $order, $items = false )
|
50 |
-
{
|
51 |
-
if ( !$order ) return;
|
52 |
-
if ( !$items ) $items = $order->get_items();
|
53 |
-
|
54 |
-
$vendors = array();
|
55 |
-
foreach ( $items as $key => $product ) {
|
56 |
-
|
57 |
-
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
58 |
-
|
59 |
-
// Only store the vendor authors
|
60 |
-
if ( !WCV_Vendors::is_vendor( $author ) ) continue;
|
61 |
-
|
62 |
-
$vendors[ $author ] = the_author_meta( 'author_paypal', $author );
|
63 |
-
}
|
64 |
-
|
65 |
-
return apply_filters( 'pv_vendors_from_order', $vendors, $order );
|
66 |
-
}
|
67 |
-
|
68 |
-
|
69 |
-
/**
|
70 |
-
*
|
71 |
-
*
|
72 |
-
* @param unknown $order
|
73 |
-
* @param unknown $group (optional)
|
74 |
-
*
|
75 |
-
* @return unknown
|
76 |
-
*/
|
77 |
-
public static function get_vendor_dues_from_order( $order, $group = true )
|
78 |
-
{
|
79 |
-
global $woocommerce;
|
80 |
-
|
81 |
-
$give_tax = WC_Vendors::$pv_options->get_option( 'give_tax' );
|
82 |
-
$give_shipping
|
83 |
-
$receiver = array();
|
84 |
-
$shipping_given = 0;
|
85 |
-
$tax_given = 0;
|
86 |
-
|
87 |
-
WCV_Shipping::$pps_shipping_costs = array();
|
88 |
-
|
89 |
-
foreach ( $order->get_items() as $key => $product ) {
|
90 |
-
|
91 |
-
$product_id = !empty( $product[ 'variation_id' ] ) ? $product[ 'variation_id' ] : $product[ 'product_id' ];
|
92 |
-
$author = WCV_Vendors::get_vendor_from_product( $product_id );
|
93 |
-
$is_vendor = WCV_Vendors::is_vendor( $author );
|
94 |
-
$commission = $is_vendor ? WCV_Commission::calculate_commission( $product[ 'line_subtotal' ], $product_id, $order ) : 0;
|
95 |
-
$tax = !empty( $product[ 'line_tax' ] ) ? (float) $product[ 'line_tax' ] : 0;
|
96 |
-
// Check if shipping is enabled
|
97 |
-
if ( get_option('woocommerce_calc_shipping') === 'no' ) { $shipping = 0; } else {
|
98 |
-
$shipping = WCV_Shipping::get_shipping_due( $order->id, $product, $author );
|
99 |
-
}
|
100 |
-
|
101 |
-
if ( $is_vendor ) {
|
102 |
-
|
103 |
-
$shipping_given += $give_shipping ? $shipping : 0;
|
104 |
-
$tax_given += $give_tax ? $tax : 0;
|
105 |
-
|
106 |
-
$give = 0;
|
107 |
-
$give += !empty( $receiver[ $author ][ 'total' ] ) ? $receiver[ $author ][ 'total' ] : 0;
|
108 |
-
$give += $give_shipping ? $shipping : 0;
|
109 |
-
$give += $commission;
|
110 |
-
$give += $give_tax ? $tax : 0;
|
111 |
-
|
112 |
-
if ( $group ) {
|
113 |
-
|
114 |
-
$receiver[ $author ] = array(
|
115 |
-
'vendor_id' => (int) $author,
|
116 |
-
'commission' => !empty( $receiver[ $author ][ 'commission' ] ) ? $receiver[ $author ][ 'commission' ] + $commission : $commission,
|
117 |
-
'shipping' => $give_shipping ? ( !empty( $receiver[ $author ][ 'shipping' ] ) ? $receiver[ $author ][ 'shipping' ] + $shipping : $shipping) : 0,
|
118 |
-
'tax' => $give_tax ? ( !empty( $receiver[ $author ][ 'tax' ] ) ? $receiver[ $author ][ 'tax' ] + $tax : $tax ) : 0,
|
119 |
-
'qty' => !empty( $receiver[ $author ][ 'qty' ] ) ? $receiver[ $author ][ 'qty' ] + $product[ 'qty' ] : $product[ 'qty' ],
|
120 |
-
'total' => $give,
|
121 |
-
);
|
122 |
-
|
123 |
-
} else {
|
124 |
-
|
125 |
-
$receiver[ $author ][ $key ] = array(
|
126 |
-
'vendor_id' => (int) $author,
|
127 |
-
'product_id' => $product_id,
|
128 |
-
'commission' => $commission,
|
129 |
-
'shipping' => $give_shipping ? $shipping : 0,
|
130 |
-
'tax' => $give_tax ? $tax : 0,
|
131 |
-
'qty' => $product[ 'qty' ],
|
132 |
-
'total' => ($give_shipping ? $shipping : 0) + $commission + ( $give_tax ? $tax : 0 ),
|
133 |
-
);
|
134 |
-
|
135 |
-
}
|
136 |
-
|
137 |
-
}
|
138 |
-
|
139 |
-
$admin_comm = $product[ 'line_subtotal' ] - $commission;
|
140 |
-
|
141 |
-
if ( $group ) {
|
142 |
-
$receiver[ 1 ] = array(
|
143 |
-
'vendor_id' => 1,
|
144 |
-
'qty' => !empty( $receiver[ 1 ][ 'qty' ] ) ? $receiver[ 1 ][ 'qty' ] + $product[ 'qty' ] : $product[ 'qty' ],
|
145 |
-
'commission' => !empty( $receiver[ 1 ][ 'commission' ] ) ? $receiver[ 1 ][ 'commission' ] + $admin_comm : $admin_comm,
|
146 |
-
'total' => !empty( $receiver[ 1 ] ) ? $receiver[ 1 ][ 'total' ] + $admin_comm : $admin_comm,
|
147 |
-
);
|
148 |
-
} else {
|
149 |
-
$receiver[ 1 ][ $key ] = array(
|
150 |
-
'vendor_id' => 1,
|
151 |
-
'product_id' => $product_id,
|
152 |
-
'commission' => $admin_comm,
|
153 |
-
'shipping' => 0,
|
154 |
-
'tax' => 0,
|
155 |
-
'qty' => $product[ 'qty' ],
|
156 |
-
'total' => $admin_comm,
|
157 |
-
);
|
158 |
-
}
|
159 |
-
|
160 |
-
}
|
161 |
-
|
162 |
-
// Add remainders on end to admin
|
163 |
-
$discount = $order->get_total_discount();
|
164 |
-
$shipping = ( $order->order_shipping - $shipping_given );
|
165 |
-
$tax = round(( $order->order_tax + $order->order_shipping_tax ) - $tax_given, 2);
|
166 |
-
$total = ( $tax + $shipping ) - $discount;
|
167 |
-
|
168 |
-
if ( $group ) {
|
169 |
-
$receiver[ 1 ][ 'commission' ] = $receiver[ 1 ][ 'commission' ] - $discount;
|
170 |
-
$receiver[ 1 ][ 'shipping' ] = $shipping;
|
171 |
-
$receiver[ 1 ][ 'tax' ] = $tax;
|
172 |
-
$receiver[ 1 ][ 'total' ] += $total;
|
173 |
-
} else {
|
174 |
-
$receiver[ 1 ][ $key ][ 'commission' ] = $receiver[ 1 ][ $key ][ 'commission' ] - $discount;
|
175 |
-
$receiver[ 1 ][ $key ][ 'shipping' ] = ( $order->order_shipping - $shipping_given );
|
176 |
-
$receiver[ 1 ][ $key ][ 'tax' ] = $tax;
|
177 |
-
$receiver[ 1 ][ $key ][ 'total' ] += $total;
|
178 |
-
}
|
179 |
-
|
180 |
-
// Reset the array keys
|
181 |
-
// $receivers = array_values( $receiver );
|
182 |
-
|
183 |
-
return $receiver;
|
184 |
-
}
|
185 |
-
|
186 |
-
|
187 |
-
/**
|
188 |
-
* Return the PayPal address for a vendor
|
189 |
-
*
|
190 |
-
* If no PayPal is set, it returns the vendor's email
|
191 |
-
*
|
192 |
-
* @param int $vendor_id
|
193 |
-
*
|
194 |
-
* @return string
|
195 |
-
*/
|
196 |
-
public static function get_vendor_paypal( $vendor_id )
|
197 |
-
{
|
198 |
-
$paypal = get_user_meta( $vendor_id, $meta_key = 'pv_paypal', true );
|
199 |
-
$paypal = !empty( $paypal ) ? $paypal : get_the_author_meta( 'user_email', $vendor_id, false );
|
200 |
-
|
201 |
-
return $paypal;
|
202 |
-
}
|
203 |
-
|
204 |
-
|
205 |
-
/**
|
206 |
-
* Check if a vendor has an amount due for an order already
|
207 |
-
*
|
208 |
-
* @param int $vendor_id
|
209 |
-
* @param int $order_id
|
210 |
-
*
|
211 |
-
* @return int
|
212 |
-
*/
|
213 |
-
public static function count_due_by_vendor( $vendor_id, $order_id )
|
214 |
-
{
|
215 |
-
global $wpdb;
|
216 |
-
|
217 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
218 |
-
|
219 |
-
$query = "SELECT COUNT(*)
|
220 |
-
FROM {$table_name}
|
221 |
-
WHERE vendor_id = %s
|
222 |
-
AND order_id = %s
|
223 |
-
AND status = %s";
|
224 |
-
$count = $wpdb->get_var( $wpdb->prepare( $query, $vendor_id, $order_id, 'due' ) );
|
225 |
-
|
226 |
-
return $count;
|
227 |
-
}
|
228 |
-
|
229 |
-
|
230 |
-
/**
|
231 |
-
* All commission due for a specific vendor
|
232 |
-
*
|
233 |
-
* @param int $vendor_id
|
234 |
-
*
|
235 |
-
* @return int
|
236 |
-
*/
|
237 |
-
public static function get_due_orders_by_vendor( $vendor_id )
|
238 |
-
{
|
239 |
-
global $wpdb;
|
240 |
-
|
241 |
-
$table_name = $wpdb->prefix . "pv_commission";
|
242 |
-
|
243 |
-
$query = "SELECT *
|
244 |
-
FROM {$table_name}
|
245 |
-
WHERE vendor_id = %s
|
246 |
-
AND status = %s";
|
247 |
-
$results = $wpdb->get_results( $wpdb->prepare( $query, $vendor_id, 'due' ) );
|
248 |
-
|
249 |
-
return $results;
|
250 |
-
}
|
251 |
-
|
252 |
-
|
253 |
-
/**
|
254 |
-
*
|
255 |
-
*
|
256 |
-
* @param unknown $product_id
|
257 |
-
*
|
258 |
-
* @return unknown
|
259 |
-
*/
|
260 |
-
public static function get_vendor_from_product( $product_id )
|
261 |
-
{
|
262 |
-
|
263 |
-
if (
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
*
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
*
|
297 |
-
*
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
$
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
*
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
$
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
*
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
*
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Vendor functions
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>, WC Vendors <http://wcvendors.com>
|
7 |
+
* @package WCVendors
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Vendors
|
12 |
+
{
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Retrieve all products for a vendor
|
16 |
+
*
|
17 |
+
* @param int $vendor_id
|
18 |
+
*
|
19 |
+
* @return object
|
20 |
+
*/
|
21 |
+
public static function get_vendor_products( $vendor_id )
|
22 |
+
{
|
23 |
+
$args = array(
|
24 |
+
'numberposts' => -1,
|
25 |
+
'post_type' => 'product',
|
26 |
+
'author' => $vendor_id,
|
27 |
+
'post_status' => 'publish',
|
28 |
+
);
|
29 |
+
|
30 |
+
$args = apply_filters( 'pv_get_vendor_products_args', $args );
|
31 |
+
|
32 |
+
return get_posts( $args );
|
33 |
+
}
|
34 |
+
|
35 |
+
public static function get_default_commission( $vendor_id )
|
36 |
+
{
|
37 |
+
return get_user_meta( $vendor_id, 'pv_custom_commission_rate', true );
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
* Vendor IDs and PayPal addresses from an order
|
43 |
+
*
|
44 |
+
* @param object $order
|
45 |
+
* @param unknown $items (optional)
|
46 |
+
*
|
47 |
+
* @return array
|
48 |
+
*/
|
49 |
+
public static function get_vendors_from_order( $order, $items = false )
|
50 |
+
{
|
51 |
+
if ( !$order ) return;
|
52 |
+
if ( !$items ) $items = $order->get_items();
|
53 |
+
|
54 |
+
$vendors = array();
|
55 |
+
foreach ( $items as $key => $product ) {
|
56 |
+
|
57 |
+
$author = WCV_Vendors::get_vendor_from_product( $product[ 'product_id' ] );
|
58 |
+
|
59 |
+
// Only store the vendor authors
|
60 |
+
if ( !WCV_Vendors::is_vendor( $author ) ) continue;
|
61 |
+
|
62 |
+
$vendors[ $author ] = the_author_meta( 'author_paypal', $author );
|
63 |
+
}
|
64 |
+
|
65 |
+
return apply_filters( 'pv_vendors_from_order', $vendors, $order );
|
66 |
+
}
|
67 |
+
|
68 |
+
|
69 |
+
/**
|
70 |
+
*
|
71 |
+
*
|
72 |
+
* @param unknown $order
|
73 |
+
* @param unknown $group (optional)
|
74 |
+
*
|
75 |
+
* @return unknown
|
76 |
+
*/
|
77 |
+
public static function get_vendor_dues_from_order( $order, $group = true )
|
78 |
+
{
|
79 |
+
global $woocommerce;
|
80 |
+
|
81 |
+
$give_tax = WC_Vendors::$pv_options->get_option( 'give_tax' );
|
82 |
+
$give_shipping = WC_Vendors::$pv_options->get_option( 'give_shipping' );
|
83 |
+
$receiver = array();
|
84 |
+
$shipping_given = 0;
|
85 |
+
$tax_given = 0;
|
86 |
+
|
87 |
+
WCV_Shipping::$pps_shipping_costs = array();
|
88 |
+
|
89 |
+
foreach ( $order->get_items() as $key => $product ) {
|
90 |
+
|
91 |
+
$product_id = !empty( $product[ 'variation_id' ] ) ? $product[ 'variation_id' ] : $product[ 'product_id' ];
|
92 |
+
$author = WCV_Vendors::get_vendor_from_product( $product_id );
|
93 |
+
$is_vendor = WCV_Vendors::is_vendor( $author );
|
94 |
+
$commission = $is_vendor ? WCV_Commission::calculate_commission( $product[ 'line_subtotal' ], $product_id, $order ) : 0;
|
95 |
+
$tax = !empty( $product[ 'line_tax' ] ) ? (float) $product[ 'line_tax' ] : 0;
|
96 |
+
// Check if shipping is enabled
|
97 |
+
if ( get_option('woocommerce_calc_shipping') === 'no' ) { $shipping = 0; } else {
|
98 |
+
$shipping = WCV_Shipping::get_shipping_due( $order->id, $product, $author );
|
99 |
+
}
|
100 |
+
|
101 |
+
if ( $is_vendor ) {
|
102 |
+
|
103 |
+
$shipping_given += $give_shipping ? $shipping : 0;
|
104 |
+
$tax_given += $give_tax ? $tax : 0;
|
105 |
+
|
106 |
+
$give = 0;
|
107 |
+
$give += !empty( $receiver[ $author ][ 'total' ] ) ? $receiver[ $author ][ 'total' ] : 0;
|
108 |
+
$give += $give_shipping ? $shipping : 0;
|
109 |
+
$give += $commission;
|
110 |
+
$give += $give_tax ? $tax : 0;
|
111 |
+
|
112 |
+
if ( $group ) {
|
113 |
+
|
114 |
+
$receiver[ $author ] = array(
|
115 |
+
'vendor_id' => (int) $author,
|
116 |
+
'commission' => !empty( $receiver[ $author ][ 'commission' ] ) ? $receiver[ $author ][ 'commission' ] + $commission : $commission,
|
117 |
+
'shipping' => $give_shipping ? ( !empty( $receiver[ $author ][ 'shipping' ] ) ? $receiver[ $author ][ 'shipping' ] + $shipping : $shipping) : 0,
|
118 |
+
'tax' => $give_tax ? ( !empty( $receiver[ $author ][ 'tax' ] ) ? $receiver[ $author ][ 'tax' ] + $tax : $tax ) : 0,
|
119 |
+
'qty' => !empty( $receiver[ $author ][ 'qty' ] ) ? $receiver[ $author ][ 'qty' ] + $product[ 'qty' ] : $product[ 'qty' ],
|
120 |
+
'total' => $give,
|
121 |
+
);
|
122 |
+
|
123 |
+
} else {
|
124 |
+
|
125 |
+
$receiver[ $author ][ $key ] = array(
|
126 |
+
'vendor_id' => (int) $author,
|
127 |
+
'product_id' => $product_id,
|
128 |
+
'commission' => $commission,
|
129 |
+
'shipping' => $give_shipping ? $shipping : 0,
|
130 |
+
'tax' => $give_tax ? $tax : 0,
|
131 |
+
'qty' => $product[ 'qty' ],
|
132 |
+
'total' => ($give_shipping ? $shipping : 0) + $commission + ( $give_tax ? $tax : 0 ),
|
133 |
+
);
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
}
|
138 |
+
|
139 |
+
$admin_comm = $product[ 'line_subtotal' ] - $commission;
|
140 |
+
|
141 |
+
if ( $group ) {
|
142 |
+
$receiver[ 1 ] = array(
|
143 |
+
'vendor_id' => 1,
|
144 |
+
'qty' => !empty( $receiver[ 1 ][ 'qty' ] ) ? $receiver[ 1 ][ 'qty' ] + $product[ 'qty' ] : $product[ 'qty' ],
|
145 |
+
'commission' => !empty( $receiver[ 1 ][ 'commission' ] ) ? $receiver[ 1 ][ 'commission' ] + $admin_comm : $admin_comm,
|
146 |
+
'total' => !empty( $receiver[ 1 ] ) ? $receiver[ 1 ][ 'total' ] + $admin_comm : $admin_comm,
|
147 |
+
);
|
148 |
+
} else {
|
149 |
+
$receiver[ 1 ][ $key ] = array(
|
150 |
+
'vendor_id' => 1,
|
151 |
+
'product_id' => $product_id,
|
152 |
+
'commission' => $admin_comm,
|
153 |
+
'shipping' => 0,
|
154 |
+
'tax' => 0,
|
155 |
+
'qty' => $product[ 'qty' ],
|
156 |
+
'total' => $admin_comm,
|
157 |
+
);
|
158 |
+
}
|
159 |
+
|
160 |
+
}
|
161 |
+
|
162 |
+
// Add remainders on end to admin
|
163 |
+
$discount = $order->get_total_discount();
|
164 |
+
$shipping = ( $order->order_shipping - $shipping_given );
|
165 |
+
$tax = round(( $order->order_tax + $order->order_shipping_tax ) - $tax_given, 2);
|
166 |
+
$total = ( $tax + $shipping ) - $discount;
|
167 |
+
|
168 |
+
if ( $group ) {
|
169 |
+
$receiver[ 1 ][ 'commission' ] = $receiver[ 1 ][ 'commission' ] - $discount;
|
170 |
+
$receiver[ 1 ][ 'shipping' ] = $shipping;
|
171 |
+
$receiver[ 1 ][ 'tax' ] = $tax;
|
172 |
+
$receiver[ 1 ][ 'total' ] += $total;
|
173 |
+
} else {
|
174 |
+
$receiver[ 1 ][ $key ][ 'commission' ] = $receiver[ 1 ][ $key ][ 'commission' ] - $discount;
|
175 |
+
$receiver[ 1 ][ $key ][ 'shipping' ] = ( $order->order_shipping - $shipping_given );
|
176 |
+
$receiver[ 1 ][ $key ][ 'tax' ] = $tax;
|
177 |
+
$receiver[ 1 ][ $key ][ 'total' ] += $total;
|
178 |
+
}
|
179 |
+
|
180 |
+
// Reset the array keys
|
181 |
+
// $receivers = array_values( $receiver );
|
182 |
+
|
183 |
+
return $receiver;
|
184 |
+
}
|
185 |
+
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Return the PayPal address for a vendor
|
189 |
+
*
|
190 |
+
* If no PayPal is set, it returns the vendor's email
|
191 |
+
*
|
192 |
+
* @param int $vendor_id
|
193 |
+
*
|
194 |
+
* @return string
|
195 |
+
*/
|
196 |
+
public static function get_vendor_paypal( $vendor_id )
|
197 |
+
{
|
198 |
+
$paypal = get_user_meta( $vendor_id, $meta_key = 'pv_paypal', true );
|
199 |
+
$paypal = !empty( $paypal ) ? $paypal : get_the_author_meta( 'user_email', $vendor_id, false );
|
200 |
+
|
201 |
+
return $paypal;
|
202 |
+
}
|
203 |
+
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Check if a vendor has an amount due for an order already
|
207 |
+
*
|
208 |
+
* @param int $vendor_id
|
209 |
+
* @param int $order_id
|
210 |
+
*
|
211 |
+
* @return int
|
212 |
+
*/
|
213 |
+
public static function count_due_by_vendor( $vendor_id, $order_id )
|
214 |
+
{
|
215 |
+
global $wpdb;
|
216 |
+
|
217 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
218 |
+
|
219 |
+
$query = "SELECT COUNT(*)
|
220 |
+
FROM {$table_name}
|
221 |
+
WHERE vendor_id = %s
|
222 |
+
AND order_id = %s
|
223 |
+
AND status = %s";
|
224 |
+
$count = $wpdb->get_var( $wpdb->prepare( $query, $vendor_id, $order_id, 'due' ) );
|
225 |
+
|
226 |
+
return $count;
|
227 |
+
}
|
228 |
+
|
229 |
+
|
230 |
+
/**
|
231 |
+
* All commission due for a specific vendor
|
232 |
+
*
|
233 |
+
* @param int $vendor_id
|
234 |
+
*
|
235 |
+
* @return int
|
236 |
+
*/
|
237 |
+
public static function get_due_orders_by_vendor( $vendor_id )
|
238 |
+
{
|
239 |
+
global $wpdb;
|
240 |
+
|
241 |
+
$table_name = $wpdb->prefix . "pv_commission";
|
242 |
+
|
243 |
+
$query = "SELECT *
|
244 |
+
FROM {$table_name}
|
245 |
+
WHERE vendor_id = %s
|
246 |
+
AND status = %s";
|
247 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $vendor_id, 'due' ) );
|
248 |
+
|
249 |
+
return $results;
|
250 |
+
}
|
251 |
+
|
252 |
+
|
253 |
+
/**
|
254 |
+
*
|
255 |
+
*
|
256 |
+
* @param unknown $product_id
|
257 |
+
*
|
258 |
+
* @return unknown
|
259 |
+
*/
|
260 |
+
public static function get_vendor_from_product( $product_id )
|
261 |
+
{
|
262 |
+
// Make sure we are returning an author for products only
|
263 |
+
if ( 'product' === get_post_type( $product_id ) ) {
|
264 |
+
$parent = get_post_ancestors( $product_id );
|
265 |
+
if ( $parent ) $product_id = $parent[ 0 ];
|
266 |
+
|
267 |
+
$post = get_post( $product_id );
|
268 |
+
$author = $post ? $post->post_author : 1;
|
269 |
+
$author = apply_filters( 'pv_product_author', $author, $product_id );
|
270 |
+
} else {
|
271 |
+
$author = -1;
|
272 |
+
}
|
273 |
+
return $author;
|
274 |
+
}
|
275 |
+
|
276 |
+
|
277 |
+
/**
|
278 |
+
* Checks whether the ID provided is vendor capable or not
|
279 |
+
*
|
280 |
+
* @param int $user_id
|
281 |
+
*
|
282 |
+
* @return bool
|
283 |
+
*/
|
284 |
+
public static function is_vendor( $user_id )
|
285 |
+
{
|
286 |
+
$user = get_userdata( $user_id );
|
287 |
+
|
288 |
+
$role = !empty( $user->roles ) ? array_shift( $user->roles ) : false;
|
289 |
+
$is_vendor = $role == 'vendor';
|
290 |
+
|
291 |
+
return apply_filters( 'pv_is_vendor', $is_vendor, $user_id );
|
292 |
+
}
|
293 |
+
|
294 |
+
|
295 |
+
/**
|
296 |
+
* Grabs the vendor ID whether a username or an int is provided
|
297 |
+
* and returns the vendor_id if it's actually a vendor
|
298 |
+
*
|
299 |
+
* @param unknown $input
|
300 |
+
*
|
301 |
+
* @return unknown
|
302 |
+
*/
|
303 |
+
public static function get_vendor_id( $input )
|
304 |
+
{
|
305 |
+
if ( empty( $input ) ) {
|
306 |
+
return false;
|
307 |
+
}
|
308 |
+
|
309 |
+
$users = get_users( array( 'meta_key' => 'pv_shop_slug', 'meta_value' => sanitize_title( $input ) ) );
|
310 |
+
|
311 |
+
if ( !empty( $users ) && count( $users ) == 1 ) {
|
312 |
+
$vendor = $users[ 0 ];
|
313 |
+
} else {
|
314 |
+
$int_vendor = is_numeric( $input );
|
315 |
+
$vendor = !empty( $int_vendor ) ? get_userdata( $input ) : get_user_by( 'login', $input );
|
316 |
+
}
|
317 |
+
|
318 |
+
if ( $vendor ) {
|
319 |
+
$vendor_id = $vendor->ID;
|
320 |
+
if ( self::is_vendor( $vendor_id ) ) {
|
321 |
+
return $vendor_id;
|
322 |
+
}
|
323 |
+
}
|
324 |
+
|
325 |
+
return false;
|
326 |
+
}
|
327 |
+
|
328 |
+
|
329 |
+
/**
|
330 |
+
* Retrieve the shop page for a specific vendor
|
331 |
+
*
|
332 |
+
* @param unknown $vendor_id
|
333 |
+
*
|
334 |
+
* @return string
|
335 |
+
*/
|
336 |
+
public static function get_vendor_shop_page( $vendor_id )
|
337 |
+
{
|
338 |
+
$vendor_id = self::get_vendor_id( $vendor_id );
|
339 |
+
if ( !$vendor_id ) return;
|
340 |
+
|
341 |
+
$slug = get_user_meta( $vendor_id, 'pv_shop_slug', true );
|
342 |
+
$vendor = !$slug ? get_userdata( $vendor_id )->user_login : $slug;
|
343 |
+
|
344 |
+
if ( get_option( 'permalink_structure' ) ) {
|
345 |
+
$permalink = trailingslashit( WC_Vendors::$pv_options->get_option( 'vendor_shop_permalink' ) );
|
346 |
+
|
347 |
+
return trailingslashit( home_url( sprintf( '/%s%s', $permalink, $vendor ) ) );
|
348 |
+
} else {
|
349 |
+
return add_query_arg( array( 'vendor_shop' => $vendor ), get_post_type_archive_link( 'product' ) );
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
|
354 |
+
/**
|
355 |
+
* Retrieve the shop name for a specific vendor
|
356 |
+
*
|
357 |
+
* @param unknown $vendor_id
|
358 |
+
*
|
359 |
+
* @return string
|
360 |
+
*/
|
361 |
+
public static function get_vendor_shop_name( $vendor_id )
|
362 |
+
{
|
363 |
+
$vendor_id = self::get_vendor_id( $vendor_id );
|
364 |
+
$name = $vendor_id ? get_user_meta( $vendor_id, 'pv_shop_name', true ) : false;
|
365 |
+
$shop_name = !$name ? get_userdata( $vendor_id )->user_login : $name;
|
366 |
+
|
367 |
+
return $shop_name;
|
368 |
+
}
|
369 |
+
|
370 |
+
|
371 |
+
/**
|
372 |
+
*
|
373 |
+
*
|
374 |
+
* @param unknown $user_id
|
375 |
+
*
|
376 |
+
* @return unknown
|
377 |
+
*/
|
378 |
+
public static function is_pending( $user_id )
|
379 |
+
{
|
380 |
+
$user = get_userdata( $user_id );
|
381 |
+
|
382 |
+
$role = !empty( $user->roles ) ? array_shift( $user->roles ) : false;
|
383 |
+
$is_pending = ( $role == 'pending_vendor' );
|
384 |
+
|
385 |
+
return $is_pending;
|
386 |
+
}
|
387 |
+
|
388 |
+
/*
|
389 |
+
* Is this a vendor product ?
|
390 |
+
* @param uknown $role
|
391 |
+
*/
|
392 |
+
public static function is_vendor_product($role) {
|
393 |
+
return ($role === 'Vendor') ? true : false;
|
394 |
+
}
|
395 |
+
|
396 |
+
/*
|
397 |
+
* Is this the vendors shop archive page ?
|
398 |
+
*/
|
399 |
+
public static function is_vendor_page() {
|
400 |
+
|
401 |
+
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
402 |
+
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
403 |
+
|
404 |
+
return $vendor_id ? true : false;
|
405 |
+
|
406 |
+
}
|
407 |
+
|
408 |
+
/*
|
409 |
+
* Is this a vendor single product page ?
|
410 |
+
*/
|
411 |
+
public static function is_vendor_product_page($vendor_id) {
|
412 |
+
|
413 |
+
$vendor_product = WCV_Vendors::is_vendor_product( wcv_get_user_role($vendor_id) );
|
414 |
+
return $vendor_product ? true : false;
|
415 |
+
|
416 |
+
}
|
417 |
+
|
418 |
+
}
|
{WCVendors/classes → classes}/front/class-vendor-cart.php
RENAMED
@@ -1,63 +1,63 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
*
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Vendor_Cart
|
12 |
-
{
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
*
|
17 |
-
*/
|
18 |
-
function __construct()
|
19 |
-
{
|
20 |
-
add_filter( 'woocommerce_get_item_data', array( 'WCV_Vendor_Cart', 'sold_by' ), 10, 2 );
|
21 |
-
add_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
|
22 |
-
}
|
23 |
-
|
24 |
-
|
25 |
-
/**
|
26 |
-
*
|
27 |
-
*
|
28 |
-
* @param unknown $values
|
29 |
-
* @param unknown $cart_item
|
30 |
-
*
|
31 |
-
* @return unknown
|
32 |
-
*/
|
33 |
-
public static function sold_by( $values, $cart_item )
|
34 |
-
{
|
35 |
-
$author_id = $cart_item[ 'data' ]->post->post_author;
|
36 |
-
$sold_by = WCV_Vendors::is_vendor( $author_id )
|
37 |
-
? sprintf( '<a href="%s" target="_TOP">%s</a>', WCV_Vendors::get_vendor_shop_page( $author_id ), WCV_Vendors::get_vendor_shop_name( $author_id ) )
|
38 |
-
: get_bloginfo( 'name' );
|
39 |
-
|
40 |
-
$values[ ] = array(
|
41 |
-
'name' => apply_filters('wcvendors_cart_sold_by', __( 'Sold by', 'wcvendors' )),
|
42 |
-
'display' => $sold_by,
|
43 |
-
);
|
44 |
-
|
45 |
-
return $values;
|
46 |
-
}
|
47 |
-
|
48 |
-
|
49 |
-
/**
|
50 |
-
*
|
51 |
-
*/
|
52 |
-
public static function sold_by_meta()
|
53 |
-
{
|
54 |
-
$author_id = get_the_author_meta( 'ID' );
|
55 |
-
|
56 |
-
$sold_by = WCV_Vendors::is_vendor( $author_id )
|
57 |
-
? sprintf( '<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page( $author_id ), WCV_Vendors::get_vendor_shop_name( $author_id ) )
|
58 |
-
: get_bloginfo( 'name' );
|
59 |
-
|
60 |
-
echo apply_filters('wcvendors_cart_sold_by_meta', __( 'Sold by: ', 'wcvendors' )) . $sold_by . '<br/>';
|
61 |
-
}
|
62 |
-
|
63 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
*
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Vendor_Cart
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
*
|
17 |
+
*/
|
18 |
+
function __construct()
|
19 |
+
{
|
20 |
+
add_filter( 'woocommerce_get_item_data', array( 'WCV_Vendor_Cart', 'sold_by' ), 10, 2 );
|
21 |
+
add_action( 'woocommerce_product_meta_start', array( 'WCV_Vendor_Cart', 'sold_by_meta' ), 10, 2 );
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
+
/**
|
26 |
+
*
|
27 |
+
*
|
28 |
+
* @param unknown $values
|
29 |
+
* @param unknown $cart_item
|
30 |
+
*
|
31 |
+
* @return unknown
|
32 |
+
*/
|
33 |
+
public static function sold_by( $values, $cart_item )
|
34 |
+
{
|
35 |
+
$author_id = $cart_item[ 'data' ]->post->post_author;
|
36 |
+
$sold_by = WCV_Vendors::is_vendor( $author_id )
|
37 |
+
? sprintf( '<a href="%s" target="_TOP">%s</a>', WCV_Vendors::get_vendor_shop_page( $author_id ), WCV_Vendors::get_vendor_shop_name( $author_id ) )
|
38 |
+
: get_bloginfo( 'name' );
|
39 |
+
|
40 |
+
$values[ ] = array(
|
41 |
+
'name' => apply_filters('wcvendors_cart_sold_by', __( 'Sold by', 'wcvendors' )),
|
42 |
+
'display' => $sold_by,
|
43 |
+
);
|
44 |
+
|
45 |
+
return $values;
|
46 |
+
}
|
47 |
+
|
48 |
+
|
49 |
+
/**
|
50 |
+
*
|
51 |
+
*/
|
52 |
+
public static function sold_by_meta()
|
53 |
+
{
|
54 |
+
$author_id = get_the_author_meta( 'ID' );
|
55 |
+
|
56 |
+
$sold_by = WCV_Vendors::is_vendor( $author_id )
|
57 |
+
? sprintf( '<a href="%s" class="wcvendors_cart_sold_by_meta">%s</a>', WCV_Vendors::get_vendor_shop_page( $author_id ), WCV_Vendors::get_vendor_shop_name( $author_id ) )
|
58 |
+
: get_bloginfo( 'name' );
|
59 |
+
|
60 |
+
echo apply_filters('wcvendors_cart_sold_by_meta', __( 'Sold by: ', 'wcvendors' )) . $sold_by . '<br/>';
|
61 |
+
}
|
62 |
+
|
63 |
+
}
|
{WCVendors/classes → classes}/front/class-vendor-shop.php
RENAMED
@@ -1,266 +1,266 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Shop functions for each vendor.
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package ProductVendor
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Vendor_Shop
|
12 |
-
{
|
13 |
-
|
14 |
-
public static $seller_info;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* init
|
18 |
-
*/
|
19 |
-
function __construct()
|
20 |
-
{
|
21 |
-
|
22 |
-
add_filter( 'product_enquiry_send_to', array( 'WCV_Vendor_Shop', 'product_enquiry_compatibility' ), 10, 2 );
|
23 |
-
|
24 |
-
add_action( 'woocommerce_product_query', array( $this, 'vendor_shop_query' ), 10, 2 );
|
25 |
-
add_filter( 'init', array( $this, 'add_rewrite_rules' ), 0 );
|
26 |
-
|
27 |
-
add_action( 'woocommerce_before_main_content', array( 'WCV_Vendor_Shop', 'shop_description' ), 30 );
|
28 |
-
add_filter( 'woocommerce_product_tabs', array( 'WCV_Vendor_Shop', 'seller_info_tab' ) );
|
29 |
-
add_filter( 'post_type_archive_link', array( 'WCV_Vendor_Shop', 'change_archive_link' ) );
|
30 |
-
|
31 |
-
// Add sold by to product loop before add to cart
|
32 |
-
add_action( 'woocommerce_after_shop_loop_item', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 9 );
|
33 |
-
|
34 |
-
// Remove Page Title if on Vendor Shop
|
35 |
-
add_filter ( 'woocommerce_show_page_title', array('WCV_Vendor_Shop', 'remove_vendor_title') );
|
36 |
-
|
37 |
-
// Show vendor on all sales related invoices
|
38 |
-
add_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 );
|
39 |
-
|
40 |
-
// Add a vendor header
|
41 |
-
if (WC_Vendors::$pv_options->get_option( 'shop_headers_enabled' ) ) {
|
42 |
-
add_action( 'woocommerce_before_main_content', array('WCV_Vendor_Shop', 'vendor_main_header'), 20 );
|
43 |
-
add_action( 'woocommerce_before_single_product', array('WCV_Vendor_Shop', 'vendor_mini_header'));
|
44 |
-
}
|
45 |
-
|
46 |
-
}
|
47 |
-
|
48 |
-
public static function change_archive_link( $link )
|
49 |
-
{
|
50 |
-
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
51 |
-
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
52 |
-
|
53 |
-
return !$vendor_id ? $link : WCV_Vendors::get_vendor_shop_page( $vendor_id );
|
54 |
-
}
|
55 |
-
|
56 |
-
public static function vendor_shop_query( $q, $that )
|
57 |
-
{
|
58 |
-
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
59 |
-
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
60 |
-
|
61 |
-
if ( !$vendor_id ) return;
|
62 |
-
add_filter( 'woocommerce_page_title', array( 'WCV_Vendor_Shop', 'page_title' ) );
|
63 |
-
|
64 |
-
$q->set( 'author', $vendor_id );
|
65 |
-
}
|
66 |
-
|
67 |
-
public static function product_enquiry_compatibility( $send_to, $product_id )
|
68 |
-
{
|
69 |
-
$author_id = get_post( $product_id )->post_author;
|
70 |
-
if ( WCV_Vendors::is_vendor( $author_id ) ) {
|
71 |
-
$send_to = get_userdata( $author_id )->user_email;
|
72 |
-
}
|
73 |
-
|
74 |
-
return $send_to;
|
75 |
-
}
|
76 |
-
|
77 |
-
|
78 |
-
/**
|
79 |
-
*
|
80 |
-
*
|
81 |
-
* @param unknown $tabs
|
82 |
-
*
|
83 |
-
* @return unknown
|
84 |
-
*/
|
85 |
-
public static function seller_info_tab( $tabs )
|
86 |
-
{
|
87 |
-
global $post;
|
88 |
-
|
89 |
-
if ( WCV_Vendors::is_vendor( $post->post_author ) ) {
|
90 |
-
|
91 |
-
$seller_info = get_user_meta( $post->post_author, 'pv_seller_info', true );
|
92 |
-
$has_html = get_user_meta( $post->post_author, 'pv_shop_html_enabled', true );
|
93 |
-
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
94 |
-
|
95 |
-
if ( !empty( $seller_info ) ) {
|
96 |
-
|
97 |
-
$seller_info = do_shortcode( $seller_info );
|
98 |
-
self::$seller_info = '<div class="pv_seller_info">';
|
99 |
-
self::$seller_info .= ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $seller_info ) ) ) : sanitize_text_field( $seller_info );
|
100 |
-
self::$seller_info .= '</div>';
|
101 |
-
|
102 |
-
$tabs[ 'seller_info' ] = array(
|
103 |
-
'title' => apply_filters( 'wcvendors_seller_info_label', __( 'Seller info', 'wcvendors' ) ),
|
104 |
-
'priority' => 50,
|
105 |
-
'callback' => array( 'WCV_Vendor_Shop', 'seller_info_tab_panel' ),
|
106 |
-
);
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
return $tabs;
|
111 |
-
}
|
112 |
-
|
113 |
-
|
114 |
-
/**
|
115 |
-
*
|
116 |
-
*/
|
117 |
-
public static function seller_info_tab_panel()
|
118 |
-
{
|
119 |
-
echo self::$seller_info;
|
120 |
-
}
|
121 |
-
|
122 |
-
|
123 |
-
/**
|
124 |
-
* Show the description a vendor sets when viewing products by that vendor
|
125 |
-
*/
|
126 |
-
public static function shop_description()
|
127 |
-
{
|
128 |
-
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
129 |
-
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
130 |
-
|
131 |
-
if ( $vendor_id ) {
|
132 |
-
$has_html = get_user_meta( $vendor_id, 'pv_shop_html_enabled', true );
|
133 |
-
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
134 |
-
$description = do_shortcode( get_user_meta( $vendor_id, 'pv_shop_description', true ) );
|
135 |
-
|
136 |
-
echo '<div class="pv_shop_description">';
|
137 |
-
echo ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $description ) ) ) : sanitize_text_field( $description );
|
138 |
-
echo '</div>';
|
139 |
-
}
|
140 |
-
}
|
141 |
-
|
142 |
-
/**
|
143 |
-
*
|
144 |
-
*/
|
145 |
-
public static function add_rewrite_rules()
|
146 |
-
{
|
147 |
-
$permalink = untrailingslashit( WC_Vendors::$pv_options->get_option( 'vendor_shop_permalink' ) );
|
148 |
-
|
149 |
-
// Remove beginning slash
|
150 |
-
if ( substr( $permalink, 0, 1 ) == '/' ) {
|
151 |
-
$permalink = substr( $permalink, 1, strlen( $permalink ) );
|
152 |
-
}
|
153 |
-
|
154 |
-
add_rewrite_tag( '%vendor_shop%', '([^&]+)' );
|
155 |
-
|
156 |
-
add_rewrite_rule( $permalink . '/([^/]*)/page/([0-9]+)', 'index.php?post_type=product&vendor_shop=$matches[1]&paged=$matches[2]', 'top' );
|
157 |
-
add_rewrite_rule( $permalink . '/([^/]*)', 'index.php?post_type=product&vendor_shop=$matches[1]', 'top' );
|
158 |
-
}
|
159 |
-
|
160 |
-
|
161 |
-
public static function page_title( $page_title = "" )
|
162 |
-
{
|
163 |
-
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
164 |
-
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
165 |
-
|
166 |
-
return $vendor_id ? WCV_Vendors::get_vendor_shop_name( $vendor_id ) : $page_title;
|
167 |
-
}
|
168 |
-
|
169 |
-
|
170 |
-
/*
|
171 |
-
Adding sold by to product loop
|
172 |
-
*/
|
173 |
-
public static function template_loop_sold_by($product_id) {
|
174 |
-
$author = WCV_Vendors::get_vendor_from_product( $product_id );
|
175 |
-
$sold_by = WCV_Vendors::is_vendor( $author )
|
176 |
-
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $author), WCV_Vendors::get_vendor_shop_name( $author ) )
|
177 |
-
: get_bloginfo( 'name' );
|
178 |
-
echo '<small class="wcvendors_sold_by_in_loop">' . apply_filters('wcvendors_sold_by_in_loop', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small> <br />';
|
179 |
-
}
|
180 |
-
|
181 |
-
|
182 |
-
/*
|
183 |
-
* Remove the Page title from Archive-Product while on a vendor Page
|
184 |
-
*/
|
185 |
-
public static function remove_vendor_title() {
|
186 |
-
if ( WCV_Vendors::is_vendor_page() ) {
|
187 |
-
return false;
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
/*
|
192 |
-
* Display a vendor header at the top of the vendors product archive page
|
193 |
-
*/
|
194 |
-
public static function vendor_main_header() {
|
195 |
-
|
196 |
-
// Remove the basic shop description from the loop
|
197 |
-
remove_action( 'woocommerce_before_main_content', array('WCV_Vendor_Shop', 'shop_description' ), 30);
|
198 |
-
|
199 |
-
if (WCV_Vendors::is_vendor_page()) {
|
200 |
-
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
201 |
-
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
202 |
-
$shop_name = get_user_meta( $vendor_id, 'pv_shop_name', true );
|
203 |
-
|
204 |
-
// Shop description
|
205 |
-
$has_html = get_user_meta( $vendor_id, 'pv_shop_html_enabled', true );
|
206 |
-
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
207 |
-
$description = do_shortcode( get_user_meta( $vendor_id, 'pv_shop_description', true ) );
|
208 |
-
$shop_description = ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $description ) ) ) : sanitize_text_field( $description );
|
209 |
-
|
210 |
-
do_action('wcv_before_main_header', $vendor_id);
|
211 |
-
|
212 |
-
wc_get_template( 'vendor-main-header.php', array(
|
213 |
-
'shop_name' => $shop_name,
|
214 |
-
'vendor_id' => $vendor_id,
|
215 |
-
'shop_description' => $shop_description
|
216 |
-
), 'wc-
|
217 |
-
|
218 |
-
do_action('wcv_after_main_header', $vendor_id);
|
219 |
-
|
220 |
-
}
|
221 |
-
}
|
222 |
-
|
223 |
-
|
224 |
-
/*
|
225 |
-
* Display a vendor header at the top of the single-product page
|
226 |
-
*/
|
227 |
-
public static function vendor_mini_header() {
|
228 |
-
|
229 |
-
global $product;
|
230 |
-
|
231 |
-
if (WCV_Vendors::is_vendor_product_page($product->post->post_author)) {
|
232 |
-
|
233 |
-
$vendor = get_userdata( $product->post->post_author );
|
234 |
-
$vendor_shop_link = site_url( WC_Vendors::$pv_options->get_option( 'vendor_shop_permalink' ) .'/' .$vendor->pv_shop_slug );
|
235 |
-
|
236 |
-
$has_html = $vendor->pv_shop_html_enabled;
|
237 |
-
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
238 |
-
$description = do_shortcode( $vendor->pv_shop_description );
|
239 |
-
$shop_description = ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $description ) ) ) : sanitize_text_field( $description );
|
240 |
-
|
241 |
-
do_action('wcv_before_mini_header', $vendor->ID);
|
242 |
-
|
243 |
-
wc_get_template( 'vendor-mini-header.php', array(
|
244 |
-
'vendor' => $vendor,
|
245 |
-
'vendor_shop_link' => $vendor_shop_link,
|
246 |
-
'shop_description' => $shop_description,
|
247 |
-
'shop_name' => $vendor->pv_shop_name,
|
248 |
-
), 'wc-
|
249 |
-
|
250 |
-
do_action('wcv_after_mini_header', $vendor->ID);
|
251 |
-
|
252 |
-
}
|
253 |
-
}
|
254 |
-
|
255 |
-
/*
|
256 |
-
* Add Vendor to Order item Meta
|
257 |
-
* Thanks to Asbjoern Andersen for the code
|
258 |
-
*
|
259 |
-
*/
|
260 |
-
public static function add_vendor_to_order_item_meta( $item_id, $cart_item) {
|
261 |
-
$vendor_id = $cart_item[ 'data' ]->post->post_author;
|
262 |
-
$sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_shop_name( $vendor_id ) ): get_bloginfo( 'name' );
|
263 |
-
wc_add_order_item_meta( $item_id, apply_filters('wcvendors_sold_by_in_email', __('Sold by', 'wcvendors')), $sold_by);
|
264 |
-
}
|
265 |
-
|
266 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Shop functions for each vendor.
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package ProductVendor
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Vendor_Shop
|
12 |
+
{
|
13 |
+
|
14 |
+
public static $seller_info;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* init
|
18 |
+
*/
|
19 |
+
function __construct()
|
20 |
+
{
|
21 |
+
|
22 |
+
add_filter( 'product_enquiry_send_to', array( 'WCV_Vendor_Shop', 'product_enquiry_compatibility' ), 10, 2 );
|
23 |
+
|
24 |
+
add_action( 'woocommerce_product_query', array( $this, 'vendor_shop_query' ), 10, 2 );
|
25 |
+
add_filter( 'init', array( $this, 'add_rewrite_rules' ), 0 );
|
26 |
+
|
27 |
+
add_action( 'woocommerce_before_main_content', array( 'WCV_Vendor_Shop', 'shop_description' ), 30 );
|
28 |
+
add_filter( 'woocommerce_product_tabs', array( 'WCV_Vendor_Shop', 'seller_info_tab' ) );
|
29 |
+
add_filter( 'post_type_archive_link', array( 'WCV_Vendor_Shop', 'change_archive_link' ) );
|
30 |
+
|
31 |
+
// Add sold by to product loop before add to cart
|
32 |
+
add_action( 'woocommerce_after_shop_loop_item', array('WCV_Vendor_Shop', 'template_loop_sold_by'), 9 );
|
33 |
+
|
34 |
+
// Remove Page Title if on Vendor Shop
|
35 |
+
add_filter ( 'woocommerce_show_page_title', array('WCV_Vendor_Shop', 'remove_vendor_title') );
|
36 |
+
|
37 |
+
// Show vendor on all sales related invoices
|
38 |
+
add_action( 'woocommerce_add_order_item_meta', array('WCV_Vendor_Shop', 'add_vendor_to_order_item_meta'), 10, 2 );
|
39 |
+
|
40 |
+
// Add a vendor header
|
41 |
+
if (WC_Vendors::$pv_options->get_option( 'shop_headers_enabled' ) ) {
|
42 |
+
add_action( 'woocommerce_before_main_content', array('WCV_Vendor_Shop', 'vendor_main_header'), 20 );
|
43 |
+
add_action( 'woocommerce_before_single_product', array('WCV_Vendor_Shop', 'vendor_mini_header'));
|
44 |
+
}
|
45 |
+
|
46 |
+
}
|
47 |
+
|
48 |
+
public static function change_archive_link( $link )
|
49 |
+
{
|
50 |
+
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
51 |
+
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
52 |
+
|
53 |
+
return !$vendor_id ? $link : WCV_Vendors::get_vendor_shop_page( $vendor_id );
|
54 |
+
}
|
55 |
+
|
56 |
+
public static function vendor_shop_query( $q, $that )
|
57 |
+
{
|
58 |
+
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
59 |
+
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
60 |
+
|
61 |
+
if ( !$vendor_id ) return;
|
62 |
+
add_filter( 'woocommerce_page_title', array( 'WCV_Vendor_Shop', 'page_title' ) );
|
63 |
+
|
64 |
+
$q->set( 'author', $vendor_id );
|
65 |
+
}
|
66 |
+
|
67 |
+
public static function product_enquiry_compatibility( $send_to, $product_id )
|
68 |
+
{
|
69 |
+
$author_id = get_post( $product_id )->post_author;
|
70 |
+
if ( WCV_Vendors::is_vendor( $author_id ) ) {
|
71 |
+
$send_to = get_userdata( $author_id )->user_email;
|
72 |
+
}
|
73 |
+
|
74 |
+
return $send_to;
|
75 |
+
}
|
76 |
+
|
77 |
+
|
78 |
+
/**
|
79 |
+
*
|
80 |
+
*
|
81 |
+
* @param unknown $tabs
|
82 |
+
*
|
83 |
+
* @return unknown
|
84 |
+
*/
|
85 |
+
public static function seller_info_tab( $tabs )
|
86 |
+
{
|
87 |
+
global $post;
|
88 |
+
|
89 |
+
if ( WCV_Vendors::is_vendor( $post->post_author ) ) {
|
90 |
+
|
91 |
+
$seller_info = get_user_meta( $post->post_author, 'pv_seller_info', true );
|
92 |
+
$has_html = get_user_meta( $post->post_author, 'pv_shop_html_enabled', true );
|
93 |
+
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
94 |
+
|
95 |
+
if ( !empty( $seller_info ) ) {
|
96 |
+
|
97 |
+
$seller_info = do_shortcode( $seller_info );
|
98 |
+
self::$seller_info = '<div class="pv_seller_info">';
|
99 |
+
self::$seller_info .= ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $seller_info ) ) ) : sanitize_text_field( $seller_info );
|
100 |
+
self::$seller_info .= '</div>';
|
101 |
+
|
102 |
+
$tabs[ 'seller_info' ] = array(
|
103 |
+
'title' => apply_filters( 'wcvendors_seller_info_label', __( 'Seller info', 'wcvendors' ) ),
|
104 |
+
'priority' => 50,
|
105 |
+
'callback' => array( 'WCV_Vendor_Shop', 'seller_info_tab_panel' ),
|
106 |
+
);
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
return $tabs;
|
111 |
+
}
|
112 |
+
|
113 |
+
|
114 |
+
/**
|
115 |
+
*
|
116 |
+
*/
|
117 |
+
public static function seller_info_tab_panel()
|
118 |
+
{
|
119 |
+
echo self::$seller_info;
|
120 |
+
}
|
121 |
+
|
122 |
+
|
123 |
+
/**
|
124 |
+
* Show the description a vendor sets when viewing products by that vendor
|
125 |
+
*/
|
126 |
+
public static function shop_description()
|
127 |
+
{
|
128 |
+
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
129 |
+
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
130 |
+
|
131 |
+
if ( $vendor_id ) {
|
132 |
+
$has_html = get_user_meta( $vendor_id, 'pv_shop_html_enabled', true );
|
133 |
+
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
134 |
+
$description = do_shortcode( get_user_meta( $vendor_id, 'pv_shop_description', true ) );
|
135 |
+
|
136 |
+
echo '<div class="pv_shop_description">';
|
137 |
+
echo ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $description ) ) ) : sanitize_text_field( $description );
|
138 |
+
echo '</div>';
|
139 |
+
}
|
140 |
+
}
|
141 |
+
|
142 |
+
/**
|
143 |
+
*
|
144 |
+
*/
|
145 |
+
public static function add_rewrite_rules()
|
146 |
+
{
|
147 |
+
$permalink = untrailingslashit( WC_Vendors::$pv_options->get_option( 'vendor_shop_permalink' ) );
|
148 |
+
|
149 |
+
// Remove beginning slash
|
150 |
+
if ( substr( $permalink, 0, 1 ) == '/' ) {
|
151 |
+
$permalink = substr( $permalink, 1, strlen( $permalink ) );
|
152 |
+
}
|
153 |
+
|
154 |
+
add_rewrite_tag( '%vendor_shop%', '([^&]+)' );
|
155 |
+
|
156 |
+
add_rewrite_rule( $permalink . '/([^/]*)/page/([0-9]+)', 'index.php?post_type=product&vendor_shop=$matches[1]&paged=$matches[2]', 'top' );
|
157 |
+
add_rewrite_rule( $permalink . '/([^/]*)', 'index.php?post_type=product&vendor_shop=$matches[1]', 'top' );
|
158 |
+
}
|
159 |
+
|
160 |
+
|
161 |
+
public static function page_title( $page_title = "" )
|
162 |
+
{
|
163 |
+
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
164 |
+
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
165 |
+
|
166 |
+
return $vendor_id ? WCV_Vendors::get_vendor_shop_name( $vendor_id ) : $page_title;
|
167 |
+
}
|
168 |
+
|
169 |
+
|
170 |
+
/*
|
171 |
+
Adding sold by to product loop
|
172 |
+
*/
|
173 |
+
public static function template_loop_sold_by($product_id) {
|
174 |
+
$author = WCV_Vendors::get_vendor_from_product( $product_id );
|
175 |
+
$sold_by = WCV_Vendors::is_vendor( $author )
|
176 |
+
? sprintf( '<a href="%s">%s</a>', WCV_Vendors::get_vendor_shop_page( $author), WCV_Vendors::get_vendor_shop_name( $author ) )
|
177 |
+
: get_bloginfo( 'name' );
|
178 |
+
echo '<small class="wcvendors_sold_by_in_loop">' . apply_filters('wcvendors_sold_by_in_loop', __( 'Sold by: ', 'wcvendors' )). $sold_by . '</small> <br />';
|
179 |
+
}
|
180 |
+
|
181 |
+
|
182 |
+
/*
|
183 |
+
* Remove the Page title from Archive-Product while on a vendor Page
|
184 |
+
*/
|
185 |
+
public static function remove_vendor_title() {
|
186 |
+
if ( WCV_Vendors::is_vendor_page() ) {
|
187 |
+
return false;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
/*
|
192 |
+
* Display a vendor header at the top of the vendors product archive page
|
193 |
+
*/
|
194 |
+
public static function vendor_main_header() {
|
195 |
+
|
196 |
+
// Remove the basic shop description from the loop
|
197 |
+
remove_action( 'woocommerce_before_main_content', array('WCV_Vendor_Shop', 'shop_description' ), 30);
|
198 |
+
|
199 |
+
if (WCV_Vendors::is_vendor_page()) {
|
200 |
+
$vendor_shop = urldecode( get_query_var( 'vendor_shop' ) );
|
201 |
+
$vendor_id = WCV_Vendors::get_vendor_id( $vendor_shop );
|
202 |
+
$shop_name = get_user_meta( $vendor_id, 'pv_shop_name', true );
|
203 |
+
|
204 |
+
// Shop description
|
205 |
+
$has_html = get_user_meta( $vendor_id, 'pv_shop_html_enabled', true );
|
206 |
+
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
207 |
+
$description = do_shortcode( get_user_meta( $vendor_id, 'pv_shop_description', true ) );
|
208 |
+
$shop_description = ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $description ) ) ) : sanitize_text_field( $description );
|
209 |
+
|
210 |
+
do_action('wcv_before_main_header', $vendor_id);
|
211 |
+
|
212 |
+
wc_get_template( 'vendor-main-header.php', array(
|
213 |
+
'shop_name' => $shop_name,
|
214 |
+
'vendor_id' => $vendor_id,
|
215 |
+
'shop_description' => $shop_description
|
216 |
+
), 'wc-vendors/front/', wcv_plugin_dir . 'templates/front/' );
|
217 |
+
|
218 |
+
do_action('wcv_after_main_header', $vendor_id);
|
219 |
+
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
|
224 |
+
/*
|
225 |
+
* Display a vendor header at the top of the single-product page
|
226 |
+
*/
|
227 |
+
public static function vendor_mini_header() {
|
228 |
+
|
229 |
+
global $product;
|
230 |
+
|
231 |
+
if (WCV_Vendors::is_vendor_product_page($product->post->post_author)) {
|
232 |
+
|
233 |
+
$vendor = get_userdata( $product->post->post_author );
|
234 |
+
$vendor_shop_link = site_url( WC_Vendors::$pv_options->get_option( 'vendor_shop_permalink' ) .'/' .$vendor->pv_shop_slug );
|
235 |
+
|
236 |
+
$has_html = $vendor->pv_shop_html_enabled;
|
237 |
+
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
238 |
+
$description = do_shortcode( $vendor->pv_shop_description );
|
239 |
+
$shop_description = ( $global_html || $has_html ) ? wpautop( wptexturize( wp_kses_post( $description ) ) ) : sanitize_text_field( $description );
|
240 |
+
|
241 |
+
do_action('wcv_before_mini_header', $vendor->ID);
|
242 |
+
|
243 |
+
wc_get_template( 'vendor-mini-header.php', array(
|
244 |
+
'vendor' => $vendor,
|
245 |
+
'vendor_shop_link' => $vendor_shop_link,
|
246 |
+
'shop_description' => $shop_description,
|
247 |
+
'shop_name' => $vendor->pv_shop_name,
|
248 |
+
), 'wc-vendors/front/', wcv_plugin_dir . 'templates/front/' );
|
249 |
+
|
250 |
+
do_action('wcv_after_mini_header', $vendor->ID);
|
251 |
+
|
252 |
+
}
|
253 |
+
}
|
254 |
+
|
255 |
+
/*
|
256 |
+
* Add Vendor to Order item Meta
|
257 |
+
* Thanks to Asbjoern Andersen for the code
|
258 |
+
*
|
259 |
+
*/
|
260 |
+
public static function add_vendor_to_order_item_meta( $item_id, $cart_item) {
|
261 |
+
$vendor_id = $cart_item[ 'data' ]->post->post_author;
|
262 |
+
$sold_by = WCV_Vendors::is_vendor( $vendor_id ) ? sprintf( WCV_Vendors::get_vendor_shop_name( $vendor_id ) ): get_bloginfo( 'name' );
|
263 |
+
wc_add_order_item_meta( $item_id, apply_filters('wcvendors_sold_by_in_email', __('Sold by', 'wcvendors')), $sold_by);
|
264 |
+
}
|
265 |
+
|
266 |
+
}
|
{WCVendors/classes → classes}/front/dashboard/class-vendor-dashboard.php
RENAMED
@@ -1,378 +1,378 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* My account views
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package ProductVendor
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Vendor_Dashboard
|
12 |
-
{
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* __construct()
|
17 |
-
*/
|
18 |
-
function __construct()
|
19 |
-
{
|
20 |
-
add_shortcode( 'wcv_shop_settings', array( $this, 'display_vendor_settings' ) );
|
21 |
-
add_shortcode( 'wcv_vendor_dashboard', array( $this, 'display_vendor_products' ) );
|
22 |
-
|
23 |
-
add_action( 'template_redirect', array( $this, 'check_access' ) );
|
24 |
-
add_action( 'init', array( $this, 'save_vendor_settings' ) );
|
25 |
-
}
|
26 |
-
|
27 |
-
public function save_vendor_settings()
|
28 |
-
{
|
29 |
-
global $woocommerce;
|
30 |
-
|
31 |
-
$user_id = get_current_user_id();
|
32 |
-
|
33 |
-
if ( !empty( $_GET['wc_pv_mark_shipped'] ) ) {
|
34 |
-
$order_id = $_GET['wc_pv_mark_shipped'];
|
35 |
-
$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
|
36 |
-
|
37 |
-
// If not in the shippers array mark as shipped otherwise do nothing.
|
38 |
-
if( !in_array($user_id, $shippers)) {
|
39 |
-
$shippers[] = $user_id;
|
40 |
-
$mails = $woocommerce->mailer()->get_emails();
|
41 |
-
if ( !empty( $mails ) ) {
|
42 |
-
$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );
|
43 |
-
}
|
44 |
-
do_action('wcvendors_vendor_ship', $order_id, $user_id);
|
45 |
-
wc_add_notice( __( 'Order marked shipped.', 'wcvendors' ), 'success' );
|
46 |
-
}
|
47 |
-
|
48 |
-
update_post_meta( $order_id, 'wc_pv_shipped', $shippers );
|
49 |
-
return;
|
50 |
-
}
|
51 |
-
|
52 |
-
if ( isset( $_POST[ 'update_tracking' ] ) ) {
|
53 |
-
$order_id = (int) $_POST[ 'order_id' ];
|
54 |
-
$product_id = (int) $_POST[ 'product_id' ];
|
55 |
-
|
56 |
-
$tracking_provider = woocommerce_clean( $_POST[ 'tracking_provider' ] );
|
57 |
-
$custom_tracking_provider = woocommerce_clean( $_POST[ 'custom_tracking_provider' ] );
|
58 |
-
$custom_tracking_link = woocommerce_clean( $_POST[ 'custom_tracking_link' ] );
|
59 |
-
$tracking_number = woocommerce_clean( $_POST[ 'tracking_number' ] );
|
60 |
-
$date_shipped = woocommerce_clean( strtotime( $_POST[ 'date_shipped' ] ) );
|
61 |
-
|
62 |
-
$order = new WC_Order( $order_id );
|
63 |
-
$products = $order->get_items();
|
64 |
-
foreach ( $products as $key => $value ) {
|
65 |
-
if ( $value[ 'product_id' ] == $product_id || $value[ 'variation_id' ] == $product_id ) {
|
66 |
-
$order_item_id = $key;
|
67 |
-
break;
|
68 |
-
}
|
69 |
-
}
|
70 |
-
if ( $order_item_id ) {
|
71 |
-
woocommerce_delete_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ) );
|
72 |
-
woocommerce_add_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ), $tracking_number );
|
73 |
-
|
74 |
-
$message = __( 'Success. Your tracking number has been updated.', 'wcvendors' );
|
75 |
-
wc_add_notice( $message, 'success' );
|
76 |
-
|
77 |
-
// Update order data
|
78 |
-
update_post_meta( $order_id, '_tracking_provider', $tracking_provider );
|
79 |
-
update_post_meta( $order_id, '_custom_tracking_provider', $custom_tracking_provider );
|
80 |
-
update_post_meta( $order_id, '_tracking_number', $tracking_number );
|
81 |
-
update_post_meta( $order_id, '_custom_tracking_link', $custom_tracking_link );
|
82 |
-
update_post_meta( $order_id, '_date_shipped', $date_shipped );
|
83 |
-
}
|
84 |
-
|
85 |
-
}
|
86 |
-
|
87 |
-
if ( empty( $_POST[ 'vendor_application_submit' ] ) ) {
|
88 |
-
return false;
|
89 |
-
}
|
90 |
-
|
91 |
-
if ( !wp_verify_nonce( $_POST[ 'wc-product-vendor-nonce' ], 'save-shop-settings' ) ) {
|
92 |
-
return false;
|
93 |
-
}
|
94 |
-
|
95 |
-
|
96 |
-
if ( isset( $_POST[ 'pv_paypal' ] ) ) {
|
97 |
-
if ( !is_email( $_POST[ 'pv_paypal' ] ) ) {
|
98 |
-
wc_add_notice( __( 'Your PayPal address is not a valid email address.', 'wcvendors' ), 'error' );
|
99 |
-
} else {
|
100 |
-
update_user_meta( $user_id, 'pv_paypal', $_POST[ 'pv_paypal' ] );
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
if ( !empty( $_POST[ 'pv_shop_name' ] ) ) {
|
105 |
-
$users = get_users( array( 'meta_key' => 'pv_shop_slug', 'meta_value' => sanitize_title( $_POST[ 'pv_shop_name' ] ) ) );
|
106 |
-
if ( !empty( $users ) && $users[ 0 ]->ID != $user_id ) {
|
107 |
-
wc_add_notice( __( 'That shop name is already taken. Your shop name must be unique.', 'wcvendors' ), 'error' );
|
108 |
-
} else {
|
109 |
-
update_user_meta( $user_id, 'pv_shop_name', $_POST[ 'pv_shop_name' ] );
|
110 |
-
update_user_meta( $user_id, 'pv_shop_slug', sanitize_title( $_POST[ 'pv_shop_name' ] ) );
|
111 |
-
}
|
112 |
-
}
|
113 |
-
|
114 |
-
if ( isset( $_POST[ 'pv_shop_description' ] ) ) {
|
115 |
-
update_user_meta( $user_id, 'pv_shop_description', $_POST[ 'pv_shop_description' ] );
|
116 |
-
}
|
117 |
-
|
118 |
-
if ( isset( $_POST[ 'pv_seller_info' ] ) ) {
|
119 |
-
update_user_meta( $user_id, 'pv_seller_info', $_POST[ 'pv_seller_info' ] );
|
120 |
-
}
|
121 |
-
|
122 |
-
do_action( 'wcvendors_shop_settings_saved', $user_id );
|
123 |
-
|
124 |
-
if ( !wc_notice_count() ) {
|
125 |
-
wc_add_notice( __( 'Settings saved.', 'wcvendors' ), 'success' );
|
126 |
-
}
|
127 |
-
}
|
128 |
-
|
129 |
-
|
130 |
-
/**
|
131 |
-
*
|
132 |
-
*/
|
133 |
-
public function check_access()
|
134 |
-
{
|
135 |
-
$vendor_dashboard_page = WC_Vendors::$pv_options->get_option( 'vendor_dashboard_page' );
|
136 |
-
$shop_settings_page = WC_Vendors::$pv_options->get_option( 'shop_settings_page' );
|
137 |
-
|
138 |
-
if ( ( is_page( $vendor_dashboard_page ) || is_page( $shop_settings_page ) ) && !is_user_logged_in() ) {
|
139 |
-
wp_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
|
140 |
-
exit;
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
|
145 |
-
/**
|
146 |
-
* [wcv_vendor_dashboard] shortcode
|
147 |
-
*
|
148 |
-
* @param array $atts
|
149 |
-
*
|
150 |
-
* @return unknown
|
151 |
-
*/
|
152 |
-
public function display_vendor_products( $atts )
|
153 |
-
{
|
154 |
-
global $start_date, $end_date;
|
155 |
-
|
156 |
-
$start_date = !empty( $_SESSION[ 'PV_Session' ][ 'start_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
|
157 |
-
$end_date = !empty( $_SESSION[ 'PV_Session' ][ 'end_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
|
158 |
-
|
159 |
-
$can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
|
160 |
-
$settings_page = get_permalink( WC_Vendors::$pv_options->get_option( 'shop_settings_page' ) );
|
161 |
-
$can_submit = WC_Vendors::$pv_options->get_option( 'can_submit_products' );
|
162 |
-
if ( $can_submit ) $submit_link = admin_url( 'post-new.php?post_type=product' );
|
163 |
-
if ( $can_submit ) $edit_link = admin_url( 'edit.php?post_type=product' );
|
164 |
-
|
165 |
-
if ( !$this->can_view_vendor_page() ) {
|
166 |
-
return false;
|
167 |
-
}
|
168 |
-
|
169 |
-
extract( shortcode_atts( array(
|
170 |
-
'user_id' => get_current_user_id(),
|
171 |
-
'datepicker' => true,
|
172 |
-
), $atts ) );
|
173 |
-
|
174 |
-
$vendor_products = WCV_Queries::get_commission_products( $user_id );
|
175 |
-
$products = array();
|
176 |
-
foreach ($vendor_products as $_product) {
|
177 |
-
$products[] = $_product->ID;
|
178 |
-
}
|
179 |
-
|
180 |
-
$vendor_summary = $this->format_product_details( $vendor_products );
|
181 |
-
$order_summary = WCV_Queries::get_orders_for_products( $products );
|
182 |
-
$shop_page = WCV_Vendors::get_vendor_shop_page( wp_get_current_user()->user_login );
|
183 |
-
|
184 |
-
wp_enqueue_style( 'wcv_frontend_style', wcv_assets_url . 'css/wcv-frontend.css' );
|
185 |
-
|
186 |
-
// WC Shipment Tracking Providers
|
187 |
-
global $WC_Shipment_Tracking;
|
188 |
-
|
189 |
-
$providers = !empty( $WC_Shipment_Tracking->providers ) ? $WC_Shipment_Tracking->providers : false;
|
190 |
-
$provider_array = array();
|
191 |
-
|
192 |
-
if ( $providers ) {
|
193 |
-
foreach ( $providers as $providerss ) {
|
194 |
-
foreach ( $providerss as $provider => $format ) {
|
195 |
-
$provider_array[ sanitize_title( $provider ) ] = urlencode( $format );
|
196 |
-
}
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
200 |
-
ob_start();
|
201 |
-
do_action( 'wcvendors_before_dashboard' );
|
202 |
-
|
203 |
-
wc_print_notices();
|
204 |
-
wc_get_template( 'links.php', array(
|
205 |
-
'shop_page' => urldecode($shop_page),
|
206 |
-
'settings_page' => $settings_page,
|
207 |
-
'can_submit' => $can_submit,
|
208 |
-
'submit_link' => $submit_link,
|
209 |
-
'edit_link' => $edit_link,
|
210 |
-
), 'wc-
|
211 |
-
|
212 |
-
if ( $can_view_sales = WC_Vendors::$pv_options->get_option( 'can_view_frontend_reports' ) ) {
|
213 |
-
|
214 |
-
wc_get_template( 'reports.php', array(
|
215 |
-
'start_date' => $start_date,
|
216 |
-
'end_date' => $end_date,
|
217 |
-
'vendor_products' => $vendor_products,
|
218 |
-
'vendor_summary' => $vendor_summary,
|
219 |
-
'datepicker' => $datepicker,
|
220 |
-
'can_view_orders' => $can_view_orders,
|
221 |
-
), 'wc-
|
222 |
-
}
|
223 |
-
|
224 |
-
wc_get_template( 'orders.php', array(
|
225 |
-
'start_date' => $start_date,
|
226 |
-
'end_date' => $end_date,
|
227 |
-
'vendor_products' => $vendor_products,
|
228 |
-
'order_summary' => $order_summary,
|
229 |
-
'datepicker' => $datepicker,
|
230 |
-
'providers' => $providers,
|
231 |
-
'provider_array' => $provider_array,
|
232 |
-
'can_view_orders' => $can_view_orders,
|
233 |
-
), 'wc-
|
234 |
-
do_action( 'wcvendors_after_dashboard' );
|
235 |
-
|
236 |
-
return ob_get_clean();
|
237 |
-
}
|
238 |
-
|
239 |
-
|
240 |
-
/**
|
241 |
-
* [pv_recent_vendor_sales] shortcode
|
242 |
-
*
|
243 |
-
* @param array $atts
|
244 |
-
*
|
245 |
-
* @return unknown
|
246 |
-
*/
|
247 |
-
public function display_vendor_settings( $atts )
|
248 |
-
{
|
249 |
-
global $woocommerce;
|
250 |
-
|
251 |
-
if ( !$this->can_view_vendor_page() ) {
|
252 |
-
return false;
|
253 |
-
}
|
254 |
-
|
255 |
-
extract( shortcode_atts( array(
|
256 |
-
'user_id' => get_current_user_id(),
|
257 |
-
'paypal_address' => true,
|
258 |
-
'shop_description' => true,
|
259 |
-
), $atts ) );
|
260 |
-
|
261 |
-
$description = get_user_meta( $user_id, 'pv_shop_description', true );
|
262 |
-
$seller_info = get_user_meta( $user_id, 'pv_seller_info', true );
|
263 |
-
$has_html = get_user_meta( $user_id, 'pv_shop_html_enabled', true );
|
264 |
-
$shop_page = WCV_Vendors::get_vendor_shop_page( wp_get_current_user()->user_login );
|
265 |
-
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
266 |
-
|
267 |
-
ob_start();
|
268 |
-
wc_get_template( 'settings.php', array(
|
269 |
-
'description' => $description,
|
270 |
-
'global_html' => $global_html,
|
271 |
-
'has_html' => $has_html,
|
272 |
-
'paypal_address' => $paypal_address,
|
273 |
-
'seller_info' => $seller_info,
|
274 |
-
'shop_description' => $shop_description,
|
275 |
-
'shop_page' => $shop_page,
|
276 |
-
'user_id' => $user_id,
|
277 |
-
), 'wc-
|
278 |
-
|
279 |
-
return ob_get_clean();
|
280 |
-
}
|
281 |
-
|
282 |
-
|
283 |
-
/**
|
284 |
-
*
|
285 |
-
*
|
286 |
-
* @return unknown
|
287 |
-
*/
|
288 |
-
public function can_view_vendor_page()
|
289 |
-
{
|
290 |
-
if ( !is_user_logged_in() ) {
|
291 |
-
|
292 |
-
return false;
|
293 |
-
|
294 |
-
} else if ( !WCV_Vendors::is_vendor( get_current_user_id() ) ) {
|
295 |
-
|
296 |
-
wc_get_template( 'denied.php', array(), 'wc-
|
297 |
-
|
298 |
-
return false;
|
299 |
-
|
300 |
-
}
|
301 |
-
|
302 |
-
return true;
|
303 |
-
}
|
304 |
-
|
305 |
-
|
306 |
-
/**
|
307 |
-
* Format products for easier displaying
|
308 |
-
*
|
309 |
-
* @param object $products
|
310 |
-
*
|
311 |
-
* @return array
|
312 |
-
*/
|
313 |
-
public function format_product_details( $products )
|
314 |
-
{
|
315 |
-
if ( empty( $products ) ) return false;
|
316 |
-
|
317 |
-
$orders_page = get_permalink( WC_Vendors::$pv_options->get_option( 'orders_page' ) );
|
318 |
-
$default_commission = WC_Vendors::$pv_options->get_option( 'default_commission' );
|
319 |
-
$total_qty = $total_cost = 0;
|
320 |
-
$data = array(
|
321 |
-
'products' => array(),
|
322 |
-
'total_qty' => '',
|
323 |
-
'total_cost' => '',
|
324 |
-
);
|
325 |
-
|
326 |
-
foreach ( $products as $product )
|
327 |
-
$ids[ ] = $product->ID;
|
328 |
-
|
329 |
-
$orders = WCV_Queries::sum_orders_for_products( $ids, array( 'vendor_id' => get_current_user_id() ) );
|
330 |
-
|
331 |
-
if ( $orders )
|
332 |
-
foreach ( $orders as $order_item ) {
|
333 |
-
if ( $order_item->qty < 1 ) continue;
|
334 |
-
|
335 |
-
$commission_rate = WCV_Commission::get_commission_rate( $order_item->product_id );
|
336 |
-
$_product = get_product( $order_item->product_id );
|
337 |
-
$id = !empty($_product->parent->id) ? $_product->parent->id : $order_item->product_id;
|
338 |
-
|
339 |
-
$data[ 'products' ][$id] = array(
|
340 |
-
'id' => $id,
|
341 |
-
'title' => $_product->get_title(),
|
342 |
-
'qty' => !empty($data[ 'products' ][$id]) ? $data[ 'products' ][$id]['qty'] + $order_item->qty : $order_item->qty,
|
343 |
-
'cost' => !empty($data[ 'products' ][$id]) ? $data[ 'products' ][$id]['cost'] + $order_item->line_total : $order_item->line_total,
|
344 |
-
'view_orders_url' => esc_url( add_query_arg( 'orders_for_product', $id, $orders_page ) ),
|
345 |
-
'commission_rate' => $commission_rate,
|
346 |
-
);
|
347 |
-
|
348 |
-
$total_qty += $order_item->qty;
|
349 |
-
$total_cost += $order_item->line_total;
|
350 |
-
|
351 |
-
}
|
352 |
-
|
353 |
-
$data[ 'total_qty' ] = $total_qty;
|
354 |
-
$data[ 'total_cost' ] = $total_cost;
|
355 |
-
|
356 |
-
// Sort by product title
|
357 |
-
if ( !empty( $data[ 'products' ] ) )
|
358 |
-
usort( $data[ 'products' ], array( $this, 'sort_by_title' ) );
|
359 |
-
|
360 |
-
return $data;
|
361 |
-
}
|
362 |
-
|
363 |
-
|
364 |
-
/**
|
365 |
-
* Sort an array by 'title'
|
366 |
-
*
|
367 |
-
* @param array $a
|
368 |
-
* @param array $b
|
369 |
-
*
|
370 |
-
* @return array
|
371 |
-
*/
|
372 |
-
private function sort_by_title( array $a, array $b )
|
373 |
-
{
|
374 |
-
return strcasecmp( $a[ 'title' ], $b[ 'title' ] );
|
375 |
-
}
|
376 |
-
|
377 |
-
|
378 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* My account views
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package ProductVendor
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Vendor_Dashboard
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* __construct()
|
17 |
+
*/
|
18 |
+
function __construct()
|
19 |
+
{
|
20 |
+
add_shortcode( 'wcv_shop_settings', array( $this, 'display_vendor_settings' ) );
|
21 |
+
add_shortcode( 'wcv_vendor_dashboard', array( $this, 'display_vendor_products' ) );
|
22 |
+
|
23 |
+
add_action( 'template_redirect', array( $this, 'check_access' ) );
|
24 |
+
add_action( 'init', array( $this, 'save_vendor_settings' ) );
|
25 |
+
}
|
26 |
+
|
27 |
+
public function save_vendor_settings()
|
28 |
+
{
|
29 |
+
global $woocommerce;
|
30 |
+
|
31 |
+
$user_id = get_current_user_id();
|
32 |
+
|
33 |
+
if ( !empty( $_GET['wc_pv_mark_shipped'] ) ) {
|
34 |
+
$order_id = $_GET['wc_pv_mark_shipped'];
|
35 |
+
$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );
|
36 |
+
|
37 |
+
// If not in the shippers array mark as shipped otherwise do nothing.
|
38 |
+
if( !in_array($user_id, $shippers)) {
|
39 |
+
$shippers[] = $user_id;
|
40 |
+
$mails = $woocommerce->mailer()->get_emails();
|
41 |
+
if ( !empty( $mails ) ) {
|
42 |
+
$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );
|
43 |
+
}
|
44 |
+
do_action('wcvendors_vendor_ship', $order_id, $user_id);
|
45 |
+
wc_add_notice( __( 'Order marked shipped.', 'wcvendors' ), 'success' );
|
46 |
+
}
|
47 |
+
|
48 |
+
update_post_meta( $order_id, 'wc_pv_shipped', $shippers );
|
49 |
+
return;
|
50 |
+
}
|
51 |
+
|
52 |
+
if ( isset( $_POST[ 'update_tracking' ] ) ) {
|
53 |
+
$order_id = (int) $_POST[ 'order_id' ];
|
54 |
+
$product_id = (int) $_POST[ 'product_id' ];
|
55 |
+
|
56 |
+
$tracking_provider = woocommerce_clean( $_POST[ 'tracking_provider' ] );
|
57 |
+
$custom_tracking_provider = woocommerce_clean( $_POST[ 'custom_tracking_provider' ] );
|
58 |
+
$custom_tracking_link = woocommerce_clean( $_POST[ 'custom_tracking_link' ] );
|
59 |
+
$tracking_number = woocommerce_clean( $_POST[ 'tracking_number' ] );
|
60 |
+
$date_shipped = woocommerce_clean( strtotime( $_POST[ 'date_shipped' ] ) );
|
61 |
+
|
62 |
+
$order = new WC_Order( $order_id );
|
63 |
+
$products = $order->get_items();
|
64 |
+
foreach ( $products as $key => $value ) {
|
65 |
+
if ( $value[ 'product_id' ] == $product_id || $value[ 'variation_id' ] == $product_id ) {
|
66 |
+
$order_item_id = $key;
|
67 |
+
break;
|
68 |
+
}
|
69 |
+
}
|
70 |
+
if ( $order_item_id ) {
|
71 |
+
woocommerce_delete_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ) );
|
72 |
+
woocommerce_add_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ), $tracking_number );
|
73 |
+
|
74 |
+
$message = __( 'Success. Your tracking number has been updated.', 'wcvendors' );
|
75 |
+
wc_add_notice( $message, 'success' );
|
76 |
+
|
77 |
+
// Update order data
|
78 |
+
update_post_meta( $order_id, '_tracking_provider', $tracking_provider );
|
79 |
+
update_post_meta( $order_id, '_custom_tracking_provider', $custom_tracking_provider );
|
80 |
+
update_post_meta( $order_id, '_tracking_number', $tracking_number );
|
81 |
+
update_post_meta( $order_id, '_custom_tracking_link', $custom_tracking_link );
|
82 |
+
update_post_meta( $order_id, '_date_shipped', $date_shipped );
|
83 |
+
}
|
84 |
+
|
85 |
+
}
|
86 |
+
|
87 |
+
if ( empty( $_POST[ 'vendor_application_submit' ] ) ) {
|
88 |
+
return false;
|
89 |
+
}
|
90 |
+
|
91 |
+
if ( !wp_verify_nonce( $_POST[ 'wc-product-vendor-nonce' ], 'save-shop-settings' ) ) {
|
92 |
+
return false;
|
93 |
+
}
|
94 |
+
|
95 |
+
|
96 |
+
if ( isset( $_POST[ 'pv_paypal' ] ) ) {
|
97 |
+
if ( !is_email( $_POST[ 'pv_paypal' ] ) ) {
|
98 |
+
wc_add_notice( __( 'Your PayPal address is not a valid email address.', 'wcvendors' ), 'error' );
|
99 |
+
} else {
|
100 |
+
update_user_meta( $user_id, 'pv_paypal', $_POST[ 'pv_paypal' ] );
|
101 |
+
}
|
102 |
+
}
|
103 |
+
|
104 |
+
if ( !empty( $_POST[ 'pv_shop_name' ] ) ) {
|
105 |
+
$users = get_users( array( 'meta_key' => 'pv_shop_slug', 'meta_value' => sanitize_title( $_POST[ 'pv_shop_name' ] ) ) );
|
106 |
+
if ( !empty( $users ) && $users[ 0 ]->ID != $user_id ) {
|
107 |
+
wc_add_notice( __( 'That shop name is already taken. Your shop name must be unique.', 'wcvendors' ), 'error' );
|
108 |
+
} else {
|
109 |
+
update_user_meta( $user_id, 'pv_shop_name', $_POST[ 'pv_shop_name' ] );
|
110 |
+
update_user_meta( $user_id, 'pv_shop_slug', sanitize_title( $_POST[ 'pv_shop_name' ] ) );
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
if ( isset( $_POST[ 'pv_shop_description' ] ) ) {
|
115 |
+
update_user_meta( $user_id, 'pv_shop_description', $_POST[ 'pv_shop_description' ] );
|
116 |
+
}
|
117 |
+
|
118 |
+
if ( isset( $_POST[ 'pv_seller_info' ] ) ) {
|
119 |
+
update_user_meta( $user_id, 'pv_seller_info', $_POST[ 'pv_seller_info' ] );
|
120 |
+
}
|
121 |
+
|
122 |
+
do_action( 'wcvendors_shop_settings_saved', $user_id );
|
123 |
+
|
124 |
+
if ( !wc_notice_count() ) {
|
125 |
+
wc_add_notice( __( 'Settings saved.', 'wcvendors' ), 'success' );
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
/**
|
131 |
+
*
|
132 |
+
*/
|
133 |
+
public function check_access()
|
134 |
+
{
|
135 |
+
$vendor_dashboard_page = WC_Vendors::$pv_options->get_option( 'vendor_dashboard_page' );
|
136 |
+
$shop_settings_page = WC_Vendors::$pv_options->get_option( 'shop_settings_page' );
|
137 |
+
|
138 |
+
if ( ( is_page( $vendor_dashboard_page ) || is_page( $shop_settings_page ) ) && !is_user_logged_in() ) {
|
139 |
+
wp_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
|
140 |
+
exit;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
|
145 |
+
/**
|
146 |
+
* [wcv_vendor_dashboard] shortcode
|
147 |
+
*
|
148 |
+
* @param array $atts
|
149 |
+
*
|
150 |
+
* @return unknown
|
151 |
+
*/
|
152 |
+
public function display_vendor_products( $atts )
|
153 |
+
{
|
154 |
+
global $start_date, $end_date;
|
155 |
+
|
156 |
+
$start_date = !empty( $_SESSION[ 'PV_Session' ][ 'start_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'start_date' ] : strtotime( date( 'Ymd', strtotime( date( 'Ym', current_time( 'timestamp' ) ) . '01' ) ) );
|
157 |
+
$end_date = !empty( $_SESSION[ 'PV_Session' ][ 'end_date' ] ) ? $_SESSION[ 'PV_Session' ][ 'end_date' ] : strtotime( date( 'Ymd', current_time( 'timestamp' ) ) );
|
158 |
+
|
159 |
+
$can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
|
160 |
+
$settings_page = get_permalink( WC_Vendors::$pv_options->get_option( 'shop_settings_page' ) );
|
161 |
+
$can_submit = WC_Vendors::$pv_options->get_option( 'can_submit_products' );
|
162 |
+
if ( $can_submit ) $submit_link = admin_url( 'post-new.php?post_type=product' );
|
163 |
+
if ( $can_submit ) $edit_link = admin_url( 'edit.php?post_type=product' );
|
164 |
+
|
165 |
+
if ( !$this->can_view_vendor_page() ) {
|
166 |
+
return false;
|
167 |
+
}
|
168 |
+
|
169 |
+
extract( shortcode_atts( array(
|
170 |
+
'user_id' => get_current_user_id(),
|
171 |
+
'datepicker' => true,
|
172 |
+
), $atts ) );
|
173 |
+
|
174 |
+
$vendor_products = WCV_Queries::get_commission_products( $user_id );
|
175 |
+
$products = array();
|
176 |
+
foreach ($vendor_products as $_product) {
|
177 |
+
$products[] = $_product->ID;
|
178 |
+
}
|
179 |
+
|
180 |
+
$vendor_summary = $this->format_product_details( $vendor_products );
|
181 |
+
$order_summary = WCV_Queries::get_orders_for_products( $products );
|
182 |
+
$shop_page = WCV_Vendors::get_vendor_shop_page( wp_get_current_user()->user_login );
|
183 |
+
|
184 |
+
wp_enqueue_style( 'wcv_frontend_style', wcv_assets_url . 'css/wcv-frontend.css' );
|
185 |
+
|
186 |
+
// WC Shipment Tracking Providers
|
187 |
+
global $WC_Shipment_Tracking;
|
188 |
+
|
189 |
+
$providers = !empty( $WC_Shipment_Tracking->providers ) ? $WC_Shipment_Tracking->providers : false;
|
190 |
+
$provider_array = array();
|
191 |
+
|
192 |
+
if ( $providers ) {
|
193 |
+
foreach ( $providers as $providerss ) {
|
194 |
+
foreach ( $providerss as $provider => $format ) {
|
195 |
+
$provider_array[ sanitize_title( $provider ) ] = urlencode( $format );
|
196 |
+
}
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
ob_start();
|
201 |
+
do_action( 'wcvendors_before_dashboard' );
|
202 |
+
|
203 |
+
wc_print_notices();
|
204 |
+
wc_get_template( 'links.php', array(
|
205 |
+
'shop_page' => urldecode($shop_page),
|
206 |
+
'settings_page' => $settings_page,
|
207 |
+
'can_submit' => $can_submit,
|
208 |
+
'submit_link' => $submit_link,
|
209 |
+
'edit_link' => $edit_link,
|
210 |
+
), 'wc-vendors/dashboard/', wcv_plugin_dir . 'templates/dashboard/' );
|
211 |
+
|
212 |
+
if ( $can_view_sales = WC_Vendors::$pv_options->get_option( 'can_view_frontend_reports' ) ) {
|
213 |
+
|
214 |
+
wc_get_template( 'reports.php', array(
|
215 |
+
'start_date' => $start_date,
|
216 |
+
'end_date' => $end_date,
|
217 |
+
'vendor_products' => $vendor_products,
|
218 |
+
'vendor_summary' => $vendor_summary,
|
219 |
+
'datepicker' => $datepicker,
|
220 |
+
'can_view_orders' => $can_view_orders,
|
221 |
+
), 'wc-vendors/dashboard/', wcv_plugin_dir . 'templates/dashboard/' );
|
222 |
+
}
|
223 |
+
|
224 |
+
wc_get_template( 'orders.php', array(
|
225 |
+
'start_date' => $start_date,
|
226 |
+
'end_date' => $end_date,
|
227 |
+
'vendor_products' => $vendor_products,
|
228 |
+
'order_summary' => $order_summary,
|
229 |
+
'datepicker' => $datepicker,
|
230 |
+
'providers' => $providers,
|
231 |
+
'provider_array' => $provider_array,
|
232 |
+
'can_view_orders' => $can_view_orders,
|
233 |
+
), 'wc-vendors/dashboard/', wcv_plugin_dir . 'templates/dashboard/' );
|
234 |
+
do_action( 'wcvendors_after_dashboard' );
|
235 |
+
|
236 |
+
return ob_get_clean();
|
237 |
+
}
|
238 |
+
|
239 |
+
|
240 |
+
/**
|
241 |
+
* [pv_recent_vendor_sales] shortcode
|
242 |
+
*
|
243 |
+
* @param array $atts
|
244 |
+
*
|
245 |
+
* @return unknown
|
246 |
+
*/
|
247 |
+
public function display_vendor_settings( $atts )
|
248 |
+
{
|
249 |
+
global $woocommerce;
|
250 |
+
|
251 |
+
if ( !$this->can_view_vendor_page() ) {
|
252 |
+
return false;
|
253 |
+
}
|
254 |
+
|
255 |
+
extract( shortcode_atts( array(
|
256 |
+
'user_id' => get_current_user_id(),
|
257 |
+
'paypal_address' => true,
|
258 |
+
'shop_description' => true,
|
259 |
+
), $atts ) );
|
260 |
+
|
261 |
+
$description = get_user_meta( $user_id, 'pv_shop_description', true );
|
262 |
+
$seller_info = get_user_meta( $user_id, 'pv_seller_info', true );
|
263 |
+
$has_html = get_user_meta( $user_id, 'pv_shop_html_enabled', true );
|
264 |
+
$shop_page = WCV_Vendors::get_vendor_shop_page( wp_get_current_user()->user_login );
|
265 |
+
$global_html = WC_Vendors::$pv_options->get_option( 'shop_html_enabled' );
|
266 |
+
|
267 |
+
ob_start();
|
268 |
+
wc_get_template( 'settings.php', array(
|
269 |
+
'description' => $description,
|
270 |
+
'global_html' => $global_html,
|
271 |
+
'has_html' => $has_html,
|
272 |
+
'paypal_address' => $paypal_address,
|
273 |
+
'seller_info' => $seller_info,
|
274 |
+
'shop_description' => $shop_description,
|
275 |
+
'shop_page' => $shop_page,
|
276 |
+
'user_id' => $user_id,
|
277 |
+
), 'wc-vendors/dashboard/settings/', wcv_plugin_dir . 'templates/dashboard/settings/' );
|
278 |
+
|
279 |
+
return ob_get_clean();
|
280 |
+
}
|
281 |
+
|
282 |
+
|
283 |
+
/**
|
284 |
+
*
|
285 |
+
*
|
286 |
+
* @return unknown
|
287 |
+
*/
|
288 |
+
public static function can_view_vendor_page()
|
289 |
+
{
|
290 |
+
if ( !is_user_logged_in() ) {
|
291 |
+
|
292 |
+
return false;
|
293 |
+
|
294 |
+
} else if ( !WCV_Vendors::is_vendor( get_current_user_id() ) ) {
|
295 |
+
|
296 |
+
wc_get_template( 'denied.php', array(), 'wc-vendors/dashboard/', wcv_plugin_dir . 'templates/dashboard/' );
|
297 |
+
|
298 |
+
return false;
|
299 |
+
|
300 |
+
}
|
301 |
+
|
302 |
+
return true;
|
303 |
+
}
|
304 |
+
|
305 |
+
|
306 |
+
/**
|
307 |
+
* Format products for easier displaying
|
308 |
+
*
|
309 |
+
* @param object $products
|
310 |
+
*
|
311 |
+
* @return array
|
312 |
+
*/
|
313 |
+
public function format_product_details( $products )
|
314 |
+
{
|
315 |
+
if ( empty( $products ) ) return false;
|
316 |
+
|
317 |
+
$orders_page = get_permalink( WC_Vendors::$pv_options->get_option( 'orders_page' ) );
|
318 |
+
$default_commission = WC_Vendors::$pv_options->get_option( 'default_commission' );
|
319 |
+
$total_qty = $total_cost = 0;
|
320 |
+
$data = array(
|
321 |
+
'products' => array(),
|
322 |
+
'total_qty' => '',
|
323 |
+
'total_cost' => '',
|
324 |
+
);
|
325 |
+
|
326 |
+
foreach ( $products as $product )
|
327 |
+
$ids[ ] = $product->ID;
|
328 |
+
|
329 |
+
$orders = WCV_Queries::sum_orders_for_products( $ids, array( 'vendor_id' => get_current_user_id() ) );
|
330 |
+
|
331 |
+
if ( $orders )
|
332 |
+
foreach ( $orders as $order_item ) {
|
333 |
+
if ( $order_item->qty < 1 ) continue;
|
334 |
+
|
335 |
+
$commission_rate = WCV_Commission::get_commission_rate( $order_item->product_id );
|
336 |
+
$_product = get_product( $order_item->product_id );
|
337 |
+
$id = !empty($_product->parent->id) ? $_product->parent->id : $order_item->product_id;
|
338 |
+
|
339 |
+
$data[ 'products' ][$id] = array(
|
340 |
+
'id' => $id,
|
341 |
+
'title' => $_product->get_title(),
|
342 |
+
'qty' => !empty($data[ 'products' ][$id]) ? $data[ 'products' ][$id]['qty'] + $order_item->qty : $order_item->qty,
|
343 |
+
'cost' => !empty($data[ 'products' ][$id]) ? $data[ 'products' ][$id]['cost'] + $order_item->line_total : $order_item->line_total,
|
344 |
+
'view_orders_url' => esc_url( add_query_arg( 'orders_for_product', $id, $orders_page ) ),
|
345 |
+
'commission_rate' => $commission_rate,
|
346 |
+
);
|
347 |
+
|
348 |
+
$total_qty += $order_item->qty;
|
349 |
+
$total_cost += $order_item->line_total;
|
350 |
+
|
351 |
+
}
|
352 |
+
|
353 |
+
$data[ 'total_qty' ] = $total_qty;
|
354 |
+
$data[ 'total_cost' ] = $total_cost;
|
355 |
+
|
356 |
+
// Sort by product title
|
357 |
+
if ( !empty( $data[ 'products' ] ) )
|
358 |
+
usort( $data[ 'products' ], array( $this, 'sort_by_title' ) );
|
359 |
+
|
360 |
+
return $data;
|
361 |
+
}
|
362 |
+
|
363 |
+
|
364 |
+
/**
|
365 |
+
* Sort an array by 'title'
|
366 |
+
*
|
367 |
+
* @param array $a
|
368 |
+
* @param array $b
|
369 |
+
*
|
370 |
+
* @return array
|
371 |
+
*/
|
372 |
+
private function sort_by_title( array $a, array $b )
|
373 |
+
{
|
374 |
+
return strcasecmp( $a[ 'title' ], $b[ 'title' ] );
|
375 |
+
}
|
376 |
+
|
377 |
+
|
378 |
+
}
|
{WCVendors/classes → classes}/front/orders/class-export-csv.php
RENAMED
@@ -1,77 +1,77 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WCV_Export_CSV
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Sort the data for CSV output first
|
8 |
-
*
|
9 |
-
* @param int $product_id
|
10 |
-
* @param array $headers
|
11 |
-
* @param array $body
|
12 |
-
* @param array $items
|
13 |
-
*/
|
14 |
-
|
15 |
-
|
16 |
-
public static function output_csv( $product_id, $headers, $body, $items )
|
17 |
-
{
|
18 |
-
foreach ( $body as $i => $data ) {
|
19 |
-
|
20 |
-
unset( $body[ $i ][ 'comments' ] );
|
21 |
-
|
22 |
-
foreach ( $items[ $i ][ 'items' ] as $item ) {
|
23 |
-
|
24 |
-
$item_meta = new WC_Order_Item_Meta( $item[ 'item_meta' ] );
|
25 |
-
$item_meta = $item_meta->display( true, true );
|
26 |
-
|
27 |
-
if ( !empty( $item_meta ) ) {
|
28 |
-
$meta = true;
|
29 |
-
$body[ $i ][ ] = $item[ 'qty' ] . 'x: ' . html_entity_decode( $item_meta );
|
30 |
-
} else {
|
31 |
-
$body[ $i ][ ] = $item[ 'qty' ];
|
32 |
-
}
|
33 |
-
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
if ( $meta ) $headers[ 'meta' ] = __( 'Extra data', 'wcvendors' );
|
38 |
-
else $headers[ 'quantity' ] = __( 'Quantity', 'wcvendors' );
|
39 |
-
|
40 |
-
$headers = apply_filters( 'wcvendors_csv_headers', $headers, $product_id, $items );
|
41 |
-
$body = apply_filters( 'wcvendors_csv_body', $body, $product_id, $items );
|
42 |
-
|
43 |
-
WCV_Export_CSV::download( $headers, $body, $product_id );
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
/**
|
48 |
-
* Send the CSV to the browser for download
|
49 |
-
*
|
50 |
-
* @param array $headers
|
51 |
-
* @param array $body
|
52 |
-
* @param string $filename
|
53 |
-
*/
|
54 |
-
public static function download( $headers, $body, $filename )
|
55 |
-
{
|
56 |
-
// Clear browser output before this point
|
57 |
-
ob_end_clean();
|
58 |
-
|
59 |
-
// Output headers so that the file is downloaded rather than displayed
|
60 |
-
header( 'Content-Type: text/csv; charset=utf-8' );
|
61 |
-
header( 'Content-Disposition: attachment; filename=orders_for_' . $filename . '.csv' );
|
62 |
-
|
63 |
-
// Create a file pointer connected to the output stream
|
64 |
-
$output = fopen( 'php://output', 'w' );
|
65 |
-
|
66 |
-
// Output the column headings
|
67 |
-
fputcsv( $output, $headers );
|
68 |
-
|
69 |
-
// Body
|
70 |
-
foreach ( $body as $data )
|
71 |
-
fputcsv( $output, $data );
|
72 |
-
|
73 |
-
die();
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WCV_Export_CSV
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Sort the data for CSV output first
|
8 |
+
*
|
9 |
+
* @param int $product_id
|
10 |
+
* @param array $headers
|
11 |
+
* @param array $body
|
12 |
+
* @param array $items
|
13 |
+
*/
|
14 |
+
|
15 |
+
|
16 |
+
public static function output_csv( $product_id, $headers, $body, $items )
|
17 |
+
{
|
18 |
+
foreach ( $body as $i => $data ) {
|
19 |
+
|
20 |
+
unset( $body[ $i ][ 'comments' ] );
|
21 |
+
|
22 |
+
foreach ( $items[ $i ][ 'items' ] as $item ) {
|
23 |
+
|
24 |
+
$item_meta = new WC_Order_Item_Meta( $item[ 'item_meta' ] );
|
25 |
+
$item_meta = $item_meta->display( true, true );
|
26 |
+
|
27 |
+
if ( !empty( $item_meta ) ) {
|
28 |
+
$meta = true;
|
29 |
+
$body[ $i ][ ] = $item[ 'qty' ] . 'x: ' . html_entity_decode( $item_meta );
|
30 |
+
} else {
|
31 |
+
$body[ $i ][ ] = $item[ 'qty' ];
|
32 |
+
}
|
33 |
+
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
if ( $meta ) $headers[ 'meta' ] = __( 'Extra data', 'wcvendors' );
|
38 |
+
else $headers[ 'quantity' ] = __( 'Quantity', 'wcvendors' );
|
39 |
+
|
40 |
+
$headers = apply_filters( 'wcvendors_csv_headers', $headers, $product_id, $items );
|
41 |
+
$body = apply_filters( 'wcvendors_csv_body', $body, $product_id, $items );
|
42 |
+
|
43 |
+
WCV_Export_CSV::download( $headers, $body, $product_id );
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Send the CSV to the browser for download
|
49 |
+
*
|
50 |
+
* @param array $headers
|
51 |
+
* @param array $body
|
52 |
+
* @param string $filename
|
53 |
+
*/
|
54 |
+
public static function download( $headers, $body, $filename )
|
55 |
+
{
|
56 |
+
// Clear browser output before this point
|
57 |
+
ob_end_clean();
|
58 |
+
|
59 |
+
// Output headers so that the file is downloaded rather than displayed
|
60 |
+
header( 'Content-Type: text/csv; charset=utf-8' );
|
61 |
+
header( 'Content-Disposition: attachment; filename=orders_for_' . $filename . '.csv' );
|
62 |
+
|
63 |
+
// Create a file pointer connected to the output stream
|
64 |
+
$output = fopen( 'php://output', 'w' );
|
65 |
+
|
66 |
+
// Output the column headings
|
67 |
+
fputcsv( $output, $headers );
|
68 |
+
|
69 |
+
// Body
|
70 |
+
foreach ( $body as $data )
|
71 |
+
fputcsv( $output, $data );
|
72 |
+
|
73 |
+
die();
|
74 |
+
}
|
75 |
+
|
76 |
+
|
77 |
+
}
|
{WCVendors/classes → classes}/front/orders/class-orders.php
RENAMED
@@ -1,294 +1,294 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* My account views
|
5 |
-
*
|
6 |
-
* @author Matt Gates <http://mgates.me>
|
7 |
-
* @package ProductVendor
|
8 |
-
*/
|
9 |
-
|
10 |
-
|
11 |
-
class WCV_Orders
|
12 |
-
{
|
13 |
-
|
14 |
-
|
15 |
-
/**
|
16 |
-
* __construct()
|
17 |
-
*/
|
18 |
-
function __construct()
|
19 |
-
{
|
20 |
-
$this->can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
|
21 |
-
$this->can_export_csv = WC_Vendors::$pv_options->get_option( 'can_export_csv' );
|
22 |
-
$this->can_view_emails = WC_Vendors::$pv_options->get_option( 'can_view_order_emails' );
|
23 |
-
|
24 |
-
add_action( 'template_redirect', array( $this, 'check_access' ) );
|
25 |
-
add_action( 'wp', array( $this, 'display_shortcodes' ) );
|
26 |
-
}
|
27 |
-
|
28 |
-
|
29 |
-
/**
|
30 |
-
*
|
31 |
-
*/
|
32 |
-
public function check_access()
|
33 |
-
{
|
34 |
-
if ( is_page( WC_Vendors::$pv_options->get_option( 'orders_page' ) ) && !is_user_logged_in() ) {
|
35 |
-
wp_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
|
36 |
-
exit;
|
37 |
-
}
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
*
|
43 |
-
*/
|
44 |
-
public function display_shortcodes()
|
45 |
-
{
|
46 |
-
if ( is_page( WC_Vendors::$pv_options->get_option( 'orders_page' ) ) && $this->can_view_orders ) {
|
47 |
-
|
48 |
-
wp_enqueue_script( 'jquery' );
|
49 |
-
|
50 |
-
$this->product_id = !empty( $_GET[ 'orders_for_product' ] ) ? (int) $_GET[ 'orders_for_product' ] : false;
|
51 |
-
$products = array( $this->product_id );
|
52 |
-
|
53 |
-
$_product = get_product( $this->product_id );
|
54 |
-
$children = $_product->get_children();
|
55 |
-
if ( !empty( $children ) ) {
|
56 |
-
$products = array_merge($products, $children);
|
57 |
-
$products = array_unique($products);
|
58 |
-
}
|
59 |
-
|
60 |
-
$this->orders = WCV_Queries::get_orders_for_products( $products, array( 'vendor_id' => get_current_user_id() ) );
|
61 |
-
|
62 |
-
add_action( 'init', array( $this, 'verify_order_access' ) );
|
63 |
-
add_shortcode( 'wcv_orders', array( $this, 'display_product_orders' ) );
|
64 |
-
|
65 |
-
if ( $this->can_export_csv && !empty( $_POST[ 'export_orders' ] ) ) {
|
66 |
-
$this->download_csv();
|
67 |
-
}
|
68 |
-
|
69 |
-
}
|
70 |
-
|
71 |
-
}
|
72 |
-
|
73 |
-
|
74 |
-
/**
|
75 |
-
*
|
76 |
-
*
|
77 |
-
* @return unknown
|
78 |
-
*/
|
79 |
-
public function download_csv()
|
80 |
-
{
|
81 |
-
if ( !$this->orders ) return false;
|
82 |
-
|
83 |
-
extract( WCV_Orders::format_order_details( $this->orders, $this->product_id ) );
|
84 |
-
$headers = WCV_Orders::get_headers();
|
85 |
-
|
86 |
-
// Export the CSV
|
87 |
-
require_once wcv_plugin_dir . 'classes/front/orders/class-export-csv.php';
|
88 |
-
WCV_Export_CSV::output_csv( $this->product_id, $headers, $body, $items );
|
89 |
-
}
|
90 |
-
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Use views to display the Orders page
|
94 |
-
*
|
95 |
-
* @return html
|
96 |
-
*/
|
97 |
-
public function display_product_orders()
|
98 |
-
{
|
99 |
-
if ( !WCV_Vendors::is_vendor( get_current_user_id() ) ) {
|
100 |
-
ob_start();
|
101 |
-
wc_get_template( 'denied.php', array(), 'wc-
|
102 |
-
|
103 |
-
return ob_get_clean();
|
104 |
-
}
|
105 |
-
|
106 |
-
if ( empty( $_GET[ 'orders_for_product' ] ) ) {
|
107 |
-
return __( 'You haven\'t selected a product\'s orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you\'d like to view.', 'wcvendors' );
|
108 |
-
}
|
109 |
-
|
110 |
-
if ( !$this->orders ) {
|
111 |
-
return __( 'No orders.', 'wcvendors' );;
|
112 |
-
}
|
113 |
-
|
114 |
-
if ( !empty( $_POST[ 'submit_comment' ] ) ) {
|
115 |
-
require_once wcv_plugin_dir . 'classes/front/orders/class-submit-comment.php';
|
116 |
-
WCV_Submit_Comment::new_comment( $this->orders );
|
117 |
-
}
|
118 |
-
|
119 |
-
if ( isset( $_POST[ 'mark_shipped' ] ) ) {
|
120 |
-
$order_id = (int) $_POST[ 'order_id' ];
|
121 |
-
$product_id = (int) $_POST[ 'product_id' ];
|
122 |
-
exit;
|
123 |
-
}
|
124 |
-
|
125 |
-
if ( isset( $_POST[ 'update_tracking' ] ) ) {
|
126 |
-
$order_id = (int) $_POST[ 'order_id' ];
|
127 |
-
$product_id = (int) $_POST[ 'product_id' ];
|
128 |
-
|
129 |
-
$tracking_provider = woocommerce_clean( $_POST[ 'tracking_provider' ] );
|
130 |
-
$custom_tracking_provider = woocommerce_clean( $_POST[ 'custom_tracking_provider' ] );
|
131 |
-
$custom_tracking_link = woocommerce_clean( $_POST[ 'custom_tracking_link' ] );
|
132 |
-
$tracking_number = woocommerce_clean( $_POST[ 'tracking_number' ] );
|
133 |
-
$date_shipped = woocommerce_clean( strtotime( $_POST[ 'date_shipped' ] ) );
|
134 |
-
|
135 |
-
$order = new WC_Order( $order_id );
|
136 |
-
$products = $order->get_items();
|
137 |
-
foreach ( $products as $key => $value ) {
|
138 |
-
if ( $value[ 'product_id' ] == $product_id || $value[ 'variation_id' ] == $product_id ) {
|
139 |
-
$order_item_id = $key;
|
140 |
-
break;
|
141 |
-
}
|
142 |
-
}
|
143 |
-
if ( $order_item_id ) {
|
144 |
-
woocommerce_delete_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ) );
|
145 |
-
woocommerce_add_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ), $tracking_number );
|
146 |
-
|
147 |
-
$message = __( 'Success. Your tracking number has been updated.', 'wcvendors' );
|
148 |
-
wc_add_notice( $message, 'success' );
|
149 |
-
|
150 |
-
// Update order data
|
151 |
-
update_post_meta( $order_id, '_tracking_provider', $tracking_provider );
|
152 |
-
update_post_meta( $order_id, '_custom_tracking_provider', $custom_tracking_provider );
|
153 |
-
update_post_meta( $order_id, '_tracking_number', $tracking_number );
|
154 |
-
update_post_meta( $order_id, '_custom_tracking_link', $custom_tracking_link );
|
155 |
-
update_post_meta( $order_id, '_date_shipped', $date_shipped );
|
156 |
-
}
|
157 |
-
|
158 |
-
}
|
159 |
-
|
160 |
-
$headers = WCV_Orders::get_headers();
|
161 |
-
$all = WCV_Orders::format_order_details( $this->orders, $this->product_id );
|
162 |
-
|
163 |
-
wp_enqueue_style( 'pv_frontend_style', wcv_assets_url . 'css/wcv-frontend.css' );
|
164 |
-
wp_enqueue_script( 'pv_frontend_script', wcv_assets_url . 'js/front-orders.js' );
|
165 |
-
|
166 |
-
// WC Shipment Tracking Providers
|
167 |
-
global $WC_Shipment_Tracking;
|
168 |
-
|
169 |
-
$providers = !empty( $WC_Shipment_Tracking->providers ) ? $WC_Shipment_Tracking->providers : false;
|
170 |
-
$provider_array = array();
|
171 |
-
|
172 |
-
if ( $providers ) {
|
173 |
-
foreach ( $providers as $providerss ) {
|
174 |
-
foreach ( $providerss as $provider => $format ) {
|
175 |
-
$provider_array[ sanitize_title( $provider ) ] = urlencode( $format );
|
176 |
-
}
|
177 |
-
}
|
178 |
-
}
|
179 |
-
// End
|
180 |
-
|
181 |
-
ob_start();
|
182 |
-
// Show the Export CSV button
|
183 |
-
if ( $this->can_export_csv ) {
|
184 |
-
wc_get_template( 'csv-export.php', array(), 'wc-
|
185 |
-
}
|
186 |
-
|
187 |
-
wc_get_template( 'orders.php', array(
|
188 |
-
'headers' => $headers,
|
189 |
-
'body' => $all[ 'body' ],
|
190 |
-
'items' => $all[ 'items' ],
|
191 |
-
'product_id' => $all[ 'product_id' ],
|
192 |
-
'providers' => $providers,
|
193 |
-
'provider_array' => $provider_array,
|
194 |
-
), 'wc-
|
195 |
-
|
196 |
-
return ob_get_clean();
|
197 |
-
}
|
198 |
-
|
199 |
-
|
200 |
-
/**
|
201 |
-
* Headers for the Orders page
|
202 |
-
*
|
203 |
-
* @return array
|
204 |
-
*/
|
205 |
-
public function get_headers()
|
206 |
-
{
|
207 |
-
$headers = array(
|
208 |
-
'order' => __( 'Order', 'wcvendors' ),
|
209 |
-
'product' => __( 'Product Title', 'wcvendors' ),
|
210 |
-
'name' => __( 'Full name', 'wcvendors' ),
|
211 |
-
'address' => __( 'Address', 'wcvendors' ),
|
212 |
-
'city' => __( 'City', 'wcvendors' ),
|
213 |
-
'state' => __( 'State', 'wcvendors' ),
|
214 |
-
'zip' => __( 'Zip', 'wcvendors' ),
|
215 |
-
'email' => __( 'Email address', 'wcvendors' ),
|
216 |
-
'date' => __( 'Date', 'wcvendors' ),
|
217 |
-
);
|
218 |
-
|
219 |
-
if ( !$this->can_view_emails ) {
|
220 |
-
unset( $headers[ 'email' ] );
|
221 |
-
}
|
222 |
-
|
223 |
-
return $headers;
|
224 |
-
}
|
225 |
-
|
226 |
-
|
227 |
-
/**
|
228 |
-
* Format the orders with just the products we want
|
229 |
-
*
|
230 |
-
* @param object $orders
|
231 |
-
* @param int $product_id
|
232 |
-
*
|
233 |
-
* @return array
|
234 |
-
*/
|
235 |
-
public function format_order_details( $orders, $product_id )
|
236 |
-
{
|
237 |
-
$body = $items = array();
|
238 |
-
$product = get_product( $product_id )->get_title();
|
239 |
-
|
240 |
-
foreach ( $orders as $i => $order ) {
|
241 |
-
$i = $order->order_id;
|
242 |
-
$order = new WC_Order ( $i );
|
243 |
-
$body[ $i ] = array(
|
244 |
-
'order_number' => $order->get_order_number(),
|
245 |
-
'product' => $product,
|
246 |
-
'name' => $order->shipping_first_name . ' ' . $order->shipping_last_name,
|
247 |
-
'address' => $order->shipping_address_1,
|
248 |
-
'city' => $order->shipping_city,
|
249 |
-
'state' => $order->shipping_state,
|
250 |
-
'zip' => $order->shipping_postcode,
|
251 |
-
'email' => $order->billing_email,
|
252 |
-
'date' => $order->order_date,
|
253 |
-
'comments' => wptexturize( $order->customer_note ),
|
254 |
-
);
|
255 |
-
|
256 |
-
if ( !$this->can_view_emails ) {
|
257 |
-
unset( $body[ $i ][ 'email' ] );
|
258 |
-
}
|
259 |
-
|
260 |
-
$items[ $i ][ 'total_qty' ] = 0;
|
261 |
-
foreach ( $order->get_items() as $line_id => $item ) {
|
262 |
-
|
263 |
-
if ( $item[ 'product_id' ] != $product_id && $item[ 'variation_id' ] != $product_id ) continue;
|
264 |
-
|
265 |
-
$items[ $i ][ 'items' ][ ] = $item;
|
266 |
-
$items[ $i ][ 'total_qty' ] += $item[ 'qty' ];
|
267 |
-
}
|
268 |
-
|
269 |
-
}
|
270 |
-
|
271 |
-
return array( 'body' => $body, 'items' => $items, 'product_id' => $product_id );
|
272 |
-
}
|
273 |
-
|
274 |
-
|
275 |
-
/**
|
276 |
-
* Verify the current user can view orders for a product
|
277 |
-
*
|
278 |
-
* @param int $product_id
|
279 |
-
*/
|
280 |
-
public function verify_order_access()
|
281 |
-
{
|
282 |
-
if ( !is_user_logged_in() || empty( $this->product_id ) ) {
|
283 |
-
wp_safe_redirect( apply_filters( 'woocommerce_get_myaccount_page_id', get_permalink( woocommerce_get_page_id( 'myaccount' ) ) ) );
|
284 |
-
exit;
|
285 |
-
}
|
286 |
-
|
287 |
-
$product = get_post( $this->product_id );
|
288 |
-
if ( empty ( $product ) || $product->post_type != 'product' || get_current_user_id() != $product->post_author ) {
|
289 |
-
wp_safe_redirect( apply_filters( 'woocommerce_get_myaccount_page_id', get_permalink( woocommerce_get_page_id( 'myaccount' ) ) ) );
|
290 |
-
exit;
|
291 |
-
}
|
292 |
-
}
|
293 |
-
|
294 |
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* My account views
|
5 |
+
*
|
6 |
+
* @author Matt Gates <http://mgates.me>
|
7 |
+
* @package ProductVendor
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
+
class WCV_Orders
|
12 |
+
{
|
13 |
+
|
14 |
+
|
15 |
+
/**
|
16 |
+
* __construct()
|
17 |
+
*/
|
18 |
+
function __construct()
|
19 |
+
{
|
20 |
+
$this->can_view_orders = WC_Vendors::$pv_options->get_option( 'can_show_orders' );
|
21 |
+
$this->can_export_csv = WC_Vendors::$pv_options->get_option( 'can_export_csv' );
|
22 |
+
$this->can_view_emails = WC_Vendors::$pv_options->get_option( 'can_view_order_emails' );
|
23 |
+
|
24 |
+
add_action( 'template_redirect', array( $this, 'check_access' ) );
|
25 |
+
add_action( 'wp', array( $this, 'display_shortcodes' ) );
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
/**
|
30 |
+
*
|
31 |
+
*/
|
32 |
+
public function check_access()
|
33 |
+
{
|
34 |
+
if ( is_page( WC_Vendors::$pv_options->get_option( 'orders_page' ) ) && !is_user_logged_in() ) {
|
35 |
+
wp_redirect( get_permalink( woocommerce_get_page_id( 'myaccount' ) ) );
|
36 |
+
exit;
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
|
41 |
+
/**
|
42 |
+
*
|
43 |
+
*/
|
44 |
+
public function display_shortcodes()
|
45 |
+
{
|
46 |
+
if ( is_page( WC_Vendors::$pv_options->get_option( 'orders_page' ) ) && $this->can_view_orders ) {
|
47 |
+
|
48 |
+
wp_enqueue_script( 'jquery' );
|
49 |
+
|
50 |
+
$this->product_id = !empty( $_GET[ 'orders_for_product' ] ) ? (int) $_GET[ 'orders_for_product' ] : false;
|
51 |
+
$products = array( $this->product_id );
|
52 |
+
|
53 |
+
$_product = get_product( $this->product_id );
|
54 |
+
$children = $_product->get_children();
|
55 |
+
if ( !empty( $children ) ) {
|
56 |
+
$products = array_merge($products, $children);
|
57 |
+
$products = array_unique($products);
|
58 |
+
}
|
59 |
+
|
60 |
+
$this->orders = WCV_Queries::get_orders_for_products( $products, array( 'vendor_id' => get_current_user_id() ) );
|
61 |
+
|
62 |
+
add_action( 'init', array( $this, 'verify_order_access' ) );
|
63 |
+
add_shortcode( 'wcv_orders', array( $this, 'display_product_orders' ) );
|
64 |
+
|
65 |
+
if ( $this->can_export_csv && !empty( $_POST[ 'export_orders' ] ) ) {
|
66 |
+
$this->download_csv();
|
67 |
+
}
|
68 |
+
|
69 |
+
}
|
70 |
+
|
71 |
+
}
|
72 |
+
|
73 |
+
|
74 |
+
/**
|
75 |
+
*
|
76 |
+
*
|
77 |
+
* @return unknown
|
78 |
+
*/
|
79 |
+
public function download_csv()
|
80 |
+
{
|
81 |
+
if ( !$this->orders ) return false;
|
82 |
+
|
83 |
+
extract( WCV_Orders::format_order_details( $this->orders, $this->product_id ) );
|
84 |
+
$headers = WCV_Orders::get_headers();
|
85 |
+
|
86 |
+
// Export the CSV
|
87 |
+
require_once wcv_plugin_dir . 'classes/front/orders/class-export-csv.php';
|
88 |
+
WCV_Export_CSV::output_csv( $this->product_id, $headers, $body, $items );
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Use views to display the Orders page
|
94 |
+
*
|
95 |
+
* @return html
|
96 |
+
*/
|
97 |
+
public function display_product_orders()
|
98 |
+
{
|
99 |
+
if ( !WCV_Vendors::is_vendor( get_current_user_id() ) ) {
|
100 |
+
ob_start();
|
101 |
+
wc_get_template( 'denied.php', array(), 'wc-vendors/dashboard/', wcv_plugin_dir . 'templates/dashboard/' );
|
102 |
+
|
103 |
+
return ob_get_clean();
|
104 |
+
}
|
105 |
+
|
106 |
+
if ( empty( $_GET[ 'orders_for_product' ] ) ) {
|
107 |
+
return __( 'You haven\'t selected a product\'s orders to view! Please go back to the Vendor Dashboard and click Show Orders on the product you\'d like to view.', 'wcvendors' );
|
108 |
+
}
|
109 |
+
|
110 |
+
if ( !$this->orders ) {
|
111 |
+
return __( 'No orders.', 'wcvendors' );;
|
112 |
+
}
|
113 |
+
|
114 |
+
if ( !empty( $_POST[ 'submit_comment' ] ) ) {
|
115 |
+
require_once wcv_plugin_dir . 'classes/front/orders/class-submit-comment.php';
|
116 |
+
WCV_Submit_Comment::new_comment( $this->orders );
|
117 |
+
}
|
118 |
+
|
119 |
+
if ( isset( $_POST[ 'mark_shipped' ] ) ) {
|
120 |
+
$order_id = (int) $_POST[ 'order_id' ];
|
121 |
+
$product_id = (int) $_POST[ 'product_id' ];
|
122 |
+
exit;
|
123 |
+
}
|
124 |
+
|
125 |
+
if ( isset( $_POST[ 'update_tracking' ] ) ) {
|
126 |
+
$order_id = (int) $_POST[ 'order_id' ];
|
127 |
+
$product_id = (int) $_POST[ 'product_id' ];
|
128 |
+
|
129 |
+
$tracking_provider = woocommerce_clean( $_POST[ 'tracking_provider' ] );
|
130 |
+
$custom_tracking_provider = woocommerce_clean( $_POST[ 'custom_tracking_provider' ] );
|
131 |
+
$custom_tracking_link = woocommerce_clean( $_POST[ 'custom_tracking_link' ] );
|
132 |
+
$tracking_number = woocommerce_clean( $_POST[ 'tracking_number' ] );
|
133 |
+
$date_shipped = woocommerce_clean( strtotime( $_POST[ 'date_shipped' ] ) );
|
134 |
+
|
135 |
+
$order = new WC_Order( $order_id );
|
136 |
+
$products = $order->get_items();
|
137 |
+
foreach ( $products as $key => $value ) {
|
138 |
+
if ( $value[ 'product_id' ] == $product_id || $value[ 'variation_id' ] == $product_id ) {
|
139 |
+
$order_item_id = $key;
|
140 |
+
break;
|
141 |
+
}
|
142 |
+
}
|
143 |
+
if ( $order_item_id ) {
|
144 |
+
woocommerce_delete_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ) );
|
145 |
+
woocommerce_add_order_item_meta( $order_item_id, __( 'Tracking number', 'wcvendors' ), $tracking_number );
|
146 |
+
|
147 |
+
$message = __( 'Success. Your tracking number has been updated.', 'wcvendors' );
|
148 |
+
wc_add_notice( $message, 'success' );
|
149 |
+
|
150 |
+
// Update order data
|
151 |
+
update_post_meta( $order_id, '_tracking_provider', $tracking_provider );
|
152 |
+
update_post_meta( $order_id, '_custom_tracking_provider', $custom_tracking_provider );
|
153 |
+
update_post_meta( $order_id, '_tracking_number', $tracking_number );
|
154 |
+
update_post_meta( $order_id, '_custom_tracking_link', $custom_tracking_link );
|
155 |
+
update_post_meta( $order_id, '_date_shipped', $date_shipped );
|
156 |
+
}
|
157 |
+
|
158 |
+
}
|
159 |
+
|
160 |
+
$headers = WCV_Orders::get_headers();
|
161 |
+
$all = WCV_Orders::format_order_details( $this->orders, $this->product_id );
|
162 |
+
|
163 |
+
wp_enqueue_style( 'pv_frontend_style', wcv_assets_url . 'css/wcv-frontend.css' );
|
164 |
+
wp_enqueue_script( 'pv_frontend_script', wcv_assets_url . 'js/front-orders.js' );
|
165 |
+
|
166 |
+
// WC Shipment Tracking Providers
|
167 |
+
global $WC_Shipment_Tracking;
|
168 |
+
|
169 |
+
$providers = !empty( $WC_Shipment_Tracking->providers ) ? $WC_Shipment_Tracking->providers : false;
|
170 |
+
$provider_array = array();
|
171 |
+
|
172 |
+
if ( $providers ) {
|
173 |
+
foreach ( $providers as $providerss ) {
|
174 |
+
foreach ( $providerss as $provider => $format ) {
|
175 |
+
$provider_array[ sanitize_title( $provider ) ] = urlencode( $format );
|
176 |
+
}
|
177 |
+
}
|
178 |
+
}
|
179 |
+
// End
|
180 |
+
|
181 |
+
ob_start();
|
182 |
+
// Show the Export CSV button
|
183 |
+
if ( $this->can_export_csv ) {
|
184 |
+
wc_get_template( 'csv-export.php', array(), 'wc-vendors/orders/', wcv_plugin_dir . 'templates/orders/' );
|
185 |
+
}
|
186 |
+
|
187 |
+
wc_get_template( 'orders.php', array(
|
188 |
+
'headers' => $headers,
|
189 |
+
'body' => $all[ 'body' ],
|
190 |
+
'items' => $all[ 'items' ],
|
191 |
+
'product_id' => $all[ 'product_id' ],
|
192 |
+
'providers' => $providers,
|
193 |
+
'provider_array' => $provider_array,
|
194 |
+
), 'wc-vendors/orders/', wcv_plugin_dir . 'templates/orders/' );
|
195 |
+
|
196 |
+
return ob_get_clean();
|
197 |
+
}
|
198 |
+
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Headers for the Orders page
|
202 |
+
*
|
203 |
+
* @return array
|
204 |
+
*/
|
205 |
+
public function get_headers()
|
206 |
+
{
|
207 |
+
$headers = array(
|
208 |
+
'order' => __( 'Order', 'wcvendors' ),
|
209 |
+
'product' => __( 'Product Title', 'wcvendors' ),
|
210 |
+
'name' => __( 'Full name', 'wcvendors' ),
|
211 |
+
'address' => __( 'Address', 'wcvendors' ),
|
212 |
+
'city' => __( 'City', 'wcvendors' ),
|
213 |
+
'state' => __( 'State', 'wcvendors' ),
|
214 |
+
'zip' => __( 'Zip', 'wcvendors' ),
|
215 |
+
'email' => __( 'Email address', 'wcvendors' ),
|
216 |
+
'date' => __( 'Date', 'wcvendors' ),
|
217 |
+
);
|
218 |
+
|
219 |
+
if ( !$this->can_view_emails ) {
|
220 |
+
unset( $headers[ 'email' ] );
|
221 |
+
}
|
222 |
+
|
223 |
+
return $headers;
|
224 |
+
}
|
225 |
+
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Format the orders with just the products we want
|
229 |
+
*
|
230 |
+
* @param object $orders
|
231 |
+
* @param int $product_id
|
232 |
+
*
|
233 |
+
* @return array
|
234 |
+
*/
|
235 |
+
public function format_order_details( $orders, $product_id )
|
236 |
+
{
|
237 |
+
$body = $items = array();
|
238 |
+
$product = get_product( $product_id )->get_title();
|
239 |
+
|
240 |
+
foreach ( $orders as $i => $order ) {
|
241 |
+
$i = $order->order_id;
|
242 |
+
$order = new WC_Order ( $i );
|
243 |
+
$body[ $i ] = array(
|
244 |
+
'order_number' => $order->get_order_number(),
|
245 |
+
'product' => $product,
|
246 |
+
'name' => $order->shipping_first_name . ' ' . $order->shipping_last_name,
|
247 |
+
'address' => $order->shipping_address_1,
|
248 |
+
'city' => $order->shipping_city,
|
249 |
+
'state' => $order->shipping_state,
|
250 |
+
'zip' => $order->shipping_postcode,
|
251 |
+
'email' => $order->billing_email,
|
252 |
+
'date' => $order->order_date,
|
253 |
+
'comments' => wptexturize( $order->customer_note ),
|
254 |
+
);
|
255 |
+
|
256 |
+
if ( !$this->can_view_emails ) {
|
257 |
+
unset( $body[ $i ][ 'email' ] );
|
258 |
+
}
|
259 |
+
|
260 |
+
$items[ $i ][ 'total_qty' ] = 0;
|
261 |
+
foreach ( $order->get_items() as $line_id => $item ) {
|
262 |
+
|
263 |
+
if ( $item[ 'product_id' ] != $product_id && $item[ 'variation_id' ] != $product_id ) continue;
|
264 |
+
|
265 |
+
$items[ $i ][ 'items' ][ ] = $item;
|
266 |
+
$items[ $i ][ 'total_qty' ] += $item[ 'qty' ];
|
267 |
+
}
|
268 |
+
|
269 |
+
}
|
270 |
+
|
271 |
+
return array( 'body' => $body, 'items' => $items, 'product_id' => $product_id );
|
272 |
+
}
|
273 |
+
|
274 |
+
|
275 |
+
/**
|
276 |
+
* Verify the current user can view orders for a product
|
277 |
+
*
|
278 |
+
* @param int $product_id
|
279 |
+
*/
|
280 |
+
public function verify_order_access()
|
281 |
+
{
|
282 |
+
if ( !is_user_logged_in() || empty( $this->product_id ) ) {
|
283 |
+
wp_safe_redirect( apply_filters( 'woocommerce_get_myaccount_page_id', get_permalink( woocommerce_get_page_id( 'myaccount' ) ) ) );
|
284 |
+
exit;
|
285 |
+
}
|
286 |
+
|
287 |
+
$product = get_post( $this->product_id );
|
288 |
+
if ( empty ( $product ) || $product->post_type != 'product' || get_current_user_id() != $product->post_author ) {
|
289 |
+
wp_safe_redirect( apply_filters( 'woocommerce_get_myaccount_page_id', get_permalink( woocommerce_get_page_id( 'myaccount' ) ) ) );
|
290 |
+
exit;
|
291 |
+
}
|
292 |
+
}
|
293 |
+
|
294 |
}
|
{WCVendors/classes → classes}/front/orders/class-submit-comment.php
RENAMED
@@ -1,81 +1,81 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class WCV_Submit_Comment
|
4 |
-
{
|
5 |
-
|
6 |
-
/**
|
7 |
-
* Submit a comment for an order
|
8 |
-
*
|
9 |
-
* @param object $orders
|
10 |
-
*
|
11 |
-
* @return unknown
|
12 |
-
*/
|
13 |
-
public static function new_comment( $orders )
|
14 |
-
{
|
15 |
-
global $woocommerce;
|
16 |
-
|
17 |
-
$user = wp_get_current_user();
|
18 |
-
$user = $user->ID;
|
19 |
-
|
20 |
-
// Security
|
21 |
-
if ( !wp_verify_nonce( $_POST[ '_wpnonce' ], 'add-comment' ) ) return false;
|
22 |
-
|
23 |
-
// Check if this product belongs to the vendor submitting the comment
|
24 |
-
$product_id = (int) $_POST[ 'product_id' ];
|
25 |
-
$author = WCV_Vendors::get_vendor_from_product( $product_id );
|
26 |
-
if ( $author != $user ) return false;
|
27 |
-
|
28 |
-
// Find the order belonging to this comment
|
29 |
-
foreach ( $orders as $order ) {
|
30 |
-
if ( $order->order_id == $_POST[ 'order_id' ] ) {
|
31 |
-
$found_order = $order;
|
32 |
-
break;
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
// No order was found
|
37 |
-
if ( empty( $found_order ) ) return false;
|
38 |
-
|
39 |
-
// Don't submit empty comments
|
40 |
-
if ( empty( $_POST[ 'comment_text' ] ) ) {
|
41 |
-
wc_add_notice( __( 'You\'ve left the comment field empty!', 'wcvendors' ), 'error' );
|
42 |
-
|
43 |
-
return false;
|
44 |
-
}
|
45 |
-
|
46 |
-
// Only submit if the order has the product belonging to this vendor
|
47 |
-
$found_order = new WC_Order ( $found_order->order_id );
|
48 |
-
$valid_order = false;
|
49 |
-
foreach ( $found_order->get_items() as $item ) {
|
50 |
-
if ( $item[ 'product_id' ] == $product_id ) {
|
51 |
-
$valid_order = true;
|
52 |
-
break;
|
53 |
-
}
|
54 |
-
}
|
55 |
-
|
56 |
-
if ( $valid_order ) {
|
57 |
-
$comment = esc_textarea( $_POST[ 'comment_text' ] );
|
58 |
-
|
59 |
-
add_filter( 'woocommerce_new_order_note_data', array( __CLASS__, 'filter_comment' ), 10, 2 );
|
60 |
-
$found_order->add_order_note( $comment, 1 );
|
61 |
-
remove_filter( 'woocommerce_new_order_note_data', array( __CLASS__, 'filter_comment' ), 10, 2 );
|
62 |
-
|
63 |
-
wc_add_notice( __( 'Success. The customer has been notified of your comment.', 'wcvendors' ), 'success' );
|
64 |
-
}
|
65 |
-
|
66 |
-
}
|
67 |
-
|
68 |
-
public function filter_comment( $commentdata, $order )
|
69 |
-
{
|
70 |
-
$user_id = get_current_user_id();
|
71 |
-
|
72 |
-
$commentdata[ 'user_id' ] = $user_id;
|
73 |
-
$commentdata[ 'comment_author' ] = WCV_Vendors::get_vendor_shop_name( $user_id );
|
74 |
-
$commentdata[ 'comment_author_url' ] = WCV_Vendors::get_vendor_shop_page( $user_id );
|
75 |
-
$commentdata[ 'comment_author_email' ] = wp_get_current_user()->user_email;
|
76 |
-
|
77 |
-
return $commentdata;
|
78 |
-
}
|
79 |
-
|
80 |
-
|
81 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WCV_Submit_Comment
|
4 |
+
{
|
5 |
+
|
6 |
+
/**
|
7 |
+
* Submit a comment for an order
|
8 |
+
*
|
9 |
+
* @param object $orders
|
10 |
+
*
|
11 |
+
* @return unknown
|
12 |
+
*/
|
13 |
+
public static function new_comment( $orders )
|
14 |
+
{
|
15 |
+
global $woocommerce;
|
16 |
+
|
17 |
+
$user = wp_get_current_user();
|
18 |
+
$user = $user->ID;
|
19 |
+
|
20 |
+
// Security
|
21 |
+
if ( !wp_verify_nonce( $_POST[ '_wpnonce' ], 'add-comment' ) ) return false;
|
22 |
+
|
23 |
+
// Check if this product belongs to the vendor submitting the comment
|
24 |
+
$product_id = (int) $_POST[ 'product_id' ];
|
25 |
+
$author = WCV_Vendors::get_vendor_from_product( $product_id );
|
26 |
+
if ( $author != $user ) return false;
|
27 |
+
|
28 |
+
// Find the order belonging to this comment
|
29 |
+
foreach ( $orders as $order ) {
|
30 |
+
if ( $order->order_id == $_POST[ 'order_id' ] ) {
|
31 |
+
$found_order = $order;
|
32 |
+
break;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
// No order was found
|
37 |
+
if ( empty( $found_order ) ) return false;
|
38 |
+
|
39 |
+
// Don't submit empty comments
|
40 |
+
if ( empty( $_POST[ 'comment_text' ] ) ) {
|
41 |
+
wc_add_notice( __( 'You\'ve left the comment field empty!', 'wcvendors' ), 'error' );
|
42 |
+
|
43 |
+
return false;
|
44 |
+
}
|
45 |
+
|
46 |
+
// Only submit if the order has the product belonging to this vendor
|
47 |
+
$found_order = new WC_Order ( $found_order->order_id );
|
48 |
+
$valid_order = false;
|
49 |
+
foreach ( $found_order->get_items() as $item ) {
|
50 |
+
if ( $item[ 'product_id' ] == $product_id ) {
|
51 |
+
$valid_order = true;
|
52 |
+
break;
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
if ( $valid_order ) {
|
57 |
+
$comment = esc_textarea( $_POST[ 'comment_text' ] );
|
58 |
+
|
59 |
+
add_filter( 'woocommerce_new_order_note_data', array( __CLASS__, 'filter_comment' ), 10, 2 );
|
60 |
+
$found_order->add_order_note( $comment, 1 );
|
61 |
+
remove_filter( 'woocommerce_new_order_note_data', array( __CLASS__, 'filter_comment' ), 10, 2 );
|
62 |
+
|
63 |
+
wc_add_notice( __( 'Success. The customer has been notified of your comment.', 'wcvendors' ), 'success' );
|
64 |
+
}
|
65 |
+
|
66 |
+
}
|
67 |
+
|
68 |
+
public function filter_comment( $commentdata, $order )
|
69 |
+
{
|
70 |
+
$user_id = get_current_user_id();
|
71 |
+
|
72 |
+
$commentdata[ 'user_id' ] = $user_id;
|
73 |
+
$commentdata[ 'comment_author' ] = WCV_Vendors::get_vendor_shop_name( $user_id );
|
74 |
+
$commentdata[ 'comment_author_url' ] = WCV_Vendors::get_vendor_shop_page( $user_id );
|
75 |
+
$commentdata[ 'comment_author_email' ] = wp_get_current_user()->user_email;
|
76 |
+
|
77 |
+
return $commentdata;
|
78 |
+
}
|
79 |
+
|
80 |
+
|
81 |
+
}
|
{WCVendors/classes → classes}/front/signup/class-vendor-signup.php
RENAMED
File without changes
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/assets/icons/index.php
RENAMED
File without changes
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/assets/icons/paypalap.png
RENAMED
File without changes
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/assets/index.php
RENAMED
File without changes
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/ChangeLog.txt
RENAMED
@@ -1,33 +1,33 @@
|
|
1 |
-
|
2 |
-
Version 1.2.95 - September 28, 2012
|
3 |
-
|
4 |
-
- Sender details (eg:email,phno) serialization bug fixed(https://github.com/paypal/SDKs/issues/30)
|
5 |
-
- Bug fixed for 'PPLoggingManager.php' to pickup configuration entries.(https://github.com/paypal/SDKs/issues/28)
|
6 |
-
- Updated SDK sample
|
7 |
-
|
8 |
-
--------------------------------------------------------------------------------------------------
|
9 |
-
|
10 |
-
|
11 |
-
Version 1.1.93 - August 13, 2012
|
12 |
-
|
13 |
-
- SDK refreshed to Release 1.8.1. Please refer https://www.x.com/developers/paypal/documentation-tools/release-notes#AdaptivePaymentsAPI
|
14 |
-
- SDK Core - Deserialization Logic Change
|
15 |
-
--------------------------------------------------------------------------------------------------
|
16 |
-
|
17 |
-
|
18 |
-
Version 1.0.92 - July 30, 2012
|
19 |
-
|
20 |
-
- Stable release
|
21 |
-
-------------------------------------------------------------------------------------------------
|
22 |
-
Version 0.7.92 - July 17, 2012
|
23 |
-
- wsdl update version 0.7.92
|
24 |
-
------------------------------------------
|
25 |
-
|
26 |
-
Version 0.6.88 - Apr 17, 2012
|
27 |
-
----------------------------------------
|
28 |
-
- Fix to get SDK working with Permissions API token
|
29 |
-
- wsdl update version 88.0
|
30 |
-
|
31 |
-
Version 0.6.86 - Feb 27, 2012
|
32 |
-
----------------------------------------
|
33 |
- Initial release
|
1 |
+
|
2 |
+
Version 1.2.95 - September 28, 2012
|
3 |
+
|
4 |
+
- Sender details (eg:email,phno) serialization bug fixed(https://github.com/paypal/SDKs/issues/30)
|
5 |
+
- Bug fixed for 'PPLoggingManager.php' to pickup configuration entries.(https://github.com/paypal/SDKs/issues/28)
|
6 |
+
- Updated SDK sample
|
7 |
+
|
8 |
+
--------------------------------------------------------------------------------------------------
|
9 |
+
|
10 |
+
|
11 |
+
Version 1.1.93 - August 13, 2012
|
12 |
+
|
13 |
+
- SDK refreshed to Release 1.8.1. Please refer https://www.x.com/developers/paypal/documentation-tools/release-notes#AdaptivePaymentsAPI
|
14 |
+
- SDK Core - Deserialization Logic Change
|
15 |
+
--------------------------------------------------------------------------------------------------
|
16 |
+
|
17 |
+
|
18 |
+
Version 1.0.92 - July 30, 2012
|
19 |
+
|
20 |
+
- Stable release
|
21 |
+
-------------------------------------------------------------------------------------------------
|
22 |
+
Version 0.7.92 - July 17, 2012
|
23 |
+
- wsdl update version 0.7.92
|
24 |
+
------------------------------------------
|
25 |
+
|
26 |
+
Version 0.6.88 - Apr 17, 2012
|
27 |
+
----------------------------------------
|
28 |
+
- Fix to get SDK working with Permissions API token
|
29 |
+
- wsdl update version 88.0
|
30 |
+
|
31 |
+
Version 0.6.86 - Feb 27, 2012
|
32 |
+
----------------------------------------
|
33 |
- Initial release
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/LICENSE.txt
RENAMED
@@ -1,41 +1,41 @@
|
|
1 |
-
PAYPAL, INC.
|
2 |
-
|
3 |
-
SDK LICENSE
|
4 |
-
|
5 |
-
NOTICE TO USER: PayPal, Inc. is providing the Software and Documentation for use under the terms of this Agreement. Any use, reproduction, modification or distribution of the Software or Documentation, or any derivatives or portions hereof, constitutes your acceptance of this Agreement.
|
6 |
-
|
7 |
-
As used in this Agreement, "PayPal" means PayPal, Inc. "Software" means the software code accompanying this agreement. "Documentation" means the documents, specifications and all other items accompanying this Agreement other than the Software.
|
8 |
-
|
9 |
-
1. LICENSE GRANT Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free license to use, reproduce, prepare derivative works from, publicly display, publicly perform, distribute and sublicense the Software for any purpose, provided the copyright notice below appears in a conspicuous location within the source code of the distributed Software and this license is distributed in the supporting documentation of the Software you distribute. Furthermore, you must comply with all third party licenses in order to use the third party software contained in the Software.
|
10 |
-
|
11 |
-
Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free license to use, reproduce, publicly display, publicly perform, distribute and sublicense the Documentation for any purpose. You may not modify the Documentation.
|
12 |
-
|
13 |
-
No title to the intellectual property in the Software or Documentation is transferred to you under the terms of this Agreement. You do not acquire any rights to the Software or the Documentation except as expressly set forth in this Agreement.
|
14 |
-
|
15 |
-
If you choose to distribute the Software in a commercial product, you do so with the understanding that you agree to defend, indemnify and hold harmless PayPal and its suppliers against any losses, damages and costs arising from the claims, lawsuits or other legal actions arising out of such distribution. You may distribute the Software in object code form under your own license, provided that your license agreement:
|
16 |
-
|
17 |
-
(a) complies with the terms and conditions of this license agreement;
|
18 |
-
|
19 |
-
(b) effectively disclaims all warranties and conditions, express or implied, on behalf of PayPal;
|
20 |
-
|
21 |
-
(c) effectively excludes all liability for damages on behalf of PayPal;
|
22 |
-
|
23 |
-
(d) states that any provisions that differ from this Agreement are offered by you alone and not PayPal; and
|
24 |
-
|
25 |
-
(e) states that the Software is available from you or PayPal and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
|
26 |
-
|
27 |
-
2. DISCLAIMER OF WARRANTY
|
28 |
-
PAYPAL LICENSES THE SOFTWARE AND DOCUMENTATION TO YOU ONLY ON AN "AS IS" BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PAYPAL MAKES NO WARRANTY THAT THE SOFTWARE OR DOCUMENTATION WILL BE ERROR-FREE. Each user of the Software or Documentation is solely responsible for determining the appropriateness of using and distributing the Software and Documentation and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs, or equipment, and unavailability or interruption of operations. Use of the Software and Documentation is made with the understanding that PayPal will not provide you with any technical or customer support or maintenance. Some states or jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied warranty may last, so the above limitations may not apply to you. To the extent permissible, any implied warranties are limited to ninety (90) days.
|
29 |
-
|
30 |
-
|
31 |
-
3. LIMITATION OF LIABILITY
|
32 |
-
PAYPAL AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE USE OF THE SOFTWARE OR DOCUMENTATION. IN NO EVENT WILL PAYPAL OR ITS SUPPLIERS BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES INCLUDING LOST PROFITS, LOST SAVINGS, COSTS, FEES, OR EXPENSES OF ANY KIND ARISING OUT OF ANY PROVISION OF THIS AGREEMENT OR THE USE OR THE INABILITY TO USE THE SOFTWARE OR DOCUMENTATION, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. PAYPAL'S AGGREGATE LIABILITY AND THAT OF ITS SUPPLIERS UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL BE LIMITED TO THE AMOUNT PAID BY YOU FOR THE SOFTWARE AND DOCUMENTATION.
|
33 |
-
|
34 |
-
4. TRADEMARK USAGE
|
35 |
-
PayPal is a trademark PayPal, Inc. in the United States and other countries. Such trademarks may not be used to endorse or promote any product unless expressly permitted under separate agreement with PayPal.
|
36 |
-
|
37 |
-
5. TERM
|
38 |
-
Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all your rights under this Agreement terminate, you agree to cease use and distribution of the Software and Documentation as soon as reasonably practicable.
|
39 |
-
|
40 |
-
6. GOVERNING LAW AND JURISDICTION. This Agreement is governed by the statutes and laws of the State of California, without regard to the conflicts of law principles thereof. If any part of this Agreement is found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall remain valid and enforceable according to its terms. Any dispute arising out of or related to this Agreement shall be brought in the courts of Santa Clara County, California, USA.
|
41 |
-
|
1 |
+
PAYPAL, INC.
|
2 |
+
|
3 |
+
SDK LICENSE
|
4 |
+
|
5 |
+
NOTICE TO USER: PayPal, Inc. is providing the Software and Documentation for use under the terms of this Agreement. Any use, reproduction, modification or distribution of the Software or Documentation, or any derivatives or portions hereof, constitutes your acceptance of this Agreement.
|
6 |
+
|
7 |
+
As used in this Agreement, "PayPal" means PayPal, Inc. "Software" means the software code accompanying this agreement. "Documentation" means the documents, specifications and all other items accompanying this Agreement other than the Software.
|
8 |
+
|
9 |
+
1. LICENSE GRANT Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free license to use, reproduce, prepare derivative works from, publicly display, publicly perform, distribute and sublicense the Software for any purpose, provided the copyright notice below appears in a conspicuous location within the source code of the distributed Software and this license is distributed in the supporting documentation of the Software you distribute. Furthermore, you must comply with all third party licenses in order to use the third party software contained in the Software.
|
10 |
+
|
11 |
+
Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free license to use, reproduce, publicly display, publicly perform, distribute and sublicense the Documentation for any purpose. You may not modify the Documentation.
|
12 |
+
|
13 |
+
No title to the intellectual property in the Software or Documentation is transferred to you under the terms of this Agreement. You do not acquire any rights to the Software or the Documentation except as expressly set forth in this Agreement.
|
14 |
+
|
15 |
+
If you choose to distribute the Software in a commercial product, you do so with the understanding that you agree to defend, indemnify and hold harmless PayPal and its suppliers against any losses, damages and costs arising from the claims, lawsuits or other legal actions arising out of such distribution. You may distribute the Software in object code form under your own license, provided that your license agreement:
|
16 |
+
|
17 |
+
(a) complies with the terms and conditions of this license agreement;
|
18 |
+
|
19 |
+
(b) effectively disclaims all warranties and conditions, express or implied, on behalf of PayPal;
|
20 |
+
|
21 |
+
(c) effectively excludes all liability for damages on behalf of PayPal;
|
22 |
+
|
23 |
+
(d) states that any provisions that differ from this Agreement are offered by you alone and not PayPal; and
|
24 |
+
|
25 |
+
(e) states that the Software is available from you or PayPal and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
|
26 |
+
|
27 |
+
2. DISCLAIMER OF WARRANTY
|
28 |
+
PAYPAL LICENSES THE SOFTWARE AND DOCUMENTATION TO YOU ONLY ON AN "AS IS" BASIS WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PAYPAL MAKES NO WARRANTY THAT THE SOFTWARE OR DOCUMENTATION WILL BE ERROR-FREE. Each user of the Software or Documentation is solely responsible for determining the appropriateness of using and distributing the Software and Documentation and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs, or equipment, and unavailability or interruption of operations. Use of the Software and Documentation is made with the understanding that PayPal will not provide you with any technical or customer support or maintenance. Some states or jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied warranty may last, so the above limitations may not apply to you. To the extent permissible, any implied warranties are limited to ninety (90) days.
|
29 |
+
|
30 |
+
|
31 |
+
3. LIMITATION OF LIABILITY
|
32 |
+
PAYPAL AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE USE OF THE SOFTWARE OR DOCUMENTATION. IN NO EVENT WILL PAYPAL OR ITS SUPPLIERS BE LIABLE TO YOU OR ANY THIRD PARTY FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES INCLUDING LOST PROFITS, LOST SAVINGS, COSTS, FEES, OR EXPENSES OF ANY KIND ARISING OUT OF ANY PROVISION OF THIS AGREEMENT OR THE USE OR THE INABILITY TO USE THE SOFTWARE OR DOCUMENTATION, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. PAYPAL'S AGGREGATE LIABILITY AND THAT OF ITS SUPPLIERS UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL BE LIMITED TO THE AMOUNT PAID BY YOU FOR THE SOFTWARE AND DOCUMENTATION.
|
33 |
+
|
34 |
+
4. TRADEMARK USAGE
|
35 |
+
PayPal is a trademark PayPal, Inc. in the United States and other countries. Such trademarks may not be used to endorse or promote any product unless expressly permitted under separate agreement with PayPal.
|
36 |
+
|
37 |
+
5. TERM
|
38 |
+
Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all your rights under this Agreement terminate, you agree to cease use and distribution of the Software and Documentation as soon as reasonably practicable.
|
39 |
+
|
40 |
+
6. GOVERNING LAW AND JURISDICTION. This Agreement is governed by the statutes and laws of the State of California, without regard to the conflicts of law principles thereof. If any part of this Agreement is found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall remain valid and enforceable according to its terms. Any dispute arising out of or related to this Agreement shall be brought in the courts of Santa Clara County, California, USA.
|
41 |
+
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/README.md
RENAMED
@@ -1,57 +1,57 @@
|
|
1 |
-
|
2 |
-
PayPal PHP Adaptive Payments SDK
|
3 |
-
===============================
|
4 |
-
|
5 |
-
Prerequisites
|
6 |
-
-------------
|
7 |
-
|
8 |
-
PayPal's PHP Adaptive Payments SDK requires
|
9 |
-
|
10 |
-
* PHP 5.2 and above with curl extension enabled
|
11 |
-
|
12 |
-
|
13 |
-
Using the SDK
|
14 |
-
-------------
|
15 |
-
|
16 |
-
To use the SDK,
|
17 |
-
|
18 |
-
* Copy the config and lib folders into your project.
|
19 |
-
* Make sure that the lib folder in your project is available in PHP's include path
|
20 |
-
* Include the services\AdaptivePayments\AdaptivePaymentsService.php file in your code.
|
21 |
-
* Create a service wrapper object
|
22 |
-
* Create a request object as per your project's needs. All the API request and response classes are available in services\AdaptivePayments\AdaptivePaymentsService.php
|
23 |
-
* Invoke the appropriate method on the request object.
|
24 |
-
|
25 |
-
For example,
|
26 |
-
|
27 |
-
require_once('services/AdaptivePayments/AdaptivePaymentsService.php');
|
28 |
-
require_once('PPLoggingManager.php');
|
29 |
-
|
30 |
-
$payRequest = new PayRequest($requestEnvelope, $_POST['actionType'], $_POST['cancelUrl'], $_POST['currencyCode'], $receiverList, $_POST['returnUrl']);
|
31 |
-
// Add optional params
|
32 |
-
if($_POST["feesPayer"] != "") {
|
33 |
-
$payRequest->feesPayer = $_POST["feesPayer"];
|
34 |
-
}
|
35 |
-
......
|
36 |
-
|
37 |
-
$service = new AdaptivePaymentsService();
|
38 |
-
$response = $service->Pay($payRequest);
|
39 |
-
|
40 |
-
$ack = strtoupper($response->responseEnvelope->ack);
|
41 |
-
|
42 |
-
if($ack == 'SUCCESS') {
|
43 |
-
// Success
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
SDK Configuration
|
49 |
-
-----------------
|
50 |
-
|
51 |
-
replace the API credential in config/sdk_config.ini . You can use the configuration file to configure
|
52 |
-
|
53 |
-
* (Multiple) API account credentials.
|
54 |
-
* Service endpoint and other HTTP connection parameters
|
55 |
-
|
56 |
-
|
57 |
-
Please refer to the sample config file provided with this bundle.
|
1 |
+
|
2 |
+
PayPal PHP Adaptive Payments SDK
|
3 |
+
===============================
|
4 |
+
|
5 |
+
Prerequisites
|
6 |
+
-------------
|
7 |
+
|
8 |
+
PayPal's PHP Adaptive Payments SDK requires
|
9 |
+
|
10 |
+
* PHP 5.2 and above with curl extension enabled
|
11 |
+
|
12 |
+
|
13 |
+
Using the SDK
|
14 |
+
-------------
|
15 |
+
|
16 |
+
To use the SDK,
|
17 |
+
|
18 |
+
* Copy the config and lib folders into your project.
|
19 |
+
* Make sure that the lib folder in your project is available in PHP's include path
|
20 |
+
* Include the services\AdaptivePayments\AdaptivePaymentsService.php file in your code.
|
21 |
+
* Create a service wrapper object
|
22 |
+
* Create a request object as per your project's needs. All the API request and response classes are available in services\AdaptivePayments\AdaptivePaymentsService.php
|
23 |
+
* Invoke the appropriate method on the request object.
|
24 |
+
|
25 |
+
For example,
|
26 |
+
|
27 |
+
require_once('services/AdaptivePayments/AdaptivePaymentsService.php');
|
28 |
+
require_once('PPLoggingManager.php');
|
29 |
+
|
30 |
+
$payRequest = new PayRequest($requestEnvelope, $_POST['actionType'], $_POST['cancelUrl'], $_POST['currencyCode'], $receiverList, $_POST['returnUrl']);
|
31 |
+
// Add optional params
|
32 |
+
if($_POST["feesPayer"] != "") {
|
33 |
+
$payRequest->feesPayer = $_POST["feesPayer"];
|
34 |
+
}
|
35 |
+
......
|
36 |
+
|
37 |
+
$service = new AdaptivePaymentsService();
|
38 |
+
$response = $service->Pay($payRequest);
|
39 |
+
|
40 |
+
$ack = strtoupper($response->responseEnvelope->ack);
|
41 |
+
|
42 |
+
if($ack == 'SUCCESS') {
|
43 |
+
// Success
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
SDK Configuration
|
49 |
+
-----------------
|
50 |
+
|
51 |
+
replace the API credential in config/sdk_config.ini . You can use the configuration file to configure
|
52 |
+
|
53 |
+
* (Multiple) API account credentials.
|
54 |
+
* Service endpoint and other HTTP connection parameters
|
55 |
+
|
56 |
+
|
57 |
+
Please refer to the sample config file provided with this bundle.
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/build.xml
RENAMED
@@ -1,24 +1,24 @@
|
|
1 |
-
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
<project name="PayPal_PHP_SDK" default="build">
|
3 |
-
|
4 |
-
|
5 |
-
<condition property="PHPUNIT_PATH" value="phpunit.bat" else="phpunit">
|
6 |
-
<os family="windows"/>
|
7 |
-
</condition>
|
8 |
-
|
9 |
-
<target name="clean">
|
10 |
-
<delete dir="${basedir}/build"/>
|
11 |
-
</target>
|
12 |
-
|
13 |
-
|
14 |
-
<target name="phpunit">
|
15 |
-
<mkdir dir="tests/reports/"/>
|
16 |
-
<exec dir="${basedir}" executable="${PHPUNIT_PATH}" failonerror="true">
|
17 |
-
<arg
|
18 |
-
line="--testdox --include-path lib --log-junit tests\reports\phpunit.xml tests"/>
|
19 |
-
</exec>
|
20 |
-
</target>
|
21 |
-
|
22 |
-
|
23 |
-
<target name="build" depends="clean, phpunit"/>
|
24 |
-
</project>
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<project name="PayPal_PHP_SDK" default="build">
|
3 |
+
|
4 |
+
|
5 |
+
<condition property="PHPUNIT_PATH" value="phpunit.bat" else="phpunit">
|
6 |
+
<os family="windows"/>
|
7 |
+
</condition>
|
8 |
+
|
9 |
+
<target name="clean">
|
10 |
+
<delete dir="${basedir}/build"/>
|
11 |
+
</target>
|
12 |
+
|
13 |
+
|
14 |
+
<target name="phpunit">
|
15 |
+
<mkdir dir="tests/reports/"/>
|
16 |
+
<exec dir="${basedir}" executable="${PHPUNIT_PATH}" failonerror="true">
|
17 |
+
<arg
|
18 |
+
line="--testdox --include-path lib --log-junit tests\reports\phpunit.xml tests"/>
|
19 |
+
</exec>
|
20 |
+
</target>
|
21 |
+
|
22 |
+
|
23 |
+
<target name="build" depends="clean, phpunit"/>
|
24 |
+
</project>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/config/cert_key.pem
RENAMED
@@ -1,31 +1,31 @@
|
|
1 |
-
-----BEGIN RSA PRIVATE KEY-----
|
2 |
-
MIICXgIBAAKBgQCaGw566OIaeIsrp2tyzfwUtwapk2aPgL9N8oOoPmTmA/bqhqF8
|
3 |
-
2X43EB2zZF1HY35kPp3L5rZSjqraEZz5j7W4DkXMS286wLnaoh02sVWbbXlLcZ/v
|
4 |
-
sAQzNgi1s2raOWonkcbAIAyhjVoGQjpuCn7y9YNgQfpZkgrh/R5ig8obQwIDAQAB
|
5 |
-
AoGBAI/YrZ2BAHzhBFdNQXi6WZEkfu2PD27oKKojs006YIhsLvEflmGpyqyvOGoZ
|
6 |
-
RxC6CGKeKEEKLCnHzicbxcEVqfKfOxrXkym3ldqBaYubL1OU62biDRtZZdIpG3TE
|
7 |
-
gBDRtU8gPQv1ykqY9KqdeORy8vu0lW9Zx9/4ccW126HLt/kxAkEAzF9NKltIc+gu
|
8 |
-
S79lzerE8qngiUSc/ccb1ssLj4v4Lf90HNeJ4oSQEikuN32GjPVrUpQYpC4fjcET
|
9 |
-
KmqE7k1V3wJBAMEJB3VRToeTQKhWet8JQPkcfES3B+l7NCauUcysSI5XZ9kVflLu
|
10 |
-
c5vzznMooRpcNtjJwDmkcnW0lhIQH/DKvx0CQQCWHJXoO54vDGYc2xuisQMyHha/
|
11 |
-
nHcXbA0FqqP2Lt/+oTifCq3LhITx4e+BcKDInmbTA9ZJmVsx2pQCPrUe+AzPAkA/
|
12 |
-
OU7ZDPVUkFU4DYMW8/f033CQLQaJYVH2bVfbWn41KMmZn2GNlg4FgTgYHbGOaa+J
|
13 |
-
F6M+/e6DQM96QQ/FFRK9AkEApx1r0di+W2ibrTANnk6QjQbva9JyOztI+Avg86X5
|
14 |
-
swB44tEsRImOTNsE6nfE/215AxjgI1vdn6uU4P8GIKfxnw==
|
15 |
-
-----END RSA PRIVATE KEY-----
|
16 |
-
-----BEGIN CERTIFICATE-----
|
17 |
-
MIICiDCCAfGgAwIBAgIDD/WUMA0GCSqGSIb3DQEBBQUAMIGfMQswCQYDVQQGEwJV
|
18 |
-
UzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxFTATBgNV
|
19 |
-
BAoTDFBheVBhbCwgSW5jLjEWMBQGA1UECxQNc2FuZGJveF9jZXJ0czEbMBkGA1UE
|
20 |
-
AxQSc2FuZGJveF9jYW1lcmNoYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwu
|
21 |
-
Y29tMB4XDTExMDUwMjA1MDQ0NFoXDTIxMDQyOTA1MDQ0NFowYzElMCMGA1UEAxQc
|
22 |
-
Y2VydHVzZXJfYml6X2FwaTEucGF5cGFsLmNvbTEPMA0GA1UEChMGQm9uem9wMQ8w
|
23 |
-
DQYDVQQHEwZBdXN0aW4xCzAJBgNVBAgTAlRYMQswCQYDVQQGEwJVUzCBnzANBgkq
|
24 |
-
hkiG9w0BAQEFAAOBjQAwgYkCgYEAmhsOeujiGniLK6drcs38FLcGqZNmj4C/TfKD
|
25 |
-
qD5k5gP26oahfNl+NxAds2RdR2N+ZD6dy+a2Uo6q2hGc+Y+1uA5FzEtvOsC52qId
|
26 |
-
NrFVm215S3Gf77AEMzYItbNq2jlqJ5HGwCAMoY1aBkI6bgp+8vWDYEH6WZIK4f0e
|
27 |
-
YoPKG0MCAwEAAaMNMAswCQYDVR0TBAIwADANBgkqhkiG9w0BAQUFAAOBgQBj6xWw
|
28 |
-
AumLzSodCWyocPcyKSooNa7wgJKzaVrf0Kxz2QBesKpsfe9UN3Dj04016FIUbkRI
|
29 |
-
4qLJIkKHyeQRU9hvJ78tU7OeykDEVqlHAEE/Z4c5EIs6l9x60VqOpAjnaqX/9Jty
|
30 |
-
jXhqpINjolTh6D5jq8y4FX5krKqIYBCNDHM+cQ==
|
31 |
-
-----END CERTIFICATE-----
|
1 |
+
-----BEGIN RSA PRIVATE KEY-----
|
2 |
+
MIICXgIBAAKBgQCaGw566OIaeIsrp2tyzfwUtwapk2aPgL9N8oOoPmTmA/bqhqF8
|
3 |
+
2X43EB2zZF1HY35kPp3L5rZSjqraEZz5j7W4DkXMS286wLnaoh02sVWbbXlLcZ/v
|
4 |
+
sAQzNgi1s2raOWonkcbAIAyhjVoGQjpuCn7y9YNgQfpZkgrh/R5ig8obQwIDAQAB
|
5 |
+
AoGBAI/YrZ2BAHzhBFdNQXi6WZEkfu2PD27oKKojs006YIhsLvEflmGpyqyvOGoZ
|
6 |
+
RxC6CGKeKEEKLCnHzicbxcEVqfKfOxrXkym3ldqBaYubL1OU62biDRtZZdIpG3TE
|
7 |
+
gBDRtU8gPQv1ykqY9KqdeORy8vu0lW9Zx9/4ccW126HLt/kxAkEAzF9NKltIc+gu
|
8 |
+
S79lzerE8qngiUSc/ccb1ssLj4v4Lf90HNeJ4oSQEikuN32GjPVrUpQYpC4fjcET
|
9 |
+
KmqE7k1V3wJBAMEJB3VRToeTQKhWet8JQPkcfES3B+l7NCauUcysSI5XZ9kVflLu
|
10 |
+
c5vzznMooRpcNtjJwDmkcnW0lhIQH/DKvx0CQQCWHJXoO54vDGYc2xuisQMyHha/
|
11 |
+
nHcXbA0FqqP2Lt/+oTifCq3LhITx4e+BcKDInmbTA9ZJmVsx2pQCPrUe+AzPAkA/
|
12 |
+
OU7ZDPVUkFU4DYMW8/f033CQLQaJYVH2bVfbWn41KMmZn2GNlg4FgTgYHbGOaa+J
|
13 |
+
F6M+/e6DQM96QQ/FFRK9AkEApx1r0di+W2ibrTANnk6QjQbva9JyOztI+Avg86X5
|
14 |
+
swB44tEsRImOTNsE6nfE/215AxjgI1vdn6uU4P8GIKfxnw==
|
15 |
+
-----END RSA PRIVATE KEY-----
|
16 |
+
-----BEGIN CERTIFICATE-----
|
17 |
+
MIICiDCCAfGgAwIBAgIDD/WUMA0GCSqGSIb3DQEBBQUAMIGfMQswCQYDVQQGEwJV
|
18 |
+
UzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxFTATBgNV
|
19 |
+
BAoTDFBheVBhbCwgSW5jLjEWMBQGA1UECxQNc2FuZGJveF9jZXJ0czEbMBkGA1UE
|
20 |
+
AxQSc2FuZGJveF9jYW1lcmNoYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwu
|
21 |
+
Y29tMB4XDTExMDUwMjA1MDQ0NFoXDTIxMDQyOTA1MDQ0NFowYzElMCMGA1UEAxQc
|
22 |
+
Y2VydHVzZXJfYml6X2FwaTEucGF5cGFsLmNvbTEPMA0GA1UEChMGQm9uem9wMQ8w
|
23 |
+
DQYDVQQHEwZBdXN0aW4xCzAJBgNVBAgTAlRYMQswCQYDVQQGEwJVUzCBnzANBgkq
|
24 |
+
hkiG9w0BAQEFAAOBjQAwgYkCgYEAmhsOeujiGniLK6drcs38FLcGqZNmj4C/TfKD
|
25 |
+
qD5k5gP26oahfNl+NxAds2RdR2N+ZD6dy+a2Uo6q2hGc+Y+1uA5FzEtvOsC52qId
|
26 |
+
NrFVm215S3Gf77AEMzYItbNq2jlqJ5HGwCAMoY1aBkI6bgp+8vWDYEH6WZIK4f0e
|
27 |
+
YoPKG0MCAwEAAaMNMAswCQYDVR0TBAIwADANBgkqhkiG9w0BAQUFAAOBgQBj6xWw
|
28 |
+
AumLzSodCWyocPcyKSooNa7wgJKzaVrf0Kxz2QBesKpsfe9UN3Dj04016FIUbkRI
|
29 |
+
4qLJIkKHyeQRU9hvJ78tU7OeykDEVqlHAEE/Z4c5EIs6l9x60VqOpAjnaqX/9Jty
|
30 |
+
jXhqpINjolTh6D5jq8y4FX5krKqIYBCNDHM+cQ==
|
31 |
+
-----END CERTIFICATE-----
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/config/sdk_config.ini
RENAMED
@@ -1,26 +1,26 @@
|
|
1 |
-
;Account credentials
|
2 |
-
[Account]
|
3 |
-
acct1.UserName = jb-us-seller_api1.paypal.com
|
4 |
-
acct1.Password = WX4WTU3S8MY44S7F
|
5 |
-
acct1.Signature = AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
|
6 |
-
acct1.AppId = APP-80W284485P519543T
|
7 |
-
|
8 |
-
;Connection Information
|
9 |
-
[Http]
|
10 |
-
http.ConnectionTimeOut = 30
|
11 |
-
http.Retry = 5
|
12 |
-
;http.Proxy
|
13 |
-
|
14 |
-
;Service Configuration
|
15 |
-
[Service]
|
16 |
-
; NOTE: Do not change the service binding configuration.
|
17 |
-
service.Binding = NV
|
18 |
-
service.EndPoint = "https://svcs.sandbox.paypal.com/"
|
19 |
-
service.RedirectURL = "https://www.sandbox.paypal.com/webscr&cmd="
|
20 |
-
service.DevCentralURL = "https://developer.paypal.com"
|
21 |
-
|
22 |
-
;Logging Information
|
23 |
-
[Log]
|
24 |
-
log.FileName = PayPal.log
|
25 |
-
log.LogLevel = INFO
|
26 |
-
log.LogEnabled = true
|
1 |
+
;Account credentials
|
2 |
+
[Account]
|
3 |
+
acct1.UserName = jb-us-seller_api1.paypal.com
|
4 |
+
acct1.Password = WX4WTU3S8MY44S7F
|
5 |
+
acct1.Signature = AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy
|
6 |
+
acct1.AppId = APP-80W284485P519543T
|
7 |
+
|
8 |
+
;Connection Information
|
9 |
+
[Http]
|
10 |
+
http.ConnectionTimeOut = 30
|
11 |
+
http.Retry = 5
|
12 |
+
;http.Proxy
|
13 |
+
|
14 |
+
;Service Configuration
|
15 |
+
[Service]
|
16 |
+
; NOTE: Do not change the service binding configuration.
|
17 |
+
service.Binding = NV
|
18 |
+
service.EndPoint = "https://svcs.sandbox.paypal.com/"
|
19 |
+
service.RedirectURL = "https://www.sandbox.paypal.com/webscr&cmd="
|
20 |
+
service.DevCentralURL = "https://developer.paypal.com"
|
21 |
+
|
22 |
+
;Logging Information
|
23 |
+
[Log]
|
24 |
+
log.FileName = PayPal.log
|
25 |
+
log.LogLevel = INFO
|
26 |
+
log.LogEnabled = true
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/IPPCredential.php
RENAMED
@@ -1,53 +1,53 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Base class that represents API credentials
|
5 |
-
*/
|
6 |
-
abstract class IPPCredential
|
7 |
-
{
|
8 |
-
/**
|
9 |
-
* Application Id that uniquely identifies the application
|
10 |
-
* The application Id is issued by PayPal.
|
11 |
-
* Test application Ids are available for the sandbox environment
|
12 |
-
* @var string
|
13 |
-
*/
|
14 |
-
protected $applicationId;
|
15 |
-
|
16 |
-
/**
|
17 |
-
* API username
|
18 |
-
* @var string
|
19 |
-
*/
|
20 |
-
protected $userName;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* API password
|
24 |
-
* @var string
|
25 |
-
*/
|
26 |
-
protected $password;
|
27 |
-
|
28 |
-
protected abstract function validate();
|
29 |
-
|
30 |
-
public function __construct( $userName, $password, $applicationId )
|
31 |
-
{
|
32 |
-
$this->userName = $userName;
|
33 |
-
$this->password = $password;
|
34 |
-
$this->applicationId = $applicationId;
|
35 |
-
}
|
36 |
-
|
37 |
-
public function getApplicationId()
|
38 |
-
{
|
39 |
-
return $this->applicationId;
|
40 |
-
}
|
41 |
-
|
42 |
-
public function getUserName()
|
43 |
-
{
|
44 |
-
return $this->userName;
|
45 |
-
}
|
46 |
-
|
47 |
-
public function getPassword()
|
48 |
-
{
|
49 |
-
return $this->password;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
|
53 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Base class that represents API credentials
|
5 |
+
*/
|
6 |
+
abstract class IPPCredential
|
7 |
+
{
|
8 |
+
/**
|
9 |
+
* Application Id that uniquely identifies the application
|
10 |
+
* The application Id is issued by PayPal.
|
11 |
+
* Test application Ids are available for the sandbox environment
|
12 |
+
* @var string
|
13 |
+
*/
|
14 |
+
protected $applicationId;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* API username
|
18 |
+
* @var string
|
19 |
+
*/
|
20 |
+
protected $userName;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* API password
|
24 |
+
* @var string
|
25 |
+
*/
|
26 |
+
protected $password;
|
27 |
+
|
28 |
+
protected abstract function validate();
|
29 |
+
|
30 |
+
public function __construct( $userName, $password, $applicationId )
|
31 |
+
{
|
32 |
+
$this->userName = $userName;
|
33 |
+
$this->password = $password;
|
34 |
+
$this->applicationId = $applicationId;
|
35 |
+
}
|
36 |
+
|
37 |
+
public function getApplicationId()
|
38 |
+
{
|
39 |
+
return $this->applicationId;
|
40 |
+
}
|
41 |
+
|
42 |
+
public function getUserName()
|
43 |
+
{
|
44 |
+
return $this->userName;
|
45 |
+
}
|
46 |
+
|
47 |
+
public function getPassword()
|
48 |
+
{
|
49 |
+
return $this->password;
|
50 |
+
}
|
51 |
+
}
|
52 |
+
|
53 |
?>
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPAPIService.php
RENAMED
@@ -1,62 +1,62 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'PPCredentialManager.php';
|
3 |
-
require_once 'PPConnectionManager.php';
|
4 |
-
require_once 'PPObjectTransformer.php';
|
5 |
-
require_once 'PPLoggingManager.php';
|
6 |
-
require_once 'PPUtils.php';
|
7 |
-
require_once 'PPAuthenticationManager.php';
|
8 |
-
|
9 |
-
class PPAPIService
|
10 |
-
{
|
11 |
-
public $endpoint;
|
12 |
-
public $serviceName;
|
13 |
-
private $logger;
|
14 |
-
|
15 |
-
public function __construct( $serviceName = "" )
|
16 |
-
{
|
17 |
-
$this->serviceName = $serviceName;
|
18 |
-
$config = PPConfigManager::getInstance();
|
19 |
-
$this->endpoint = $config->get( 'service.EndPoint' );
|
20 |
-
$this->logger = new PPLoggingManager( __CLASS__ );
|
21 |
-
}
|
22 |
-
|
23 |
-
public function setServiceName( $serviceName )
|
24 |
-
{
|
25 |
-
$this->serviceName = $serviceName;
|
26 |
-
}
|
27 |
-
|
28 |
-
|
29 |
-
public function makeRequest( $apiMethod, $params, $apiUsername = null, $accessToken = null, $tokenSecret = null )
|
30 |
-
{
|
31 |
-
|
32 |
-
$authentication = new PPAuthenticationManager();
|
33 |
-
$connectionMgr = PPConnectionManager::getInstance();
|
34 |
-
$connection = $connectionMgr->getConnection();
|
35 |
-
|
36 |
-
$credMgr = PPCredentialManager::getInstance();
|
37 |
-
// $apiUsernam is optional, if null the default account in congif file is taken
|
38 |
-
$apIPPCredential = $credMgr->getCredentialObject( $apiUsername );
|
39 |
-
$config = PPConfigManager::getInstance();
|
40 |
-
if ( $config->get( 'service.Binding' ) == 'SOAP' ) {
|
41 |
-
$url = $this->endpoint;
|
42 |
-
if ( isset( $accessToken ) && isset( $tokenSecret ) ) {
|
43 |
-
$headers = $authentication->getPayPalHeaders( $apIPPCredential, $connection, $accessToken, $tokenSecret, $url );
|
44 |
-
} else {
|
45 |
-
$headers = null;
|
46 |
-
}
|
47 |
-
$params = $authentication->appendSoapHeader( $params, $apIPPCredential, $connection, $accessToken, $tokenSecret, $url );
|
48 |
-
} else {
|
49 |
-
$url = $this->endpoint . $this->serviceName . '/' . $apiMethod;
|
50 |
-
$headers = $authentication->getPayPalHeaders( $apIPPCredential, $connection, $accessToken, $tokenSecret, $url );
|
51 |
-
}
|
52 |
-
|
53 |
-
|
54 |
-
$this->logger->info( "Request: $params" );
|
55 |
-
$response = $connection->execute( $url, $params, $headers );
|
56 |
-
$this->logger->info( "Response: $response" );
|
57 |
-
|
58 |
-
return $response;
|
59 |
-
}
|
60 |
-
|
61 |
-
|
62 |
-
}
|
1 |
+
<?php
|
2 |
+
require_once 'PPCredentialManager.php';
|
3 |
+
require_once 'PPConnectionManager.php';
|
4 |
+
require_once 'PPObjectTransformer.php';
|
5 |
+
require_once 'PPLoggingManager.php';
|
6 |
+
require_once 'PPUtils.php';
|
7 |
+
require_once 'PPAuthenticationManager.php';
|
8 |
+
|
9 |
+
class PPAPIService
|
10 |
+
{
|
11 |
+
public $endpoint;
|
12 |
+
public $serviceName;
|
13 |
+
private $logger;
|
14 |
+
|
15 |
+
public function __construct( $serviceName = "" )
|
16 |
+
{
|
17 |
+
$this->serviceName = $serviceName;
|
18 |
+
$config = PPConfigManager::getInstance();
|
19 |
+
$this->endpoint = $config->get( 'service.EndPoint' );
|
20 |
+
$this->logger = new PPLoggingManager( __CLASS__ );
|
21 |
+
}
|
22 |
+
|
23 |
+
public function setServiceName( $serviceName )
|
24 |
+
{
|
25 |
+
$this->serviceName = $serviceName;
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
public function makeRequest( $apiMethod, $params, $apiUsername = null, $accessToken = null, $tokenSecret = null )
|
30 |
+
{
|
31 |
+
|
32 |
+
$authentication = new PPAuthenticationManager();
|
33 |
+
$connectionMgr = PPConnectionManager::getInstance();
|
34 |
+
$connection = $connectionMgr->getConnection();
|
35 |
+
|
36 |
+
$credMgr = PPCredentialManager::getInstance();
|
37 |
+
// $apiUsernam is optional, if null the default account in congif file is taken
|
38 |
+
$apIPPCredential = $credMgr->getCredentialObject( $apiUsername );
|
39 |
+
$config = PPConfigManager::getInstance();
|
40 |
+
if ( $config->get( 'service.Binding' ) == 'SOAP' ) {
|
41 |
+
$url = $this->endpoint;
|
42 |
+
if ( isset( $accessToken ) && isset( $tokenSecret ) ) {
|
43 |
+
$headers = $authentication->getPayPalHeaders( $apIPPCredential, $connection, $accessToken, $tokenSecret, $url );
|
44 |
+
} else {
|
45 |
+
$headers = null;
|
46 |
+
}
|
47 |
+
$params = $authentication->appendSoapHeader( $params, $apIPPCredential, $connection, $accessToken, $tokenSecret, $url );
|
48 |
+
} else {
|
49 |
+
$url = $this->endpoint . $this->serviceName . '/' . $apiMethod;
|
50 |
+
$headers = $authentication->getPayPalHeaders( $apIPPCredential, $connection, $accessToken, $tokenSecret, $url );
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
$this->logger->info( "Request: $params" );
|
55 |
+
$response = $connection->execute( $url, $params, $headers );
|
56 |
+
$this->logger->info( "Response: $response" );
|
57 |
+
|
58 |
+
return $response;
|
59 |
+
}
|
60 |
+
|
61 |
+
|
62 |
+
}
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPAuthenticationManager.php
RENAMED
@@ -1,91 +1,91 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'IPPCredential.php';
|
3 |
-
require_once 'PPConfigManager.php';
|
4 |
-
require_once 'PPSignatureCredential.php';
|
5 |
-
require_once 'PPCertificateCredential.php';
|
6 |
-
require_once 'exceptions/PPInvalidCredentialException.php';
|
7 |
-
require_once 'auth/PPAuth.php';
|
8 |
-
|
9 |
-
class PPAuthenticationManager
|
10 |
-
{
|
11 |
-
public function getPayPalHeaders( $apiCred, $connection, $accessToken = null, $tokenSecret = null, $url = null )
|
12 |
-
{
|
13 |
-
$config = PPConfigManager::getInstance();
|
14 |
-
|
15 |
-
if ( isset( $accessToken ) && isset( $tokenSecret ) ) {
|
16 |
-
$headers_arr[ ] = "X-PAYPAL-AUTHORIZATION: " . $this->generateAuthString( $apiCred, $accessToken, $tokenSecret, $url );
|
17 |
-
//$headers_arr[] = "CLIENT-AUTH: No cert";
|
18 |
-
} // Add headers required for service authentication
|
19 |
-
else if ( $apiCred instanceof PPSignatureCredential ) {
|
20 |
-
$headers_arr[ ] = "X-PAYPAL-SECURITY-USERID: " . $apiCred->getUserName();
|
21 |
-
$headers_arr[ ] = "X-PAYPAL-SECURITY-PASSWORD: " . $apiCred->getPassword();
|
22 |
-
$headers_arr[ ] = "X-PAYPAL-SECURITY-SIGNATURE: " . $apiCred->getSignature();
|
23 |
-
} else if ( $apiCred instanceof PPCertificateCredential ) {
|
24 |
-
|
25 |
-
$headers_arr[ ] = "X-PAYPAL-SECURITY-USERID: " . $apiCred->getUserName();
|
26 |
-
$headers_arr[ ] = "X-PAYPAL-SECURITY-PASSWORD: " . $apiCred->getPassword();
|
27 |
-
$connection->setSSLCert( $apiCred->getCertificatePath(), $apiCred->getPassPhrase() );
|
28 |
-
}
|
29 |
-
|
30 |
-
// Add other headers
|
31 |
-
$headers_arr[ ] = "X-PAYPAL-APPLICATION-ID: " . $apiCred->getApplicationId();
|
32 |
-
$headers_arr[ ] = "X-PAYPAL-REQUEST-DATA-FORMAT: " . $config->get( 'service.Binding' );
|
33 |
-
$headers_arr[ ] = "X-PAYPAL-RESPONSE-DATA-FORMAT: " . $config->get( 'service.Binding' );
|
34 |
-
$headers_arr[ ] = "X-PAYPAL-DEVICE-IPADDRESS: " . PPUtils::getLocalIPAddress();
|
35 |
-
$headers_arr[ ] = "X-PAYPAL-REQUEST-SOURCE: " . PPUtils::getRequestSource();
|
36 |
-
|
37 |
-
return $headers_arr;
|
38 |
-
}
|
39 |
-
|
40 |
-
public function appendSoapHeader( $payLoad, $apiCred, $connection, $accessToken = null, $tokenSecret = null, $url = null )
|
41 |
-
{
|
42 |
-
$soapHeader = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:ebay:api:PayPalAPI\" xmlns:ebl=\"urn:ebay:apis:eBLBaseComponents\" xmlns:cc=\"urn:ebay:apis:CoreComponentTypes\" xmlns:ed=\"urn:ebay:apis:EnhancedDataTypes\">";
|
43 |
-
|
44 |
-
if ( isset( $accessToken ) && isset( $tokenSecret ) ) {
|
45 |
-
$soapHeader .= "<soapenv:Header>";
|
46 |
-
$soapHeader .= "<urn:RequesterCredentials/>";
|
47 |
-
$soapHeader .= "</soapenv:Header>";
|
48 |
-
} else if ( $apiCred instanceof PPSignatureCredential ) {
|
49 |
-
$soapHeader .= "<soapenv:Header>";
|
50 |
-
$soapHeader .= "<urn:RequesterCredentials>";
|
51 |
-
$soapHeader .= "<ebl:Credentials>";
|
52 |
-
$soapHeader .= "<ebl:Username>" . $apiCred->getUserName() . "</ebl:Username>";
|
53 |
-
$soapHeader .= "<ebl:Password>" . $apiCred->getPassword() . "</ebl:Password>";
|
54 |
-
$soapHeader .= "<ebl:Signature>" . $apiCred->getSignature() . "</ebl:Signature>";
|
55 |
-
$soapHeader .= "</ebl:Credentials>";
|
56 |
-
$soapHeader .= "</urn:RequesterCredentials>";
|
57 |
-
$soapHeader .= "</soapenv:Header>";
|
58 |
-
} else if ( $apiCred instanceof PPCertificateCredential ) {
|
59 |
-
$soapHeader .= "<soapenv:Header>";
|
60 |
-
$soapHeader .= "<urn:RequesterCredentials>";
|
61 |
-
$soapHeader .= "<ebl:Credentials>";
|
62 |
-
$soapHeader .= "<ebl:Username>" . $apiCred->getUserName() . "</ebl:Username>";
|
63 |
-
$soapHeader .= "<ebl:Password>" . $apiCred->getPassword() . "</ebl:Password>";
|
64 |
-
$soapHeader .= "</ebl:Credentials>";
|
65 |
-
$soapHeader .= "</urn:RequesterCredentials>";
|
66 |
-
$soapHeader .= "</soapenv:Header>";
|
67 |
-
$connection->setSSLCert( $apiCred->getCertificatePath(), $apiCred->getPassPhrase() );
|
68 |
-
}
|
69 |
-
$soapHeader .= "<soapenv:Body>";
|
70 |
-
$soapHeader .= $payLoad;
|
71 |
-
$soapHeader .= "</soapenv:Body>";
|
72 |
-
$soapHeader .= "</soapenv:Envelope>";
|
73 |
-
|
74 |
-
return $soapHeader;
|
75 |
-
|
76 |
-
}
|
77 |
-
|
78 |
-
private function generateAuthString( $apiCred, $accessToken, $tokenSecret, $endpoint )
|
79 |
-
{
|
80 |
-
$key = $apiCred->getUserName();
|
81 |
-
$secret = $apiCred->getPassword();
|
82 |
-
$auth = new AuthSignature();
|
83 |
-
$response = $auth->genSign( $key, $secret, $accessToken, $tokenSecret, 'POST', $endpoint );
|
84 |
-
$authString = "token=" . $accessToken . ",signature=" . $response[ 'oauth_signature' ] . ",timestamp=" . $response[ 'oauth_timestamp' ];
|
85 |
-
|
86 |
-
return $authString;
|
87 |
-
}
|
88 |
-
|
89 |
-
}
|
90 |
-
|
91 |
?>
|
1 |
+
<?php
|
2 |
+
require_once 'IPPCredential.php';
|
3 |
+
require_once 'PPConfigManager.php';
|
4 |
+
require_once 'PPSignatureCredential.php';
|
5 |
+
require_once 'PPCertificateCredential.php';
|
6 |
+
require_once 'exceptions/PPInvalidCredentialException.php';
|
7 |
+
require_once 'auth/PPAuth.php';
|
8 |
+
|
9 |
+
class PPAuthenticationManager
|
10 |
+
{
|
11 |
+
public function getPayPalHeaders( $apiCred, $connection, $accessToken = null, $tokenSecret = null, $url = null )
|
12 |
+
{
|
13 |
+
$config = PPConfigManager::getInstance();
|
14 |
+
|
15 |
+
if ( isset( $accessToken ) && isset( $tokenSecret ) ) {
|
16 |
+
$headers_arr[ ] = "X-PAYPAL-AUTHORIZATION: " . $this->generateAuthString( $apiCred, $accessToken, $tokenSecret, $url );
|
17 |
+
//$headers_arr[] = "CLIENT-AUTH: No cert";
|
18 |
+
} // Add headers required for service authentication
|
19 |
+
else if ( $apiCred instanceof PPSignatureCredential ) {
|
20 |
+
$headers_arr[ ] = "X-PAYPAL-SECURITY-USERID: " . $apiCred->getUserName();
|
21 |
+
$headers_arr[ ] = "X-PAYPAL-SECURITY-PASSWORD: " . $apiCred->getPassword();
|
22 |
+
$headers_arr[ ] = "X-PAYPAL-SECURITY-SIGNATURE: " . $apiCred->getSignature();
|
23 |
+
} else if ( $apiCred instanceof PPCertificateCredential ) {
|
24 |
+
|
25 |
+
$headers_arr[ ] = "X-PAYPAL-SECURITY-USERID: " . $apiCred->getUserName();
|
26 |
+
$headers_arr[ ] = "X-PAYPAL-SECURITY-PASSWORD: " . $apiCred->getPassword();
|
27 |
+
$connection->setSSLCert( $apiCred->getCertificatePath(), $apiCred->getPassPhrase() );
|
28 |
+
}
|
29 |
+
|
30 |
+
// Add other headers
|
31 |
+
$headers_arr[ ] = "X-PAYPAL-APPLICATION-ID: " . $apiCred->getApplicationId();
|
32 |
+
$headers_arr[ ] = "X-PAYPAL-REQUEST-DATA-FORMAT: " . $config->get( 'service.Binding' );
|
33 |
+
$headers_arr[ ] = "X-PAYPAL-RESPONSE-DATA-FORMAT: " . $config->get( 'service.Binding' );
|
34 |
+
$headers_arr[ ] = "X-PAYPAL-DEVICE-IPADDRESS: " . PPUtils::getLocalIPAddress();
|
35 |
+
$headers_arr[ ] = "X-PAYPAL-REQUEST-SOURCE: " . PPUtils::getRequestSource();
|
36 |
+
|
37 |
+
return $headers_arr;
|
38 |
+
}
|
39 |
+
|
40 |
+
public function appendSoapHeader( $payLoad, $apiCred, $connection, $accessToken = null, $tokenSecret = null, $url = null )
|
41 |
+
{
|
42 |
+
$soapHeader = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:urn=\"urn:ebay:api:PayPalAPI\" xmlns:ebl=\"urn:ebay:apis:eBLBaseComponents\" xmlns:cc=\"urn:ebay:apis:CoreComponentTypes\" xmlns:ed=\"urn:ebay:apis:EnhancedDataTypes\">";
|
43 |
+
|
44 |
+
if ( isset( $accessToken ) && isset( $tokenSecret ) ) {
|
45 |
+
$soapHeader .= "<soapenv:Header>";
|
46 |
+
$soapHeader .= "<urn:RequesterCredentials/>";
|
47 |
+
$soapHeader .= "</soapenv:Header>";
|
48 |
+
} else if ( $apiCred instanceof PPSignatureCredential ) {
|
49 |
+
$soapHeader .= "<soapenv:Header>";
|
50 |
+
$soapHeader .= "<urn:RequesterCredentials>";
|
51 |
+
$soapHeader .= "<ebl:Credentials>";
|
52 |
+
$soapHeader .= "<ebl:Username>" . $apiCred->getUserName() . "</ebl:Username>";
|
53 |
+
$soapHeader .= "<ebl:Password>" . $apiCred->getPassword() . "</ebl:Password>";
|
54 |
+
$soapHeader .= "<ebl:Signature>" . $apiCred->getSignature() . "</ebl:Signature>";
|
55 |
+
$soapHeader .= "</ebl:Credentials>";
|
56 |
+
$soapHeader .= "</urn:RequesterCredentials>";
|
57 |
+
$soapHeader .= "</soapenv:Header>";
|
58 |
+
} else if ( $apiCred instanceof PPCertificateCredential ) {
|
59 |
+
$soapHeader .= "<soapenv:Header>";
|
60 |
+
$soapHeader .= "<urn:RequesterCredentials>";
|
61 |
+
$soapHeader .= "<ebl:Credentials>";
|
62 |
+
$soapHeader .= "<ebl:Username>" . $apiCred->getUserName() . "</ebl:Username>";
|
63 |
+
$soapHeader .= "<ebl:Password>" . $apiCred->getPassword() . "</ebl:Password>";
|
64 |
+
$soapHeader .= "</ebl:Credentials>";
|
65 |
+
$soapHeader .= "</urn:RequesterCredentials>";
|
66 |
+
$soapHeader .= "</soapenv:Header>";
|
67 |
+
$connection->setSSLCert( $apiCred->getCertificatePath(), $apiCred->getPassPhrase() );
|
68 |
+
}
|
69 |
+
$soapHeader .= "<soapenv:Body>";
|
70 |
+
$soapHeader .= $payLoad;
|
71 |
+
$soapHeader .= "</soapenv:Body>";
|
72 |
+
$soapHeader .= "</soapenv:Envelope>";
|
73 |
+
|
74 |
+
return $soapHeader;
|
75 |
+
|
76 |
+
}
|
77 |
+
|
78 |
+
private function generateAuthString( $apiCred, $accessToken, $tokenSecret, $endpoint )
|
79 |
+
{
|
80 |
+
$key = $apiCred->getUserName();
|
81 |
+
$secret = $apiCred->getPassword();
|
82 |
+
$auth = new AuthSignature();
|
83 |
+
$response = $auth->genSign( $key, $secret, $accessToken, $tokenSecret, 'POST', $endpoint );
|
84 |
+
$authString = "token=" . $accessToken . ",signature=" . $response[ 'oauth_signature' ] . ",timestamp=" . $response[ 'oauth_timestamp' ];
|
85 |
+
|
86 |
+
return $authString;
|
87 |
+
}
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
?>
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPBaseService.php
RENAMED
@@ -1,88 +1,88 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'PPAPIService.php';
|
3 |
-
|
4 |
-
|
5 |
-
class PPBaseService
|
6 |
-
{
|
7 |
-
|
8 |
-
private $serviceName;
|
9 |
-
|
10 |
-
/*
|
11 |
-
* Setters and getters for Third party authentication (Permission Services)
|
12 |
-
*/
|
13 |
-
protected $accessToken;
|
14 |
-
protected $tokenSecret;
|
15 |
-
protected $lastRequest;
|
16 |
-
protected $lastResponse;
|
17 |
-
|
18 |
-
public function getLastRequest()
|
19 |
-
{
|
20 |
-
return $this->lastRequest;
|
21 |
-
}
|
22 |
-
|
23 |
-
public function setLastRequest( $lastRqst )
|
24 |
-
{
|
25 |
-
$this->lastRequest = $lastRqst;
|
26 |
-
}
|
27 |
-
|
28 |
-
public function getLastResponse()
|
29 |
-
{
|
30 |
-
return $this->lastResponse;
|
31 |
-
}
|
32 |
-
|
33 |
-
public function setLastResponse( $lastRspns )
|
34 |
-
{
|
35 |
-
$this->lastResponse = $lastRspns;
|
36 |
-
}
|
37 |
-
|
38 |
-
public function getAccessToken()
|
39 |
-
{
|
40 |
-
return $this->accessToken;
|
41 |
-
}
|
42 |
-
|
43 |
-
public function setAccessToken( $accessToken )
|
44 |
-
{
|
45 |
-
$this->accessToken = $accessToken;
|
46 |
-
}
|
47 |
-
|
48 |
-
public function getTokenSecret()
|
49 |
-
{
|
50 |
-
return $this->tokenSecret;
|
51 |
-
}
|
52 |
-
|
53 |
-
public function setTokenSecret( $tokenSecret )
|
54 |
-
{
|
55 |
-
$this->tokenSecret = $tokenSecret;
|
56 |
-
}
|
57 |
-
|
58 |
-
public function __construct( $serviceName )
|
59 |
-
{
|
60 |
-
$this->serviceName = $serviceName;
|
61 |
-
}
|
62 |
-
|
63 |
-
public function getServiceName()
|
64 |
-
{
|
65 |
-
return $this->serviceName;
|
66 |
-
}
|
67 |
-
|
68 |
-
public function call( $method, $requestObject, $apiUsername = null )
|
69 |
-
{
|
70 |
-
$params = $this->marshall( $requestObject );
|
71 |
-
$service = new PPAPIService();
|
72 |
-
$service->setServiceName( $this->serviceName );
|
73 |
-
|
74 |
-
$this->lastRequest = $params;
|
75 |
-
$this->lastResponse = $service->makeRequest( $method, $params, $apiUsername, $this->accessToken, $this->tokenSecret );
|
76 |
-
|
77 |
-
return $this->lastResponse;
|
78 |
-
}
|
79 |
-
|
80 |
-
private function marshall( $object )
|
81 |
-
{
|
82 |
-
$transformer = new PPObjectTransformer();
|
83 |
-
|
84 |
-
return $transformer->toString( $object );
|
85 |
-
}
|
86 |
-
}
|
87 |
-
|
88 |
-
?>
|
1 |
+
<?php
|
2 |
+
require_once 'PPAPIService.php';
|
3 |
+
|
4 |
+
|
5 |
+
class PPBaseService
|
6 |
+
{
|
7 |
+
|
8 |
+
private $serviceName;
|
9 |
+
|
10 |
+
/*
|
11 |
+
* Setters and getters for Third party authentication (Permission Services)
|
12 |
+
*/
|
13 |
+
protected $accessToken;
|
14 |
+
protected $tokenSecret;
|
15 |
+
protected $lastRequest;
|
16 |
+
protected $lastResponse;
|
17 |
+
|
18 |
+
public function getLastRequest()
|
19 |
+
{
|
20 |
+
return $this->lastRequest;
|
21 |
+
}
|
22 |
+
|
23 |
+
public function setLastRequest( $lastRqst )
|
24 |
+
{
|
25 |
+
$this->lastRequest = $lastRqst;
|
26 |
+
}
|
27 |
+
|
28 |
+
public function getLastResponse()
|
29 |
+
{
|
30 |
+
return $this->lastResponse;
|
31 |
+
}
|
32 |
+
|
33 |
+
public function setLastResponse( $lastRspns )
|
34 |
+
{
|
35 |
+
$this->lastResponse = $lastRspns;
|
36 |
+
}
|
37 |
+
|
38 |
+
public function getAccessToken()
|
39 |
+
{
|
40 |
+
return $this->accessToken;
|
41 |
+
}
|
42 |
+
|
43 |
+
public function setAccessToken( $accessToken )
|
44 |
+
{
|
45 |
+
$this->accessToken = $accessToken;
|
46 |
+
}
|
47 |
+
|
48 |
+
public function getTokenSecret()
|
49 |
+
{
|
50 |
+
return $this->tokenSecret;
|
51 |
+
}
|
52 |
+
|
53 |
+
public function setTokenSecret( $tokenSecret )
|
54 |
+
{
|
55 |
+
$this->tokenSecret = $tokenSecret;
|
56 |
+
}
|
57 |
+
|
58 |
+
public function __construct( $serviceName )
|
59 |
+
{
|
60 |
+
$this->serviceName = $serviceName;
|
61 |
+
}
|
62 |
+
|
63 |
+
public function getServiceName()
|
64 |
+
{
|
65 |
+
return $this->serviceName;
|
66 |
+
}
|
67 |
+
|
68 |
+
public function call( $method, $requestObject, $apiUsername = null )
|
69 |
+
{
|
70 |
+
$params = $this->marshall( $requestObject );
|
71 |
+
$service = new PPAPIService();
|
72 |
+
$service->setServiceName( $this->serviceName );
|
73 |
+
|
74 |
+
$this->lastRequest = $params;
|
75 |
+
$this->lastResponse = $service->makeRequest( $method, $params, $apiUsername, $this->accessToken, $this->tokenSecret );
|
76 |
+
|
77 |
+
return $this->lastResponse;
|
78 |
+
}
|
79 |
+
|
80 |
+
private function marshall( $object )
|
81 |
+
{
|
82 |
+
$transformer = new PPObjectTransformer();
|
83 |
+
|
84 |
+
return $transformer->toString( $object );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
|
88 |
+
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPCertificateCredential.php
RENAMED
@@ -1,72 +1,72 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'IPPCredential.php';
|
3 |
-
require_once 'PPConfigManager.php';
|
4 |
-
require_once 'exceptions/PPMissingCredentialException.php';
|
5 |
-
|
6 |
-
class PPCertificateCredential extends IPPCredential
|
7 |
-
{
|
8 |
-
|
9 |
-
private $certificatePath;
|
10 |
-
|
11 |
-
private $passPhrase;
|
12 |
-
|
13 |
-
public function __construct( $userName, $password, $certPath, $appId, $passPhrase )
|
14 |
-
{
|
15 |
-
parent::__construct( $userName, $password, $appId );
|
16 |
-
$this->certificatePath = $certPath;
|
17 |
-
$this->passPhrase = $passPhrase;
|
18 |
-
$this->validate();
|
19 |
-
}
|
20 |
-
|
21 |
-
public function validate()
|
22 |
-
{
|
23 |
-
|
24 |
-
if ( $this->userName == null || $this->userName == "" ) {
|
25 |
-
throw new PPMissingCredentialException( "username cannot be empty" );
|
26 |
-
}
|
27 |
-
if ( $this->password == null || $this->password == "" ) {
|
28 |
-
throw new PPMissingCredentialException( "password cannot be empty" );
|
29 |
-
}
|
30 |
-
if ( $this->certificatePath == null || $this->certificatePath == "" ) {
|
31 |
-
throw new PPMissingCredentialException( "certificate cannot be empty" );
|
32 |
-
}
|
33 |
-
if ( $this->passPhrase == null || $this->passPhrase == "" ) {
|
34 |
-
throw new PPMissingCredentialException( "passphrase cannot be empty" );
|
35 |
-
}
|
36 |
-
if ( $this->applicationId == null || $this->applicationId == "" ) {
|
37 |
-
throw new PPMissingCredentialException( "applicationId cannot be empty" );
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
public function getUserName()
|
42 |
-
{
|
43 |
-
return $this->userName;
|
44 |
-
}
|
45 |
-
|
46 |
-
public function getPassword()
|
47 |
-
{
|
48 |
-
return $this->password;
|
49 |
-
}
|
50 |
-
|
51 |
-
public function getCertificatePath()
|
52 |
-
{
|
53 |
-
if ( realpath( $this->certificatePath ) ) {
|
54 |
-
return realpath( $this->certificatePath );
|
55 |
-
} else {
|
56 |
-
return realpath( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . $this->certificatePath );
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
public function getPassPhrase()
|
61 |
-
{
|
62 |
-
return $this->passPhrase;
|
63 |
-
}
|
64 |
-
|
65 |
-
public function getApplicationId()
|
66 |
-
{
|
67 |
-
return $this->applicationId;
|
68 |
-
}
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
?>
|
1 |
+
<?php
|
2 |
+
require_once 'IPPCredential.php';
|
3 |
+
require_once 'PPConfigManager.php';
|
4 |
+
require_once 'exceptions/PPMissingCredentialException.php';
|
5 |
+
|
6 |
+
class PPCertificateCredential extends IPPCredential
|
7 |
+
{
|
8 |
+
|
9 |
+
private $certificatePath;
|
10 |
+
|
11 |
+
private $passPhrase;
|
12 |
+
|
13 |
+
public function __construct( $userName, $password, $certPath, $appId, $passPhrase )
|
14 |
+
{
|
15 |
+
parent::__construct( $userName, $password, $appId );
|
16 |
+
$this->certificatePath = $certPath;
|
17 |
+
$this->passPhrase = $passPhrase;
|
18 |
+
$this->validate();
|
19 |
+
}
|
20 |
+
|
21 |
+
public function validate()
|
22 |
+
{
|
23 |
+
|
24 |
+
if ( $this->userName == null || $this->userName == "" ) {
|
25 |
+
throw new PPMissingCredentialException( "username cannot be empty" );
|
26 |
+
}
|
27 |
+
if ( $this->password == null || $this->password == "" ) {
|
28 |
+
throw new PPMissingCredentialException( "password cannot be empty" );
|
29 |
+
}
|
30 |
+
if ( $this->certificatePath == null || $this->certificatePath == "" ) {
|
31 |
+
throw new PPMissingCredentialException( "certificate cannot be empty" );
|
32 |
+
}
|
33 |
+
if ( $this->passPhrase == null || $this->passPhrase == "" ) {
|
34 |
+
throw new PPMissingCredentialException( "passphrase cannot be empty" );
|
35 |
+
}
|
36 |
+
if ( $this->applicationId == null || $this->applicationId == "" ) {
|
37 |
+
throw new PPMissingCredentialException( "applicationId cannot be empty" );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
public function getUserName()
|
42 |
+
{
|
43 |
+
return $this->userName;
|
44 |
+
}
|
45 |
+
|
46 |
+
public function getPassword()
|
47 |
+
{
|
48 |
+
return $this->password;
|
49 |
+
}
|
50 |
+
|
51 |
+
public function getCertificatePath()
|
52 |
+
{
|
53 |
+
if ( realpath( $this->certificatePath ) ) {
|
54 |
+
return realpath( $this->certificatePath );
|
55 |
+
} else {
|
56 |
+
return realpath( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . $this->certificatePath );
|
57 |
+
}
|
58 |
+
}
|
59 |
+
|
60 |
+
public function getPassPhrase()
|
61 |
+
{
|
62 |
+
return $this->passPhrase;
|
63 |
+
}
|
64 |
+
|
65 |
+
public function getApplicationId()
|
66 |
+
{
|
67 |
+
return $this->applicationId;
|
68 |
+
}
|
69 |
+
|
70 |
+
}
|
71 |
+
|
72 |
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPConfigManager.php
RENAMED
@@ -1,124 +1,124 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* PPConfigManager loads the SDK configuration file and
|
4 |
-
* hands out appropriate config params to other classes
|
5 |
-
*/
|
6 |
-
require_once 'exceptions/PPConfigurationException.php';
|
7 |
-
|
8 |
-
class PPConfigManager
|
9 |
-
{
|
10 |
-
|
11 |
-
private $config;
|
12 |
-
/**
|
13 |
-
*
|
14 |
-
*
|
15 |
-
* @var PPConfigManager
|
16 |
-
*/
|
17 |
-
private static $instance;
|
18 |
-
|
19 |
-
private function __construct()
|
20 |
-
{
|
21 |
-
$configFile = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . ".."
|
22 |
-
. DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "sdk_config.ini";
|
23 |
-
$this->load( $configFile );
|
24 |
-
}
|
25 |
-
|
26 |
-
// create singleton object for PPConfigManager
|
27 |
-
public static function getInstance()
|
28 |
-
{
|
29 |
-
if ( !isset( self::$instance ) ) {
|
30 |
-
self::$instance = new PPConfigManager();
|
31 |
-
}
|
32 |
-
|
33 |
-
return self::$instance;
|
34 |
-
}
|
35 |
-
|
36 |
-
//used to load the file
|
37 |
-
private function load( $fileName )
|
38 |
-
{
|
39 |
-
if ( class_exists( 'Woocommerce' ) ) {
|
40 |
-
global $woocommerce;
|
41 |
-
$gateways = $woocommerce->payment_gateways->payment_gateways();
|
42 |
-
$settings = $gateways[ 'paypalap' ]->settings;
|
43 |
-
|
44 |
-
$mode = $settings[ 'sandbox_enabled' ];
|
45 |
-
|
46 |
-
$this->config = array(
|
47 |
-
'acct1.UserName' => $mode == 'yes' ? $settings[ 'username' ] : $settings[ 'username_live' ],
|
48 |
-
'acct1.Password' => $mode == 'yes' ? $settings[ 'password' ] : $settings[ 'password_live' ],
|
49 |
-
'acct1.Signature' => $mode == 'yes' ? $settings[ 'signature' ] : $settings[ 'signature_live' ],
|
50 |
-
'acct1.AppId' => $mode == 'yes' ? 'APP-80W284485P519543T' : $settings[ 'app_id' ],
|
51 |
-
|
52 |
-
'service.Binding' => 'NV',
|
53 |
-
'service.EndPoint' => $mode == 'yes' ? 'https://svcs.sandbox.paypal.com/' : 'https://svcs.paypal.com/',
|
54 |
-
'service.RedirectURL' => $mode == 'yes' ? 'https://sandbox.paypal.com/webscr&cmd=' : 'https://paypal.com/webscr&cmd=',
|
55 |
-
'service.DevCentralURL' => 'https://developer.paypal.com',
|
56 |
-
'http.ConnectionTimeOut' => '30',
|
57 |
-
'http.Retry' => '5',
|
58 |
-
'log.FileName' => 'PayPal.log',
|
59 |
-
'log.LogLevel' => 'INFO',
|
60 |
-
'log.LogEnabled' => $settings[ 'logging_enabled' ] == 'yes' ? 'true' : 'false',
|
61 |
-
);
|
62 |
-
} else {
|
63 |
-
$this->config = @parse_ini_file( $fileName );
|
64 |
-
}
|
65 |
-
|
66 |
-
if ( $this->config == null || count( $this->config ) == 0 ) {
|
67 |
-
throw new PPConfigurationException( "Config file $fileName not found", "303" );
|
68 |
-
}
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* simple getter for configuration params
|
73 |
-
* If an exact match for key is not found,
|
74 |
-
* does a "contains" search on the key
|
75 |
-
*/
|
76 |
-
public function get( $searchKey )
|
77 |
-
{
|
78 |
-
|
79 |
-
if ( array_key_exists( $searchKey, $this->config ) ) {
|
80 |
-
return $this->config[ $searchKey ];
|
81 |
-
} else {
|
82 |
-
$arr = array();
|
83 |
-
foreach ( $this->config as $k => $v ) {
|
84 |
-
if ( strstr( $k, $searchKey ) ) {
|
85 |
-
$arr[ $k ] = $v;
|
86 |
-
}
|
87 |
-
}
|
88 |
-
|
89 |
-
return $arr;
|
90 |
-
}
|
91 |
-
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* Utility method for handling account configuration
|
96 |
-
* return config key corresponding to the API userId passed in
|
97 |
-
*
|
98 |
-
* If $userId is null, returns config keys corresponding to
|
99 |
-
* all configured accounts
|
100 |
-
*/
|
101 |
-
public function getIniPrefix( $userId = null )
|
102 |
-
{
|
103 |
-
|
104 |
-
if ( $userId == null ) {
|
105 |
-
$arr = array();
|
106 |
-
foreach ( $this->config as $key => $value ) {
|
107 |
-
$pos = strpos( $key, '.' );
|
108 |
-
if ( strstr( $key, "acct" ) ) {
|
109 |
-
$arr[ ] = substr( $key, 0, $pos );
|
110 |
-
}
|
111 |
-
}
|
112 |
-
|
113 |
-
return array_unique( $arr );
|
114 |
-
} else {
|
115 |
-
$iniPrefix = array_search( $userId, $this->config );
|
116 |
-
$pos = strpos( $iniPrefix, '.' );
|
117 |
-
$acct = substr( $iniPrefix, 0, $pos );
|
118 |
-
|
119 |
-
return $acct;
|
120 |
-
}
|
121 |
-
}
|
122 |
-
}
|
123 |
-
|
124 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* PPConfigManager loads the SDK configuration file and
|
4 |
+
* hands out appropriate config params to other classes
|
5 |
+
*/
|
6 |
+
require_once 'exceptions/PPConfigurationException.php';
|
7 |
+
|
8 |
+
class PPConfigManager
|
9 |
+
{
|
10 |
+
|
11 |
+
private $config;
|
12 |
+
/**
|
13 |
+
*
|
14 |
+
*
|
15 |
+
* @var PPConfigManager
|
16 |
+
*/
|
17 |
+
private static $instance;
|
18 |
+
|
19 |
+
private function __construct()
|
20 |
+
{
|
21 |
+
$configFile = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . ".."
|
22 |
+
. DIRECTORY_SEPARATOR . "config" . DIRECTORY_SEPARATOR . "sdk_config.ini";
|
23 |
+
$this->load( $configFile );
|
24 |
+
}
|
25 |
+
|
26 |
+
// create singleton object for PPConfigManager
|
27 |
+
public static function getInstance()
|
28 |
+
{
|
29 |
+
if ( !isset( self::$instance ) ) {
|
30 |
+
self::$instance = new PPConfigManager();
|
31 |
+
}
|
32 |
+
|
33 |
+
return self::$instance;
|
34 |
+
}
|
35 |
+
|
36 |
+
//used to load the file
|
37 |
+
private function load( $fileName )
|
38 |
+
{
|
39 |
+
if ( class_exists( 'Woocommerce' ) ) {
|
40 |
+
global $woocommerce;
|
41 |
+
$gateways = $woocommerce->payment_gateways->payment_gateways();
|
42 |
+
$settings = $gateways[ 'paypalap' ]->settings;
|
43 |
+
|
44 |
+
$mode = $settings[ 'sandbox_enabled' ];
|
45 |
+
|
46 |
+
$this->config = array(
|
47 |
+
'acct1.UserName' => $mode == 'yes' ? $settings[ 'username' ] : $settings[ 'username_live' ],
|
48 |
+
'acct1.Password' => $mode == 'yes' ? $settings[ 'password' ] : $settings[ 'password_live' ],
|
49 |
+
'acct1.Signature' => $mode == 'yes' ? $settings[ 'signature' ] : $settings[ 'signature_live' ],
|
50 |
+
'acct1.AppId' => $mode == 'yes' ? 'APP-80W284485P519543T' : $settings[ 'app_id' ],
|
51 |
+
|
52 |
+
'service.Binding' => 'NV',
|
53 |
+
'service.EndPoint' => $mode == 'yes' ? 'https://svcs.sandbox.paypal.com/' : 'https://svcs.paypal.com/',
|
54 |
+
'service.RedirectURL' => $mode == 'yes' ? 'https://sandbox.paypal.com/webscr&cmd=' : 'https://paypal.com/webscr&cmd=',
|
55 |
+
'service.DevCentralURL' => 'https://developer.paypal.com',
|
56 |
+
'http.ConnectionTimeOut' => '30',
|
57 |
+
'http.Retry' => '5',
|
58 |
+
'log.FileName' => 'PayPal.log',
|
59 |
+
'log.LogLevel' => 'INFO',
|
60 |
+
'log.LogEnabled' => $settings[ 'logging_enabled' ] == 'yes' ? 'true' : 'false',
|
61 |
+
);
|
62 |
+
} else {
|
63 |
+
$this->config = @parse_ini_file( $fileName );
|
64 |
+
}
|
65 |
+
|
66 |
+
if ( $this->config == null || count( $this->config ) == 0 ) {
|
67 |
+
throw new PPConfigurationException( "Config file $fileName not found", "303" );
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
/**
|
72 |
+
* simple getter for configuration params
|
73 |
+
* If an exact match for key is not found,
|
74 |
+
* does a "contains" search on the key
|
75 |
+
*/
|
76 |
+
public function get( $searchKey )
|
77 |
+
{
|
78 |
+
|
79 |
+
if ( array_key_exists( $searchKey, $this->config ) ) {
|
80 |
+
return $this->config[ $searchKey ];
|
81 |
+
} else {
|
82 |
+
$arr = array();
|
83 |
+
foreach ( $this->config as $k => $v ) {
|
84 |
+
if ( strstr( $k, $searchKey ) ) {
|
85 |
+
$arr[ $k ] = $v;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
return $arr;
|
90 |
+
}
|
91 |
+
|
92 |
+
}
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Utility method for handling account configuration
|
96 |
+
* return config key corresponding to the API userId passed in
|
97 |
+
*
|
98 |
+
* If $userId is null, returns config keys corresponding to
|
99 |
+
* all configured accounts
|
100 |
+
*/
|
101 |
+
public function getIniPrefix( $userId = null )
|
102 |
+
{
|
103 |
+
|
104 |
+
if ( $userId == null ) {
|
105 |
+
$arr = array();
|
106 |
+
foreach ( $this->config as $key => $value ) {
|
107 |
+
$pos = strpos( $key, '.' );
|
108 |
+
if ( strstr( $key, "acct" ) ) {
|
109 |
+
$arr[ ] = substr( $key, 0, $pos );
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
return array_unique( $arr );
|
114 |
+
} else {
|
115 |
+
$iniPrefix = array_search( $userId, $this->config );
|
116 |
+
$pos = strpos( $iniPrefix, '.' );
|
117 |
+
$acct = substr( $iniPrefix, 0, $pos );
|
118 |
+
|
119 |
+
return $acct;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPConnectionManager.php
RENAMED
@@ -1,48 +1,48 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'PPHttpConnection.php';
|
3 |
-
require_once 'PPConfigManager.php';
|
4 |
-
class PPConnectionManager
|
5 |
-
{
|
6 |
-
/**
|
7 |
-
* reference to singleton instance
|
8 |
-
* @var PPConnectionManager
|
9 |
-
*/
|
10 |
-
private static $instance;
|
11 |
-
|
12 |
-
private function __construct()
|
13 |
-
{
|
14 |
-
}
|
15 |
-
|
16 |
-
public static function getInstance()
|
17 |
-
{
|
18 |
-
if ( self::$instance == null ) {
|
19 |
-
self::$instance = new PPConnectionManager();
|
20 |
-
}
|
21 |
-
|
22 |
-
return self::$instance;
|
23 |
-
}
|
24 |
-
|
25 |
-
/**
|
26 |
-
* This function returns a new PPHttpConnection object
|
27 |
-
*/
|
28 |
-
public function getConnection()
|
29 |
-
{
|
30 |
-
|
31 |
-
$connection = new PPHttpConnection();
|
32 |
-
|
33 |
-
$configMgr = PPConfigManager::getInstance();
|
34 |
-
if ( ( $configMgr->get( "http.ConnectionTimeOut" ) ) ) {
|
35 |
-
$connection->setHttpTimeout( $configMgr->get( "http.ConnectionTimeOut" ) );
|
36 |
-
}
|
37 |
-
if ( $configMgr->get( "http.Proxy" ) ) {
|
38 |
-
$connection->setHttpProxy( $configMgr->get( "http.Proxy" ) );
|
39 |
-
}
|
40 |
-
if ( $configMgr->get( "http.Retry" ) ) {
|
41 |
-
$retry = $configMgr->get( "http.Retry" );
|
42 |
-
$connection->setHttpRetry( $retry );
|
43 |
-
}
|
44 |
-
|
45 |
-
return $connection;
|
46 |
-
}
|
47 |
-
|
48 |
-
}
|
1 |
+
<?php
|
2 |
+
require_once 'PPHttpConnection.php';
|
3 |
+
require_once 'PPConfigManager.php';
|
4 |
+
class PPConnectionManager
|
5 |
+
{
|
6 |
+
/**
|
7 |
+
* reference to singleton instance
|
8 |
+
* @var PPConnectionManager
|
9 |
+
*/
|
10 |
+
private static $instance;
|
11 |
+
|
12 |
+
private function __construct()
|
13 |
+
{
|
14 |
+
}
|
15 |
+
|
16 |
+
public static function getInstance()
|
17 |
+
{
|
18 |
+
if ( self::$instance == null ) {
|
19 |
+
self::$instance = new PPConnectionManager();
|
20 |
+
}
|
21 |
+
|
22 |
+
return self::$instance;
|
23 |
+
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* This function returns a new PPHttpConnection object
|
27 |
+
*/
|
28 |
+
public function getConnection()
|
29 |
+
{
|
30 |
+
|
31 |
+
$connection = new PPHttpConnection();
|
32 |
+
|
33 |
+
$configMgr = PPConfigManager::getInstance();
|
34 |
+
if ( ( $configMgr->get( "http.ConnectionTimeOut" ) ) ) {
|
35 |
+
$connection->setHttpTimeout( $configMgr->get( "http.ConnectionTimeOut" ) );
|
36 |
+
}
|
37 |
+
if ( $configMgr->get( "http.Proxy" ) ) {
|
38 |
+
$connection->setHttpProxy( $configMgr->get( "http.Proxy" ) );
|
39 |
+
}
|
40 |
+
if ( $configMgr->get( "http.Retry" ) ) {
|
41 |
+
$retry = $configMgr->get( "http.Retry" );
|
42 |
+
$connection->setHttpRetry( $retry );
|
43 |
+
}
|
44 |
+
|
45 |
+
return $connection;
|
46 |
+
}
|
47 |
+
|
48 |
+
}
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPCredentialManager.php
RENAMED
@@ -1,117 +1,117 @@
|
|
1 |
-
<?php
|
2 |
-
require_once 'IPPCredential.php';
|
3 |
-
require_once 'PPConfigManager.php';
|
4 |
-
require_once 'PPSignatureCredential.php';
|
5 |
-
require_once 'PPCertificateCredential.php';
|
6 |
-
require_once 'exceptions/PPInvalidCredentialException.php';
|
7 |
-
|
8 |
-
class PPCredentialManager
|
9 |
-
{
|
10 |
-
|
11 |
-
private static $instance;
|
12 |
-
//hashmap to contain credentials for accounts.
|
13 |
-
private $credentialHashmap = array();
|
14 |
-
/**
|
15 |
-
* Contains the API username of the default account to use
|
16 |
-
* when authenticating API calls.
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
private $defaultAccountName;
|
20 |
-
|
21 |
-
/*
|
22 |
-
* Constructor initialize credential for multiple accounts specified in property file.
|
23 |
-
*/
|
24 |
-
private function __construct()
|
25 |
-
{
|
26 |
-
try {
|
27 |
-
$this->initCredential();
|
28 |
-
} catch ( Exception $e ) {
|
29 |
-
$this->credentialHashmap = array();
|
30 |
-
throw $e;
|
31 |
-
}
|
32 |
-
}
|
33 |
-
|
34 |
-
/*
|
35 |
-
* Create singleton instance for this class.
|
36 |
-
*/
|
37 |
-
public static function getInstance()
|
38 |
-
{
|
39 |
-
if ( !isset( self::$instance ) ) {
|
40 |
-
self::$instance = new PPCredentialManager();
|
41 |
-
}
|
42 |
-
|
43 |
-
return self::$instance;
|
44 |
-
}
|
45 |
-
|
46 |
-
/*
|
47 |
-
* Load credentials for multiple accounts, with priority given to Signature credential.
|
48 |
-
*/
|
49 |
-
private function initCredential()
|
50 |
-
{
|
51 |
-
$configMgr = PPConfigManager::getInstance();
|
52 |
-
$suffix = 1;
|
53 |
-
$prefix = "acct";
|
54 |
-
|
55 |
-
$credArr = $configMgr->get( $prefix );
|
56 |
-
$arrayPartKeys = $configMgr->getIniPrefix();
|
57 |
-
if ( count( $arrayPartKeys ) == 0 )
|
58 |
-
throw new MissingCredentialException( "No valid API accounts have been configured" );
|
59 |
-
|
60 |
-
while ( in_array( $prefix . $suffix, $arrayPartKeys ) ) {
|
61 |
-
|
62 |
-
if ( isset( $credArr[ $prefix . $suffix . ".Signature" ] )
|
63 |
-
&& $credArr[ $prefix . $suffix . ".Signature" ] != null && $credArr[ $prefix . $suffix . ".Signature" ] != ""
|
64 |
-
) {
|
65 |
-
|
66 |
-
$userName = isset( $credArr[ $prefix . $suffix . '.UserName' ] ) ? $credArr[ $prefix . $suffix . '.UserName' ] : "";
|
67 |
-
$password = isset( $credArr[ $prefix . $suffix . '.Password' ] ) ? $credArr[ $prefix . $suffix . '.Password' ] : "";
|
68 |
-
$signature = isset( $credArr[ $prefix . $suffix . '.Signature' ] ) ? $credArr[ $prefix . $suffix . '.Signature' ] : "";
|
69 |
-
$appId = isset( $credArr[ $prefix . $suffix . '.AppId' ] ) ? $credArr[ $prefix . $suffix . '.AppId' ] : "";
|
70 |
-
$this->credentialHashmap[ $userName ] = new PPSignatureCredential( $userName, $password, $signature, $appId );
|
71 |
-
|
72 |
-
} elseif ( isset( $credArr[ $prefix . $suffix . ".CertPath" ] )
|
73 |
-
&& $credArr[ $prefix . $suffix . ".CertPath" ] != null && $credArr[ $prefix . $suffix . ".CertPath" ] != ""
|
74 |
-
) {
|
75 |
-
|
76 |
-
$userName = isset( $credArr[ $prefix . $suffix . '.UserName' ] ) ? $credArr[ $prefix . $suffix . '.UserName' ] : "";
|
77 |
-
$password = isset( $credArr[ $prefix . $suffix . '.Password' ] ) ? $credArr[ $prefix . $suffix . '.Password' ] : "";
|
78 |
-
$passPhrase = isset( $credArr[ $prefix . $suffix . '.CertKey' ] ) ? $credArr[ $prefix . $suffix . '.CertKey' ] : "";
|
79 |
-
$certPath = isset( $credArr[ $prefix . $suffix . '.CertPath' ] ) ? $credArr[ $prefix . $suffix . '.CertPath' ] : "";
|
80 |
-
$appId = isset( $credArr[ $prefix . $suffix . '.AppId' ] ) ? $credArr[ $prefix . $suffix . '.AppId' ] : "";
|
81 |
-
$this->credentialHashmap[ $userName ] = new PPCertificateCredential( $userName, $password, $certPath, $appId, $passPhrase );
|
82 |
-
|
83 |
-
}
|
84 |
-
if ( $this->defaultAccountName == null )
|
85 |
-
$this->defaultAccountName = $credArr[ $prefix . $suffix . '.UserName' ];
|
86 |
-
$suffix++;
|
87 |
-
}
|
88 |
-
|
89 |
-
}
|
90 |
-
|
91 |
-
/*
|
92 |
-
* Obtain Credential Object based on UserId provided.
|
93 |
-
*/
|
94 |
-
public function getCredentialObject( $userId = null )
|
95 |
-
{
|
96 |
-
|
97 |
-
if ( $userId == null )
|
98 |
-
$credObj = $this->credentialHashmap[ $this->defaultAccountName ];
|
99 |
-
else if ( array_key_exists( $userId, $this->credentialHashmap ) )
|
100 |
-
$credObj = $this->credentialHashmap[ $userId ];
|
101 |
-
|
102 |
-
if ( empty( $credObj ) ) {
|
103 |
-
throw new PPInvalidCredentialException( "Invalid userId $userId" );
|
104 |
-
}
|
105 |
-
|
106 |
-
return $credObj;
|
107 |
-
}
|
108 |
-
|
109 |
-
|
110 |
-
public function __clone()
|
111 |
-
{
|
112 |
-
trigger_error( 'Clone is not allowed.', E_USER_ERROR );
|
113 |
-
}
|
114 |
-
|
115 |
-
}
|
116 |
-
|
117 |
?>
|
1 |
+
<?php
|
2 |
+
require_once 'IPPCredential.php';
|
3 |
+
require_once 'PPConfigManager.php';
|
4 |
+
require_once 'PPSignatureCredential.php';
|
5 |
+
require_once 'PPCertificateCredential.php';
|
6 |
+
require_once 'exceptions/PPInvalidCredentialException.php';
|
7 |
+
|
8 |
+
class PPCredentialManager
|
9 |
+
{
|
10 |
+
|
11 |
+
private static $instance;
|
12 |
+
//hashmap to contain credentials for accounts.
|
13 |
+
private $credentialHashmap = array();
|
14 |
+
/**
|
15 |
+
* Contains the API username of the default account to use
|
16 |
+
* when authenticating API calls.
|
17 |
+
* @var string
|
18 |
+
*/
|
19 |
+
private $defaultAccountName;
|
20 |
+
|
21 |
+
/*
|
22 |
+
* Constructor initialize credential for multiple accounts specified in property file.
|
23 |
+
*/
|
24 |
+
private function __construct()
|
25 |
+
{
|
26 |
+
try {
|
27 |
+
$this->initCredential();
|
28 |
+
} catch ( Exception $e ) {
|
29 |
+
$this->credentialHashmap = array();
|
30 |
+
throw $e;
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/*
|
35 |
+
* Create singleton instance for this class.
|
36 |
+
*/
|
37 |
+
public static function getInstance()
|
38 |
+
{
|
39 |
+
if ( !isset( self::$instance ) ) {
|
40 |
+
self::$instance = new PPCredentialManager();
|
41 |
+
}
|
42 |
+
|
43 |
+
return self::$instance;
|
44 |
+
}
|
45 |
+
|
46 |
+
/*
|
47 |
+
* Load credentials for multiple accounts, with priority given to Signature credential.
|
48 |
+
*/
|
49 |
+
private function initCredential()
|
50 |
+
{
|
51 |
+
$configMgr = PPConfigManager::getInstance();
|
52 |
+
$suffix = 1;
|
53 |
+
$prefix = "acct";
|
54 |
+
|
55 |
+
$credArr = $configMgr->get( $prefix );
|
56 |
+
$arrayPartKeys = $configMgr->getIniPrefix();
|
57 |
+
if ( count( $arrayPartKeys ) == 0 )
|
58 |
+
throw new MissingCredentialException( "No valid API accounts have been configured" );
|
59 |
+
|
60 |
+
while ( in_array( $prefix . $suffix, $arrayPartKeys ) ) {
|
61 |
+
|
62 |
+
if ( isset( $credArr[ $prefix . $suffix . ".Signature" ] )
|
63 |
+
&& $credArr[ $prefix . $suffix . ".Signature" ] != null && $credArr[ $prefix . $suffix . ".Signature" ] != ""
|
64 |
+
) {
|
65 |
+
|
66 |
+
$userName = isset( $credArr[ $prefix . $suffix . '.UserName' ] ) ? $credArr[ $prefix . $suffix . '.UserName' ] : "";
|
67 |
+
$password = isset( $credArr[ $prefix . $suffix . '.Password' ] ) ? $credArr[ $prefix . $suffix . '.Password' ] : "";
|
68 |
+
$signature = isset( $credArr[ $prefix . $suffix . '.Signature' ] ) ? $credArr[ $prefix . $suffix . '.Signature' ] : "";
|
69 |
+
$appId = isset( $credArr[ $prefix . $suffix . '.AppId' ] ) ? $credArr[ $prefix . $suffix . '.AppId' ] : "";
|
70 |
+
$this->credentialHashmap[ $userName ] = new PPSignatureCredential( $userName, $password, $signature, $appId );
|
71 |
+
|
72 |
+
} elseif ( isset( $credArr[ $prefix . $suffix . ".CertPath" ] )
|
73 |
+
&& $credArr[ $prefix . $suffix . ".CertPath" ] != null && $credArr[ $prefix . $suffix . ".CertPath" ] != ""
|
74 |
+
) {
|
75 |
+
|
76 |
+
$userName = isset( $credArr[ $prefix . $suffix . '.UserName' ] ) ? $credArr[ $prefix . $suffix . '.UserName' ] : "";
|
77 |
+
$password = isset( $credArr[ $prefix . $suffix . '.Password' ] ) ? $credArr[ $prefix . $suffix . '.Password' ] : "";
|
78 |
+
$passPhrase = isset( $credArr[ $prefix . $suffix . '.CertKey' ] ) ? $credArr[ $prefix . $suffix . '.CertKey' ] : "";
|
79 |
+
$certPath = isset( $credArr[ $prefix . $suffix . '.CertPath' ] ) ? $credArr[ $prefix . $suffix . '.CertPath' ] : "";
|
80 |
+
$appId = isset( $credArr[ $prefix . $suffix . '.AppId' ] ) ? $credArr[ $prefix . $suffix . '.AppId' ] : "";
|
81 |
+
$this->credentialHashmap[ $userName ] = new PPCertificateCredential( $userName, $password, $certPath, $appId, $passPhrase );
|
82 |
+
|
83 |
+
}
|
84 |
+
if ( $this->defaultAccountName == null )
|
85 |
+
$this->defaultAccountName = $credArr[ $prefix . $suffix . '.UserName' ];
|
86 |
+
$suffix++;
|
87 |
+
}
|
88 |
+
|
89 |
+
}
|
90 |
+
|
91 |
+
/*
|
92 |
+
* Obtain Credential Object based on UserId provided.
|
93 |
+
*/
|
94 |
+
public function getCredentialObject( $userId = null )
|
95 |
+
{
|
96 |
+
|
97 |
+
if ( $userId == null )
|
98 |
+
$credObj = $this->credentialHashmap[ $this->defaultAccountName ];
|
99 |
+
else if ( array_key_exists( $userId, $this->credentialHashmap ) )
|
100 |
+
$credObj = $this->credentialHashmap[ $userId ];
|
101 |
+
|
102 |
+
if ( empty( $credObj ) ) {
|
103 |
+
throw new PPInvalidCredentialException( "Invalid userId $userId" );
|
104 |
+
}
|
105 |
+
|
106 |
+
return $credObj;
|
107 |
+
}
|
108 |
+
|
109 |
+
|
110 |
+
public function __clone()
|
111 |
+
{
|
112 |
+
trigger_error( 'Clone is not allowed.', E_USER_ERROR );
|
113 |
+
}
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
?>
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPHttpConnection.php
RENAMED
@@ -1,184 +1,184 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
require_once 'exceptions/PPConnectionException.php';
|
4 |
-
require_once 'exceptions/PPConfigurationException.php';
|
5 |
-
require_once 'PPLoggingManager.php';
|
6 |
-
/**
|
7 |
-
* A wrapper class based on the curl extension.
|
8 |
-
* Requires the PHP curl module to be enabled.
|
9 |
-
* See for full requirements the PHP manual: http://php.net/curl
|
10 |
-
*/
|
11 |
-
|
12 |
-
|
13 |
-
class PPHttpConnection
|
14 |
-
{
|
15 |
-
|
16 |
-
const HTTP_GET = 'GET';
|
17 |
-
const HTTP_POST = 'POST';
|
18 |
-
|
19 |
-
/**
|
20 |
-
* curl options to be set for the request
|
21 |
-
*/
|
22 |
-
private $curlOpt = array();
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Number of times a retry must be attempted on getting an HTTP error
|
26 |
-
* @var integer
|
27 |
-
*/
|
28 |
-
private $retry;
|
29 |
-
|
30 |
-
/**
|
31 |
-
* HTTP status codes for which a retry must be attempted
|
32 |
-
*/
|
33 |
-
private static $retryCodes = array( '401', '403', '404', );
|
34 |
-
|
35 |
-
private $logger;
|
36 |
-
|
37 |
-
|
38 |
-
/**
|
39 |
-
* Some default options for curl
|
40 |
-
* These are typically overridden by PPConnectionManager
|
41 |
-
*/
|
42 |
-
public static $DEFAULT_CURL_OPTS = array(
|
43 |
-
CURLOPT_CONNECTTIMEOUT => 10,
|
44 |
-
CURLOPT_RETURNTRANSFER => true,
|
45 |
-
CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute
|
46 |
-
CURLOPT_USERAGENT => 'PayPal-PHP-SDK',
|
47 |
-
CURLOPT_POST => 1,
|
48 |
-
CURLOPT_HTTPHEADER => array(),
|
49 |
-
CURLOPT_SSL_VERIFYHOST =>
|
50 |
-
CURLOPT_SSL_VERIFYPEER => 2
|
51 |
-
);
|
52 |
-
|
53 |
-
public function __construct()
|
54 |
-
{
|
55 |
-
if ( !function_exists( "curl_init" ) ) {
|
56 |
-
throw new PPConfigurationException( "Curl module is not available on this system" );
|
57 |
-
}
|
58 |
-
$this->curlOpt = self::$DEFAULT_CURL_OPTS;
|
59 |
-
$this->logger = new PPLoggingManager( __CLASS__ );
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Set ssl parameters for certificate based client authentication
|
64 |
-
*
|
65 |
-
* @param string $certPath - path to client certificate file (PEM formatted file)
|
66 |
-
*/
|
67 |
-
public function setSSLCert( $certPath, $passPhrase )
|
68 |
-
{
|
69 |
-
$this->curlOpt[ CURLOPT_SSLCERT ] = realpath( $certPath );
|
70 |
-
$this->curlOpt[ CURLOPT_SSLCERTPASSWD ] = $passPhrase;
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* Set connection timeout in seconds
|
75 |
-
*
|
76 |
-
* @param integer $timeout
|
77 |
-
*/
|
78 |
-
public function setHttpTimeout( $timeout )
|
79 |
-
{
|
80 |
-
$this->curlOpt[ CURLOPT_CONNECTTIMEOUT ] = $timeout;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* Set HTTP proxy information
|
85 |
-
*
|
86 |
-
* @param string $proxy
|
87 |
-
*
|
88 |
-
* @throws PPConfigurationException
|
89 |
-
*/
|
90 |
-
public function setHttpProxy( $proxy )
|
91 |
-
{
|
92 |
-
$urlParts = parse_url( $proxy );
|
93 |
-
if ( $urlParts == false || !array_key_exists( "host", $urlParts ) )
|
94 |
-
throw new PPConfigurationException( "Invalid proxy configuration " . $proxy );
|
95 |
-
|
96 |
-
$this->curlOpt[ CURLOPT_PROXY ] = $urlParts[ "host" ];
|
97 |
-
if ( isset( $urlParts[ "port" ] ) )
|
98 |
-
$this->curlOpt[ CURLOPT_PROXY ] .= ":" . $urlParts[ "port" ];
|
99 |
-
if ( isset( $urlParts[ "user" ] ) )
|
100 |
-
$this->curlOpt[ URLOPT_PROXYUSERPWD ] = $urlParts[ "user" ] . ":" . $urlParts[ "pass" ];
|
101 |
-
}
|
102 |
-
|
103 |
-
public function setHttpHeaders( $headers )
|
104 |
-
{
|
105 |
-
$this->curlOpt[ CURLOPT_HTTPHEADER ] = $headers;
|
106 |
-
}
|
107 |
-
|
108 |
-
/**
|
109 |
-
* @param integer $retry
|
110 |
-
*/
|
111 |
-
public function setHttpRetry( $retry )
|
112 |
-
{
|
113 |
-
$this->retry = $retry;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Executes an HTTP request
|
118 |
-
*
|
119 |
-
* @param string $url
|
120 |
-
* @param string $params query string OR POST content as a string
|
121 |
-
* @param array $headers array of HTTP headers to be added to existing headers
|
122 |
-
* @param string $method HTTP method (GET, POST etc) defaults to POST
|
123 |
-
*
|
124 |
-
* @throws PPConnectionException
|
125 |
-
*/
|
126 |
-
public function execute( $url, $params, $headers = null, $method = null )
|
127 |
-
{
|
128 |
-
|
129 |
-
$ch = curl_init( $url );
|
130 |
-
|
131 |
-
$this->curlOpt[ CURLOPT_POSTFIELDS ] = $params;
|
132 |
-
$this->curlOpt[ CURLOPT_URL ] = $url;
|
133 |
-
$this->curlOpt[ CURLOPT_HEADER ] = false;
|
134 |
-
if ( isset( $headers ) ) {
|
135 |
-
$this->curlOpt[ CURLOPT_HTTPHEADER ] = array_merge( $this->curlOpt[ CURLOPT_HTTPHEADER ], $headers );
|
136 |
-
}
|
137 |
-
foreach ( $this->curlOpt[ CURLOPT_HTTPHEADER ] as $header ) {
|
138 |
-
//TODO: Strip out credentials when logging.
|
139 |
-
$this->logger->info( "Adding header $header" );
|
140 |
-
}
|
141 |
-
if ( isset( $method ) ) {
|
142 |
-
$this->curlOpt[ CURLOPT_CUSTOMREQUEST ] = $method;
|
143 |
-
}
|
144 |
-
|
145 |
-
// curl_setopt_array available only in PHP 5 >= 5.1.3
|
146 |
-
curl_setopt_array( $ch, $this->curlOpt );
|
147 |
-
|
148 |
-
$result = curl_exec( $ch );
|
149 |
-
|
150 |
-
if ( curl_errno( $ch ) == 60 ) {
|
151 |
-
$this->logger->info( "Invalid or no certificate authority found, retrying using bundled CA certs" );
|
152 |
-
curl_setopt( $ch, CURLOPT_CAINFO,
|
153 |
-
dirname( __FILE__ ) . '/cacert.pem' );
|
154 |
-
$result = curl_exec( $ch );
|
155 |
-
}
|
156 |
-
$httpStatus = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
|
157 |
-
$retries = 0;
|
158 |
-
if ( in_array( $httpStatus, self::$retryCodes ) && isset( $this->retry ) ) {
|
159 |
-
$this->logger->info( "Got $httpStatus response from server. Retrying" );
|
160 |
-
|
161 |
-
do {
|
162 |
-
$result = curl_exec( $ch );
|
163 |
-
$httpStatus = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
|
164 |
-
|
165 |
-
} while ( in_array( $httpStatus, self::$retryCodes ) && ++$retries < $this->retry );
|
166 |
-
|
167 |
-
|
168 |
-
}
|
169 |
-
if ( curl_errno( $ch ) ) {
|
170 |
-
$ex = new PPConnectionException( $url, curl_error( $ch ), curl_errno( $ch ) );
|
171 |
-
curl_close( $ch );
|
172 |
-
throw $ex;
|
173 |
-
}
|
174 |
-
|
175 |
-
curl_close( $ch );
|
176 |
-
|
177 |
-
if ( in_array( $httpStatus, self::$retryCodes ) ) {
|
178 |
-
throw new PPConnectionException( $url, "Retried " . $retries . " times, Http Response code " . $httpStatus );
|
179 |
-
}
|
180 |
-
|
181 |
-
return $result;
|
182 |
-
}
|
183 |
-
|
184 |
-
}
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once 'exceptions/PPConnectionException.php';
|
4 |
+
require_once 'exceptions/PPConfigurationException.php';
|
5 |
+
require_once 'PPLoggingManager.php';
|
6 |
+
/**
|
7 |
+
* A wrapper class based on the curl extension.
|
8 |
+
* Requires the PHP curl module to be enabled.
|
9 |
+
* See for full requirements the PHP manual: http://php.net/curl
|
10 |
+
*/
|
11 |
+
|
12 |
+
|
13 |
+
class PPHttpConnection
|
14 |
+
{
|
15 |
+
|
16 |
+
const HTTP_GET = 'GET';
|
17 |
+
const HTTP_POST = 'POST';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* curl options to be set for the request
|
21 |
+
*/
|
22 |
+
private $curlOpt = array();
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Number of times a retry must be attempted on getting an HTTP error
|
26 |
+
* @var integer
|
27 |
+
*/
|
28 |
+
private $retry;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* HTTP status codes for which a retry must be attempted
|
32 |
+
*/
|
33 |
+
private static $retryCodes = array( '401', '403', '404', );
|
34 |
+
|
35 |
+
private $logger;
|
36 |
+
|
37 |
+
|
38 |
+
/**
|
39 |
+
* Some default options for curl
|
40 |
+
* These are typically overridden by PPConnectionManager
|
41 |
+
*/
|
42 |
+
public static $DEFAULT_CURL_OPTS = array(
|
43 |
+
CURLOPT_CONNECTTIMEOUT => 10,
|
44 |
+
CURLOPT_RETURNTRANSFER => true,
|
45 |
+
CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute
|
46 |
+
CURLOPT_USERAGENT => 'PayPal-PHP-SDK',
|
47 |
+
CURLOPT_POST => 1,
|
48 |
+
CURLOPT_HTTPHEADER => array(),
|
49 |
+
CURLOPT_SSL_VERIFYHOST => 2,
|
50 |
+
CURLOPT_SSL_VERIFYPEER => 2
|
51 |
+
);
|
52 |
+
|
53 |
+
public function __construct()
|
54 |
+
{
|
55 |
+
if ( !function_exists( "curl_init" ) ) {
|
56 |
+
throw new PPConfigurationException( "Curl module is not available on this system" );
|
57 |
+
}
|
58 |
+
$this->curlOpt = self::$DEFAULT_CURL_OPTS;
|
59 |
+
$this->logger = new PPLoggingManager( __CLASS__ );
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Set ssl parameters for certificate based client authentication
|
64 |
+
*
|
65 |
+
* @param string $certPath - path to client certificate file (PEM formatted file)
|
66 |
+
*/
|
67 |
+
public function setSSLCert( $certPath, $passPhrase )
|
68 |
+
{
|
69 |
+
$this->curlOpt[ CURLOPT_SSLCERT ] = realpath( $certPath );
|
70 |
+
$this->curlOpt[ CURLOPT_SSLCERTPASSWD ] = $passPhrase;
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Set connection timeout in seconds
|
75 |
+
*
|
76 |
+
* @param integer $timeout
|
77 |
+
*/
|
78 |
+
public function setHttpTimeout( $timeout )
|
79 |
+
{
|
80 |
+
$this->curlOpt[ CURLOPT_CONNECTTIMEOUT ] = $timeout;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Set HTTP proxy information
|
85 |
+
*
|
86 |
+
* @param string $proxy
|
87 |
+
*
|
88 |
+
* @throws PPConfigurationException
|
89 |
+
*/
|
90 |
+
public function setHttpProxy( $proxy )
|
91 |
+
{
|
92 |
+
$urlParts = parse_url( $proxy );
|
93 |
+
if ( $urlParts == false || !array_key_exists( "host", $urlParts ) )
|
94 |
+
throw new PPConfigurationException( "Invalid proxy configuration " . $proxy );
|
95 |
+
|
96 |
+
$this->curlOpt[ CURLOPT_PROXY ] = $urlParts[ "host" ];
|
97 |
+
if ( isset( $urlParts[ "port" ] ) )
|
98 |
+
$this->curlOpt[ CURLOPT_PROXY ] .= ":" . $urlParts[ "port" ];
|
99 |
+
if ( isset( $urlParts[ "user" ] ) )
|
100 |
+
$this->curlOpt[ URLOPT_PROXYUSERPWD ] = $urlParts[ "user" ] . ":" . $urlParts[ "pass" ];
|
101 |
+
}
|
102 |
+
|
103 |
+
public function setHttpHeaders( $headers )
|
104 |
+
{
|
105 |
+
$this->curlOpt[ CURLOPT_HTTPHEADER ] = $headers;
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* @param integer $retry
|
110 |
+
*/
|
111 |
+
public function setHttpRetry( $retry )
|
112 |
+
{
|
113 |
+
$this->retry = $retry;
|
114 |
+
}
|
115 |
+
|
116 |
+
/**
|
117 |
+
* Executes an HTTP request
|
118 |
+
*
|
119 |
+
* @param string $url
|
120 |
+
* @param string $params query string OR POST content as a string
|
121 |
+
* @param array $headers array of HTTP headers to be added to existing headers
|
122 |
+
* @param string $method HTTP method (GET, POST etc) defaults to POST
|
123 |
+
*
|
124 |
+
* @throws PPConnectionException
|
125 |
+
*/
|
126 |
+
public function execute( $url, $params, $headers = null, $method = null )
|
127 |
+
{
|
128 |
+
|
129 |
+
$ch = curl_init( $url );
|
130 |
+
|
131 |
+
$this->curlOpt[ CURLOPT_POSTFIELDS ] = $params;
|
132 |
+
$this->curlOpt[ CURLOPT_URL ] = $url;
|
133 |
+
$this->curlOpt[ CURLOPT_HEADER ] = false;
|
134 |
+
if ( isset( $headers ) ) {
|
135 |
+
$this->curlOpt[ CURLOPT_HTTPHEADER ] = array_merge( $this->curlOpt[ CURLOPT_HTTPHEADER ], $headers );
|
136 |
+
}
|
137 |
+
foreach ( $this->curlOpt[ CURLOPT_HTTPHEADER ] as $header ) {
|
138 |
+
//TODO: Strip out credentials when logging.
|
139 |
+
$this->logger->info( "Adding header $header" );
|
140 |
+
}
|
141 |
+
if ( isset( $method ) ) {
|
142 |
+
$this->curlOpt[ CURLOPT_CUSTOMREQUEST ] = $method;
|
143 |
+
}
|
144 |
+
|
145 |
+
// curl_setopt_array available only in PHP 5 >= 5.1.3
|
146 |
+
curl_setopt_array( $ch, $this->curlOpt );
|
147 |
+
|
148 |
+
$result = curl_exec( $ch );
|
149 |
+
|
150 |
+
if ( curl_errno( $ch ) == 60 ) {
|
151 |
+
$this->logger->info( "Invalid or no certificate authority found, retrying using bundled CA certs" );
|
152 |
+
curl_setopt( $ch, CURLOPT_CAINFO,
|
153 |
+
dirname( __FILE__ ) . '/cacert.pem' );
|
154 |
+
$result = curl_exec( $ch );
|
155 |
+
}
|
156 |
+
$httpStatus = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
|
157 |
+
$retries = 0;
|
158 |
+
if ( in_array( $httpStatus, self::$retryCodes ) && isset( $this->retry ) ) {
|
159 |
+
$this->logger->info( "Got $httpStatus response from server. Retrying" );
|
160 |
+
|
161 |
+
do {
|
162 |
+
$result = curl_exec( $ch );
|
163 |
+
$httpStatus = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
|
164 |
+
|
165 |
+
} while ( in_array( $httpStatus, self::$retryCodes ) && ++$retries < $this->retry );
|
166 |
+
|
167 |
+
|
168 |
+
}
|
169 |
+
if ( curl_errno( $ch ) ) {
|
170 |
+
$ex = new PPConnectionException( $url, curl_error( $ch ), curl_errno( $ch ) );
|
171 |
+
curl_close( $ch );
|
172 |
+
throw $ex;
|
173 |
+
}
|
174 |
+
|
175 |
+
curl_close( $ch );
|
176 |
+
|
177 |
+
if ( in_array( $httpStatus, self::$retryCodes ) ) {
|
178 |
+
throw new PPConnectionException( $url, "Retried " . $retries . " times, Http Response code " . $httpStatus );
|
179 |
+
}
|
180 |
+
|
181 |
+
return $result;
|
182 |
+
}
|
183 |
+
|
184 |
+
}
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/PPLoggingManager.php
RENAMED
@@ -1,84 +1,84 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Simple Logging Manager.
|
5 |
-
* This does an error_log for now
|
6 |
-
* Potential frameworks to use are PEAR logger, log4php from Apache
|
7 |
-
*/
|
8 |
-
|
9 |
-
class PPLoggingLevel
|
10 |
-
{
|
11 |
-
|
12 |
-
// FINE Logging Level
|
13 |
-
const FINE = 3;
|
14 |
-
|
15 |
-
// INFO Logging Level
|
16 |
-
const INFO = 2;
|
17 |
-
|
18 |
-
// WARN Logging Level
|
19 |
-
const WARN = 1;
|
20 |
-
|
21 |
-
// ERROR Logging Level
|
22 |
-
const ERROR = 0;
|
23 |
-
}
|
24 |
-
|
25 |
-
class PPLoggingManager
|
26 |
-
{
|
27 |
-
|
28 |
-
// Default Logging Level
|
29 |
-
const DEFAULT_LOGGING_LEVEL = 0;
|
30 |
-
|
31 |
-
// Logger name
|
32 |
-
private $loggerName;
|
33 |
-
|
34 |
-
// Log enabled
|
35 |
-
private $isLoggingEnabled;
|
36 |
-
|
37 |
-
// Configured logging level
|
38 |
-
private $loggingLevel;
|
39 |
-
|
40 |
-
// Configured logging file
|
41 |
-
private $loggerFile;
|
42 |
-
|
43 |
-
public function __construct( $loggerName )
|
44 |
-
{
|
45 |
-
$this->loggerName = $loggerName;
|
46 |
-
$config = PPConfigManager::getInstance();
|
47 |
-
$this->loggerFile = ( $config->get( 'log.FileName' ) ) ? $config->get( 'log.FileName' ) : ini_get( 'error_log' );
|
48 |
-
$loggingEnabled = $config->get( 'log.LogEnabled' );
|
49 |
-
$this->isLoggingEnabled = ( isset( $loggingEnabled ) ) ? $loggingEnabled : false;
|
50 |
-
$loggingLevel = strtoupper( $config->get( 'log.LogLevel' ) );
|
51 |
-
$this->loggingLevel = ( isset( $loggingLevel ) && defined( "PPLoggingLevel::$loggingLevel" ) ) ? constant( "PPLoggingLevel::$loggingLevel" ) : PPLoggingManager::DEFAULT_LOGGING_LEVEL;
|
52 |
-
|
53 |
-
}
|
54 |
-
|
55 |
-
public function log( $message, $level = PPLoggingLevel::INFO )
|
56 |
-
{
|
57 |
-
if ( $this->isLoggingEnabled && ( $level <= $this->loggingLevel ) ) {
|
58 |
-
error_log( $this->loggerName . ": $message\n", 3, $this->loggerFile );
|
59 |
-
}
|
60 |
-
}
|
61 |
-
|
62 |
-
public function error( $message )
|
63 |
-
{
|
64 |
-
$this->log( $message, PPLoggingLevel::ERROR );
|
65 |
-
}
|
66 |
-
|
67 |
-
public function warning( $message )
|
68 |
-
{
|
69 |
-
$this->log( $message, PPLoggingLevel::WARN );
|
70 |
-
}
|
71 |
-
|
72 |
-
public function info( $message )
|
73 |
-
{
|
74 |
-
$this->log( $message, PPLoggingLevel::INFO );
|
75 |
-
}
|
76 |
-
|
77 |
-
public function fine( $message )
|
78 |
-
{
|
79 |
-
$this->log( $message, PPLoggingLevel::FINE );
|
80 |
-
}
|
81 |
-
|
82 |
-
}
|
83 |
-
|
84 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Simple Logging Manager.
|
5 |
+
* This does an error_log for now
|
6 |
+
* Potential frameworks to use are PEAR logger, log4php from Apache
|
7 |
+
*/
|
8 |
+
|
9 |
+
class PPLoggingLevel
|
10 |
+
{
|
11 |
+
|
12 |
+
// FINE Logging Level
|
13 |
+
const FINE = 3;
|
14 |
+
|
15 |
+
// INFO Logging Level
|
16 |
+
const INFO = 2;
|
17 |
+
|
18 |
+
// WARN Logging Level
|
19 |
+
const WARN = 1;
|
20 |
+
|
21 |
+
// ERROR Logging Level
|
22 |
+
const ERROR = 0;
|
23 |
+
}
|
24 |
+
|
25 |
+
class PPLoggingManager
|
26 |
+
{
|
27 |
+
|
28 |
+
// Default Logging Level
|
29 |
+
const DEFAULT_LOGGING_LEVEL = 0;
|
30 |
+
|
31 |
+
// Logger name
|
32 |
+
private $loggerName;
|
33 |
+
|
34 |
+
// Log enabled
|
35 |
+
private $isLoggingEnabled;
|
36 |
+
|
37 |
+
// Configured logging level
|
38 |
+
private $loggingLevel;
|
39 |
+
|
40 |
+
// Configured logging file
|
41 |
+
private $loggerFile;
|
42 |
+
|
43 |
+
public function __construct( $loggerName )
|
44 |
+
{
|
45 |
+
$this->loggerName = $loggerName;
|
46 |
+
$config = PPConfigManager::getInstance();
|
47 |
+
$this->loggerFile = ( $config->get( 'log.FileName' ) ) ? $config->get( 'log.FileName' ) : ini_get( 'error_log' );
|
48 |
+
$loggingEnabled = $config->get( 'log.LogEnabled' );
|
49 |
+
$this->isLoggingEnabled = ( isset( $loggingEnabled ) ) ? $loggingEnabled : false;
|
50 |
+
$loggingLevel = strtoupper( $config->get( 'log.LogLevel' ) );
|
51 |
+
$this->loggingLevel = ( isset( $loggingLevel ) && defined( "PPLoggingLevel::$loggingLevel" ) ) ? constant( "PPLoggingLevel::$loggingLevel" ) : PPLoggingManager::DEFAULT_LOGGING_LEVEL;
|
52 |
+
|
53 |
+
}
|
54 |
+
|
55 |
+
public function log( $message, $level = PPLoggingLevel::INFO )
|
56 |
+
{
|
57 |
+
if ( $this->isLoggingEnabled && ( $level <= $this->loggingLevel ) ) {
|
58 |
+
error_log( $this->loggerName . ": $message\n", 3, $this->loggerFile );
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
public function error( $message )
|
63 |
+
{
|
64 |
+
$this->log( $message, PPLoggingLevel::ERROR );
|
65 |
+
}
|
66 |
+
|
67 |
+
public function warning( $message )
|
68 |
+
{
|
69 |
+
$this->log( $message, PPLoggingLevel::WARN );
|
70 |
+
}
|
71 |
+
|
72 |
+
public function info( $message )
|
73 |
+
{
|
74 |
+
$this->log( $message, PPLoggingLevel::INFO );
|
75 |
+
}
|
76 |
+
|
77 |
+
public function fine( $message )
|
78 |
+
{
|
79 |
+
$this->log( $message, PPLoggingLevel::FINE );
|
80 |
+
}
|
81 |
+
|
82 |
+
}
|
83 |
+
|
84 |
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPObjectTransformer.php
RENAMED
@@ -1,33 +1,33 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Utility class for transforming PHP objects into
|
4 |
-
* appropriate service payload type and vice versa
|
5 |
-
*/
|
6 |
-
class PPObjectTransformer
|
7 |
-
{
|
8 |
-
|
9 |
-
public function toString( $object )
|
10 |
-
{
|
11 |
-
|
12 |
-
if ( $object == null ) {
|
13 |
-
throw new PPTransformerException( "Empty object" );
|
14 |
-
}
|
15 |
-
|
16 |
-
$confManager = PPConfigManager::getInstance();
|
17 |
-
switch ( strtoupper( $confManager->get( "service.Binding" ) ) ) {
|
18 |
-
case 'SOAP':
|
19 |
-
return $object->toXMLString();
|
20 |
-
|
21 |
-
case 'XML':
|
22 |
-
case 'JSON':
|
23 |
-
return "";
|
24 |
-
case 'NVP':
|
25 |
-
default:
|
26 |
-
return $object->toNVPString();
|
27 |
-
}
|
28 |
-
}
|
29 |
-
|
30 |
-
|
31 |
-
}
|
32 |
-
|
33 |
-
?>
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Utility class for transforming PHP objects into
|
4 |
+
* appropriate service payload type and vice versa
|
5 |
+
*/
|
6 |
+
class PPObjectTransformer
|
7 |
+
{
|
8 |
+
|
9 |
+
public function toString( $object )
|
10 |
+
{
|
11 |
+
|
12 |
+
if ( $object == null ) {
|
13 |
+
throw new PPTransformerException( "Empty object" );
|
14 |
+
}
|
15 |
+
|
16 |
+
$confManager = PPConfigManager::getInstance();
|
17 |
+
switch ( strtoupper( $confManager->get( "service.Binding" ) ) ) {
|
18 |
+
case 'SOAP':
|
19 |
+
return $object->toXMLString();
|
20 |
+
|
21 |
+
case 'XML':
|
22 |
+
case 'JSON':
|
23 |
+
return "";
|
24 |
+
case 'NVP':
|
25 |
+
default:
|
26 |
+
return $object->toNVPString();
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPSignatureCredential.php
RENAMED
@@ -1,49 +1,49 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
require_once 'exceptions/PPMissingCredentialException.php';
|
4 |
-
require_once 'IPPCredential.php';
|
5 |
-
require_once 'PPConfigManager.php';
|
6 |
-
|
7 |
-
/**
|
8 |
-
* API signature based credentials
|
9 |
-
*/
|
10 |
-
class PPSignatureCredential extends IPPCredential
|
11 |
-
{
|
12 |
-
|
13 |
-
/**
|
14 |
-
* API Signature
|
15 |
-
* @var string
|
16 |
-
*/
|
17 |
-
private $signature;
|
18 |
-
|
19 |
-
public function __construct( $userName, $password, $signature, $appId )
|
20 |
-
{
|
21 |
-
parent::__construct( $userName, $password, $appId );
|
22 |
-
$this->signature = $signature;
|
23 |
-
$this->validate();
|
24 |
-
}
|
25 |
-
|
26 |
-
public function validate()
|
27 |
-
{
|
28 |
-
|
29 |
-
if ( $this->userName == null || $this->userName == "" ) {
|
30 |
-
throw new PPMissingCredentialException( "username cannot be empty" );
|
31 |
-
}
|
32 |
-
if ( $this->password == null || $this->password == "" ) {
|
33 |
-
throw new PPMissingCredentialException( "password cannot be empty" );
|
34 |
-
}
|
35 |
-
if ( $this->signature == null || $this->signature == "" ) {
|
36 |
-
throw new PPMissingCredentialException( "signature cannot be empty" );
|
37 |
-
}
|
38 |
-
if ( $this->applicationId == null || $this->applicationId == "" ) {
|
39 |
-
throw new PPMissingCredentialException( "applicationId cannot be empty" );
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
public function getSignature()
|
44 |
-
{
|
45 |
-
return $this->signature;
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once 'exceptions/PPMissingCredentialException.php';
|
4 |
+
require_once 'IPPCredential.php';
|
5 |
+
require_once 'PPConfigManager.php';
|
6 |
+
|
7 |
+
/**
|
8 |
+
* API signature based credentials
|
9 |
+
*/
|
10 |
+
class PPSignatureCredential extends IPPCredential
|
11 |
+
{
|
12 |
+
|
13 |
+
/**
|
14 |
+
* API Signature
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
private $signature;
|
18 |
+
|
19 |
+
public function __construct( $userName, $password, $signature, $appId )
|
20 |
+
{
|
21 |
+
parent::__construct( $userName, $password, $appId );
|
22 |
+
$this->signature = $signature;
|
23 |
+
$this->validate();
|
24 |
+
}
|
25 |
+
|
26 |
+
public function validate()
|
27 |
+
{
|
28 |
+
|
29 |
+
if ( $this->userName == null || $this->userName == "" ) {
|
30 |
+
throw new PPMissingCredentialException( "username cannot be empty" );
|
31 |
+
}
|
32 |
+
if ( $this->password == null || $this->password == "" ) {
|
33 |
+
throw new PPMissingCredentialException( "password cannot be empty" );
|
34 |
+
}
|
35 |
+
if ( $this->signature == null || $this->signature == "" ) {
|
36 |
+
throw new PPMissingCredentialException( "signature cannot be empty" );
|
37 |
+
}
|
38 |
+
if ( $this->applicationId == null || $this->applicationId == "" ) {
|
39 |
+
throw new PPMissingCredentialException( "applicationId cannot be empty" );
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
public function getSignature()
|
44 |
+
{
|
45 |
+
return $this->signature;
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/PPUtils.php
RENAMED
@@ -1,274 +1,274 @@
|
|
1 |
-
<?php
|
2 |
-
class PPUtils
|
3 |
-
{
|
4 |
-
|
5 |
-
const SDK_VERSION = "1.2.95";
|
6 |
-
const SDK_NAME = "sdk-adaptivepayments-php ";
|
7 |
-
|
8 |
-
/**
|
9 |
-
*
|
10 |
-
* Convert a Name Value Pair (NVP) formatted string into
|
11 |
-
* an associative array taking care to urldecode array values
|
12 |
-
*
|
13 |
-
* @param string $nvpString
|
14 |
-
*/
|
15 |
-
public static function nvpToMap( $nvpString )
|
16 |
-
{
|
17 |
-
|
18 |
-
$ret = array();
|
19 |
-
$params = explode( "&", $nvpString );
|
20 |
-
foreach ( $params as $p ) {
|
21 |
-
list( $k, $v ) = explode( "=", $p );
|
22 |
-
$ret[ $k ] = urldecode( $v );
|
23 |
-
}
|
24 |
-
|
25 |
-
return $ret;
|
26 |
-
}
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Returns true if the array contains a key like $key
|
30 |
-
*
|
31 |
-
* @param array $map
|
32 |
-
* @param regex $key
|
33 |
-
*/
|
34 |
-
public static function array_match_key( $map, $key )
|
35 |
-
{
|
36 |
-
$key = str_replace( "(", "\(", $key );
|
37 |
-
$key = str_replace( ")", "\)", $key );
|
38 |
-
$key = str_replace( ".", "\.", $key );
|
39 |
-
$pattern = "/$key*/";
|
40 |
-
foreach ( $map as $k => $v ) {
|
41 |
-
preg_match( $pattern, $k, $matches );
|
42 |
-
if ( count( $matches ) > 0 )
|
43 |
-
return true;
|
44 |
-
}
|
45 |
-
|
46 |
-
return false;
|
47 |
-
}
|
48 |
-
|
49 |
-
/**
|
50 |
-
*
|
51 |
-
* Get the local IP address. The client address is a required
|
52 |
-
* request parameter for some API calls
|
53 |
-
*/
|
54 |
-
public static function getLocalIPAddress()
|
55 |
-
{
|
56 |
-
|
57 |
-
if ( array_key_exists( "SERVER_ADDR", $_SERVER ) ) {
|
58 |
-
// SERVER_ADDR is available only if we are running the CGI SAPI
|
59 |
-
return $_SERVER[ 'SERVER_ADDR' ];
|
60 |
-
} else if ( function_exists( "gethostname" ) ) {
|
61 |
-
// gethostname is available only in PHP >= v5.3
|
62 |
-
return gethostbyname( gethostname() );
|
63 |
-
} else {
|
64 |
-
// fallback if nothing works
|
65 |
-
return "127.0.0.1";
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
*
|
71 |
-
* Compute the value that needs to sent for the PAYPAL_REQUEST_SOURCE
|
72 |
-
* parameter when making API calls
|
73 |
-
*/
|
74 |
-
public static function getRequestSource()
|
75 |
-
{
|
76 |
-
return str_replace( " ", "_", self::SDK_NAME ) . self::SDK_VERSION;
|
77 |
-
}
|
78 |
-
|
79 |
-
public static function xmlToArray( $xmlInput )
|
80 |
-
{
|
81 |
-
|
82 |
-
$xml = simplexml_load_string( $xmlInput );
|
83 |
-
|
84 |
-
$ns = $xml->getNamespaces( true );
|
85 |
-
|
86 |
-
$soap = $xml->children( $ns[ 'SOAP-ENV' ] );
|
87 |
-
$getChild = $soap->Body->children();
|
88 |
-
|
89 |
-
$ret = PPUtils::convertXmlObjToArr( $getChild, $array = array() );
|
90 |
-
|
91 |
-
return $ret;
|
92 |
-
}
|
93 |
-
|
94 |
-
/*foreach ($ret as $arry)
|
95 |
-
{
|
96 |
-
if (isset($arry['children']) && is_array($arry['children'])&& ($arry['children'])!=null) {
|
97 |
-
foreach ($arry['children'] as $novel)
|
98 |
-
{
|
99 |
-
|
100 |
-
}
|
101 |
-
}
|
102 |
-
else if ($arry['name'] != null)
|
103 |
-
{
|
104 |
-
$a = $arry['name'] ;
|
105 |
-
$b= $arry['text'];
|
106 |
-
if (isset($arry['attribute']))
|
107 |
-
{
|
108 |
-
$c = $arry['attribute'];
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
-
|
113 |
-
}*/
|
114 |
-
|
115 |
-
/*public function xml2array ( $xmlObject, $out = array () )
|
116 |
-
{
|
117 |
-
foreach ( (array) $xmlObject as $index => $node )
|
118 |
-
{
|
119 |
-
$out[$index] = ( is_object ( $node ) ) ? PPUtils::xml2array ( $node ) : $node;
|
120 |
-
}
|
121 |
-
return $out;
|
122 |
-
}*/
|
123 |
-
|
124 |
-
|
125 |
-
function convertXmlObjToArr( $obj, &$arr )
|
126 |
-
{
|
127 |
-
$children = $obj->children();
|
128 |
-
foreach ( $children as $elementName => $node ) {
|
129 |
-
$nextIdx = count( $arr );
|
130 |
-
$arr[ $nextIdx ] = array();
|
131 |
-
$arr[ $nextIdx ][ 'name' ] = strtolower( (string) $elementName );
|
132 |
-
$arr[ $nextIdx ][ 'attributes' ] = array();
|
133 |
-
$attributes = $node->attributes();
|
134 |
-
foreach ( $attributes as $attributeName => $attributeValue ) {
|
135 |
-
$attribName = strtolower( trim( (string) $attributeName ) );
|
136 |
-
$attribVal = trim( (string) $attributeValue );
|
137 |
-
$arr[ $nextIdx ][ 'attributes' ][ $attribName ] = $attribVal;
|
138 |
-
}
|
139 |
-
$text = (string) $node;
|
140 |
-
$text = trim( $text );
|
141 |
-
if ( strlen( $text ) > 0 ) {
|
142 |
-
$arr[ $nextIdx ][ 'text' ] = $text;
|
143 |
-
}
|
144 |
-
$arr[ $nextIdx ][ 'children' ] = array();
|
145 |
-
PPutils::convertXmlObjToArr( $node, $arr[ $nextIdx ][ 'children' ] );
|
146 |
-
}
|
147 |
-
|
148 |
-
return $arr;
|
149 |
-
}
|
150 |
-
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* @class xml2array
|
155 |
-
*/
|
156 |
-
|
157 |
-
|
158 |
-
/**
|
159 |
-
* XMLToArray Generator Class
|
160 |
-
* @author : MA Razzaque Rupom <rupom_315@yahoo.com>, <rupom.bd@gmail.com>
|
161 |
-
* Moderator, phpResource (LINK1http://groups.yahoo.com/group/phpresource/LINK1)
|
162 |
-
* URL: LINK2http://www.rupom.infoLINK2
|
163 |
-
* @version : 1.0
|
164 |
-
* @date 06/05/2006
|
165 |
-
* Purpose : Creating Hierarchical Array from XML Data
|
166 |
-
* Released : Under GPL
|
167 |
-
*/
|
168 |
-
|
169 |
-
class XmlToArray
|
170 |
-
{
|
171 |
-
|
172 |
-
var $xml = '';
|
173 |
-
|
174 |
-
/**
|
175 |
-
* Default Constructor
|
176 |
-
*
|
177 |
-
* @param $xml = xml data
|
178 |
-
*
|
179 |
-
* @return none
|
180 |
-
*/
|
181 |
-
|
182 |
-
function XmlToArray( $xml )
|
183 |
-
{
|
184 |
-
$this->xml = $xml;
|
185 |
-
}
|
186 |
-
|
187 |
-
/**
|
188 |
-
* _struct_to_array($values, &$i)
|
189 |
-
*
|
190 |
-
* This is adds the contents of the return xml into the array for easier processing.
|
191 |
-
* Recursive, Static
|
192 |
-
*
|
193 |
-
* @access private
|
194 |
-
*
|
195 |
-
* @param array $values this is the xml data in an array
|
196 |
-
* @param int $i this is the current location in the array
|
197 |
-
*
|
198 |
-
* @return Array
|
199 |
-
*/
|
200 |
-
|
201 |
-
function _struct_to_array( $values, &$i )
|
202 |
-
{
|
203 |
-
$child = array();
|
204 |
-
if ( isset( $values[ $i ][ 'value' ] ) ) array_push( $child, $values[ $i ][ 'value' ] );
|
205 |
-
|
206 |
-
while ( $i++ < count( $values ) ) {
|
207 |
-
switch ( $values[ $i ][ 'type' ] ) {
|
208 |
-
case 'cdata':
|
209 |
-
array_push( $child, $values[ $i ][ 'value' ] );
|
210 |
-
break;
|
211 |
-
|
212 |
-
case 'complete':
|
213 |
-
$name = $values[ $i ][ 'tag' ];
|
214 |
-
if ( !empty( $name ) ) {
|
215 |
-
$child[ $name ] = ( $values[ $i ][ 'value' ] ) ? ( $values[ $i ][ 'value' ] ) : '';
|
216 |
-
if ( isset( $values[ $i ][ 'attributes' ] ) ) {
|
217 |
-
$child[ $name ] = $values[ $i ][ 'attributes' ];
|
218 |
-
}
|
219 |
-
}
|
220 |
-
break;
|
221 |
-
|
222 |
-
case 'open':
|
223 |
-
$name = $values[ $i ][ 'tag' ];
|
224 |
-
$size = isset( $child[ $name ] ) ? sizeof( $child[ $name ] ) : 0;
|
225 |
-
$child[ $name ][ $size ] = $this->_struct_to_array( $values, $i );
|
226 |
-
break;
|
227 |
-
|
228 |
-
case 'close':
|
229 |
-
return $child;
|
230 |
-
break;
|
231 |
-
}
|
232 |
-
}
|
233 |
-
|
234 |
-
return $child;
|
235 |
-
}
|
236 |
-
|
237 |
-
//_struct_to_array
|
238 |
-
|
239 |
-
/**
|
240 |
-
* createArray($data)
|
241 |
-
*
|
242 |
-
* This is adds the contents of the return xml into the array for easier processing.
|
243 |
-
*
|
244 |
-
* @access public
|
245 |
-
*
|
246 |
-
* @param string $data this is the string of the xml data
|
247 |
-
*
|
248 |
-
* @return Array
|
249 |
-
*/
|
250 |
-
function createArray()
|
251 |
-
{
|
252 |
-
$xml = $this->xml;
|
253 |
-
$values = array();
|
254 |
-
$index = array();
|
255 |
-
$array = array();
|
256 |
-
$parser = xml_parser_create();
|
257 |
-
xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
|
258 |
-
xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
|
259 |
-
xml_parse_into_struct( $parser, $xml, $values, $index );
|
260 |
-
xml_parser_free( $parser );
|
261 |
-
$i = 0;
|
262 |
-
$name = $values[ $i ][ 'tag' ];
|
263 |
-
$array[ $name ] = isset( $values[ $i ][ 'attributes' ] ) ? $values[ $i ][ 'attributes' ] : '';
|
264 |
-
$array[ $name ] = $this->_struct_to_array( $values, $i );
|
265 |
-
|
266 |
-
return $array;
|
267 |
-
}
|
268 |
-
//createArray
|
269 |
-
|
270 |
-
|
271 |
-
}
|
272 |
-
|
273 |
-
//XmlToArray
|
274 |
?>
|
1 |
+
<?php
|
2 |
+
class PPUtils
|
3 |
+
{
|
4 |
+
|
5 |
+
const SDK_VERSION = "1.2.95";
|
6 |
+
const SDK_NAME = "sdk-adaptivepayments-php ";
|
7 |
+
|
8 |
+
/**
|
9 |
+
*
|
10 |
+
* Convert a Name Value Pair (NVP) formatted string into
|
11 |
+
* an associative array taking care to urldecode array values
|
12 |
+
*
|
13 |
+
* @param string $nvpString
|
14 |
+
*/
|
15 |
+
public static function nvpToMap( $nvpString )
|
16 |
+
{
|
17 |
+
|
18 |
+
$ret = array();
|
19 |
+
$params = explode( "&", $nvpString );
|
20 |
+
foreach ( $params as $p ) {
|
21 |
+
list( $k, $v ) = explode( "=", $p );
|
22 |
+
$ret[ $k ] = urldecode( $v );
|
23 |
+
}
|
24 |
+
|
25 |
+
return $ret;
|
26 |
+
}
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Returns true if the array contains a key like $key
|
30 |
+
*
|
31 |
+
* @param array $map
|
32 |
+
* @param regex $key
|
33 |
+
*/
|
34 |
+
public static function array_match_key( $map, $key )
|
35 |
+
{
|
36 |
+
$key = str_replace( "(", "\(", $key );
|
37 |
+
$key = str_replace( ")", "\)", $key );
|
38 |
+
$key = str_replace( ".", "\.", $key );
|
39 |
+
$pattern = "/$key*/";
|
40 |
+
foreach ( $map as $k => $v ) {
|
41 |
+
preg_match( $pattern, $k, $matches );
|
42 |
+
if ( count( $matches ) > 0 )
|
43 |
+
return true;
|
44 |
+
}
|
45 |
+
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
*
|
51 |
+
* Get the local IP address. The client address is a required
|
52 |
+
* request parameter for some API calls
|
53 |
+
*/
|
54 |
+
public static function getLocalIPAddress()
|
55 |
+
{
|
56 |
+
|
57 |
+
if ( array_key_exists( "SERVER_ADDR", $_SERVER ) ) {
|
58 |
+
// SERVER_ADDR is available only if we are running the CGI SAPI
|
59 |
+
return $_SERVER[ 'SERVER_ADDR' ];
|
60 |
+
} else if ( function_exists( "gethostname" ) ) {
|
61 |
+
// gethostname is available only in PHP >= v5.3
|
62 |
+
return gethostbyname( gethostname() );
|
63 |
+
} else {
|
64 |
+
// fallback if nothing works
|
65 |
+
return "127.0.0.1";
|
66 |
+
}
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
*
|
71 |
+
* Compute the value that needs to sent for the PAYPAL_REQUEST_SOURCE
|
72 |
+
* parameter when making API calls
|
73 |
+
*/
|
74 |
+
public static function getRequestSource()
|
75 |
+
{
|
76 |
+
return str_replace( " ", "_", self::SDK_NAME ) . self::SDK_VERSION;
|
77 |
+
}
|
78 |
+
|
79 |
+
public static function xmlToArray( $xmlInput )
|
80 |
+
{
|
81 |
+
|
82 |
+
$xml = simplexml_load_string( $xmlInput );
|
83 |
+
|
84 |
+
$ns = $xml->getNamespaces( true );
|
85 |
+
|
86 |
+
$soap = $xml->children( $ns[ 'SOAP-ENV' ] );
|
87 |
+
$getChild = $soap->Body->children();
|
88 |
+
|
89 |
+
$ret = PPUtils::convertXmlObjToArr( $getChild, $array = array() );
|
90 |
+
|
91 |
+
return $ret;
|
92 |
+
}
|
93 |
+
|
94 |
+
/*foreach ($ret as $arry)
|
95 |
+
{
|
96 |
+
if (isset($arry['children']) && is_array($arry['children'])&& ($arry['children'])!=null) {
|
97 |
+
foreach ($arry['children'] as $novel)
|
98 |
+
{
|
99 |
+
|
100 |
+
}
|
101 |
+
}
|
102 |
+
else if ($arry['name'] != null)
|
103 |
+
{
|
104 |
+
$a = $arry['name'] ;
|
105 |
+
$b= $arry['text'];
|
106 |
+
if (isset($arry['attribute']))
|
107 |
+
{
|
108 |
+
$c = $arry['attribute'];
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
|
113 |
+
}*/
|
114 |
+
|
115 |
+
/*public function xml2array ( $xmlObject, $out = array () )
|
116 |
+
{
|
117 |
+
foreach ( (array) $xmlObject as $index => $node )
|
118 |
+
{
|
119 |
+
$out[$index] = ( is_object ( $node ) ) ? PPUtils::xml2array ( $node ) : $node;
|
120 |
+
}
|
121 |
+
return $out;
|
122 |
+
}*/
|
123 |
+
|
124 |
+
|
125 |
+
function convertXmlObjToArr( $obj, &$arr )
|
126 |
+
{
|
127 |
+
$children = $obj->children();
|
128 |
+
foreach ( $children as $elementName => $node ) {
|
129 |
+
$nextIdx = count( $arr );
|
130 |
+
$arr[ $nextIdx ] = array();
|
131 |
+
$arr[ $nextIdx ][ 'name' ] = strtolower( (string) $elementName );
|
132 |
+
$arr[ $nextIdx ][ 'attributes' ] = array();
|
133 |
+
$attributes = $node->attributes();
|
134 |
+
foreach ( $attributes as $attributeName => $attributeValue ) {
|
135 |
+
$attribName = strtolower( trim( (string) $attributeName ) );
|
136 |
+
$attribVal = trim( (string) $attributeValue );
|
137 |
+
$arr[ $nextIdx ][ 'attributes' ][ $attribName ] = $attribVal;
|
138 |
+
}
|
139 |
+
$text = (string) $node;
|
140 |
+
$text = trim( $text );
|
141 |
+
if ( strlen( $text ) > 0 ) {
|
142 |
+
$arr[ $nextIdx ][ 'text' ] = $text;
|
143 |
+
}
|
144 |
+
$arr[ $nextIdx ][ 'children' ] = array();
|
145 |
+
PPutils::convertXmlObjToArr( $node, $arr[ $nextIdx ][ 'children' ] );
|
146 |
+
}
|
147 |
+
|
148 |
+
return $arr;
|
149 |
+
}
|
150 |
+
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* @class xml2array
|
155 |
+
*/
|
156 |
+
|
157 |
+
|
158 |
+
/**
|
159 |
+
* XMLToArray Generator Class
|
160 |
+
* @author : MA Razzaque Rupom <rupom_315@yahoo.com>, <rupom.bd@gmail.com>
|
161 |
+
* Moderator, phpResource (LINK1http://groups.yahoo.com/group/phpresource/LINK1)
|
162 |
+
* URL: LINK2http://www.rupom.infoLINK2
|
163 |
+
* @version : 1.0
|
164 |
+
* @date 06/05/2006
|
165 |
+
* Purpose : Creating Hierarchical Array from XML Data
|
166 |
+
* Released : Under GPL
|
167 |
+
*/
|
168 |
+
|
169 |
+
class XmlToArray
|
170 |
+
{
|
171 |
+
|
172 |
+
var $xml = '';
|
173 |
+
|
174 |
+
/**
|
175 |
+
* Default Constructor
|
176 |
+
*
|
177 |
+
* @param $xml = xml data
|
178 |
+
*
|
179 |
+
* @return none
|
180 |
+
*/
|
181 |
+
|
182 |
+
function XmlToArray( $xml )
|
183 |
+
{
|
184 |
+
$this->xml = $xml;
|
185 |
+
}
|
186 |
+
|
187 |
+
/**
|
188 |
+
* _struct_to_array($values, &$i)
|
189 |
+
*
|
190 |
+
* This is adds the contents of the return xml into the array for easier processing.
|
191 |
+
* Recursive, Static
|
192 |
+
*
|
193 |
+
* @access private
|
194 |
+
*
|
195 |
+
* @param array $values this is the xml data in an array
|
196 |
+
* @param int $i this is the current location in the array
|
197 |
+
*
|
198 |
+
* @return Array
|
199 |
+
*/
|
200 |
+
|
201 |
+
function _struct_to_array( $values, &$i )
|
202 |
+
{
|
203 |
+
$child = array();
|
204 |
+
if ( isset( $values[ $i ][ 'value' ] ) ) array_push( $child, $values[ $i ][ 'value' ] );
|
205 |
+
|
206 |
+
while ( $i++ < count( $values ) ) {
|
207 |
+
switch ( $values[ $i ][ 'type' ] ) {
|
208 |
+
case 'cdata':
|
209 |
+
array_push( $child, $values[ $i ][ 'value' ] );
|
210 |
+
break;
|
211 |
+
|
212 |
+
case 'complete':
|
213 |
+
$name = $values[ $i ][ 'tag' ];
|
214 |
+
if ( !empty( $name ) ) {
|
215 |
+
$child[ $name ] = ( $values[ $i ][ 'value' ] ) ? ( $values[ $i ][ 'value' ] ) : '';
|
216 |
+
if ( isset( $values[ $i ][ 'attributes' ] ) ) {
|
217 |
+
$child[ $name ] = $values[ $i ][ 'attributes' ];
|
218 |
+
}
|
219 |
+
}
|
220 |
+
break;
|
221 |
+
|
222 |
+
case 'open':
|
223 |
+
$name = $values[ $i ][ 'tag' ];
|
224 |
+
$size = isset( $child[ $name ] ) ? sizeof( $child[ $name ] ) : 0;
|
225 |
+
$child[ $name ][ $size ] = $this->_struct_to_array( $values, $i );
|
226 |
+
break;
|
227 |
+
|
228 |
+
case 'close':
|
229 |
+
return $child;
|
230 |
+
break;
|
231 |
+
}
|
232 |
+
}
|
233 |
+
|
234 |
+
return $child;
|
235 |
+
}
|
236 |
+
|
237 |
+
//_struct_to_array
|
238 |
+
|
239 |
+
/**
|
240 |
+
* createArray($data)
|
241 |
+
*
|
242 |
+
* This is adds the contents of the return xml into the array for easier processing.
|
243 |
+
*
|
244 |
+
* @access public
|
245 |
+
*
|
246 |
+
* @param string $data this is the string of the xml data
|
247 |
+
*
|
248 |
+
* @return Array
|
249 |
+
*/
|
250 |
+
function createArray()
|
251 |
+
{
|
252 |
+
$xml = $this->xml;
|
253 |
+
$values = array();
|
254 |
+
$index = array();
|
255 |
+
$array = array();
|
256 |
+
$parser = xml_parser_create();
|
257 |
+
xml_parser_set_option( $parser, XML_OPTION_SKIP_WHITE, 1 );
|
258 |
+
xml_parser_set_option( $parser, XML_OPTION_CASE_FOLDING, 0 );
|
259 |
+
xml_parse_into_struct( $parser, $xml, $values, $index );
|
260 |
+
xml_parser_free( $parser );
|
261 |
+
$i = 0;
|
262 |
+
$name = $values[ $i ][ 'tag' ];
|
263 |
+
$array[ $name ] = isset( $values[ $i ][ 'attributes' ] ) ? $values[ $i ][ 'attributes' ] : '';
|
264 |
+
$array[ $name ] = $this->_struct_to_array( $values, $i );
|
265 |
+
|
266 |
+
return $array;
|
267 |
+
}
|
268 |
+
//createArray
|
269 |
+
|
270 |
+
|
271 |
+
}
|
272 |
+
|
273 |
+
//XmlToArray
|
274 |
?>
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/auth/AuthUtil.php
RENAMED
@@ -1,83 +1,83 @@
|
|
1 |
-
<?php //vim: foldmethod=marker
|
2 |
-
|
3 |
-
class MockOAuthDataStore extends OAuthDataStore
|
4 |
-
{ /*{{{*/
|
5 |
-
private $consumer;
|
6 |
-
private $request_token;
|
7 |
-
private $access_token;
|
8 |
-
private $nonce;
|
9 |
-
|
10 |
-
function __construct()
|
11 |
-
{ /*{{{*/
|
12 |
-
$this->consumer = new OAuthConsumer( "key", "secret", null );
|
13 |
-
$this->request_token = new OAuthToken( "requestkey", "requestsecret", 1 );
|
14 |
-
$this->access_token = new OAuthToken( "accesskey", "accesssecret", 1 );
|
15 |
-
$this->nonce = "nonce";
|
16 |
-
}
|
17 |
-
|
18 |
-
/*}}}*/
|
19 |
-
|
20 |
-
function lookup_consumer( $consumer_key )
|
21 |
-
{ /*{{{*/
|
22 |
-
if ( $consumer_key == $this->consumer->key ) return $this->consumer;
|
23 |
-
|
24 |
-
return null;
|
25 |
-
}
|
26 |
-
|
27 |
-
/*}}}*/
|
28 |
-
|
29 |
-
function lookup_token( $consumer, $token_type, $token )
|
30 |
-
{ /*{{{*/
|
31 |
-
$token_attrib = $token_type . "_token";
|
32 |
-
if ( $consumer->key == $this->consumer->key
|
33 |
-
&& $token == $this->$token_attrib->key
|
34 |
-
) {
|
35 |
-
return $this->$token_attrib;
|
36 |
-
}
|
37 |
-
|
38 |
-
return null;
|
39 |
-
}
|
40 |
-
|
41 |
-
/*}}}*/
|
42 |
-
|
43 |
-
function lookup_nonce( $consumer, $token, $nonce, $timestamp )
|
44 |
-
{ /*{{{*/
|
45 |
-
if ( $consumer->key == $this->consumer->key
|
46 |
-
&& ( ( $token && $token->key == $this->request_token->key )
|
47 |
-
|| ( $token && $token->key == $this->access_token->key ) )
|
48 |
-
&& $nonce == $this->nonce
|
49 |
-
) {
|
50 |
-
return $this->nonce;
|
51 |
-
}
|
52 |
-
|
53 |
-
return null;
|
54 |
-
}
|
55 |
-
|
56 |
-
/*}}}*/
|
57 |
-
|
58 |
-
function new_request_token( $consumer, $callback = null )
|
59 |
-
{ /*{{{*/
|
60 |
-
if ( $consumer->key == $this->consumer->key ) {
|
61 |
-
return $this->request_token;
|
62 |
-
}
|
63 |
-
|
64 |
-
return null;
|
65 |
-
}
|
66 |
-
|
67 |
-
/*}}}*/
|
68 |
-
|
69 |
-
function new_access_token( $token, $consumer, $verifier = null )
|
70 |
-
{ /*{{{*/
|
71 |
-
if ( $consumer->key == $this->consumer->key
|
72 |
-
&& $token->key == $this->request_token->key
|
73 |
-
) {
|
74 |
-
return $this->access_token;
|
75 |
-
}
|
76 |
-
|
77 |
-
return null;
|
78 |
-
}
|
79 |
-
/*}}}*/
|
80 |
-
}
|
81 |
-
|
82 |
-
/*}}}*/
|
83 |
-
?>
|
1 |
+
<?php //vim: foldmethod=marker
|
2 |
+
|
3 |
+
class MockOAuthDataStore extends OAuthDataStore
|
4 |
+
{ /*{{{*/
|
5 |
+
private $consumer;
|
6 |
+
private $request_token;
|
7 |
+
private $access_token;
|
8 |
+
private $nonce;
|
9 |
+
|
10 |
+
function __construct()
|
11 |
+
{ /*{{{*/
|
12 |
+
$this->consumer = new OAuthConsumer( "key", "secret", null );
|
13 |
+
$this->request_token = new OAuthToken( "requestkey", "requestsecret", 1 );
|
14 |
+
$this->access_token = new OAuthToken( "accesskey", "accesssecret", 1 );
|
15 |
+
$this->nonce = "nonce";
|
16 |
+
}
|
17 |
+
|
18 |
+
/*}}}*/
|
19 |
+
|
20 |
+
function lookup_consumer( $consumer_key )
|
21 |
+
{ /*{{{*/
|
22 |
+
if ( $consumer_key == $this->consumer->key ) return $this->consumer;
|
23 |
+
|
24 |
+
return null;
|
25 |
+
}
|
26 |
+
|
27 |
+
/*}}}*/
|
28 |
+
|
29 |
+
function lookup_token( $consumer, $token_type, $token )
|
30 |
+
{ /*{{{*/
|
31 |
+
$token_attrib = $token_type . "_token";
|
32 |
+
if ( $consumer->key == $this->consumer->key
|
33 |
+
&& $token == $this->$token_attrib->key
|
34 |
+
) {
|
35 |
+
return $this->$token_attrib;
|
36 |
+
}
|
37 |
+
|
38 |
+
return null;
|
39 |
+
}
|
40 |
+
|
41 |
+
/*}}}*/
|
42 |
+
|
43 |
+
function lookup_nonce( $consumer, $token, $nonce, $timestamp )
|
44 |
+
{ /*{{{*/
|
45 |
+
if ( $consumer->key == $this->consumer->key
|
46 |
+
&& ( ( $token && $token->key == $this->request_token->key )
|
47 |
+
|| ( $token && $token->key == $this->access_token->key ) )
|
48 |
+
&& $nonce == $this->nonce
|
49 |
+
) {
|
50 |
+
return $this->nonce;
|
51 |
+
}
|
52 |
+
|
53 |
+
return null;
|
54 |
+
}
|
55 |
+
|
56 |
+
/*}}}*/
|
57 |
+
|
58 |
+
function new_request_token( $consumer, $callback = null )
|
59 |
+
{ /*{{{*/
|
60 |
+
if ( $consumer->key == $this->consumer->key ) {
|
61 |
+
return $this->request_token;
|
62 |
+
}
|
63 |
+
|
64 |
+
return null;
|
65 |
+
}
|
66 |
+
|
67 |
+
/*}}}*/
|
68 |
+
|
69 |
+
function new_access_token( $token, $consumer, $verifier = null )
|
70 |
+
{ /*{{{*/
|
71 |
+
if ( $consumer->key == $this->consumer->key
|
72 |
+
&& $token->key == $this->request_token->key
|
73 |
+
) {
|
74 |
+
return $this->access_token;
|
75 |
+
}
|
76 |
+
|
77 |
+
return null;
|
78 |
+
}
|
79 |
+
/*}}}*/
|
80 |
+
}
|
81 |
+
|
82 |
+
/*}}}*/
|
83 |
+
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/auth/PPAuth.php
RENAMED
@@ -1,1073 +1,1073 @@
|
|
1 |
-
<?php
|
2 |
-
//PayPal specific modification starts
|
3 |
-
//Method to be called for generating signature
|
4 |
-
require_once( "AuthUtil.php" );
|
5 |
-
class AuthSignature
|
6 |
-
{
|
7 |
-
|
8 |
-
public function genSign( $key, $secret, $token, $tokenSecret, $httpMethod, $endpoint )
|
9 |
-
{
|
10 |
-
|
11 |
-
|
12 |
-
$authServer = new OAuthServer( new MockOAuthDataStore() );
|
13 |
-
$hmac_method = new OAuthSignatureMethod_HMAC_SHA1();
|
14 |
-
$authServer->add_signature_method( $hmac_method );
|
15 |
-
|
16 |
-
$sig_method = $hmac_method;
|
17 |
-
$authConsumer = new OAuthConsumer( $key, $secret, null );
|
18 |
-
$authToken = null;
|
19 |
-
$authToken = new OAuthToken( $token, $tokenSecret );
|
20 |
-
|
21 |
-
//$params is the query param array which is required only in the httpMethod is "GET"
|
22 |
-
|
23 |
-
$params = array();
|
24 |
-
//set the Query parameters to $params if httpMethod is "GET"
|
25 |
-
|
26 |
-
$acc_req = OAuthRequest::from_consumer_and_token( $authConsumer, $authToken, $httpMethod, $endpoint, $params );
|
27 |
-
|
28 |
-
$acc_req->sign_request( $sig_method, $authConsumer, $authToken );
|
29 |
-
$response = OAuthutil::parseQueryString( $acc_req );
|
30 |
-
|
31 |
-
return $response;
|
32 |
-
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
//PayPal specific modification ends
|
37 |
-
/* Generic exception class
|
38 |
-
*/
|
39 |
-
if ( !class_exists( 'OAuthException' ) ) {
|
40 |
-
class OAuthException extends Exception
|
41 |
-
{
|
42 |
-
// pass
|
43 |
-
}
|
44 |
-
}
|
45 |
-
|
46 |
-
if ( !class_exists( 'OAuthConsumer' ) ) {
|
47 |
-
class OAuthConsumer
|
48 |
-
{
|
49 |
-
public $key;
|
50 |
-
public $secret;
|
51 |
-
|
52 |
-
function __construct( $key, $secret, $callback_url = null )
|
53 |
-
{
|
54 |
-
$this->key = $key;
|
55 |
-
$this->secret = $secret;
|
56 |
-
$this->callback_url = $callback_url;
|
57 |
-
}
|
58 |
-
|
59 |
-
function __toString()
|
60 |
-
{
|
61 |
-
return "OAuthConsumer[key=$this->key,secret=$this->secret]";
|
62 |
-
}
|
63 |
-
}
|
64 |
-
}
|
65 |
-
|
66 |
-
if ( !class_exists( 'OAuthToken' ) ) {
|
67 |
-
class OAuthToken
|
68 |
-
{
|
69 |
-
// access tokens and request tokens
|
70 |
-
public $key;
|
71 |
-
public $secret;
|
72 |
-
|
73 |
-
/**
|
74 |
-
* key = the token
|
75 |
-
* secret = the token secret
|
76 |
-
*/
|
77 |
-
function __construct( $key, $secret )
|
78 |
-
{
|
79 |
-
$this->key = $key;
|
80 |
-
$this->secret = $secret;
|
81 |
-
}
|
82 |
-
|
83 |
-
/**
|
84 |
-
* generates the basic string serialization of a token that a server
|
85 |
-
* would respond to request_token and access_token calls with
|
86 |
-
*/
|
87 |
-
function to_string()
|
88 |
-
{
|
89 |
-
return "oauth_token=" .
|
90 |
-
OAuthUtil::urlencode_rfc3986( $this->key ) .
|
91 |
-
"&oauth_token_secret=" .
|
92 |
-
OAuthUtil::urlencode_rfc3986( $this->secret );
|
93 |
-
}
|
94 |
-
|
95 |
-
function __toString()
|
96 |
-
{
|
97 |
-
return $this->to_string();
|
98 |
-
}
|
99 |
-
}
|
100 |
-
}
|
101 |
-
|
102 |
-
/**
|
103 |
-
* A class for implementing a Signature Method
|
104 |
-
* See section 9 ("Signing Requests") in the spec
|
105 |
-
*/
|
106 |
-
if ( !class_exists( 'OAuthSignatureMethod' ) ) {
|
107 |
-
abstract class OAuthSignatureMethod
|
108 |
-
{
|
109 |
-
/**
|
110 |
-
* Needs to return the name of the Signature Method (ie HMAC-SHA1)
|
111 |
-
* @return string
|
112 |
-
*/
|
113 |
-
abstract public function get_name();
|
114 |
-
|
115 |
-
/**
|
116 |
-
* Build up the signature
|
117 |
-
* NOTE: The output of this function MUST NOT be urlencoded.
|
118 |
-
* the encoding is handled in OAuthRequest when the final
|
119 |
-
* request is serialized
|
120 |
-
*
|
121 |
-
* @param OAuthRequest $request
|
122 |
-
* @param OAuthConsumer $consumer
|
123 |
-
* @param OAuthToken $token
|
124 |
-
*
|
125 |
-
* @return string
|
126 |
-
*/
|
127 |
-
abstract public function build_signature( $request, $consumer, $token );
|
128 |
-
|
129 |
-
/**
|
130 |
-
* Verifies that a given signature is correct
|
131 |
-
*
|
132 |
-
* @param OAuthRequest $request
|
133 |
-
* @param OAuthConsumer $consumer
|
134 |
-
* @param OAuthToken $token
|
135 |
-
* @param string $signature
|
136 |
-
*
|
137 |
-
* @return bool
|
138 |
-
*/
|
139 |
-
public function check_signature( $request, $consumer, $token, $signature )
|
140 |
-
{
|
141 |
-
$built = $this->build_signature( $request, $consumer, $token );
|
142 |
-
|
143 |
-
return $built == $signature;
|
144 |
-
}
|
145 |
-
}
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
|
150 |
-
* where the Signature Base String is the text and the key is the concatenated values (each first
|
151 |
-
* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
|
152 |
-
* character (ASCII code 38) even if empty.
|
153 |
-
* - Chapter 9.2 ("HMAC-SHA1")
|
154 |
-
*/
|
155 |
-
if ( !class_exists( 'OAuthSignatureMethod_HMAC_SHA1' ) ) {
|
156 |
-
class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod
|
157 |
-
{
|
158 |
-
function get_name()
|
159 |
-
{
|
160 |
-
return "HMAC-SHA1";
|
161 |
-
}
|
162 |
-
|
163 |
-
public function build_signature( $request, $consumer, $token )
|
164 |
-
{
|
165 |
-
$base_string = $request->get_signature_base_string();
|
166 |
-
$base_string = preg_replace( "/(%[A-Za-z0-9]{2})/e", "strtolower('\\0')", $base_string ); //convert base string to lowercase
|
167 |
-
$request->base_string = $base_string;
|
168 |
-
|
169 |
-
$key_parts = array(
|
170 |
-
$consumer->secret,
|
171 |
-
( $token ) ? $token->secret : ""
|
172 |
-
);
|
173 |
-
|
174 |
-
$key_parts = OAuthUtil::urlencode_rfc3986( $key_parts );
|
175 |
-
$key = implode( '&', $key_parts );
|
176 |
-
$key = preg_replace( "/(%[A-Za-z0-9]{2})/e", "strtolower('\\0')", $key ); //convert to lowercase
|
177 |
-
return base64_encode( hash_hmac( 'sha1', $base_string, $key, true ) );
|
178 |
-
}
|
179 |
-
}
|
180 |
-
}
|
181 |
-
/**
|
182 |
-
* The PLAINTEXT method does not provide any security protection and SHOULD only be used
|
183 |
-
* over a secure channel such as HTTPS. It does not use the Signature Base String.
|
184 |
-
* - Chapter 9.4 ("PLAINTEXT")
|
185 |
-
*/
|
186 |
-
if ( !class_exists( 'OAuthSignatureMethod_PLAINTEXT' ) ) {
|
187 |
-
class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod
|
188 |
-
{
|
189 |
-
public function get_name()
|
190 |
-
{
|
191 |
-
return "PLAINTEXT";
|
192 |
-
}
|
193 |
-
|
194 |
-
/**
|
195 |
-
* oauth_signature is set to the concatenated encoded values of the Consumer Secret and
|
196 |
-
* Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
|
197 |
-
* empty. The result MUST be encoded again.
|
198 |
-
* - Chapter 9.4.1 ("Generating Signatures")
|
199 |
-
*
|
200 |
-
* Please note that the second encoding MUST NOT happen in the SignatureMethod, as
|
201 |
-
* OAuthRequest handles this!
|
202 |
-
*/
|
203 |
-
public function build_signature( $request, $consumer, $token )
|
204 |
-
{
|
205 |
-
$key_parts = array(
|
206 |
-
$consumer->secret,
|
207 |
-
( $token ) ? $token->secret : ""
|
208 |
-
);
|
209 |
-
|
210 |
-
$key_parts = OAuthUtil::urlencode_rfc3986( $key_parts );
|
211 |
-
$key = implode( '&', $key_parts );
|
212 |
-
$request->base_string = $key;
|
213 |
-
|
214 |
-
return $key;
|
215 |
-
}
|
216 |
-
}
|
217 |
-
}
|
218 |
-
/**
|
219 |
-
* The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
|
220 |
-
* [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
|
221 |
-
* EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
|
222 |
-
* verified way to the Service Provider, in a manner which is beyond the scope of this
|
223 |
-
* specification.
|
224 |
-
* - Chapter 9.3 ("RSA-SHA1")
|
225 |
-
*/
|
226 |
-
if ( !class_exists( 'OAuthSignatureMethod_RSA_SHA1' ) ) {
|
227 |
-
abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod
|
228 |
-
{
|
229 |
-
public function get_name()
|
230 |
-
{
|
231 |
-
return "RSA-SHA1";
|
232 |
-
}
|
233 |
-
|
234 |
-
// Up to the SP to implement this lookup of keys. Possible ideas are:
|
235 |
-
// (1) do a lookup in a table of trusted certs keyed off of consumer
|
236 |
-
// (2) fetch via http using a url provided by the requester
|
237 |
-
// (3) some sort of specific discovery code based on request
|
238 |
-
//
|
239 |
-
// Either way should return a string representation of the certificate
|
240 |
-
protected abstract function fetch_public_cert( &$request );
|
241 |
-
|
242 |
-
// Up to the SP to implement this lookup of keys. Possible ideas are:
|
243 |
-
// (1) do a lookup in a table of trusted certs keyed off of consumer
|
244 |
-
//
|
245 |
-
// Either way should return a string representation of the certificate
|
246 |
-
protected abstract function fetch_private_cert( &$request );
|
247 |
-
|
248 |
-
public function build_signature( $request, $consumer, $token )
|
249 |
-
{
|
250 |
-
$base_string = $request->get_signature_base_string();
|
251 |
-
$request->base_string = $base_string;
|
252 |
-
|
253 |
-
// Fetch the private key cert based on the request
|
254 |
-
$cert = $this->fetch_private_cert( $request );
|
255 |
-
|
256 |
-
// Pull the private key ID from the certificate
|
257 |
-
$privatekeyid = openssl_get_privatekey( $cert );
|
258 |
-
|
259 |
-
// Sign using the key
|
260 |
-
$ok = openssl_sign( $base_string, $signature, $privatekeyid );
|
261 |
-
|
262 |
-
// Release the key resource
|
263 |
-
openssl_free_key( $privatekeyid );
|
264 |
-
|
265 |
-
return base64_encode( $signature );
|
266 |
-
}
|
267 |
-
|
268 |
-
public function check_signature( $request, $consumer, $token, $signature )
|
269 |
-
{
|
270 |
-
$decoded_sig = base64_decode( $signature );
|
271 |
-
|
272 |
-
$base_string = $request->get_signature_base_string();
|
273 |
-
|
274 |
-
// Fetch the public key cert based on the request
|
275 |
-
$cert = $this->fetch_public_cert( $request );
|
276 |
-
|
277 |
-
// Pull the public key ID from the certificate
|
278 |
-
$publickeyid = openssl_get_publickey( $cert );
|
279 |
-
|
280 |
-
// Check the computed signature against the one passed in the query
|
281 |
-
$ok = openssl_verify( $base_string, $decoded_sig, $publickeyid );
|
282 |
-
|
283 |
-
// Release the key resource
|
284 |
-
openssl_free_key( $publickeyid );
|
285 |
-
|
286 |
-
return $ok == 1;
|
287 |
-
}
|
288 |
-
}
|
289 |
-
}
|
290 |
-
|
291 |
-
if ( !class_exists( 'OAuthRequest' ) ) {
|
292 |
-
class OAuthRequest
|
293 |
-
{
|
294 |
-
public $parameters;
|
295 |
-
protected $http_method;
|
296 |
-
protected $http_url;
|
297 |
-
// for debug purposes
|
298 |
-
public $base_string;
|
299 |
-
public static $version = '1.0';
|
300 |
-
public static $POST_INPUT = 'php://input';
|
301 |
-
|
302 |
-
function __construct( $http_method, $http_url, $parameters = null )
|
303 |
-
{
|
304 |
-
$parameters = ( $parameters ) ? $parameters : array();
|
305 |
-
$parameters = array_merge( OAuthUtil::parse_parameters( parse_url( $http_url, PHP_URL_QUERY ) ), $parameters );
|
306 |
-
$this->parameters = $parameters;
|
307 |
-
$this->http_method = $http_method;
|
308 |
-
$this->http_url = $http_url;
|
309 |
-
}
|
310 |
-
|
311 |
-
|
312 |
-
/**
|
313 |
-
* attempt to build up a request from what was passed to the server
|
314 |
-
*/
|
315 |
-
public static function from_request( $http_method = null, $http_url = null, $parameters = null )
|
316 |
-
{
|
317 |
-
$scheme = ( !isset( $_SERVER[ 'HTTPS' ] ) || $_SERVER[ 'HTTPS' ] != "on" )
|
318 |
-
? 'http'
|
319 |
-
: 'https';
|
320 |
-
$http_url = ( $http_url ) ? $http_url : $scheme .
|
321 |
-
'://' . $_SERVER[ 'HTTP_HOST' ] .
|
322 |
-
':' .
|
323 |
-
$_SERVER[ 'SERVER_PORT' ] .
|
324 |
-
$_SERVER[ 'REQUEST_URI' ];
|
325 |
-
$http_method = ( $http_method ) ? $http_method : $_SERVER[ 'REQUEST_METHOD' ];
|
326 |
-
|
327 |
-
// We weren't handed any parameters, so let's find the ones relevant to
|
328 |
-
// this request.
|
329 |
-
// If you run XML-RPC or similar you should use this to provide your own
|
330 |
-
// parsed parameter-list
|
331 |
-
if ( !$parameters ) {
|
332 |
-
// Find request headers
|
333 |
-
$request_headers = OAuthUtil::get_headers();
|
334 |
-
|
335 |
-
// Parse the query-string to find GET parameters
|
336 |
-
$parameters = OAuthUtil::parse_parameters( $_SERVER[ 'QUERY_STRING' ] );
|
337 |
-
|
338 |
-
// It's a POST request of the proper content-type, so parse POST
|
339 |
-
// parameters and add those overriding any duplicates from GET
|
340 |
-
if ( $http_method == "POST"
|
341 |
-
&& isset( $request_headers[ 'Content-Type' ] )
|
342 |
-
&& strstr( $request_headers[ 'Content-Type' ],
|
343 |
-
'application/x-www-form-urlencoded' )
|
344 |
-
) {
|
345 |
-
$post_data = OAuthUtil::parse_parameters(
|
346 |
-
file_get_contents( self::$POST_INPUT )
|
347 |
-
);
|
348 |
-
$parameters = array_merge( $parameters, $post_data );
|
349 |
-
}
|
350 |
-
|
351 |
-
// We have a Authorization-header with OAuth data. Parse the header
|
352 |
-
// and add those overriding any duplicates from GET or POST
|
353 |
-
if ( isset( $request_headers[ 'Authorization' ] ) && substr( $request_headers[ 'Authorization' ], 0, 6 ) == 'OAuth ' ) {
|
354 |
-
$header_parameters = OAuthUtil::split_header(
|
355 |
-
$request_headers[ 'Authorization' ]
|
356 |
-
);
|
357 |
-
$parameters = array_merge( $parameters, $header_parameters );
|
358 |
-
}
|
359 |
-
|
360 |
-
}
|
361 |
-
|
362 |
-
return new OAuthRequest( $http_method, $http_url, $parameters );
|
363 |
-
}
|
364 |
-
|
365 |
-
/**
|
366 |
-
* pretty much a helper function to set up the request
|
367 |
-
*/
|
368 |
-
public static function from_consumer_and_token( $consumer, $token, $http_method, $http_url, $parameters = null )
|
369 |
-
{
|
370 |
-
$parameters = ( $parameters ) ? $parameters : array();
|
371 |
-
$defaults = array(
|
372 |
-
"oauth_version" => OAuthRequest::$version,
|
373 |
-
// "oauth_nonce" => OAuthRequest::generate_nonce(),
|
374 |
-
"oauth_timestamp" => OAuthRequest::generate_timestamp(),
|
375 |
-
|
376 |
-
"oauth_consumer_key" => $consumer->key
|
377 |
-
);
|
378 |
-
if ( $token )
|
379 |
-
$defaults[ 'oauth_token' ] = $token->key;
|
380 |
-
|
381 |
-
$parameters = array_merge( $defaults, $parameters );
|
382 |
-
ksort( $parameters );
|
383 |
-
|
384 |
-
return new OAuthRequest( $http_method, $http_url, $parameters );
|
385 |
-
}
|
386 |
-
|
387 |
-
public function set_parameter( $name, $value, $allow_duplicates = true )
|
388 |
-
{
|
389 |
-
if ( $allow_duplicates && isset( $this->parameters[ $name ] ) ) {
|
390 |
-
// We have already added parameter(s) with this name, so add to the list
|
391 |
-
if ( is_scalar( $this->parameters[ $name ] ) ) {
|
392 |
-
// This is the first duplicate, so transform scalar (string)
|
393 |
-
// into an array so we can add the duplicates
|
394 |
-
$this->parameters[ $name ] = array( $this->parameters[ $name ] );
|
395 |
-
}
|
396 |
-
|
397 |
-
$this->parameters[ $name ][ ] = $value;
|
398 |
-
} else {
|
399 |
-
$this->parameters[ $name ] = $value;
|
400 |
-
}
|
401 |
-
}
|
402 |
-
|
403 |
-
public function get_parameter( $name )
|
404 |
-
{
|
405 |
-
return isset( $this->parameters[ $name ] ) ? $this->parameters[ $name ] : null;
|
406 |
-
}
|
407 |
-
|
408 |
-
public function get_parameters()
|
409 |
-
{
|
410 |
-
return $this->parameters;
|
411 |
-
}
|
412 |
-
|
413 |
-
public function unset_parameter( $name )
|
414 |
-
{
|
415 |
-
unset( $this->parameters[ $name ] );
|
416 |
-
}
|
417 |
-
|
418 |
-
/**
|
419 |
-
* The request parameters, sorted and concatenated into a normalized string.
|
420 |
-
* @return string
|
421 |
-
*/
|
422 |
-
public function get_signable_parameters()
|
423 |
-
{
|
424 |
-
// Grab all parameters
|
425 |
-
$params = $this->parameters;
|
426 |
-
ksort( $params );
|
427 |
-
// Remove oauth_signature if present
|
428 |
-
// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
|
429 |
-
if ( isset( $params[ 'oauth_signature' ] ) ) {
|
430 |
-
unset( $params[ 'oauth_signature' ] );
|
431 |
-
}
|
432 |
-
foreach ( $params as $key => $value ) {
|
433 |
-
$res[ ] = $key . "=" . $value;
|
434 |
-
}
|
435 |
-
|
436 |
-
return implode( '&', $res );
|
437 |
-
//return OAuthUtil::build_http_query($params);
|
438 |
-
}
|
439 |
-
|
440 |
-
/**
|
441 |
-
* Returns the base string of this request
|
442 |
-
*
|
443 |
-
* The base string defined as the method, the url
|
444 |
-
* and the parameters (normalized), each urlencoded
|
445 |
-
* and the concated with &.
|
446 |
-
*/
|
447 |
-
public function get_signature_base_string()
|
448 |
-
{
|
449 |
-
$parts = array(
|
450 |
-
$this->get_normalized_http_method(),
|
451 |
-
$this->get_normalized_http_url(),
|
452 |
-
$this->get_signable_parameters()
|
453 |
-
);
|
454 |
-
|
455 |
-
$parts = OAuthUtil::urlencode_rfc3986( $parts );
|
456 |
-
|
457 |
-
return implode( '&', $parts );
|
458 |
-
}
|
459 |
-
|
460 |
-
/**
|
461 |
-
* just uppercases the http method
|
462 |
-
*/
|
463 |
-
public function get_normalized_http_method()
|
464 |
-
{
|
465 |
-
return strtoupper( $this->http_method );
|
466 |
-
}
|
467 |
-
|
468 |
-
/**
|
469 |
-
* parses the url and rebuilds it to be
|
470 |
-
* scheme://host/path
|
471 |
-
*/
|
472 |
-
public function get_normalized_http_url()
|
473 |
-
{
|
474 |
-
$parts = parse_url( $this->http_url );
|
475 |
-
|
476 |
-
$scheme = ( isset( $parts[ 'scheme' ] ) ) ? $parts[ 'scheme' ] : 'http';
|
477 |
-
$port = ( isset( $parts[ 'port' ] ) ) ? $parts[ 'port' ] : ( ( $scheme == 'https' ) ? '443' : '80' );
|
478 |
-
$host = ( isset( $parts[ 'host' ] ) ) ? $parts[ 'host' ] : '';
|
479 |
-
$path = ( isset( $parts[ 'path' ] ) ) ? $parts[ 'path' ] : '';
|
480 |
-
|
481 |
-
if ( ( $scheme == 'https' && $port != '443' )
|
482 |
-
|| ( $scheme == 'http' && $port != '80' )
|
483 |
-
) {
|
484 |
-
$host = "$host:$port";
|
485 |
-
}
|
486 |
-
|
487 |
-
return "$scheme://$host$path";
|
488 |
-
}
|
489 |
-
|
490 |
-
/**
|
491 |
-
* builds a url usable for a GET request
|
492 |
-
*/
|
493 |
-
public function to_url()
|
494 |
-
{
|
495 |
-
$post_data = $this->to_postdata();
|
496 |
-
$out = $this->get_normalized_http_url();
|
497 |
-
if ( $post_data ) {
|
498 |
-
$out .= '?' . $post_data;
|
499 |
-
}
|
500 |
-
|
501 |
-
return $out;
|
502 |
-
}
|
503 |
-
|
504 |
-
/**
|
505 |
-
* builds the data one would send in a POST request
|
506 |
-
*/
|
507 |
-
public function to_postdata()
|
508 |
-
{
|
509 |
-
return OAuthUtil::build_http_query( $this->parameters );
|
510 |
-
}
|
511 |
-
|
512 |
-
/**
|
513 |
-
* builds the Authorization: header
|
514 |
-
*/
|
515 |
-
public function to_header( $realm = null )
|
516 |
-
{
|
517 |
-
$first = true;
|
518 |
-
if ( $realm ) {
|
519 |
-
$out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986( $realm ) . '"';
|
520 |
-
$first = false;
|
521 |
-
} else
|
522 |
-
$out = 'Authorization: OAuth';
|
523 |
-
|
524 |
-
$total = array();
|
525 |
-
foreach ( $this->parameters as $k => $v ) {
|
526 |
-
if ( substr( $k, 0, 5 ) != "oauth" ) continue;
|
527 |
-
if ( is_array( $v ) ) {
|
528 |
-
throw new OAuthException( 'Arrays not supported in headers' );
|
529 |
-
}
|
530 |
-
$out .= ( $first ) ? ' ' : ',';
|
531 |
-
$out .= OAuthUtil::urlencode_rfc3986( $k ) .
|
532 |
-
'="' .
|
533 |
-
OAuthUtil::urlencode_rfc3986( $v ) .
|
534 |
-
'"';
|
535 |
-
$first = false;
|
536 |
-
}
|
537 |
-
|
538 |
-
return $out;
|
539 |
-
}
|
540 |
-
|
541 |
-
public function __toString()
|
542 |
-
{
|
543 |
-
return $this->to_url();
|
544 |
-
}
|
545 |
-
|
546 |
-
|
547 |
-
public function sign_request( $signature_method, $consumer, $token )
|
548 |
-
{
|
549 |
-
|
550 |
-
$empty = false;
|
551 |
-
$msg = array();
|
552 |
-
if ( $token->key == null ) {
|
553 |
-
$msg[ ] = 'Token key';
|
554 |
-
}
|
555 |
-
if ( $token->secret == null ) {
|
556 |
-
$msg[ ] = 'Token secret';
|
557 |
-
}
|
558 |
-
if ( $consumer->key == null ) {
|
559 |
-
|
560 |
-
$msg[ ] = 'Consumer key';
|
561 |
-
}
|
562 |
-
if ( $consumer->secret == null ) {
|
563 |
-
|
564 |
-
$msg[ ] = 'Consumer secret';
|
565 |
-
}
|
566 |
-
if ( $this->http_url == null ) {
|
567 |
-
|
568 |
-
$msg[ ] = 'Endpoint';
|
569 |
-
}
|
570 |
-
if ( $this->http_method == null ) {
|
571 |
-
|
572 |
-
$msg[ ] = 'HTTP method';
|
573 |
-
}
|
574 |
-
if ( count( $msg ) ) {
|
575 |
-
throw new OAuthException( 'Enter valid ' . implode( ',', $msg ) );
|
576 |
-
}
|
577 |
-
$this->set_parameter(
|
578 |
-
"oauth_signature_method",
|
579 |
-
$signature_method->get_name(),
|
580 |
-
false );
|
581 |
-
|
582 |
-
$signature = $this->build_signature( $signature_method, $consumer, $token );
|
583 |
-
$this->set_parameter( "oauth_signature", $signature, false );
|
584 |
-
|
585 |
-
}
|
586 |
-
|
587 |
-
public function build_signature( $signature_method, $consumer, $token )
|
588 |
-
{
|
589 |
-
$signature = $signature_method->build_signature( $this, $consumer, $token );
|
590 |
-
|
591 |
-
return $signature;
|
592 |
-
}
|
593 |
-
|
594 |
-
/**
|
595 |
-
* util function: current timestamp
|
596 |
-
*/
|
597 |
-
private static function generate_timestamp()
|
598 |
-
{
|
599 |
-
return time();
|
600 |
-
}
|
601 |
-
|
602 |
-
/**
|
603 |
-
* util function: current nonce
|
604 |
-
*/
|
605 |
-
private static function generate_nonce()
|
606 |
-
{
|
607 |
-
$mt = microtime();
|
608 |
-
$rand = mt_rand();
|
609 |
-
|
610 |
-
return md5( $mt . $rand ); // md5s look nicer than numbers
|
611 |
-
}
|
612 |
-
}
|
613 |
-
}
|
614 |
-
|
615 |
-
if ( !class_exists( 'OAuthServer' ) ) {
|
616 |
-
class OAuthServer
|
617 |
-
{
|
618 |
-
protected $timestamp_threshold = 300; // in seconds, five minutes
|
619 |
-
protected $version = '1.0'; // hi blaine
|
620 |
-
protected $signature_methods = array();
|
621 |
-
|
622 |
-
protected $data_store;
|
623 |
-
|
624 |
-
function __construct( $data_store )
|
625 |
-
{
|
626 |
-
$this->data_store = $data_store;
|
627 |
-
}
|
628 |
-
|
629 |
-
public function add_signature_method( $signature_method )
|
630 |
-
{
|
631 |
-
$this->signature_methods[ $signature_method->get_name() ] =
|
632 |
-
$signature_method;
|
633 |
-
}
|
634 |
-
|
635 |
-
// high level functions
|
636 |
-
|
637 |
-
/**
|
638 |
-
* process a request_token request
|
639 |
-
* returns the request token on success
|
640 |
-
*/
|
641 |
-
public function fetch_request_token( &$request )
|
642 |
-
{
|
643 |
-
$this->get_version( $request );
|
644 |
-
|
645 |
-
$consumer = $this->get_consumer( $request );
|
646 |
-
|
647 |
-
// no token required for the initial token request
|
648 |
-
$token = null;
|
649 |
-
|
650 |
-
$this->check_signature( $request, $consumer, $token );
|
651 |
-
|
652 |
-
// Rev A change
|
653 |
-
$callback = $request->get_parameter( 'oauth_callback' );
|
654 |
-
$new_token = $this->data_store->new_request_token( $consumer, $callback );
|
655 |
-
|
656 |
-
return $new_token;
|
657 |
-
}
|
658 |
-
|
659 |
-
/**
|
660 |
-
* process an access_token request
|
661 |
-
* returns the access token on success
|
662 |
-
*/
|
663 |
-
public function fetch_access_token( &$request )
|
664 |
-
{
|
665 |
-
$this->get_version( $request );
|
666 |
-
|
667 |
-
$consumer = $this->get_consumer( $request );
|
668 |
-
|
669 |
-
// requires authorized request token
|
670 |
-
$token = $this->get_token( $request, $consumer, "request" );
|
671 |
-
|
672 |
-
$this->check_signature( $request, $consumer, $token );
|
673 |
-
|
674 |
-
// Rev A change
|
675 |
-
$verifier = $request->get_parameter( 'oauth_verifier' );
|
676 |
-
$new_token = $this->data_store->new_access_token( $token, $consumer, $verifier );
|
677 |
-
|
678 |
-
return $new_token;
|
679 |
-
}
|
680 |
-
|
681 |
-
/**
|
682 |
-
* verify an api call, checks all the parameters
|
683 |
-
*/
|
684 |
-
public function verify_request( &$request )
|
685 |
-
{
|
686 |
-
$this->get_version( $request );
|
687 |
-
$consumer = $this->get_consumer( $request );
|
688 |
-
$token = $this->get_token( $request, $consumer, "access" );
|
689 |
-
$this->check_signature( $request, $consumer, $token );
|
690 |
-
|
691 |
-
return array( $consumer, $token );
|
692 |
-
}
|
693 |
-
|
694 |
-
// Internals from here
|
695 |
-
/**
|
696 |
-
* version 1
|
697 |
-
*/
|
698 |
-
private function get_version( &$request )
|
699 |
-
{
|
700 |
-
$version = $request->get_parameter( "oauth_version" );
|
701 |
-
if ( !$version ) {
|
702 |
-
// Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.
|
703 |
-
// Chapter 7.0 ("Accessing Protected Ressources")
|
704 |
-
$version = '1.0';
|
705 |
-
}
|
706 |
-
if ( $version !== $this->version ) {
|
707 |
-
throw new OAuthException( "OAuth version '$version' not supported" );
|
708 |
-
}
|
709 |
-
|
710 |
-
return $version;
|
711 |
-
}
|
712 |
-
|
713 |
-
/**
|
714 |
-
* figure out the signature with some defaults
|
715 |
-
*/
|
716 |
-
private function get_signature_method( $request )
|
717 |
-
{
|
718 |
-
$signature_method = $request instanceof OAuthRequest
|
719 |
-
? $request->get_parameter( "oauth_signature_method" )
|
720 |
-
: null;
|
721 |
-
|
722 |
-
if ( !$signature_method ) {
|
723 |
-
// According to chapter 7 ("Accessing Protected Ressources") the signature-method
|
724 |
-
// parameter is required, and we can't just fallback to PLAINTEXT
|
725 |
-
throw new OAuthException( 'No signature method parameter. This parameter is required' );
|
726 |
-
}
|
727 |
-
|
728 |
-
if ( !in_array( $signature_method,
|
729 |
-
array_keys( $this->signature_methods ) )
|
730 |
-
) {
|
731 |
-
throw new OAuthException(
|
732 |
-
"Signature method '$signature_method' not supported " .
|
733 |
-
"try one of the following: " .
|
734 |
-
implode( ", ", array_keys( $this->signature_methods ) )
|
735 |
-
);
|
736 |
-
}
|
737 |
-
|
738 |
-
return $this->signature_methods[ $signature_method ];
|
739 |
-
}
|
740 |
-
|
741 |
-
/**
|
742 |
-
* try to find the consumer for the provided request's consumer key
|
743 |
-
*/
|
744 |
-
private function get_consumer( $request )
|
745 |
-
{
|
746 |
-
$consumer_key = $request instanceof OAuthRequest
|
747 |
-
? $request->get_parameter( "oauth_consumer_key" )
|
748 |
-
: null;
|
749 |
-
|
750 |
-
if ( !$consumer_key ) {
|
751 |
-
throw new OAuthException( "Invalid consumer key" );
|
752 |
-
}
|
753 |
-
|
754 |
-
$consumer = $this->data_store->lookup_consumer( $consumer_key );
|
755 |
-
if ( !$consumer ) {
|
756 |
-
throw new OAuthException( "Invalid consumer" );
|
757 |
-
}
|
758 |
-
|
759 |
-
return $consumer;
|
760 |
-
}
|
761 |
-
|
762 |
-
/**
|
763 |
-
* try to find the token for the provided request's token key
|
764 |
-
*/
|
765 |
-
private function get_token( $request, $consumer, $token_type = "access" )
|
766 |
-
{
|
767 |
-
$token_field = $request instanceof OAuthRequest
|
768 |
-
? $request->get_parameter( 'oauth_token' )
|
769 |
-
: null;
|
770 |
-
|
771 |
-
$token = $this->data_store->lookup_token(
|
772 |
-
$consumer, $token_type, $token_field
|
773 |
-
);
|
774 |
-
if ( !$token ) {
|
775 |
-
throw new OAuthException( "Invalid $token_type token: $token_field" );
|
776 |
-
}
|
777 |
-
|
778 |
-
return $token;
|
779 |
-
}
|
780 |
-
|
781 |
-
/**
|
782 |
-
* all-in-one function to check the signature on a request
|
783 |
-
* should guess the signature method appropriately
|
784 |
-
*/
|
785 |
-
private function check_signature( $request, $consumer, $token )
|
786 |
-
{
|
787 |
-
// this should probably be in a different method
|
788 |
-
$timestamp = $request instanceof OAuthRequest
|
789 |
-
? $request->get_parameter( 'oauth_timestamp' )
|
790 |
-
: null;
|
791 |
-
$nonce = $request instanceof OAuthRequest
|
792 |
-
? $request->get_parameter( 'oauth_nonce' )
|
793 |
-
: null;
|
794 |
-
|
795 |
-
$this->check_timestamp( $timestamp );
|
796 |
-
$this->check_nonce( $consumer, $token, $nonce, $timestamp );
|
797 |
-
|
798 |
-
$signature_method = $this->get_signature_method( $request );
|
799 |
-
|
800 |
-
$signature = $request->get_parameter( 'oauth_signature' );
|
801 |
-
$valid_sig = $signature_method->check_signature(
|
802 |
-
$request,
|
803 |
-
$consumer,
|
804 |
-
$token,
|
805 |
-
$signature
|
806 |
-
);
|
807 |
-
|
808 |
-
if ( !$valid_sig ) {
|
809 |
-
throw new OAuthException( "Invalid signature" );
|
810 |
-
}
|
811 |
-
}
|
812 |
-
|
813 |
-
/**
|
814 |
-
* check that the timestamp is new enough
|
815 |
-
*/
|
816 |
-
private function check_timestamp( $timestamp )
|
817 |
-
{
|
818 |
-
if ( !$timestamp )
|
819 |
-
throw new OAuthException(
|
820 |
-
'Missing timestamp parameter. The parameter is required'
|
821 |
-
);
|
822 |
-
|
823 |
-
// verify that timestamp is recentish
|
824 |
-
$now = time();
|
825 |
-
if ( abs( $now - $timestamp ) > $this->timestamp_threshold ) {
|
826 |
-
throw new OAuthException(
|
827 |
-
"Expired timestamp, yours $timestamp, ours $now"
|
828 |
-
);
|
829 |
-
}
|
830 |
-
}
|
831 |
-
|
832 |
-
/**
|
833 |
-
* check that the nonce is not repeated
|
834 |
-
*/
|
835 |
-
private function check_nonce( $consumer, $token, $nonce, $timestamp )
|
836 |
-
{
|
837 |
-
if ( !$nonce )
|
838 |
-
throw new OAuthException(
|
839 |
-
'Missing nonce parameter. The parameter is required'
|
840 |
-
);
|
841 |
-
|
842 |
-
// verify that the nonce is uniqueish
|
843 |
-
$found = $this->data_store->lookup_nonce(
|
844 |
-
$consumer,
|
845 |
-
$token,
|
846 |
-
$nonce,
|
847 |
-
$timestamp
|
848 |
-
);
|
849 |
-
if ( $found ) {
|
850 |
-
throw new OAuthException( "Nonce already used: $nonce" );
|
851 |
-
}
|
852 |
-
}
|
853 |
-
|
854 |
-
}
|
855 |
-
}
|
856 |
-
|
857 |
-
class OAuthDataStore
|
858 |
-
{
|
859 |
-
function lookup_consumer( $consumer_key )
|
860 |
-
{
|
861 |
-
// implement me
|
862 |
-
}
|
863 |
-
|
864 |
-
function lookup_token( $consumer, $token_type, $token )
|
865 |
-
{
|
866 |
-
// implement me
|
867 |
-
}
|
868 |
-
|
869 |
-
function lookup_nonce( $consumer, $token, $nonce, $timestamp )
|
870 |
-
{
|
871 |
-
// implement me
|
872 |
-
}
|
873 |
-
|
874 |
-
function new_request_token( $consumer, $callback = null )
|
875 |
-
{
|
876 |
-
// return a new token attached to this consumer
|
877 |
-
}
|
878 |
-
|
879 |
-
function new_access_token( $token, $consumer, $verifier = null )
|
880 |
-
{
|
881 |
-
// return a new access token attached to this consumer
|
882 |
-
// for the user associated with this token if the request token
|
883 |
-
// is authorized
|
884 |
-
// should also invalidate the request token
|
885 |
-
}
|
886 |
-
|
887 |
-
}
|
888 |
-
|
889 |
-
if ( !class_exists( 'OAuthUtil' ) ) {
|
890 |
-
class OAuthUtil
|
891 |
-
{
|
892 |
-
public static function urlencode_rfc3986( $input )
|
893 |
-
{
|
894 |
-
if ( is_array( $input ) ) {
|
895 |
-
return array_map( array( 'OAuthUtil', 'urlencode_rfc3986' ), $input );
|
896 |
-
} else if ( is_scalar( $input ) ) {
|
897 |
-
$tmp1 = str_replace( '%7E', '~', rawurlencode( $input ) );
|
898 |
-
$tmp2 = str_replace( ".", "%2E", $tmp1 );
|
899 |
-
$tmp3 = str_replace( "*", "%2A", $tmp2 );
|
900 |
-
$tmp4 = str_replace( '+', ' ', $tmp3 );
|
901 |
-
$tmp = str_replace( "-", "%2D", $tmp4 );
|
902 |
-
|
903 |
-
return $tmp;
|
904 |
-
/*$tmp1=str_replace('%7E', '~', rawurlencode($input));
|
905 |
-
$tmp2= str_replace(".","%2E",$tmp1);
|
906 |
-
|
907 |
-
|
908 |
-
return $tmp;*/
|
909 |
-
} else {
|
910 |
-
return '';
|
911 |
-
}
|
912 |
-
}
|
913 |
-
|
914 |
-
public static function parseQueryString( $str )
|
915 |
-
{
|
916 |
-
$op = array();
|
917 |
-
$pairs = explode( "&", $str );
|
918 |
-
foreach ( $pairs as $pair ) {
|
919 |
-
list( $k, $v ) = array_map( "urldecode", explode( "=", $pair ) );
|
920 |
-
$op[ $k ] = $v;
|
921 |
-
}
|
922 |
-
|
923 |
-
return $op;
|
924 |
-
}
|
925 |
-
|
926 |
-
//parses string to associative array -modified for PayPal Signature
|
927 |
-
|
928 |
-
|
929 |
-
// This decode function isn't taking into consideration the above
|
930 |
-
// modifications to the encoding process. However, this method doesn't
|
931 |
-
// seem to be used anywhere so leaving it as is.
|
932 |
-
public static function urldecode_rfc3986( $string )
|
933 |
-
{
|
934 |
-
return urldecode( $string );
|
935 |
-
}
|
936 |
-
|
937 |
-
// Utility function for turning the Authorization: header into
|
938 |
-
// parameters, has to do some unescaping
|
939 |
-
// Can filter out any non-oauth parameters if needed (default behaviour)
|
940 |
-
// May 28th, 2010 - method updated to tjerk.meesters for a speed improvement.
|
941 |
-
// see http://code.google.com/p/oauth/issues/detail?id=163
|
942 |
-
public static function split_header( $header, $only_allow_oauth_parameters = true )
|
943 |
-
{
|
944 |
-
$params = array();
|
945 |
-
if ( preg_match_all( '/(' . ( $only_allow_oauth_parameters ? 'oauth_' : '' ) . '[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches ) ) {
|
946 |
-
foreach ( $matches[ 1 ] as $i => $h ) {
|
947 |
-
$params[ $h ] = OAuthUtil::urldecode_rfc3986( empty( $matches[ 3 ][ $i ] ) ? $matches[ 4 ][ $i ] : $matches[ 3 ][ $i ] );
|
948 |
-
}
|
949 |
-
if ( isset( $params[ 'realm' ] ) ) {
|
950 |
-
unset( $params[ 'realm' ] );
|
951 |
-
}
|
952 |
-
}
|
953 |
-
|
954 |
-
return $params;
|
955 |
-
}
|
956 |
-
|
957 |
-
// helper to try to sort out headers for people who aren't running apache
|
958 |
-
public static function get_headers()
|
959 |
-
{
|
960 |
-
if ( function_exists( 'apache_request_headers' ) ) {
|
961 |
-
// we need this to get the actual Authorization: header
|
962 |
-
// because apache tends to tell us it doesn't exist
|
963 |
-
$headers = apache_request_headers();
|
964 |
-
|
965 |
-
// sanitize the output of apache_request_headers because
|
966 |
-
// we always want the keys to be Cased-Like-This and arh()
|
967 |
-
// returns the headers in the same case as they are in the
|
968 |
-
// request
|
969 |
-
$out = array();
|
970 |
-
foreach ( $headers AS $key => $value ) {
|
971 |
-
$key = str_replace(
|
972 |
-
" ",
|
973 |
-
"-",
|
974 |
-
ucwords( strtolower( str_replace( "-", " ", $key ) ) )
|
975 |
-
);
|
976 |
-
$out[ $key ] = $value;
|
977 |
-
}
|
978 |
-
} else {
|
979 |
-
// otherwise we don't have apache and are just going to have to hope
|
980 |
-
// that $_SERVER actually contains what we need
|
981 |
-
$out = array();
|
982 |
-
if ( isset( $_SERVER[ 'CONTENT_TYPE' ] ) )
|
983 |
-
$out[ 'Content-Type' ] = $_SERVER[ 'CONTENT_TYPE' ];
|
984 |
-
if ( isset( $_ENV[ 'CONTENT_TYPE' ] ) )
|
985 |
-
$out[ 'Content-Type' ] = $_ENV[ 'CONTENT_TYPE' ];
|
986 |
-
|
987 |
-
foreach ( $_SERVER as $key => $value ) {
|
988 |
-
if ( substr( $key, 0, 5 ) == "HTTP_" ) {
|
989 |
-
// this is chaos, basically it is just there to capitalize the first
|
990 |
-
// letter of every word that is not an initial HTTP and strip HTTP
|
991 |
-
// code from przemek
|
992 |
-
$key = str_replace(
|
993 |
-
" ",
|
994 |
-
"-",
|
995 |
-
ucwords( strtolower( str_replace( "_", " ", substr( $key, 5 ) ) ) )
|
996 |
-
);
|
997 |
-
$out[ $key ] = $value;
|
998 |
-
}
|
999 |
-
}
|
1000 |
-
}
|
1001 |
-
|
1002 |
-
return $out;
|
1003 |
-
}
|
1004 |
-
|
1005 |
-
// This function takes a input like a=b&a=c&d=e and returns the parsed
|
1006 |
-
// parameters like this
|
1007 |
-
// array('a' => array('b','c'), 'd' => 'e')
|
1008 |
-
public static function parse_parameters( $input )
|
1009 |
-
{
|
1010 |
-
if ( !isset( $input ) || !$input ) return array();
|
1011 |
-
|
1012 |
-
$pairs = explode( '&', $input );
|
1013 |
-
|
1014 |
-
$parsed_parameters = array();
|
1015 |
-
foreach ( $pairs as $pair ) {
|
1016 |
-
$split = explode( '=', $pair, 2 );
|
1017 |
-
$parameter = OAuthUtil::urldecode_rfc3986( $split[ 0 ] );
|
1018 |
-
$value = isset( $split[ 1 ] ) ? OAuthUtil::urldecode_rfc3986( $split[ 1 ] ) : '';
|
1019 |
-
|
1020 |
-
if ( isset( $parsed_parameters[ $parameter ] ) ) {
|
1021 |
-
// We have already recieved parameter(s) with this name, so add to the list
|
1022 |
-
// of parameters with this name
|
1023 |
-
|
1024 |
-
if ( is_scalar( $parsed_parameters[ $parameter ] ) ) {
|
1025 |
-
// This is the first duplicate, so transform scalar (string) into an array
|
1026 |
-
// so we can add the duplicates
|
1027 |
-
$parsed_parameters[ $parameter ] = array( $parsed_parameters[ $parameter ] );
|
1028 |
-
}
|
1029 |
-
|
1030 |
-
$parsed_parameters[ $parameter ][ ] = $value;
|
1031 |
-
} else {
|
1032 |
-
$parsed_parameters[ $parameter ] = $value;
|
1033 |
-
}
|
1034 |
-
}
|
1035 |
-
|
1036 |
-
return $parsed_parameters;
|
1037 |
-
}
|
1038 |
-
|
1039 |
-
public static function build_http_query( $params )
|
1040 |
-
{
|
1041 |
-
if ( !$params ) return '';
|
1042 |
-
|
1043 |
-
// Urlencode both keys and values
|
1044 |
-
$keys = OAuthUtil::urlencode_rfc3986( array_keys( $params ) );
|
1045 |
-
$values = OAuthUtil::urlencode_rfc3986( array_values( $params ) );
|
1046 |
-
$params = array_combine( $keys, $values );
|
1047 |
-
|
1048 |
-
// Parameters are sorted by name, using lexicographical byte value ordering.
|
1049 |
-
// Ref: Spec: 9.1.1 (1)
|
1050 |
-
uksort( $params, 'strcmp' );
|
1051 |
-
|
1052 |
-
$pairs = array();
|
1053 |
-
foreach ( $params as $parameter => $value ) {
|
1054 |
-
if ( is_array( $value ) ) {
|
1055 |
-
// If two or more parameters share the same name, they are sorted by their value
|
1056 |
-
// Ref: Spec: 9.1.1 (1)
|
1057 |
-
// June 12th, 2010 - changed to sort because of issue 164 by hidetaka
|
1058 |
-
sort( $value, SORT_STRING );
|
1059 |
-
foreach ( $value as $duplicate_value ) {
|
1060 |
-
$pairs[ ] = $parameter . '=' . $duplicate_value;
|
1061 |
-
}
|
1062 |
-
} else {
|
1063 |
-
$pairs[ ] = $parameter . '=' . $value;
|
1064 |
-
}
|
1065 |
-
}
|
1066 |
-
|
1067 |
-
// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
|
1068 |
-
// Each name-value pair is separated by an '&' character (ASCII code 38)
|
1069 |
-
return implode( '&', $pairs );
|
1070 |
-
}
|
1071 |
-
}
|
1072 |
-
}
|
1073 |
-
?>
|
1 |
+
<?php
|
2 |
+
//PayPal specific modification starts
|
3 |
+
//Method to be called for generating signature
|
4 |
+
require_once( "AuthUtil.php" );
|
5 |
+
class AuthSignature
|
6 |
+
{
|
7 |
+
|
8 |
+
public function genSign( $key, $secret, $token, $tokenSecret, $httpMethod, $endpoint )
|
9 |
+
{
|
10 |
+
|
11 |
+
|
12 |
+
$authServer = new OAuthServer( new MockOAuthDataStore() );
|
13 |
+
$hmac_method = new OAuthSignatureMethod_HMAC_SHA1();
|
14 |
+
$authServer->add_signature_method( $hmac_method );
|
15 |
+
|
16 |
+
$sig_method = $hmac_method;
|
17 |
+
$authConsumer = new OAuthConsumer( $key, $secret, null );
|
18 |
+
$authToken = null;
|
19 |
+
$authToken = new OAuthToken( $token, $tokenSecret );
|
20 |
+
|
21 |
+
//$params is the query param array which is required only in the httpMethod is "GET"
|
22 |
+
|
23 |
+
$params = array();
|
24 |
+
//set the Query parameters to $params if httpMethod is "GET"
|
25 |
+
|
26 |
+
$acc_req = OAuthRequest::from_consumer_and_token( $authConsumer, $authToken, $httpMethod, $endpoint, $params );
|
27 |
+
|
28 |
+
$acc_req->sign_request( $sig_method, $authConsumer, $authToken );
|
29 |
+
$response = OAuthutil::parseQueryString( $acc_req );
|
30 |
+
|
31 |
+
return $response;
|
32 |
+
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
//PayPal specific modification ends
|
37 |
+
/* Generic exception class
|
38 |
+
*/
|
39 |
+
if ( !class_exists( 'OAuthException' ) ) {
|
40 |
+
class OAuthException extends Exception
|
41 |
+
{
|
42 |
+
// pass
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
if ( !class_exists( 'OAuthConsumer' ) ) {
|
47 |
+
class OAuthConsumer
|
48 |
+
{
|
49 |
+
public $key;
|
50 |
+
public $secret;
|
51 |
+
|
52 |
+
function __construct( $key, $secret, $callback_url = null )
|
53 |
+
{
|
54 |
+
$this->key = $key;
|
55 |
+
$this->secret = $secret;
|
56 |
+
$this->callback_url = $callback_url;
|
57 |
+
}
|
58 |
+
|
59 |
+
function __toString()
|
60 |
+
{
|
61 |
+
return "OAuthConsumer[key=$this->key,secret=$this->secret]";
|
62 |
+
}
|
63 |
+
}
|
64 |
+
}
|
65 |
+
|
66 |
+
if ( !class_exists( 'OAuthToken' ) ) {
|
67 |
+
class OAuthToken
|
68 |
+
{
|
69 |
+
// access tokens and request tokens
|
70 |
+
public $key;
|
71 |
+
public $secret;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* key = the token
|
75 |
+
* secret = the token secret
|
76 |
+
*/
|
77 |
+
function __construct( $key, $secret )
|
78 |
+
{
|
79 |
+
$this->key = $key;
|
80 |
+
$this->secret = $secret;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* generates the basic string serialization of a token that a server
|
85 |
+
* would respond to request_token and access_token calls with
|
86 |
+
*/
|
87 |
+
function to_string()
|
88 |
+
{
|
89 |
+
return "oauth_token=" .
|
90 |
+
OAuthUtil::urlencode_rfc3986( $this->key ) .
|
91 |
+
"&oauth_token_secret=" .
|
92 |
+
OAuthUtil::urlencode_rfc3986( $this->secret );
|
93 |
+
}
|
94 |
+
|
95 |
+
function __toString()
|
96 |
+
{
|
97 |
+
return $this->to_string();
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* A class for implementing a Signature Method
|
104 |
+
* See section 9 ("Signing Requests") in the spec
|
105 |
+
*/
|
106 |
+
if ( !class_exists( 'OAuthSignatureMethod' ) ) {
|
107 |
+
abstract class OAuthSignatureMethod
|
108 |
+
{
|
109 |
+
/**
|
110 |
+
* Needs to return the name of the Signature Method (ie HMAC-SHA1)
|
111 |
+
* @return string
|
112 |
+
*/
|
113 |
+
abstract public function get_name();
|
114 |
+
|
115 |
+
/**
|
116 |
+
* Build up the signature
|
117 |
+
* NOTE: The output of this function MUST NOT be urlencoded.
|
118 |
+
* the encoding is handled in OAuthRequest when the final
|
119 |
+
* request is serialized
|
120 |
+
*
|
121 |
+
* @param OAuthRequest $request
|
122 |
+
* @param OAuthConsumer $consumer
|
123 |
+
* @param OAuthToken $token
|
124 |
+
*
|
125 |
+
* @return string
|
126 |
+
*/
|
127 |
+
abstract public function build_signature( $request, $consumer, $token );
|
128 |
+
|
129 |
+
/**
|
130 |
+
* Verifies that a given signature is correct
|
131 |
+
*
|
132 |
+
* @param OAuthRequest $request
|
133 |
+
* @param OAuthConsumer $consumer
|
134 |
+
* @param OAuthToken $token
|
135 |
+
* @param string $signature
|
136 |
+
*
|
137 |
+
* @return bool
|
138 |
+
*/
|
139 |
+
public function check_signature( $request, $consumer, $token, $signature )
|
140 |
+
{
|
141 |
+
$built = $this->build_signature( $request, $consumer, $token );
|
142 |
+
|
143 |
+
return $built == $signature;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
/**
|
149 |
+
* The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
|
150 |
+
* where the Signature Base String is the text and the key is the concatenated values (each first
|
151 |
+
* encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
|
152 |
+
* character (ASCII code 38) even if empty.
|
153 |
+
* - Chapter 9.2 ("HMAC-SHA1")
|
154 |
+
*/
|
155 |
+
if ( !class_exists( 'OAuthSignatureMethod_HMAC_SHA1' ) ) {
|
156 |
+
class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod
|
157 |
+
{
|
158 |
+
function get_name()
|
159 |
+
{
|
160 |
+
return "HMAC-SHA1";
|
161 |
+
}
|
162 |
+
|
163 |
+
public function build_signature( $request, $consumer, $token )
|
164 |
+
{
|
165 |
+
$base_string = $request->get_signature_base_string();
|
166 |
+
$base_string = preg_replace( "/(%[A-Za-z0-9]{2})/e", "strtolower('\\0')", $base_string ); //convert base string to lowercase
|
167 |
+
$request->base_string = $base_string;
|
168 |
+
|
169 |
+
$key_parts = array(
|
170 |
+
$consumer->secret,
|
171 |
+
( $token ) ? $token->secret : ""
|
172 |
+
);
|
173 |
+
|
174 |
+
$key_parts = OAuthUtil::urlencode_rfc3986( $key_parts );
|
175 |
+
$key = implode( '&', $key_parts );
|
176 |
+
$key = preg_replace( "/(%[A-Za-z0-9]{2})/e", "strtolower('\\0')", $key ); //convert to lowercase
|
177 |
+
return base64_encode( hash_hmac( 'sha1', $base_string, $key, true ) );
|
178 |
+
}
|
179 |
+
}
|
180 |
+
}
|
181 |
+
/**
|
182 |
+
* The PLAINTEXT method does not provide any security protection and SHOULD only be used
|
183 |
+
* over a secure channel such as HTTPS. It does not use the Signature Base String.
|
184 |
+
* - Chapter 9.4 ("PLAINTEXT")
|
185 |
+
*/
|
186 |
+
if ( !class_exists( 'OAuthSignatureMethod_PLAINTEXT' ) ) {
|
187 |
+
class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod
|
188 |
+
{
|
189 |
+
public function get_name()
|
190 |
+
{
|
191 |
+
return "PLAINTEXT";
|
192 |
+
}
|
193 |
+
|
194 |
+
/**
|
195 |
+
* oauth_signature is set to the concatenated encoded values of the Consumer Secret and
|
196 |
+
* Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
|
197 |
+
* empty. The result MUST be encoded again.
|
198 |
+
* - Chapter 9.4.1 ("Generating Signatures")
|
199 |
+
*
|
200 |
+
* Please note that the second encoding MUST NOT happen in the SignatureMethod, as
|
201 |
+
* OAuthRequest handles this!
|
202 |
+
*/
|
203 |
+
public function build_signature( $request, $consumer, $token )
|
204 |
+
{
|
205 |
+
$key_parts = array(
|
206 |
+
$consumer->secret,
|
207 |
+
( $token ) ? $token->secret : ""
|
208 |
+
);
|
209 |
+
|
210 |
+
$key_parts = OAuthUtil::urlencode_rfc3986( $key_parts );
|
211 |
+
$key = implode( '&', $key_parts );
|
212 |
+
$request->base_string = $key;
|
213 |
+
|
214 |
+
return $key;
|
215 |
+
}
|
216 |
+
}
|
217 |
+
}
|
218 |
+
/**
|
219 |
+
* The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
|
220 |
+
* [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
|
221 |
+
* EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
|
222 |
+
* verified way to the Service Provider, in a manner which is beyond the scope of this
|
223 |
+
* specification.
|
224 |
+
* - Chapter 9.3 ("RSA-SHA1")
|
225 |
+
*/
|
226 |
+
if ( !class_exists( 'OAuthSignatureMethod_RSA_SHA1' ) ) {
|
227 |
+
abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod
|
228 |
+
{
|
229 |
+
public function get_name()
|
230 |
+
{
|
231 |
+
return "RSA-SHA1";
|
232 |
+
}
|
233 |
+
|
234 |
+
// Up to the SP to implement this lookup of keys. Possible ideas are:
|
235 |
+
// (1) do a lookup in a table of trusted certs keyed off of consumer
|
236 |
+
// (2) fetch via http using a url provided by the requester
|
237 |
+
// (3) some sort of specific discovery code based on request
|
238 |
+
//
|
239 |
+
// Either way should return a string representation of the certificate
|
240 |
+
protected abstract function fetch_public_cert( &$request );
|
241 |
+
|
242 |
+
// Up to the SP to implement this lookup of keys. Possible ideas are:
|
243 |
+
// (1) do a lookup in a table of trusted certs keyed off of consumer
|
244 |
+
//
|
245 |
+
// Either way should return a string representation of the certificate
|
246 |
+
protected abstract function fetch_private_cert( &$request );
|
247 |
+
|
248 |
+
public function build_signature( $request, $consumer, $token )
|
249 |
+
{
|
250 |
+
$base_string = $request->get_signature_base_string();
|
251 |
+
$request->base_string = $base_string;
|
252 |
+
|
253 |
+
// Fetch the private key cert based on the request
|
254 |
+
$cert = $this->fetch_private_cert( $request );
|
255 |
+
|
256 |
+
// Pull the private key ID from the certificate
|
257 |
+
$privatekeyid = openssl_get_privatekey( $cert );
|
258 |
+
|
259 |
+
// Sign using the key
|
260 |
+
$ok = openssl_sign( $base_string, $signature, $privatekeyid );
|
261 |
+
|
262 |
+
// Release the key resource
|
263 |
+
openssl_free_key( $privatekeyid );
|
264 |
+
|
265 |
+
return base64_encode( $signature );
|
266 |
+
}
|
267 |
+
|
268 |
+
public function check_signature( $request, $consumer, $token, $signature )
|
269 |
+
{
|
270 |
+
$decoded_sig = base64_decode( $signature );
|
271 |
+
|
272 |
+
$base_string = $request->get_signature_base_string();
|
273 |
+
|
274 |
+
// Fetch the public key cert based on the request
|
275 |
+
$cert = $this->fetch_public_cert( $request );
|
276 |
+
|
277 |
+
// Pull the public key ID from the certificate
|
278 |
+
$publickeyid = openssl_get_publickey( $cert );
|
279 |
+
|
280 |
+
// Check the computed signature against the one passed in the query
|
281 |
+
$ok = openssl_verify( $base_string, $decoded_sig, $publickeyid );
|
282 |
+
|
283 |
+
// Release the key resource
|
284 |
+
openssl_free_key( $publickeyid );
|
285 |
+
|
286 |
+
return $ok == 1;
|
287 |
+
}
|
288 |
+
}
|
289 |
+
}
|
290 |
+
|
291 |
+
if ( !class_exists( 'OAuthRequest' ) ) {
|
292 |
+
class OAuthRequest
|
293 |
+
{
|
294 |
+
public $parameters;
|
295 |
+
protected $http_method;
|
296 |
+
protected $http_url;
|
297 |
+
// for debug purposes
|
298 |
+
public $base_string;
|
299 |
+
public static $version = '1.0';
|
300 |
+
public static $POST_INPUT = 'php://input';
|
301 |
+
|
302 |
+
function __construct( $http_method, $http_url, $parameters = null )
|
303 |
+
{
|
304 |
+
$parameters = ( $parameters ) ? $parameters : array();
|
305 |
+
$parameters = array_merge( OAuthUtil::parse_parameters( parse_url( $http_url, PHP_URL_QUERY ) ), $parameters );
|
306 |
+
$this->parameters = $parameters;
|
307 |
+
$this->http_method = $http_method;
|
308 |
+
$this->http_url = $http_url;
|
309 |
+
}
|
310 |
+
|
311 |
+
|
312 |
+
/**
|
313 |
+
* attempt to build up a request from what was passed to the server
|
314 |
+
*/
|
315 |
+
public static function from_request( $http_method = null, $http_url = null, $parameters = null )
|
316 |
+
{
|
317 |
+
$scheme = ( !isset( $_SERVER[ 'HTTPS' ] ) || $_SERVER[ 'HTTPS' ] != "on" )
|
318 |
+
? 'http'
|
319 |
+
: 'https';
|
320 |
+
$http_url = ( $http_url ) ? $http_url : $scheme .
|
321 |
+
'://' . $_SERVER[ 'HTTP_HOST' ] .
|
322 |
+
':' .
|
323 |
+
$_SERVER[ 'SERVER_PORT' ] .
|
324 |
+
$_SERVER[ 'REQUEST_URI' ];
|
325 |
+
$http_method = ( $http_method ) ? $http_method : $_SERVER[ 'REQUEST_METHOD' ];
|
326 |
+
|
327 |
+
// We weren't handed any parameters, so let's find the ones relevant to
|
328 |
+
// this request.
|
329 |
+
// If you run XML-RPC or similar you should use this to provide your own
|
330 |
+
// parsed parameter-list
|
331 |
+
if ( !$parameters ) {
|
332 |
+
// Find request headers
|
333 |
+
$request_headers = OAuthUtil::get_headers();
|
334 |
+
|
335 |
+
// Parse the query-string to find GET parameters
|
336 |
+
$parameters = OAuthUtil::parse_parameters( $_SERVER[ 'QUERY_STRING' ] );
|
337 |
+
|
338 |
+
// It's a POST request of the proper content-type, so parse POST
|
339 |
+
// parameters and add those overriding any duplicates from GET
|
340 |
+
if ( $http_method == "POST"
|
341 |
+
&& isset( $request_headers[ 'Content-Type' ] )
|
342 |
+
&& strstr( $request_headers[ 'Content-Type' ],
|
343 |
+
'application/x-www-form-urlencoded' )
|
344 |
+
) {
|
345 |
+
$post_data = OAuthUtil::parse_parameters(
|
346 |
+
file_get_contents( self::$POST_INPUT )
|
347 |
+
);
|
348 |
+
$parameters = array_merge( $parameters, $post_data );
|
349 |
+
}
|
350 |
+
|
351 |
+
// We have a Authorization-header with OAuth data. Parse the header
|
352 |
+
// and add those overriding any duplicates from GET or POST
|
353 |
+
if ( isset( $request_headers[ 'Authorization' ] ) && substr( $request_headers[ 'Authorization' ], 0, 6 ) == 'OAuth ' ) {
|
354 |
+
$header_parameters = OAuthUtil::split_header(
|
355 |
+
$request_headers[ 'Authorization' ]
|
356 |
+
);
|
357 |
+
$parameters = array_merge( $parameters, $header_parameters );
|
358 |
+
}
|
359 |
+
|
360 |
+
}
|
361 |
+
|
362 |
+
return new OAuthRequest( $http_method, $http_url, $parameters );
|
363 |
+
}
|
364 |
+
|
365 |
+
/**
|
366 |
+
* pretty much a helper function to set up the request
|
367 |
+
*/
|
368 |
+
public static function from_consumer_and_token( $consumer, $token, $http_method, $http_url, $parameters = null )
|
369 |
+
{
|
370 |
+
$parameters = ( $parameters ) ? $parameters : array();
|
371 |
+
$defaults = array(
|
372 |
+
"oauth_version" => OAuthRequest::$version,
|
373 |
+
// "oauth_nonce" => OAuthRequest::generate_nonce(),
|
374 |
+
"oauth_timestamp" => OAuthRequest::generate_timestamp(),
|
375 |
+
|
376 |
+
"oauth_consumer_key" => $consumer->key
|
377 |
+
);
|
378 |
+
if ( $token )
|
379 |
+
$defaults[ 'oauth_token' ] = $token->key;
|
380 |
+
|
381 |
+
$parameters = array_merge( $defaults, $parameters );
|
382 |
+
ksort( $parameters );
|
383 |
+
|
384 |
+
return new OAuthRequest( $http_method, $http_url, $parameters );
|
385 |
+
}
|
386 |
+
|
387 |
+
public function set_parameter( $name, $value, $allow_duplicates = true )
|
388 |
+
{
|
389 |
+
if ( $allow_duplicates && isset( $this->parameters[ $name ] ) ) {
|
390 |
+
// We have already added parameter(s) with this name, so add to the list
|
391 |
+
if ( is_scalar( $this->parameters[ $name ] ) ) {
|
392 |
+
// This is the first duplicate, so transform scalar (string)
|
393 |
+
// into an array so we can add the duplicates
|
394 |
+
$this->parameters[ $name ] = array( $this->parameters[ $name ] );
|
395 |
+
}
|
396 |
+
|
397 |
+
$this->parameters[ $name ][ ] = $value;
|
398 |
+
} else {
|
399 |
+
$this->parameters[ $name ] = $value;
|
400 |
+
}
|
401 |
+
}
|
402 |
+
|
403 |
+
public function get_parameter( $name )
|
404 |
+
{
|
405 |
+
return isset( $this->parameters[ $name ] ) ? $this->parameters[ $name ] : null;
|
406 |
+
}
|
407 |
+
|
408 |
+
public function get_parameters()
|
409 |
+
{
|
410 |
+
return $this->parameters;
|
411 |
+
}
|
412 |
+
|
413 |
+
public function unset_parameter( $name )
|
414 |
+
{
|
415 |
+
unset( $this->parameters[ $name ] );
|
416 |
+
}
|
417 |
+
|
418 |
+
/**
|
419 |
+
* The request parameters, sorted and concatenated into a normalized string.
|
420 |
+
* @return string
|
421 |
+
*/
|
422 |
+
public function get_signable_parameters()
|
423 |
+
{
|
424 |
+
// Grab all parameters
|
425 |
+
$params = $this->parameters;
|
426 |
+
ksort( $params );
|
427 |
+
// Remove oauth_signature if present
|
428 |
+
// Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
|
429 |
+
if ( isset( $params[ 'oauth_signature' ] ) ) {
|
430 |
+
unset( $params[ 'oauth_signature' ] );
|
431 |
+
}
|
432 |
+
foreach ( $params as $key => $value ) {
|
433 |
+
$res[ ] = $key . "=" . $value;
|
434 |
+
}
|
435 |
+
|
436 |
+
return implode( '&', $res );
|
437 |
+
//return OAuthUtil::build_http_query($params);
|
438 |
+
}
|
439 |
+
|
440 |
+
/**
|
441 |
+
* Returns the base string of this request
|
442 |
+
*
|
443 |
+
* The base string defined as the method, the url
|
444 |
+
* and the parameters (normalized), each urlencoded
|
445 |
+
* and the concated with &.
|
446 |
+
*/
|
447 |
+
public function get_signature_base_string()
|
448 |
+
{
|
449 |
+
$parts = array(
|
450 |
+
$this->get_normalized_http_method(),
|
451 |
+
$this->get_normalized_http_url(),
|
452 |
+
$this->get_signable_parameters()
|
453 |
+
);
|
454 |
+
|
455 |
+
$parts = OAuthUtil::urlencode_rfc3986( $parts );
|
456 |
+
|
457 |
+
return implode( '&', $parts );
|
458 |
+
}
|
459 |
+
|
460 |
+
/**
|
461 |
+
* just uppercases the http method
|
462 |
+
*/
|
463 |
+
public function get_normalized_http_method()
|
464 |
+
{
|
465 |
+
return strtoupper( $this->http_method );
|
466 |
+
}
|
467 |
+
|
468 |
+
/**
|
469 |
+
* parses the url and rebuilds it to be
|
470 |
+
* scheme://host/path
|
471 |
+
*/
|
472 |
+
public function get_normalized_http_url()
|
473 |
+
{
|
474 |
+
$parts = parse_url( $this->http_url );
|
475 |
+
|
476 |
+
$scheme = ( isset( $parts[ 'scheme' ] ) ) ? $parts[ 'scheme' ] : 'http';
|
477 |
+
$port = ( isset( $parts[ 'port' ] ) ) ? $parts[ 'port' ] : ( ( $scheme == 'https' ) ? '443' : '80' );
|
478 |
+
$host = ( isset( $parts[ 'host' ] ) ) ? $parts[ 'host' ] : '';
|
479 |
+
$path = ( isset( $parts[ 'path' ] ) ) ? $parts[ 'path' ] : '';
|
480 |
+
|
481 |
+
if ( ( $scheme == 'https' && $port != '443' )
|
482 |
+
|| ( $scheme == 'http' && $port != '80' )
|
483 |
+
) {
|
484 |
+
$host = "$host:$port";
|
485 |
+
}
|
486 |
+
|
487 |
+
return "$scheme://$host$path";
|
488 |
+
}
|
489 |
+
|
490 |
+
/**
|
491 |
+
* builds a url usable for a GET request
|
492 |
+
*/
|
493 |
+
public function to_url()
|
494 |
+
{
|
495 |
+
$post_data = $this->to_postdata();
|
496 |
+
$out = $this->get_normalized_http_url();
|
497 |
+
if ( $post_data ) {
|
498 |
+
$out .= '?' . $post_data;
|
499 |
+
}
|
500 |
+
|
501 |
+
return $out;
|
502 |
+
}
|
503 |
+
|
504 |
+
/**
|
505 |
+
* builds the data one would send in a POST request
|
506 |
+
*/
|
507 |
+
public function to_postdata()
|
508 |
+
{
|
509 |
+
return OAuthUtil::build_http_query( $this->parameters );
|
510 |
+
}
|
511 |
+
|
512 |
+
/**
|
513 |
+
* builds the Authorization: header
|
514 |
+
*/
|
515 |
+
public function to_header( $realm = null )
|
516 |
+
{
|
517 |
+
$first = true;
|
518 |
+
if ( $realm ) {
|
519 |
+
$out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986( $realm ) . '"';
|
520 |
+
$first = false;
|
521 |
+
} else
|
522 |
+
$out = 'Authorization: OAuth';
|
523 |
+
|
524 |
+
$total = array();
|
525 |
+
foreach ( $this->parameters as $k => $v ) {
|
526 |
+
if ( substr( $k, 0, 5 ) != "oauth" ) continue;
|
527 |
+
if ( is_array( $v ) ) {
|
528 |
+
throw new OAuthException( 'Arrays not supported in headers' );
|
529 |
+
}
|
530 |
+
$out .= ( $first ) ? ' ' : ',';
|
531 |
+
$out .= OAuthUtil::urlencode_rfc3986( $k ) .
|
532 |
+
'="' .
|
533 |
+
OAuthUtil::urlencode_rfc3986( $v ) .
|
534 |
+
'"';
|
535 |
+
$first = false;
|
536 |
+
}
|
537 |
+
|
538 |
+
return $out;
|
539 |
+
}
|
540 |
+
|
541 |
+
public function __toString()
|
542 |
+
{
|
543 |
+
return $this->to_url();
|
544 |
+
}
|
545 |
+
|
546 |
+
|
547 |
+
public function sign_request( $signature_method, $consumer, $token )
|
548 |
+
{
|
549 |
+
|
550 |
+
$empty = false;
|
551 |
+
$msg = array();
|
552 |
+
if ( $token->key == null ) {
|
553 |
+
$msg[ ] = 'Token key';
|
554 |
+
}
|
555 |
+
if ( $token->secret == null ) {
|
556 |
+
$msg[ ] = 'Token secret';
|
557 |
+
}
|
558 |
+
if ( $consumer->key == null ) {
|
559 |
+
|
560 |
+
$msg[ ] = 'Consumer key';
|
561 |
+
}
|
562 |
+
if ( $consumer->secret == null ) {
|
563 |
+
|
564 |
+
$msg[ ] = 'Consumer secret';
|
565 |
+
}
|
566 |
+
if ( $this->http_url == null ) {
|
567 |
+
|
568 |
+
$msg[ ] = 'Endpoint';
|
569 |
+
}
|
570 |
+
if ( $this->http_method == null ) {
|
571 |
+
|
572 |
+
$msg[ ] = 'HTTP method';
|
573 |
+
}
|
574 |
+
if ( count( $msg ) ) {
|
575 |
+
throw new OAuthException( 'Enter valid ' . implode( ',', $msg ) );
|
576 |
+
}
|
577 |
+
$this->set_parameter(
|
578 |
+
"oauth_signature_method",
|
579 |
+
$signature_method->get_name(),
|
580 |
+
false );
|
581 |
+
|
582 |
+
$signature = $this->build_signature( $signature_method, $consumer, $token );
|
583 |
+
$this->set_parameter( "oauth_signature", $signature, false );
|
584 |
+
|
585 |
+
}
|
586 |
+
|
587 |
+
public function build_signature( $signature_method, $consumer, $token )
|
588 |
+
{
|
589 |
+
$signature = $signature_method->build_signature( $this, $consumer, $token );
|
590 |
+
|
591 |
+
return $signature;
|
592 |
+
}
|
593 |
+
|
594 |
+
/**
|
595 |
+
* util function: current timestamp
|
596 |
+
*/
|
597 |
+
private static function generate_timestamp()
|
598 |
+
{
|
599 |
+
return time();
|
600 |
+
}
|
601 |
+
|
602 |
+
/**
|
603 |
+
* util function: current nonce
|
604 |
+
*/
|
605 |
+
private static function generate_nonce()
|
606 |
+
{
|
607 |
+
$mt = microtime();
|
608 |
+
$rand = mt_rand();
|
609 |
+
|
610 |
+
return md5( $mt . $rand ); // md5s look nicer than numbers
|
611 |
+
}
|
612 |
+
}
|
613 |
+
}
|
614 |
+
|
615 |
+
if ( !class_exists( 'OAuthServer' ) ) {
|
616 |
+
class OAuthServer
|
617 |
+
{
|
618 |
+
protected $timestamp_threshold = 300; // in seconds, five minutes
|
619 |
+
protected $version = '1.0'; // hi blaine
|
620 |
+
protected $signature_methods = array();
|
621 |
+
|
622 |
+
protected $data_store;
|
623 |
+
|
624 |
+
function __construct( $data_store )
|
625 |
+
{
|
626 |
+
$this->data_store = $data_store;
|
627 |
+
}
|
628 |
+
|
629 |
+
public function add_signature_method( $signature_method )
|
630 |
+
{
|
631 |
+
$this->signature_methods[ $signature_method->get_name() ] =
|
632 |
+
$signature_method;
|
633 |
+
}
|
634 |
+
|
635 |
+
// high level functions
|
636 |
+
|
637 |
+
/**
|
638 |
+
* process a request_token request
|
639 |
+
* returns the request token on success
|
640 |
+
*/
|
641 |
+
public function fetch_request_token( &$request )
|
642 |
+
{
|
643 |
+
$this->get_version( $request );
|
644 |
+
|
645 |
+
$consumer = $this->get_consumer( $request );
|
646 |
+
|
647 |
+
// no token required for the initial token request
|
648 |
+
$token = null;
|
649 |
+
|
650 |
+
$this->check_signature( $request, $consumer, $token );
|
651 |
+
|
652 |
+
// Rev A change
|
653 |
+
$callback = $request->get_parameter( 'oauth_callback' );
|
654 |
+
$new_token = $this->data_store->new_request_token( $consumer, $callback );
|
655 |
+
|
656 |
+
return $new_token;
|
657 |
+
}
|
658 |
+
|
659 |
+
/**
|
660 |
+
* process an access_token request
|
661 |
+
* returns the access token on success
|
662 |
+
*/
|
663 |
+
public function fetch_access_token( &$request )
|
664 |
+
{
|
665 |
+
$this->get_version( $request );
|
666 |
+
|
667 |
+
$consumer = $this->get_consumer( $request );
|
668 |
+
|
669 |
+
// requires authorized request token
|
670 |
+
$token = $this->get_token( $request, $consumer, "request" );
|
671 |
+
|
672 |
+
$this->check_signature( $request, $consumer, $token );
|
673 |
+
|
674 |
+
// Rev A change
|
675 |
+
$verifier = $request->get_parameter( 'oauth_verifier' );
|
676 |
+
$new_token = $this->data_store->new_access_token( $token, $consumer, $verifier );
|
677 |
+
|
678 |
+
return $new_token;
|
679 |
+
}
|
680 |
+
|
681 |
+
/**
|
682 |
+
* verify an api call, checks all the parameters
|
683 |
+
*/
|
684 |
+
public function verify_request( &$request )
|
685 |
+
{
|
686 |
+
$this->get_version( $request );
|
687 |
+
$consumer = $this->get_consumer( $request );
|
688 |
+
$token = $this->get_token( $request, $consumer, "access" );
|
689 |
+
$this->check_signature( $request, $consumer, $token );
|
690 |
+
|
691 |
+
return array( $consumer, $token );
|
692 |
+
}
|
693 |
+
|
694 |
+
// Internals from here
|
695 |
+
/**
|
696 |
+
* version 1
|
697 |
+
*/
|
698 |
+
private function get_version( &$request )
|
699 |
+
{
|
700 |
+
$version = $request->get_parameter( "oauth_version" );
|
701 |
+
if ( !$version ) {
|
702 |
+
// Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.
|
703 |
+
// Chapter 7.0 ("Accessing Protected Ressources")
|
704 |
+
$version = '1.0';
|
705 |
+
}
|
706 |
+
if ( $version !== $this->version ) {
|
707 |
+
throw new OAuthException( "OAuth version '$version' not supported" );
|
708 |
+
}
|
709 |
+
|
710 |
+
return $version;
|
711 |
+
}
|
712 |
+
|
713 |
+
/**
|
714 |
+
* figure out the signature with some defaults
|
715 |
+
*/
|
716 |
+
private function get_signature_method( $request )
|
717 |
+
{
|
718 |
+
$signature_method = $request instanceof OAuthRequest
|
719 |
+
? $request->get_parameter( "oauth_signature_method" )
|
720 |
+
: null;
|
721 |
+
|
722 |
+
if ( !$signature_method ) {
|
723 |
+
// According to chapter 7 ("Accessing Protected Ressources") the signature-method
|
724 |
+
// parameter is required, and we can't just fallback to PLAINTEXT
|
725 |
+
throw new OAuthException( 'No signature method parameter. This parameter is required' );
|
726 |
+
}
|
727 |
+
|
728 |
+
if ( !in_array( $signature_method,
|
729 |
+
array_keys( $this->signature_methods ) )
|
730 |
+
) {
|
731 |
+
throw new OAuthException(
|
732 |
+
"Signature method '$signature_method' not supported " .
|
733 |
+
"try one of the following: " .
|
734 |
+
implode( ", ", array_keys( $this->signature_methods ) )
|
735 |
+
);
|
736 |
+
}
|
737 |
+
|
738 |
+
return $this->signature_methods[ $signature_method ];
|
739 |
+
}
|
740 |
+
|
741 |
+
/**
|
742 |
+
* try to find the consumer for the provided request's consumer key
|
743 |
+
*/
|
744 |
+
private function get_consumer( $request )
|
745 |
+
{
|
746 |
+
$consumer_key = $request instanceof OAuthRequest
|
747 |
+
? $request->get_parameter( "oauth_consumer_key" )
|
748 |
+
: null;
|
749 |
+
|
750 |
+
if ( !$consumer_key ) {
|
751 |
+
throw new OAuthException( "Invalid consumer key" );
|
752 |
+
}
|
753 |
+
|
754 |
+
$consumer = $this->data_store->lookup_consumer( $consumer_key );
|
755 |
+
if ( !$consumer ) {
|
756 |
+
throw new OAuthException( "Invalid consumer" );
|
757 |
+
}
|
758 |
+
|
759 |
+
return $consumer;
|
760 |
+
}
|
761 |
+
|
762 |
+
/**
|
763 |
+
* try to find the token for the provided request's token key
|
764 |
+
*/
|
765 |
+
private function get_token( $request, $consumer, $token_type = "access" )
|
766 |
+
{
|
767 |
+
$token_field = $request instanceof OAuthRequest
|
768 |
+
? $request->get_parameter( 'oauth_token' )
|
769 |
+
: null;
|
770 |
+
|
771 |
+
$token = $this->data_store->lookup_token(
|
772 |
+
$consumer, $token_type, $token_field
|
773 |
+
);
|
774 |
+
if ( !$token ) {
|
775 |
+
throw new OAuthException( "Invalid $token_type token: $token_field" );
|
776 |
+
}
|
777 |
+
|
778 |
+
return $token;
|
779 |
+
}
|
780 |
+
|
781 |
+
/**
|
782 |
+
* all-in-one function to check the signature on a request
|
783 |
+
* should guess the signature method appropriately
|
784 |
+
*/
|
785 |
+
private function check_signature( $request, $consumer, $token )
|
786 |
+
{
|
787 |
+
// this should probably be in a different method
|
788 |
+
$timestamp = $request instanceof OAuthRequest
|
789 |
+
? $request->get_parameter( 'oauth_timestamp' )
|
790 |
+
: null;
|
791 |
+
$nonce = $request instanceof OAuthRequest
|
792 |
+
? $request->get_parameter( 'oauth_nonce' )
|
793 |
+
: null;
|
794 |
+
|
795 |
+
$this->check_timestamp( $timestamp );
|
796 |
+
$this->check_nonce( $consumer, $token, $nonce, $timestamp );
|
797 |
+
|
798 |
+
$signature_method = $this->get_signature_method( $request );
|
799 |
+
|
800 |
+
$signature = $request->get_parameter( 'oauth_signature' );
|
801 |
+
$valid_sig = $signature_method->check_signature(
|
802 |
+
$request,
|
803 |
+
$consumer,
|
804 |
+
$token,
|
805 |
+
$signature
|
806 |
+
);
|
807 |
+
|
808 |
+
if ( !$valid_sig ) {
|
809 |
+
throw new OAuthException( "Invalid signature" );
|
810 |
+
}
|
811 |
+
}
|
812 |
+
|
813 |
+
/**
|
814 |
+
* check that the timestamp is new enough
|
815 |
+
*/
|
816 |
+
private function check_timestamp( $timestamp )
|
817 |
+
{
|
818 |
+
if ( !$timestamp )
|
819 |
+
throw new OAuthException(
|
820 |
+
'Missing timestamp parameter. The parameter is required'
|
821 |
+
);
|
822 |
+
|
823 |
+
// verify that timestamp is recentish
|
824 |
+
$now = time();
|
825 |
+
if ( abs( $now - $timestamp ) > $this->timestamp_threshold ) {
|
826 |
+
throw new OAuthException(
|
827 |
+
"Expired timestamp, yours $timestamp, ours $now"
|
828 |
+
);
|
829 |
+
}
|
830 |
+
}
|
831 |
+
|
832 |
+
/**
|
833 |
+
* check that the nonce is not repeated
|
834 |
+
*/
|
835 |
+
private function check_nonce( $consumer, $token, $nonce, $timestamp )
|
836 |
+
{
|
837 |
+
if ( !$nonce )
|
838 |
+
throw new OAuthException(
|
839 |
+
'Missing nonce parameter. The parameter is required'
|
840 |
+
);
|
841 |
+
|
842 |
+
// verify that the nonce is uniqueish
|
843 |
+
$found = $this->data_store->lookup_nonce(
|
844 |
+
$consumer,
|
845 |
+
$token,
|
846 |
+
$nonce,
|
847 |
+
$timestamp
|
848 |
+
);
|
849 |
+
if ( $found ) {
|
850 |
+
throw new OAuthException( "Nonce already used: $nonce" );
|
851 |
+
}
|
852 |
+
}
|
853 |
+
|
854 |
+
}
|
855 |
+
}
|
856 |
+
|
857 |
+
class OAuthDataStore
|
858 |
+
{
|
859 |
+
function lookup_consumer( $consumer_key )
|
860 |
+
{
|
861 |
+
// implement me
|
862 |
+
}
|
863 |
+
|
864 |
+
function lookup_token( $consumer, $token_type, $token )
|
865 |
+
{
|
866 |
+
// implement me
|
867 |
+
}
|
868 |
+
|
869 |
+
function lookup_nonce( $consumer, $token, $nonce, $timestamp )
|
870 |
+
{
|
871 |
+
// implement me
|
872 |
+
}
|
873 |
+
|
874 |
+
function new_request_token( $consumer, $callback = null )
|
875 |
+
{
|
876 |
+
// return a new token attached to this consumer
|
877 |
+
}
|
878 |
+
|
879 |
+
function new_access_token( $token, $consumer, $verifier = null )
|
880 |
+
{
|
881 |
+
// return a new access token attached to this consumer
|
882 |
+
// for the user associated with this token if the request token
|
883 |
+
// is authorized
|
884 |
+
// should also invalidate the request token
|
885 |
+
}
|
886 |
+
|
887 |
+
}
|
888 |
+
|
889 |
+
if ( !class_exists( 'OAuthUtil' ) ) {
|
890 |
+
class OAuthUtil
|
891 |
+
{
|
892 |
+
public static function urlencode_rfc3986( $input )
|
893 |
+
{
|
894 |
+
if ( is_array( $input ) ) {
|
895 |
+
return array_map( array( 'OAuthUtil', 'urlencode_rfc3986' ), $input );
|
896 |
+
} else if ( is_scalar( $input ) ) {
|
897 |
+
$tmp1 = str_replace( '%7E', '~', rawurlencode( $input ) );
|
898 |
+
$tmp2 = str_replace( ".", "%2E", $tmp1 );
|
899 |
+
$tmp3 = str_replace( "*", "%2A", $tmp2 );
|
900 |
+
$tmp4 = str_replace( '+', ' ', $tmp3 );
|
901 |
+
$tmp = str_replace( "-", "%2D", $tmp4 );
|
902 |
+
|
903 |
+
return $tmp;
|
904 |
+
/*$tmp1=str_replace('%7E', '~', rawurlencode($input));
|
905 |
+
$tmp2= str_replace(".","%2E",$tmp1);
|
906 |
+
|
907 |
+
|
908 |
+
return $tmp;*/
|
909 |
+
} else {
|
910 |
+
return '';
|
911 |
+
}
|
912 |
+
}
|
913 |
+
|
914 |
+
public static function parseQueryString( $str )
|
915 |
+
{
|
916 |
+
$op = array();
|
917 |
+
$pairs = explode( "&", $str );
|
918 |
+
foreach ( $pairs as $pair ) {
|
919 |
+
list( $k, $v ) = array_map( "urldecode", explode( "=", $pair ) );
|
920 |
+
$op[ $k ] = $v;
|
921 |
+
}
|
922 |
+
|
923 |
+
return $op;
|
924 |
+
}
|
925 |
+
|
926 |
+
//parses string to associative array -modified for PayPal Signature
|
927 |
+
|
928 |
+
|
929 |
+
// This decode function isn't taking into consideration the above
|
930 |
+
// modifications to the encoding process. However, this method doesn't
|
931 |
+
// seem to be used anywhere so leaving it as is.
|
932 |
+
public static function urldecode_rfc3986( $string )
|
933 |
+
{
|
934 |
+
return urldecode( $string );
|
935 |
+
}
|
936 |
+
|
937 |
+
// Utility function for turning the Authorization: header into
|
938 |
+
// parameters, has to do some unescaping
|
939 |
+
// Can filter out any non-oauth parameters if needed (default behaviour)
|
940 |
+
// May 28th, 2010 - method updated to tjerk.meesters for a speed improvement.
|
941 |
+
// see http://code.google.com/p/oauth/issues/detail?id=163
|
942 |
+
public static function split_header( $header, $only_allow_oauth_parameters = true )
|
943 |
+
{
|
944 |
+
$params = array();
|
945 |
+
if ( preg_match_all( '/(' . ( $only_allow_oauth_parameters ? 'oauth_' : '' ) . '[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches ) ) {
|
946 |
+
foreach ( $matches[ 1 ] as $i => $h ) {
|
947 |
+
$params[ $h ] = OAuthUtil::urldecode_rfc3986( empty( $matches[ 3 ][ $i ] ) ? $matches[ 4 ][ $i ] : $matches[ 3 ][ $i ] );
|
948 |
+
}
|
949 |
+
if ( isset( $params[ 'realm' ] ) ) {
|
950 |
+
unset( $params[ 'realm' ] );
|
951 |
+
}
|
952 |
+
}
|
953 |
+
|
954 |
+
return $params;
|
955 |
+
}
|
956 |
+
|
957 |
+
// helper to try to sort out headers for people who aren't running apache
|
958 |
+
public static function get_headers()
|
959 |
+
{
|
960 |
+
if ( function_exists( 'apache_request_headers' ) ) {
|
961 |
+
// we need this to get the actual Authorization: header
|
962 |
+
// because apache tends to tell us it doesn't exist
|
963 |
+
$headers = apache_request_headers();
|
964 |
+
|
965 |
+
// sanitize the output of apache_request_headers because
|
966 |
+
// we always want the keys to be Cased-Like-This and arh()
|
967 |
+
// returns the headers in the same case as they are in the
|
968 |
+
// request
|
969 |
+
$out = array();
|
970 |
+
foreach ( $headers AS $key => $value ) {
|
971 |
+
$key = str_replace(
|
972 |
+
" ",
|
973 |
+
"-",
|
974 |
+
ucwords( strtolower( str_replace( "-", " ", $key ) ) )
|
975 |
+
);
|
976 |
+
$out[ $key ] = $value;
|
977 |
+
}
|
978 |
+
} else {
|
979 |
+
// otherwise we don't have apache and are just going to have to hope
|
980 |
+
// that $_SERVER actually contains what we need
|
981 |
+
$out = array();
|
982 |
+
if ( isset( $_SERVER[ 'CONTENT_TYPE' ] ) )
|
983 |
+
$out[ 'Content-Type' ] = $_SERVER[ 'CONTENT_TYPE' ];
|
984 |
+
if ( isset( $_ENV[ 'CONTENT_TYPE' ] ) )
|
985 |
+
$out[ 'Content-Type' ] = $_ENV[ 'CONTENT_TYPE' ];
|
986 |
+
|
987 |
+
foreach ( $_SERVER as $key => $value ) {
|
988 |
+
if ( substr( $key, 0, 5 ) == "HTTP_" ) {
|
989 |
+
// this is chaos, basically it is just there to capitalize the first
|
990 |
+
// letter of every word that is not an initial HTTP and strip HTTP
|
991 |
+
// code from przemek
|
992 |
+
$key = str_replace(
|
993 |
+
" ",
|
994 |
+
"-",
|
995 |
+
ucwords( strtolower( str_replace( "_", " ", substr( $key, 5 ) ) ) )
|
996 |
+
);
|
997 |
+
$out[ $key ] = $value;
|
998 |
+
}
|
999 |
+
}
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
return $out;
|
1003 |
+
}
|
1004 |
+
|
1005 |
+
// This function takes a input like a=b&a=c&d=e and returns the parsed
|
1006 |
+
// parameters like this
|
1007 |
+
// array('a' => array('b','c'), 'd' => 'e')
|
1008 |
+
public static function parse_parameters( $input )
|
1009 |
+
{
|
1010 |
+
if ( !isset( $input ) || !$input ) return array();
|
1011 |
+
|
1012 |
+
$pairs = explode( '&', $input );
|
1013 |
+
|
1014 |
+
$parsed_parameters = array();
|
1015 |
+
foreach ( $pairs as $pair ) {
|
1016 |
+
$split = explode( '=', $pair, 2 );
|
1017 |
+
$parameter = OAuthUtil::urldecode_rfc3986( $split[ 0 ] );
|
1018 |
+
$value = isset( $split[ 1 ] ) ? OAuthUtil::urldecode_rfc3986( $split[ 1 ] ) : '';
|
1019 |
+
|
1020 |
+
if ( isset( $parsed_parameters[ $parameter ] ) ) {
|
1021 |
+
// We have already recieved parameter(s) with this name, so add to the list
|
1022 |
+
// of parameters with this name
|
1023 |
+
|
1024 |
+
if ( is_scalar( $parsed_parameters[ $parameter ] ) ) {
|
1025 |
+
// This is the first duplicate, so transform scalar (string) into an array
|
1026 |
+
// so we can add the duplicates
|
1027 |
+
$parsed_parameters[ $parameter ] = array( $parsed_parameters[ $parameter ] );
|
1028 |
+
}
|
1029 |
+
|
1030 |
+
$parsed_parameters[ $parameter ][ ] = $value;
|
1031 |
+
} else {
|
1032 |
+
$parsed_parameters[ $parameter ] = $value;
|
1033 |
+
}
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
return $parsed_parameters;
|
1037 |
+
}
|
1038 |
+
|
1039 |
+
public static function build_http_query( $params )
|
1040 |
+
{
|
1041 |
+
if ( !$params ) return '';
|
1042 |
+
|
1043 |
+
// Urlencode both keys and values
|
1044 |
+
$keys = OAuthUtil::urlencode_rfc3986( array_keys( $params ) );
|
1045 |
+
$values = OAuthUtil::urlencode_rfc3986( array_values( $params ) );
|
1046 |
+
$params = array_combine( $keys, $values );
|
1047 |
+
|
1048 |
+
// Parameters are sorted by name, using lexicographical byte value ordering.
|
1049 |
+
// Ref: Spec: 9.1.1 (1)
|
1050 |
+
uksort( $params, 'strcmp' );
|
1051 |
+
|
1052 |
+
$pairs = array();
|
1053 |
+
foreach ( $params as $parameter => $value ) {
|
1054 |
+
if ( is_array( $value ) ) {
|
1055 |
+
// If two or more parameters share the same name, they are sorted by their value
|
1056 |
+
// Ref: Spec: 9.1.1 (1)
|
1057 |
+
// June 12th, 2010 - changed to sort because of issue 164 by hidetaka
|
1058 |
+
sort( $value, SORT_STRING );
|
1059 |
+
foreach ( $value as $duplicate_value ) {
|
1060 |
+
$pairs[ ] = $parameter . '=' . $duplicate_value;
|
1061 |
+
}
|
1062 |
+
} else {
|
1063 |
+
$pairs[ ] = $parameter . '=' . $value;
|
1064 |
+
}
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
// For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
|
1068 |
+
// Each name-value pair is separated by an '&' character (ASCII code 38)
|
1069 |
+
return implode( '&', $pairs );
|
1070 |
+
}
|
1071 |
+
}
|
1072 |
+
}
|
1073 |
+
?>
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/cacert.pem
RENAMED
@@ -1,171 +1,171 @@
|
|
1 |
-
Verisign Class 3 Public Primary Certification Authority
|
2 |
-
=======================================================
|
3 |
-
-----BEGIN CERTIFICATE-----
|
4 |
-
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx
|
5 |
-
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
6 |
-
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow
|
7 |
-
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
|
8 |
-
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
|
9 |
-
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
|
10 |
-
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
|
11 |
-
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA
|
12 |
-
TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah
|
13 |
-
WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf
|
14 |
-
Tqj/ZA1k
|
15 |
-
-----END CERTIFICATE-----
|
16 |
-
|
17 |
-
Verisign Class 3 Public Primary Certification Authority - G2
|
18 |
-
============================================================
|
19 |
-
-----BEGIN CERTIFICATE-----
|
20 |
-
MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT
|
21 |
-
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
|
22 |
-
eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
|
23 |
-
biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
|
24 |
-
dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT
|
25 |
-
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
|
26 |
-
eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
|
27 |
-
biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
|
28 |
-
dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO
|
29 |
-
FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71
|
30 |
-
lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB
|
31 |
-
MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT
|
32 |
-
1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD
|
33 |
-
Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9
|
34 |
-
-----END CERTIFICATE-----
|
35 |
-
|
36 |
-
|
37 |
-
Verisign Class 3 Public Primary Certification Authority - G3
|
38 |
-
============================================================
|
39 |
-
-----BEGIN CERTIFICATE-----
|
40 |
-
MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
|
41 |
-
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
42 |
-
cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
43 |
-
IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
|
44 |
-
dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
|
45 |
-
CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
|
46 |
-
dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
|
47 |
-
cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg
|
48 |
-
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
49 |
-
ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1
|
50 |
-
EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc
|
51 |
-
cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw
|
52 |
-
EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj
|
53 |
-
055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
|
54 |
-
ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f
|
55 |
-
j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
|
56 |
-
/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0
|
57 |
-
xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa
|
58 |
-
t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
|
59 |
-
-----END CERTIFICATE-----
|
60 |
-
|
61 |
-
Verisign Class 4 Public Primary Certification Authority - G3
|
62 |
-
============================================================
|
63 |
-
-----BEGIN CERTIFICATE-----
|
64 |
-
MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
|
65 |
-
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
66 |
-
cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
67 |
-
IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
|
68 |
-
dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
|
69 |
-
CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
|
70 |
-
dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
|
71 |
-
cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg
|
72 |
-
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
73 |
-
ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS
|
74 |
-
tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM
|
75 |
-
8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW
|
76 |
-
Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX
|
77 |
-
Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
|
78 |
-
j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt
|
79 |
-
mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm
|
80 |
-
fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd
|
81 |
-
RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG
|
82 |
-
UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==
|
83 |
-
-----END CERTIFICATE-----
|
84 |
-
VeriSign Class 3 Public Primary Certification Authority - G5
|
85 |
-
============================================================
|
86 |
-
-----BEGIN CERTIFICATE-----
|
87 |
-
MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
|
88 |
-
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
|
89 |
-
ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
|
90 |
-
IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp
|
91 |
-
ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB
|
92 |
-
yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
|
93 |
-
biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh
|
94 |
-
dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt
|
95 |
-
YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
|
96 |
-
ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz
|
97 |
-
j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD
|
98 |
-
Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/
|
99 |
-
Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r
|
100 |
-
fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/
|
101 |
-
BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv
|
102 |
-
Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
|
103 |
-
aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG
|
104 |
-
SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+
|
105 |
-
X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE
|
106 |
-
KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC
|
107 |
-
Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE
|
108 |
-
ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
|
109 |
-
-----END CERTIFICATE-----
|
110 |
-
VeriSign Universal Root Certification Authority
|
111 |
-
===============================================
|
112 |
-
-----BEGIN CERTIFICATE-----
|
113 |
-
MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
|
114 |
-
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
|
115 |
-
ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
|
116 |
-
IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u
|
117 |
-
IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV
|
118 |
-
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
119 |
-
cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
120 |
-
IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0
|
121 |
-
aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj
|
122 |
-
1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP
|
123 |
-
MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72
|
124 |
-
9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I
|
125 |
-
AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR
|
126 |
-
tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G
|
127 |
-
CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O
|
128 |
-
a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
|
129 |
-
DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3
|
130 |
-
Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx
|
131 |
-
Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx
|
132 |
-
P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P
|
133 |
-
wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4
|
134 |
-
mJO37M2CYfE45k+XmCpajQ==
|
135 |
-
-----END CERTIFICATE-----
|
136 |
-
|
137 |
-
VeriSign Class 3 Public Primary Certification Authority - G4
|
138 |
-
============================================================
|
139 |
-
-----BEGIN CERTIFICATE-----
|
140 |
-
MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC
|
141 |
-
VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3
|
142 |
-
b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz
|
143 |
-
ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj
|
144 |
-
YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL
|
145 |
-
MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU
|
146 |
-
cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo
|
147 |
-
b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
148 |
-
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8
|
149 |
-
Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz
|
150 |
-
rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB
|
151 |
-
/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw
|
152 |
-
HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u
|
153 |
-
Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD
|
154 |
-
A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx
|
155 |
-
AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
|
156 |
-
-----END CERTIFICATE-----
|
157 |
-
Verisign Class 3 Public Primary Certification Authority
|
158 |
-
=======================================================
|
159 |
-
-----BEGIN CERTIFICATE-----
|
160 |
-
MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx
|
161 |
-
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
162 |
-
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow
|
163 |
-
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
|
164 |
-
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
|
165 |
-
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
|
166 |
-
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
|
167 |
-
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky
|
168 |
-
CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX
|
169 |
-
bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/
|
170 |
-
D/xwzoiQ
|
171 |
-
-----END CERTIFICATE-----
|
1 |
+
Verisign Class 3 Public Primary Certification Authority
|
2 |
+
=======================================================
|
3 |
+
-----BEGIN CERTIFICATE-----
|
4 |
+
MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx
|
5 |
+
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
6 |
+
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow
|
7 |
+
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
|
8 |
+
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
|
9 |
+
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
|
10 |
+
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
|
11 |
+
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA
|
12 |
+
TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah
|
13 |
+
WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf
|
14 |
+
Tqj/ZA1k
|
15 |
+
-----END CERTIFICATE-----
|
16 |
+
|
17 |
+
Verisign Class 3 Public Primary Certification Authority - G2
|
18 |
+
============================================================
|
19 |
+
-----BEGIN CERTIFICATE-----
|
20 |
+
MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT
|
21 |
+
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
|
22 |
+
eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
|
23 |
+
biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
|
24 |
+
dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT
|
25 |
+
MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy
|
26 |
+
eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln
|
27 |
+
biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
|
28 |
+
dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO
|
29 |
+
FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71
|
30 |
+
lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB
|
31 |
+
MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT
|
32 |
+
1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD
|
33 |
+
Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9
|
34 |
+
-----END CERTIFICATE-----
|
35 |
+
|
36 |
+
|
37 |
+
Verisign Class 3 Public Primary Certification Authority - G3
|
38 |
+
============================================================
|
39 |
+
-----BEGIN CERTIFICATE-----
|
40 |
+
MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
|
41 |
+
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
42 |
+
cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
43 |
+
IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
|
44 |
+
dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
|
45 |
+
CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
|
46 |
+
dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
|
47 |
+
cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg
|
48 |
+
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
49 |
+
ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1
|
50 |
+
EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc
|
51 |
+
cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw
|
52 |
+
EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj
|
53 |
+
055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
|
54 |
+
ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f
|
55 |
+
j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
|
56 |
+
/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0
|
57 |
+
xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa
|
58 |
+
t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
|
59 |
+
-----END CERTIFICATE-----
|
60 |
+
|
61 |
+
Verisign Class 4 Public Primary Certification Authority - G3
|
62 |
+
============================================================
|
63 |
+
-----BEGIN CERTIFICATE-----
|
64 |
+
MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV
|
65 |
+
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
66 |
+
cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
67 |
+
IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh
|
68 |
+
dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw
|
69 |
+
CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
|
70 |
+
dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv
|
71 |
+
cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg
|
72 |
+
Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
73 |
+
ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS
|
74 |
+
tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM
|
75 |
+
8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW
|
76 |
+
Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX
|
77 |
+
Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA
|
78 |
+
j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt
|
79 |
+
mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm
|
80 |
+
fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd
|
81 |
+
RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG
|
82 |
+
UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg==
|
83 |
+
-----END CERTIFICATE-----
|
84 |
+
VeriSign Class 3 Public Primary Certification Authority - G5
|
85 |
+
============================================================
|
86 |
+
-----BEGIN CERTIFICATE-----
|
87 |
+
MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE
|
88 |
+
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
|
89 |
+
ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
|
90 |
+
IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp
|
91 |
+
ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB
|
92 |
+
yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
|
93 |
+
biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh
|
94 |
+
dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt
|
95 |
+
YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
|
96 |
+
ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz
|
97 |
+
j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD
|
98 |
+
Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/
|
99 |
+
Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r
|
100 |
+
fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/
|
101 |
+
BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv
|
102 |
+
Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
|
103 |
+
aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG
|
104 |
+
SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+
|
105 |
+
X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE
|
106 |
+
KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC
|
107 |
+
Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE
|
108 |
+
ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
|
109 |
+
-----END CERTIFICATE-----
|
110 |
+
VeriSign Universal Root Certification Authority
|
111 |
+
===============================================
|
112 |
+
-----BEGIN CERTIFICATE-----
|
113 |
+
MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE
|
114 |
+
BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO
|
115 |
+
ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk
|
116 |
+
IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u
|
117 |
+
IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV
|
118 |
+
UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv
|
119 |
+
cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
|
120 |
+
IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0
|
121 |
+
aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj
|
122 |
+
1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP
|
123 |
+
MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72
|
124 |
+
9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I
|
125 |
+
AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR
|
126 |
+
tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G
|
127 |
+
CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O
|
128 |
+
a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
|
129 |
+
DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3
|
130 |
+
Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx
|
131 |
+
Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx
|
132 |
+
P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P
|
133 |
+
wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4
|
134 |
+
mJO37M2CYfE45k+XmCpajQ==
|
135 |
+
-----END CERTIFICATE-----
|
136 |
+
|
137 |
+
VeriSign Class 3 Public Primary Certification Authority - G4
|
138 |
+
============================================================
|
139 |
+
-----BEGIN CERTIFICATE-----
|
140 |
+
MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC
|
141 |
+
VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3
|
142 |
+
b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz
|
143 |
+
ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj
|
144 |
+
YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL
|
145 |
+
MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU
|
146 |
+
cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo
|
147 |
+
b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
148 |
+
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8
|
149 |
+
Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz
|
150 |
+
rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB
|
151 |
+
/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw
|
152 |
+
HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u
|
153 |
+
Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD
|
154 |
+
A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx
|
155 |
+
AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
|
156 |
+
-----END CERTIFICATE-----
|
157 |
+
Verisign Class 3 Public Primary Certification Authority
|
158 |
+
=======================================================
|
159 |
+
-----BEGIN CERTIFICATE-----
|
160 |
+
MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx
|
161 |
+
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5
|
162 |
+
IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow
|
163 |
+
XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz
|
164 |
+
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA
|
165 |
+
A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94
|
166 |
+
f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol
|
167 |
+
hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky
|
168 |
+
CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX
|
169 |
+
bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/
|
170 |
+
D/xwzoiQ
|
171 |
+
-----END CERTIFICATE-----
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/exceptions/PPConfigurationException.php
RENAMED
@@ -1,9 +1,9 @@
|
|
1 |
-
<?php
|
2 |
-
class PPConfigurationException extends Exception
|
3 |
-
{
|
4 |
-
|
5 |
-
public function __construct( $message = null, $code = 0 )
|
6 |
-
{
|
7 |
-
parent::__construct( $message, $code );
|
8 |
-
}
|
9 |
}
|
1 |
+
<?php
|
2 |
+
class PPConfigurationException extends Exception
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct( $message = null, $code = 0 )
|
6 |
+
{
|
7 |
+
parent::__construct( $message, $code );
|
8 |
+
}
|
9 |
}
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/exceptions/PPConnectionException.php
RENAMED
@@ -1,20 +1,20 @@
|
|
1 |
-
<?php
|
2 |
-
class PPConnectionException extends Exception
|
3 |
-
{
|
4 |
-
/**
|
5 |
-
* The url that was being connected to when the exception occured
|
6 |
-
* @var string
|
7 |
-
*/
|
8 |
-
private $url;
|
9 |
-
|
10 |
-
public function __construct( $url, $message, $code = 0 )
|
11 |
-
{
|
12 |
-
parent::__construct( $message, $code );
|
13 |
-
$this->url = $url;
|
14 |
-
}
|
15 |
-
|
16 |
-
public function getUrl()
|
17 |
-
{
|
18 |
-
return $this->url;
|
19 |
-
}
|
20 |
}
|
1 |
+
<?php
|
2 |
+
class PPConnectionException extends Exception
|
3 |
+
{
|
4 |
+
/**
|
5 |
+
* The url that was being connected to when the exception occured
|
6 |
+
* @var string
|
7 |
+
*/
|
8 |
+
private $url;
|
9 |
+
|
10 |
+
public function __construct( $url, $message, $code = 0 )
|
11 |
+
{
|
12 |
+
parent::__construct( $message, $code );
|
13 |
+
$this->url = $url;
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getUrl()
|
17 |
+
{
|
18 |
+
return $this->url;
|
19 |
+
}
|
20 |
}
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/exceptions/PPInvalidCredentialException.php
RENAMED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
class PPInvalidCredentialException extends Exception
|
5 |
-
{
|
6 |
-
|
7 |
-
public function __construct( $message = null, $code = 0 )
|
8 |
-
{
|
9 |
-
parent::__construct( $message, $code );
|
10 |
-
}
|
11 |
-
|
12 |
-
public function errorMessage()
|
13 |
-
{
|
14 |
-
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
15 |
-
. ': <b>' . $this->getMessage() . '</b>';
|
16 |
-
|
17 |
-
return $errorMsg;
|
18 |
-
}
|
19 |
-
|
20 |
-
}
|
21 |
-
|
22 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class PPInvalidCredentialException extends Exception
|
5 |
+
{
|
6 |
+
|
7 |
+
public function __construct( $message = null, $code = 0 )
|
8 |
+
{
|
9 |
+
parent::__construct( $message, $code );
|
10 |
+
}
|
11 |
+
|
12 |
+
public function errorMessage()
|
13 |
+
{
|
14 |
+
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
15 |
+
. ': <b>' . $this->getMessage() . '</b>';
|
16 |
+
|
17 |
+
return $errorMsg;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/exceptions/PPMissingCredentialException.php
RENAMED
@@ -1,22 +1,22 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
class PPMissingCredentialException extends Exception
|
5 |
-
{
|
6 |
-
|
7 |
-
public function __construct( $message = null, $code = 0 )
|
8 |
-
{
|
9 |
-
parent::__construct( $message, $code );
|
10 |
-
}
|
11 |
-
|
12 |
-
public function errorMessage()
|
13 |
-
{
|
14 |
-
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
15 |
-
. ': <b>' . $this->getMessage() . '</b>';
|
16 |
-
|
17 |
-
return $errorMsg;
|
18 |
-
}
|
19 |
-
|
20 |
-
}
|
21 |
-
|
22 |
?>
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class PPMissingCredentialException extends Exception
|
5 |
+
{
|
6 |
+
|
7 |
+
public function __construct( $message = null, $code = 0 )
|
8 |
+
{
|
9 |
+
parent::__construct( $message, $code );
|
10 |
+
}
|
11 |
+
|
12 |
+
public function errorMessage()
|
13 |
+
{
|
14 |
+
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
15 |
+
. ': <b>' . $this->getMessage() . '</b>';
|
16 |
+
|
17 |
+
return $errorMsg;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
21 |
+
|
22 |
?>
|
{WCVendors/classes/gateways/PayPal_Masspay/api → classes/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk}/lib/exceptions/PPTransformerException.php
RENAMED
@@ -1,20 +1,20 @@
|
|
1 |
-
<?php
|
2 |
-
class PPTransformerException extends Exception
|
3 |
-
{
|
4 |
-
|
5 |
-
public function __construct( $message = null, $code = 0 )
|
6 |
-
{
|
7 |
-
parent::__construct( $message, $code );
|
8 |
-
}
|
9 |
-
|
10 |
-
public function errorMessage()
|
11 |
-
{
|
12 |
-
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
13 |
-
. ': <b>' . $this->getMessage() . '</b>';
|
14 |
-
|
15 |
-
return $errorMsg;
|
16 |
-
}
|
17 |
-
|
18 |
-
}
|
19 |
-
|
20 |
?>
|
1 |
+
<?php
|
2 |
+
class PPTransformerException extends Exception
|
3 |
+
{
|
4 |
+
|
5 |
+
public function __construct( $message = null, $code = 0 )
|
6 |
+
{
|
7 |
+
parent::__construct( $message, $code );
|
8 |
+
}
|
9 |
+
|
10 |
+
public function errorMessage()
|
11 |
+
{
|
12 |
+
$errorMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()
|
13 |
+
. ': <b>' . $this->getMessage() . '</b>';
|
14 |
+
|
15 |
+
return $errorMsg;
|
16 |
+
}
|
17 |
+
|
18 |
+
}
|
19 |
+
|
20 |
?>
|
{WCVendors/classes → classes}/gateways/PayPal_AdvPayments/PayPal_AP/classes/adaptivepayments-sdk/lib/services/AdaptivePayments/AdaptivePayments.php
RENAMED
@@ -1,5797 +1,5797 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Stub objects for AdaptivePayments
|
4 |
-
* Auto generated code
|
5 |
-
*
|
6 |
-
*/
|
7 |
-
require_once( 'PPUtils.php' );
|
8 |
-
/**
|
9 |
-
*
|
10 |
-
*/
|
11 |
-
class AccountIdentifier
|
12 |
-
{
|
13 |
-
|
14 |
-
/**
|
15 |
-
*
|
16 |
-
* @access public
|
17 |
-
* @var string
|
18 |
-
*/
|
19 |
-
public $email;
|
20 |
-
|
21 |
-
/**
|
22 |
-
*
|
23 |
-
* @access public
|
24 |
-
* @var PhoneNumberType
|
25 |
-
*/
|
26 |
-
public $phone;
|
27 |
-
|
28 |
-
|
29 |
-
public function toNVPString( $prefix = '' )
|
30 |
-
{
|
31 |
-
$str = '';
|
32 |
-
$delim = '';
|
33 |
-
if ( $this->email != null ) {
|
34 |
-
$str .= $delim . $prefix . 'email=' . urlencode( $this->email );
|
35 |
-
$delim = '&';
|
36 |
-
}
|
37 |
-
if ( $this->phone != null ) {
|
38 |
-
$newPrefix = $prefix . 'phone.';
|
39 |
-
$str .= $delim . call_user_func( array( $this->phone, 'toNVPString' ), $newPrefix );
|
40 |
-
$delim = '&';
|
41 |
-
}
|
42 |
-
|
43 |
-
return $str;
|
44 |
-
}
|
45 |
-
|
46 |
-
public function init( $map = null, $prefix = '' )
|
47 |
-
{
|
48 |
-
if ( $map != null ) {
|
49 |
-
$mapKeyName = $prefix . 'email';
|
50 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
51 |
-
$this->email = $map[ $mapKeyName ];
|
52 |
-
}
|
53 |
-
if ( PPUtils::array_match_key( $map, $prefix . "phone." ) ) {
|
54 |
-
$newPrefix = $prefix . "phone.";
|
55 |
-
$this->phone = new PhoneNumberType();
|
56 |
-
$this->phone->init( $map, $newPrefix );
|
57 |
-
}
|
58 |
-
|
59 |
-
}
|
60 |
-
}
|
61 |
-
}
|
62 |
-
|
63 |
-
|
64 |
-
/**
|
65 |
-
*
|
66 |
-
*/
|
67 |
-
class BaseAddress
|
68 |
-
{
|
69 |
-
|
70 |
-
/**
|
71 |
-
*
|
72 |
-
* @access public
|
73 |
-
* @var string
|
74 |
-
*/
|
75 |
-
public $line1;
|
76 |
-
|
77 |
-
/**
|
78 |
-
*
|
79 |
-
* @access public
|
80 |
-
* @var string
|
81 |
-
*/
|
82 |
-
public $line2;
|
83 |
-
|
84 |
-
/**
|
85 |
-
*
|
86 |
-
* @access public
|
87 |
-
* @var string
|
88 |
-
*/
|
89 |
-
public $city;
|
90 |
-
|
91 |
-
/**
|
92 |
-
*
|
93 |
-
* @access public
|
94 |
-
* @var string
|
95 |
-
*/
|
96 |
-
public $state;
|
97 |
-
|
98 |
-
/**
|
99 |
-
*
|
100 |
-
* @access public
|
101 |
-
* @var string
|
102 |
-
*/
|
103 |
-
public $postalCode;
|
104 |
-
|
105 |
-
/**
|
106 |
-
*
|
107 |
-
* @access public
|
108 |
-
* @var string
|
109 |
-
*/
|
110 |
-
public $countryCode;
|
111 |
-
|
112 |
-
/**
|
113 |
-
*
|
114 |
-
* @access public
|
115 |
-
* @var string
|
116 |
-
*/
|
117 |
-
public $type;
|
118 |
-
|
119 |
-
|
120 |
-
public function init( $map = null, $prefix = '' )
|
121 |
-
{
|
122 |
-
if ( $map != null ) {
|
123 |
-
$mapKeyName = $prefix . 'line1';
|
124 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
125 |
-
$this->line1 = $map[ $mapKeyName ];
|
126 |
-
}
|
127 |
-
$mapKeyName = $prefix . 'line2';
|
128 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
129 |
-
$this->line2 = $map[ $mapKeyName ];
|
130 |
-
}
|
131 |
-
$mapKeyName = $prefix . 'city';
|
132 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
133 |
-
$this->city = $map[ $mapKeyName ];
|
134 |
-
}
|
135 |
-
$mapKeyName = $prefix . 'state';
|
136 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
137 |
-
$this->state = $map[ $mapKeyName ];
|
138 |
-
}
|
139 |
-
$mapKeyName = $prefix . 'postalCode';
|
140 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
141 |
-
$this->postalCode = $map[ $mapKeyName ];
|
142 |
-
}
|
143 |
-
$mapKeyName = $prefix . 'countryCode';
|
144 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
145 |
-
$this->countryCode = $map[ $mapKeyName ];
|
146 |
-
}
|
147 |
-
$mapKeyName = $prefix . 'type';
|
148 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
149 |
-
$this->type = $map[ $mapKeyName ];
|
150 |
-
}
|
151 |
-
|
152 |
-
}
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
|
157 |
-
/**
|
158 |
-
* Details about the end user of the application invoking this
|
159 |
-
* service.
|
160 |
-
*/
|
161 |
-
class ClientDetailsType
|
162 |
-
{
|
163 |
-
|
164 |
-
/**
|
165 |
-
*
|
166 |
-
* @access public
|
167 |
-
* @var string
|
168 |
-
*/
|
169 |
-
public $ipAddress;
|
170 |
-
|
171 |
-
/**
|
172 |
-
*
|
173 |
-
* @access public
|
174 |
-
* @var string
|
175 |
-
*/
|
176 |
-
public $deviceId;
|
177 |
-
|
178 |
-
/**
|
179 |
-
*
|
180 |
-
* @access public
|
181 |
-
* @var string
|
182 |
-
*/
|
183 |
-
public $applicationId;
|
184 |
-
|
185 |
-
/**
|
186 |
-
*
|
187 |
-
* @access public
|
188 |
-
* @var string
|
189 |
-
*/
|
190 |
-
public $model;
|
191 |
-
|
192 |
-
/**
|
193 |
-
*
|
194 |
-
* @access public
|
195 |
-
* @var string
|
196 |
-
*/
|
197 |
-
public $geoLocation;
|
198 |
-
|
199 |
-
/**
|
200 |
-
*
|
201 |
-
* @access public
|
202 |
-
* @var string
|
203 |
-
*/
|
204 |
-
public $customerType;
|
205 |
-
|
206 |
-
/**
|
207 |
-
*
|
208 |
-
* @access public
|
209 |
-
* @var string
|
210 |
-
*/
|
211 |
-
public $partnerName;
|
212 |
-
|
213 |
-
/**
|
214 |
-
*
|
215 |
-
* @access public
|
216 |
-
* @var string
|
217 |
-
*/
|
218 |
-
public $customerId;
|
219 |
-
|
220 |
-
|
221 |
-
public function toNVPString( $prefix = '' )
|
222 |
-
{
|
223 |
-
$str = '';
|
224 |
-
$delim = '';
|
225 |
-
if ( $this->ipAddress != null ) {
|
226 |
-
$str .= $delim . $prefix . 'ipAddress=' . urlencode( $this->ipAddress );
|
227 |
-
$delim = '&';
|
228 |
-
}
|
229 |
-
if ( $this->deviceId != null ) {
|
230 |
-
$str .= $delim . $prefix . 'deviceId=' . urlencode( $this->deviceId );
|
231 |
-
$delim = '&';
|
232 |
-
}
|
233 |
-
if ( $this->applicationId != null ) {
|
234 |
-
$str .= $delim . $prefix . 'applicationId=' . urlencode( $this->applicationId );
|
235 |
-
$delim = '&';
|
236 |
-
}
|
237 |
-
if ( $this->model != null ) {
|
238 |
-
$str .= $delim . $prefix . 'model=' . urlencode( $this->model );
|
239 |
-
$delim = '&';
|
240 |
-
}
|
241 |
-
if ( $this->geoLocation != null ) {
|
242 |
-
$str .= $delim . $prefix . 'geoLocation=' . urlencode( $this->geoLocation );
|
243 |
-
$delim = '&';
|
244 |
-
}
|
245 |
-
if ( $this->customerType != null ) {
|
246 |
-
$str .= $delim . $prefix . 'customerType=' . urlencode( $this->customerType );
|
247 |
-
$delim = '&';
|
248 |
-
}
|
249 |
-
if ( $this->partnerName != null ) {
|
250 |
-
$str .= $delim . $prefix . 'partnerName=' . urlencode( $this->partnerName );
|
251 |
-
$delim = '&';
|
252 |
-
}
|
253 |
-
if ( $this->customerId != null ) {
|
254 |
-
$str .= $delim . $prefix . 'customerId=' . urlencode( $this->customerId );
|
255 |
-
$delim = '&';
|
256 |
-
}
|
257 |
-
|
258 |
-
return $str;
|
259 |
-
}
|
260 |
-
|
261 |
-
}
|
262 |
-
|
263 |
-
|
264 |
-
/**
|
265 |
-
*
|
266 |
-
*/
|
267 |
-
class CurrencyType
|
268 |
-
{
|
269 |
-
|
270 |
-
/**
|
271 |
-
*
|
272 |
-
* @access public
|
273 |
-
* @var string
|
274 |
-
*/
|
275 |
-
public $code;
|
276 |
-
|
277 |
-
/**
|
278 |
-
*
|
279 |
-
* @access public
|
280 |
-
* @var double
|
281 |
-
*/
|
282 |
-
public $amount;
|
283 |
-
|
284 |
-
/**
|
285 |
-
* Constructor with arguments
|
286 |
-
*/
|
287 |
-
public function __construct( $code = null, $amount = null )
|
288 |
-
{
|
289 |
-
$this->code = $code;
|
290 |
-
$this->amount = $amount;
|
291 |
-
}
|
292 |
-
|
293 |
-
|
294 |
-
public function toNVPString( $prefix = '' )
|
295 |
-
{
|
296 |
-
$str = '';
|
297 |
-
$delim = '';
|
298 |
-
if ( $this->code != null ) {
|
299 |
-
$str .= $delim . $prefix . 'code=' . urlencode( $this->code );
|
300 |
-
$delim = '&';
|
301 |
-
}
|
302 |
-
if ( $this->amount != null ) {
|
303 |
-
$str .= $delim . $prefix . 'amount=' . urlencode( $this->amount );
|
304 |
-
$delim = '&';
|
305 |
-
}
|
306 |
-
|
307 |
-
return $str;
|
308 |
-
}
|
309 |
-
|
310 |
-
public function init( $map = null, $prefix = '' )
|
311 |
-
{
|
312 |
-
if ( $map != null ) {
|
313 |
-
$mapKeyName = $prefix . 'code';
|
314 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
315 |
-
$this->code = $map[ $mapKeyName ];
|
316 |
-
}
|
317 |
-
$mapKeyName = $prefix . 'amount';
|
318 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
319 |
-
$this->amount = $map[ $mapKeyName ];
|
320 |
-
}
|
321 |
-
|
322 |
-
}
|
323 |
-
}
|
324 |
-
}
|
325 |
-
|
326 |
-
|
327 |
-
/**
|
328 |
-
* This type contains the detailed error information resulting
|
329 |
-
* from the service operation.
|
330 |
-
*/
|
331 |
-
class ErrorData
|
332 |
-
{
|
333 |
-
|
334 |
-
/**
|
335 |
-
*
|
336 |
-
* @access public
|
337 |
-
* @var integer
|
338 |
-
*/
|
339 |
-
public $errorId;
|
340 |
-
|
341 |
-
/**
|
342 |
-
*
|
343 |
-
* @access public
|
344 |
-
* @var string
|
345 |
-
*/
|
346 |
-
public $domain;
|
347 |
-
|
348 |
-
/**
|
349 |
-
*
|
350 |
-
* @access public
|
351 |
-
* @var string
|
352 |
-
*/
|
353 |
-
public $subdomain;
|
354 |
-
|
355 |
-
/**
|
356 |
-
*
|
357 |
-
* @access public
|
358 |
-
* @var ErrorSeverity
|
359 |
-
*/
|
360 |
-
public $severity;
|
361 |
-
|
362 |
-
/**
|
363 |
-
*
|
364 |
-
* @access public
|
365 |
-
* @var ErrorCategory
|
366 |
-
*/
|
367 |
-
public $category;
|
368 |
-
|
369 |
-
/**
|
370 |
-
*
|
371 |
-
* @access public
|
372 |
-
* @var string
|
373 |
-
*/
|
374 |
-
public $message;
|
375 |
-
|
376 |
-
/**
|
377 |
-
*
|
378 |
-
* @access public
|
379 |
-
* @var string
|
380 |
-
*/
|
381 |
-
public $exceptionId;
|
382 |
-
|
383 |
-
/**
|
384 |
-
*
|
385 |
-
* @array
|
386 |
-
* @access public
|
387 |
-
* @var ErrorParameter
|
388 |
-
*/
|
389 |
-
public $parameter;
|
390 |
-
|
391 |
-
|
392 |
-
public function init( $map = null, $prefix = '' )
|
393 |
-
{
|
394 |
-
if ( $map != null ) {
|
395 |
-
$mapKeyName = $prefix . 'errorId';
|
396 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
397 |
-
$this->errorId = $map[ $mapKeyName ];
|
398 |
-
}
|
399 |
-
$mapKeyName = $prefix . 'domain';
|
400 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
401 |
-
$this->domain = $map[ $mapKeyName ];
|
402 |
-
}
|
403 |
-
$mapKeyName = $prefix . 'subdomain';
|
404 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
405 |
-
$this->subdomain = $map[ $mapKeyName ];
|
406 |
-
}
|
407 |
-
$mapKeyName = $prefix . 'severity';
|
408 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
409 |
-
$this->severity = $map[ $mapKeyName ];
|
410 |
-
}
|
411 |
-
$mapKeyName = $prefix . 'category';
|
412 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
413 |
-
$this->category = $map[ $mapKeyName ];
|
414 |
-
}
|
415 |
-
$mapKeyName = $prefix . 'message';
|
416 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
417 |
-
$this->message = $map[ $mapKeyName ];
|
418 |
-
}
|
419 |
-
$mapKeyName = $prefix . 'exceptionId';
|
420 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
421 |
-
$this->exceptionId = $map[ $mapKeyName ];
|
422 |
-
}
|
423 |
-
$i = 0;
|
424 |
-
while ( true ) {
|
425 |
-
if ( PPUtils::array_match_key( $map, $prefix . "parameter($i)" ) ) {
|
426 |
-
$newPrefix = $prefix . "parameter($i).";
|
427 |
-
$this->parameter[ $i ] = new ErrorParameter();
|
428 |
-
$this->parameter[ $i ]->init( $map, $newPrefix );
|
429 |
-
} else {
|
430 |
-
break;
|
431 |
-
}
|
432 |
-
$i++;
|
433 |
-
}
|
434 |
-
|
435 |
-
}
|
436 |
-
}
|
437 |
-
}
|
438 |
-
|
439 |
-
|
440 |
-
/**
|
441 |
-
*
|
442 |
-
*/
|
443 |
-
class ErrorParameter
|
444 |
-
{
|
445 |
-
|
446 |
-
/**
|
447 |
-
*
|
448 |
-
* @access public
|
449 |
-
* @var string
|
450 |
-
*/
|
451 |
-
public $name;
|
452 |
-
|
453 |
-
/**
|
454 |
-
*
|
455 |
-
* @access public
|
456 |
-
* @var string
|
457 |
-
*/
|
458 |
-
public $value;
|
459 |
-
|
460 |
-
|
461 |
-
public function init( $map = null, $prefix = '' )
|
462 |
-
{
|
463 |
-
if ( $map != null ) {
|
464 |
-
$mapKeyName = $prefix . 'name';
|
465 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
466 |
-
$this->name = $map[ $mapKeyName ];
|
467 |
-
}
|
468 |
-
$mapKeyName = $prefix . 'value';
|
469 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
470 |
-
$this->value = $map[ $mapKeyName ];
|
471 |
-
}
|
472 |
-
|
473 |
-
}
|
474 |
-
}
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
/**
|
479 |
-
* This specifies a fault, encapsulating error data, with
|
480 |
-
* specific error codes.
|
481 |
-
*/
|
482 |
-
class FaultMessage
|
483 |
-
{
|
484 |
-
|
485 |
-
/**
|
486 |
-
*
|
487 |
-
* @access public
|
488 |
-
* @var ResponseEnvelope
|
489 |
-
*/
|
490 |
-
public $responseEnvelope;
|
491 |
-
|
492 |
-
/**
|
493 |
-
*
|
494 |
-
* @array
|
495 |
-
* @access public
|
496 |
-
* @var ErrorData
|
497 |
-
*/
|
498 |
-
public $error;
|
499 |
-
|
500 |
-
|
501 |
-
public function init( $map = null, $prefix = '' )
|
502 |
-
{
|
503 |
-
if ( $map != null ) {
|
504 |
-
if ( PPUtils::array_match_key( $map, $prefix . "responseEnvelope." ) ) {
|
505 |
-
$newPrefix = $prefix . "responseEnvelope.";
|
506 |
-
$this->responseEnvelope = new ResponseEnvelope();
|
507 |
-
$this->responseEnvelope->init( $map, $newPrefix );
|
508 |
-
}
|
509 |
-
$i = 0;
|
510 |
-
while ( true ) {
|
511 |
-
if ( PPUtils::array_match_key( $map, $prefix . "error($i)" ) ) {
|
512 |
-
$newPrefix = $prefix . "error($i).";
|
513 |
-
$this->error[ $i ] = new ErrorData();
|
514 |
-
$this->error[ $i ]->init( $map, $newPrefix );
|
515 |
-
} else {
|
516 |
-
break;
|
517 |
-
}
|
518 |
-
$i++;
|
519 |
-
}
|
520 |
-
|
521 |
-
}
|
522 |
-
}
|
523 |
-
}
|
524 |
-
|
525 |
-
|
526 |
-
/**
|
527 |
-
*
|
528 |
-
*/
|
529 |
-
class PhoneNumberType
|
530 |
-
{
|
531 |
-
|
532 |
-
/**
|
533 |
-
*
|
534 |
-
* @access public
|
535 |
-
* @var string
|
536 |
-
*/
|
537 |
-
public $countryCode;
|
538 |
-
|
539 |
-
/**
|
540 |
-
*
|
541 |
-
* @access public
|
542 |
-
* @var string
|
543 |
-
*/
|
544 |
-
public $phoneNumber;
|
545 |
-
|
546 |
-
/**
|
547 |
-
*
|
548 |
-
* @access public
|
549 |
-
* @var string
|
550 |
-
*/
|
551 |
-
public $extension;
|
552 |
-
|
553 |
-
/**
|
554 |
-
* Constructor with arguments
|
555 |
-
*/
|
556 |
-
public function __construct( $countryCode = null, $phoneNumber = null )
|
557 |
-
{
|
558 |
-
$this->countryCode = $countryCode;
|
559 |
-
$this->phoneNumber = $phoneNumber;
|
560 |
-
}
|
561 |
-
|
562 |
-
|
563 |
-
public function toNVPString( $prefix = '' )
|
564 |
-
{
|
565 |
-
$str = '';
|
566 |
-
$delim = '';
|
567 |
-
if ( $this->countryCode != null ) {
|
568 |
-
$str .= $delim . $prefix . 'countryCode=' . urlencode( $this->countryCode );
|
569 |
-
$delim = '&';
|
570 |
-
}
|
571 |
-
if ( $this->phoneNumber != null ) {
|
572 |
-
$str .= $delim . $prefix . 'phoneNumber=' . urlencode( $this->phoneNumber );
|
573 |
-
$delim = '&';
|
574 |
-
}
|
575 |
-
if ( $this->extension != null ) {
|
576 |
-
$str .= $delim . $prefix . 'extension=' . urlencode( $this->extension );
|
577 |
-
$delim = '&';
|
578 |
-
}
|
579 |
-
|
580 |
-
return $str;
|
581 |
-
}
|
582 |
-
|
583 |
-
public function init( $map = null, $prefix = '' )
|
584 |
-
{
|
585 |
-
if ( $map != null ) {
|
586 |
-
$mapKeyName = $prefix . 'countryCode';
|
587 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
588 |
-
$this->countryCode = $map[ $mapKeyName ];
|
589 |
-
}
|
590 |
-
$mapKeyName = $prefix . 'phoneNumber';
|
591 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
592 |
-
$this->phoneNumber = $map[ $mapKeyName ];
|
593 |
-
}
|
594 |
-
$mapKeyName = $prefix . 'extension';
|
595 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
596 |
-
$this->extension = $map[ $mapKeyName ];
|
597 |
-
}
|
598 |
-
|
599 |
-
}
|
600 |
-
}
|
601 |
-
}
|
602 |
-
|
603 |
-
|
604 |
-
/**
|
605 |
-
* This specifies the list of parameters with every request to
|
606 |
-
* the service.
|
607 |
-
*/
|
608 |
-
class RequestEnvelope
|
609 |
-
{
|
610 |
-
|
611 |
-
/**
|
612 |
-
* This specifies the required detail level that is needed by a
|
613 |
-
* client application pertaining to a particular data component
|
614 |
-
* (e.g., Item, Transaction, etc.). The detail level is
|
615 |
-
* specified in the DetailLevelCodeType which has all the
|
616 |
-
* enumerated values of the detail level for each component.
|
617 |
-
* @access public
|
618 |
-
* @var DetailLevelCode
|
619 |
-
*/
|
620 |
-
public $detailLevel;
|
621 |
-
|
622 |
-
/**
|
623 |
-
* This should be the standard RFC 3066 language identification
|
624 |
-
* tag, e.g., en_US.
|
625 |
-
* @access public
|
626 |
-
* @var string
|
627 |
-
*/
|
628 |
-
public $errorLanguage;
|
629 |
-
|
630 |
-
/**
|
631 |
-
* Constructor with arguments
|
632 |
-
*/
|
633 |
-
public function __construct( $errorLanguage = null )
|
634 |
-
{
|
635 |
-
$this->errorLanguage = $errorLanguage;
|
636 |
-
}
|
637 |
-
|
638 |
-
|
639 |
-
public function toNVPString( $prefix = '' )
|
640 |
-
{
|
641 |
-
$str = '';
|
642 |
-
$delim = '';
|
643 |
-
if ( $this->detailLevel != null ) {
|
644 |
-
$str .= $delim . $prefix . 'detailLevel=' . urlencode( $this->detailLevel );
|
645 |
-
$delim = '&';
|
646 |
-
}
|
647 |
-
if ( $this->errorLanguage != null ) {
|
648 |
-
$str .= $delim . $prefix . 'errorLanguage=' . urlencode( $this->errorLanguage );
|
649 |
-
$delim = '&';
|
650 |
-
}
|
651 |
-
|
652 |
-
return $str;
|
653 |
-
}
|
654 |
-
|
655 |
-
}
|
656 |
-
|
657 |
-
|
658 |
-
/**
|
659 |
-
* This specifies a list of parameters with every response from
|
660 |
-
* a service.
|
661 |
-
*/
|
662 |
-
class ResponseEnvelope
|
663 |
-
{
|
664 |
-
|
665 |
-
/**
|
666 |
-
*
|
667 |
-
* @access public
|
668 |
-
* @var dateTime
|
669 |
-
*/
|
670 |
-
public $timestamp;
|
671 |
-
|
672 |
-
/**
|
673 |
-
* Application level acknowledgment code.
|
674 |
-
* @access public
|
675 |
-
* @var AckCode
|
676 |
-
*/
|
677 |
-
public $ack;
|
678 |
-
|
679 |
-
/**
|
680 |
-
*
|
681 |
-
* @access public
|
682 |
-
* @var string
|
683 |
-
*/
|
684 |
-
public $correlationId;
|
685 |
-
|
686 |
-
/**
|
687 |
-
*
|
688 |
-
* @access public
|
689 |
-
* @var string
|
690 |
-
*/
|
691 |
-
public $build;
|
692 |
-
|
693 |
-
|
694 |
-
public function init( $map = null, $prefix = '' )
|
695 |
-
{
|
696 |
-
if ( $map != null ) {
|
697 |
-
$mapKeyName = $prefix . 'timestamp';
|
698 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
699 |
-
$this->timestamp = $map[ $mapKeyName ];
|
700 |
-
}
|
701 |
-
$mapKeyName = $prefix . 'ack';
|
702 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
703 |
-
$this->ack = $map[ $mapKeyName ];
|
704 |
-
}
|
705 |
-
$mapKeyName = $prefix . 'correlationId';
|
706 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
707 |
-
$this->correlationId = $map[ $mapKeyName ];
|
708 |
-
}
|
709 |
-
$mapKeyName = $prefix . 'build';
|
710 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
711 |
-
$this->build = $map[ $mapKeyName ];
|
712 |
-
}
|
713 |
-
|
714 |
-
}
|
715 |
-
}
|
716 |
-
}
|
717 |
-
|
718 |
-
|
719 |
-
/**
|
720 |
-
*
|
721 |
-
*/
|
722 |
-
class Address
|
723 |
-
{
|
724 |
-
|
725 |
-
/**
|
726 |
-
*
|
727 |
-
* @access public
|
728 |
-
* @var string
|
729 |
-
*/
|
730 |
-
public $addresseeName;
|
731 |
-
|
732 |
-
/**
|
733 |
-
*
|
734 |
-
* @access public
|
735 |
-
* @var BaseAddress
|
736 |
-
*/
|
737 |
-
public $baseAddress;
|
738 |
-
|
739 |
-
/**
|
740 |
-
*
|
741 |
-
* @access public
|
742 |
-
* @var string
|
743 |
-
*/
|
744 |
-
public $addressId;
|
745 |
-
|
746 |
-
|
747 |
-
public function init( $map = null, $prefix = '' )
|
748 |
-
{
|
749 |
-
if ( $map != null ) {
|
750 |
-
$mapKeyName = $prefix . 'addresseeName';
|
751 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
752 |
-
$this->addresseeName = $map[ $mapKeyName ];
|
753 |
-
}
|
754 |
-
if ( PPUtils::array_match_key( $map, $prefix . "baseAddress." ) ) {
|
755 |
-
$newPrefix = $prefix . "baseAddress.";
|
756 |
-
$this->baseAddress = new BaseAddress();
|
757 |
-
$this->baseAddress->init( $map, $newPrefix );
|
758 |
-
}
|
759 |
-
$mapKeyName = $prefix . 'addressId';
|
760 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
761 |
-
$this->addressId = $map[ $mapKeyName ];
|
762 |
-
}
|
763 |
-
|
764 |
-
}
|
765 |
-
}
|
766 |
-
}
|
767 |
-
|
768 |
-
|
769 |
-
/**
|
770 |
-
*
|
771 |
-
*/
|
772 |
-
class AddressList
|
773 |
-
{
|
774 |
-
|
775 |
-
/**
|
776 |
-
*
|
777 |
-
* @array
|
778 |
-
* @access public
|
779 |
-
* @var Address
|
780 |
-
*/
|
781 |
-
public $address;
|
782 |
-
|
783 |
-
|
784 |
-
public function init( $map = null, $prefix = '' )
|
785 |
-
{
|
786 |
-
if ( $map != null ) {
|
787 |
-
$i = 0;
|
788 |
-
while ( true ) {
|
789 |
-
if ( PPUtils::array_match_key( $map, $prefix . "address($i)" ) ) {
|
790 |
-
$newPrefix = $prefix . "address($i).";
|
791 |
-
$this->address[ $i ] = new Address();
|
792 |
-
$this->address[ $i ]->init( $map, $newPrefix );
|
793 |
-
} else {
|
794 |
-
break;
|
795 |
-
}
|
796 |
-
$i++;
|
797 |
-
}
|
798 |
-
|
799 |
-
}
|
800 |
-
}
|
801 |
-
}
|
802 |
-
|
803 |
-
|
804 |
-
/**
|
805 |
-
* A list of ISO currency codes.
|
806 |
-
*/
|
807 |
-
class CurrencyCodeList
|
808 |
-
{
|
809 |
-
|
810 |
-
/**
|
811 |
-
*
|
812 |
-
* @array
|
813 |
-
* @access public
|
814 |
-
* @var string
|
815 |
-
*/
|
816 |
-
public $currencyCode;
|
817 |
-
|
818 |
-
/**
|
819 |
-
* Constructor with arguments
|
820 |
-
*/
|
821 |
-
public function __construct( $currencyCode = null )
|
822 |
-
{
|
823 |
-
$this->currencyCode = $currencyCode;
|
824 |
-
}
|
825 |
-
|
826 |
-
|
827 |
-
public function toNVPString( $prefix = '' )
|
828 |
-
{
|
829 |
-
$str = '';
|
830 |
-
$delim = '';
|
831 |
-
for ( $i = 0; $i < count( $this->currencyCode ); $i++ ) {
|
832 |
-
$str .= $delim . $prefix . "currencyCode($i)=" . urlencode( $this->currencyCode[ $i ] );
|
833 |
-
$delim = '&';
|
834 |
-
}
|
835 |
-
|
836 |
-
return $str;
|
837 |
-
}
|
838 |
-
|
839 |
-
}
|
840 |
-
|
841 |
-
|
842 |
-
/**
|
843 |
-
* A list of estimated currency conversions for a base
|
844 |
-
* currency.
|
845 |
-
*/
|
846 |
-
class CurrencyConversionList
|
847 |
-
{
|
848 |
-
|
849 |
-
/**
|
850 |
-
*
|
851 |
-
* @access public
|
852 |
-
* @var CurrencyType
|
853 |
-
*/
|
854 |
-
public $baseAmount;
|
855 |
-
|
856 |
-
/**
|
857 |
-
*
|
858 |
-
* @access public
|
859 |
-
* @var CurrencyList
|
860 |
-
*/
|
861 |
-
public $currencyList;
|
862 |
-
|
863 |
-
|
864 |
-
public function init( $map = null, $prefix = '' )
|
865 |
-
{
|
866 |
-
if ( $map != null ) {
|
867 |
-
if ( PPUtils::array_match_key( $map, $prefix . "baseAmount." ) ) {
|
868 |
-
$newPrefix = $prefix . "baseAmount.";
|
869 |
-
$this->baseAmount = new CurrencyType();
|
870 |
-
$this->baseAmount->init( $map, $newPrefix );
|
871 |
-
}
|
872 |
-
if ( PPUtils::array_match_key( $map, $prefix . "currencyList." ) ) {
|
873 |
-
$newPrefix = $prefix . "currencyList.";
|
874 |
-
$this->currencyList = new CurrencyList();
|
875 |
-
$this->currencyList->init( $map, $newPrefix );
|
876 |
-
}
|
877 |
-
|
878 |
-
}
|
879 |
-
}
|
880 |
-
}
|
881 |
-
|
882 |
-
|
883 |
-
/**
|
884 |
-
* A table that contains a list of estimated currency
|
885 |
-
* conversions for a base currency in each row.
|
886 |
-
*/
|
887 |
-
class CurrencyConversionTable
|
888 |
-
{
|
889 |
-
|
890 |
-
/**
|
891 |
-
*
|
892 |
-
* @array
|
893 |
-
* @access public
|
894 |
-
* @var CurrencyConversionList
|
895 |
-
*/
|
896 |
-
public $currencyConversionList;
|
897 |
-
|
898 |
-
|
899 |
-
public function init( $map = null, $prefix = '' )
|
900 |
-
{
|
901 |
-
if ( $map != null ) {
|
902 |
-
$i = 0;
|
903 |
-
while ( true ) {
|
904 |
-
if ( PPUtils::array_match_key( $map, $prefix . "currencyConversionList($i)" ) ) {
|
905 |
-
$newPrefix = $prefix . "currencyConversionList($i).";
|
906 |
-
$this->currencyConversionList[ $i ] = new CurrencyConversionList();
|
907 |
-
$this->currencyConversionList[ $i ]->init( $map, $newPrefix );
|
908 |
-
} else {
|
909 |
-
break;
|
910 |
-
}
|
911 |
-
$i++;
|
912 |
-
}
|
913 |
-
|
914 |
-
}
|
915 |
-
}
|
916 |
-
}
|
917 |
-
|
918 |
-
|
919 |
-
/**
|
920 |
-
* A list of ISO currencies.
|
921 |
-
*/
|
922 |
-
class CurrencyList
|
923 |
-
{
|
924 |
-
|
925 |
-
/**
|
926 |
-
*
|
927 |
-
* @array
|
928 |
-
* @access public
|
929 |
-
* @var CurrencyType
|
930 |
-
*/
|
931 |
-
public $currency;
|
932 |
-
|
933 |
-
/**
|
934 |
-
* Constructor with arguments
|
935 |
-
*/
|
936 |
-
public function __construct( $currency = null )
|
937 |
-
{
|
938 |
-
$this->currency = $currency;
|
939 |
-
}
|
940 |
-
|
941 |
-
|
942 |
-
public function toNVPString( $prefix = '' )
|
943 |
-
{
|
944 |
-
$str = '';
|
945 |
-
$delim = '';
|
946 |
-
for ( $i = 0; $i < count( $this->currency ); $i++ ) {
|
947 |
-
$newPrefix = $prefix . "currency($i).";
|
948 |
-
$str .= $delim . call_user_func( array( $this->currency[ $i ], 'toNVPString' ), $newPrefix );
|
949 |
-
$delim = '&';
|
950 |
-
}
|
951 |
-
|
952 |
-
return $str;
|
953 |
-
}
|
954 |
-
|
955 |
-
public function init( $map = null, $prefix = '' )
|
956 |
-
{
|
957 |
-
if ( $map != null ) {
|
958 |
-
$i = 0;
|
959 |
-
while ( true ) {
|
960 |
-
if ( PPUtils::array_match_key( $map, $prefix . "currency($i)" ) ) {
|
961 |
-
$newPrefix = $prefix . "currency($i).";
|
962 |
-
$this->currency[ $i ] = new CurrencyType();
|
963 |
-
$this->currency[ $i ]->init( $map, $newPrefix );
|
964 |
-
} else {
|
965 |
-
break;
|
966 |
-
}
|
967 |
-
$i++;
|
968 |
-
}
|
969 |
-
|
970 |
-
}
|
971 |
-
}
|
972 |
-
}
|
973 |
-
|
974 |
-
|
975 |
-
/**
|
976 |
-
* Customizable options that a client application can specify
|
977 |
-
* for display purposes.
|
978 |
-
*/
|
979 |
-
class DisplayOptions
|
980 |
-
{
|
981 |
-
|
982 |
-
/**
|
983 |
-
*
|
984 |
-
* @access public
|
985 |
-
* @var string
|
986 |
-
*/
|
987 |
-
public $emailHeaderImageUrl;
|
988 |
-
|
989 |
-
/**
|
990 |
-
*
|
991 |
-
* @access public
|
992 |
-
* @var string
|
993 |
-
*/
|
994 |
-
public $emailMarketingImageUrl;
|
995 |
-
|
996 |
-
/**
|
997 |
-
*
|
998 |
-
* @access public
|
999 |
-
* @var string
|
1000 |
-
*/
|
1001 |
-
public $headerImageUrl;
|
1002 |
-
|
1003 |
-
/**
|
1004 |
-
*
|
1005 |
-
* @access public
|
1006 |
-
* @var string
|
1007 |
-
*/
|
1008 |
-
public $businessName;
|
1009 |
-
|
1010 |
-
|
1011 |
-
public function toNVPString( $prefix = '' )
|
1012 |
-
{
|
1013 |
-
$str = '';
|
1014 |
-
$delim = '';
|
1015 |
-
if ( $this->emailHeaderImageUrl != null ) {
|
1016 |
-
$str .= $delim . $prefix . 'emailHeaderImageUrl=' . urlencode( $this->emailHeaderImageUrl );
|
1017 |
-
$delim = '&';
|
1018 |
-
}
|
1019 |
-
if ( $this->emailMarketingImageUrl != null ) {
|
1020 |
-
$str .= $delim . $prefix . 'emailMarketingImageUrl=' . urlencode( $this->emailMarketingImageUrl );
|
1021 |
-
$delim = '&';
|
1022 |
-
}
|
1023 |
-
if ( $this->headerImageUrl != null ) {
|
1024 |
-
$str .= $delim . $prefix . 'headerImageUrl=' . urlencode( $this->headerImageUrl );
|
1025 |
-
$delim = '&';
|
1026 |
-
}
|
1027 |
-
if ( $this->businessName != null ) {
|
1028 |
-
$str .= $delim . $prefix . 'businessName=' . urlencode( $this->businessName );
|
1029 |
-
$delim = '&';
|
1030 |
-
}
|
1031 |
-
|
1032 |
-
return $str;
|
1033 |
-
}
|
1034 |
-
|
1035 |
-
public function init( $map = null, $prefix = '' )
|
1036 |
-
{
|
1037 |
-
if ( $map != null ) {
|
1038 |
-
$mapKeyName = $prefix . 'emailHeaderImageUrl';
|
1039 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1040 |
-
$this->emailHeaderImageUrl = $map[ $mapKeyName ];
|
1041 |
-
}
|
1042 |
-
$mapKeyName = $prefix . 'emailMarketingImageUrl';
|
1043 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1044 |
-
$this->emailMarketingImageUrl = $map[ $mapKeyName ];
|
1045 |
-
}
|
1046 |
-
$mapKeyName = $prefix . 'headerImageUrl';
|
1047 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1048 |
-
$this->headerImageUrl = $map[ $mapKeyName ];
|
1049 |
-
}
|
1050 |
-
$mapKeyName = $prefix . 'businessName';
|
1051 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1052 |
-
$this->businessName = $map[ $mapKeyName ];
|
1053 |
-
}
|
1054 |
-
|
1055 |
-
}
|
1056 |
-
}
|
1057 |
-
}
|
1058 |
-
|
1059 |
-
|
1060 |
-
/**
|
1061 |
-
*
|
1062 |
-
*/
|
1063 |
-
class ErrorList
|
1064 |
-
{
|
1065 |
-
|
1066 |
-
/**
|
1067 |
-
*
|
1068 |
-
* @array
|
1069 |
-
* @access public
|
1070 |
-
* @var ErrorData
|
1071 |
-
*/
|
1072 |
-
public $error;
|
1073 |
-
|
1074 |
-
|
1075 |
-
public function init( $map = null, $prefix = '' )
|
1076 |
-
{
|
1077 |
-
if ( $map != null ) {
|
1078 |
-
$i = 0;
|
1079 |
-
while ( true ) {
|
1080 |
-
if ( PPUtils::array_match_key( $map, $prefix . "error($i)" ) ) {
|
1081 |
-
$newPrefix = $prefix . "error($i).";
|
1082 |
-
$this->error[ $i ] = new ErrorData();
|
1083 |
-
$this->error[ $i ]->init( $map, $newPrefix );
|
1084 |
-
} else {
|
1085 |
-
break;
|
1086 |
-
}
|
1087 |
-
$i++;
|
1088 |
-
}
|
1089 |
-
|
1090 |
-
}
|
1091 |
-
}
|
1092 |
-
}
|
1093 |
-
|
1094 |
-
|
1095 |
-
/**
|
1096 |
-
*
|
1097 |
-
*/
|
1098 |
-
class FundingConstraint
|
1099 |
-
{
|
1100 |
-
|
1101 |
-
/**
|
1102 |
-
*
|
1103 |
-
* @access public
|
1104 |
-
* @var FundingTypeList
|
1105 |
-
*/
|
1106 |
-
public $allowedFundingType;
|
1107 |
-
|
1108 |
-
|
1109 |
-
public function toNVPString( $prefix = '' )
|
1110 |
-
{
|
1111 |
-
$str = '';
|
1112 |
-
$delim = '';
|
1113 |
-
if ( $this->allowedFundingType != null ) {
|
1114 |
-
$newPrefix = $prefix . 'allowedFundingType.';
|
1115 |
-
$str .= $delim . call_user_func( array( $this->allowedFundingType, 'toNVPString' ), $newPrefix );
|
1116 |
-
$delim = '&';
|
1117 |
-
}
|
1118 |
-
|
1119 |
-
return $str;
|
1120 |
-
}
|
1121 |
-
|
1122 |
-
public function init( $map = null, $prefix = '' )
|
1123 |
-
{
|
1124 |
-
if ( $map != null ) {
|
1125 |
-
if ( PPUtils::array_match_key( $map, $prefix . "allowedFundingType." ) ) {
|
1126 |
-
$newPrefix = $prefix . "allowedFundingType.";
|
1127 |
-
$this->allowedFundingType = new FundingTypeList();
|
1128 |
-
$this->allowedFundingType->init( $map, $newPrefix );
|
1129 |
-
}
|
1130 |
-
|
1131 |
-
}
|
1132 |
-
}
|
1133 |
-
}
|
1134 |
-
|
1135 |
-
|
1136 |
-
/**
|
1137 |
-
* FundingTypeInfo represents one allowed funding type.
|
1138 |
-
*/
|
1139 |
-
class FundingTypeInfo
|
1140 |
-
{
|
1141 |
-
|
1142 |
-
/**
|
1143 |
-
*
|
1144 |
-
* @access public
|
1145 |
-
* @var string
|
1146 |
-
*/
|
1147 |
-
public $fundingType;
|
1148 |
-
|
1149 |
-
/**
|
1150 |
-
* Constructor with arguments
|
1151 |
-
*/
|
1152 |
-
public function __construct( $fundingType = null )
|
1153 |
-
{
|
1154 |
-
$this->fundingType = $fundingType;
|
1155 |
-
}
|
1156 |
-
|
1157 |
-
|
1158 |
-
public function toNVPString( $prefix = '' )
|
1159 |
-
{
|
1160 |
-
$str = '';
|
1161 |
-
$delim = '';
|
1162 |
-
if ( $this->fundingType != null ) {
|
1163 |
-
$str .= $delim . $prefix . 'fundingType=' . urlencode( $this->fundingType );
|
1164 |
-
$delim = '&';
|
1165 |
-
}
|
1166 |
-
|
1167 |
-
return $str;
|
1168 |
-
}
|
1169 |
-
|
1170 |
-
public function init( $map = null, $prefix = '' )
|
1171 |
-
{
|
1172 |
-
if ( $map != null ) {
|
1173 |
-
$mapKeyName = $prefix . 'fundingType';
|
1174 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1175 |
-
$this->fundingType = $map[ $mapKeyName ];
|
1176 |
-
}
|
1177 |
-
|
1178 |
-
}
|
1179 |
-
}
|
1180 |
-
}
|
1181 |
-
|
1182 |
-
|
1183 |
-
/**
|
1184 |
-
*
|
1185 |
-
*/
|
1186 |
-
class FundingTypeList
|
1187 |
-
{
|
1188 |
-
|
1189 |
-
/**
|
1190 |
-
*
|
1191 |
-
* @array
|
1192 |
-
* @access public
|
1193 |
-
* @var FundingTypeInfo
|
1194 |
-
*/
|
1195 |
-
public $fundingTypeInfo;
|
1196 |
-
|
1197 |
-
/**
|
1198 |
-
* Constructor with arguments
|
1199 |
-
*/
|
1200 |
-
public function __construct( $fundingTypeInfo = null )
|
1201 |
-
{
|
1202 |
-
$this->fundingTypeInfo = $fundingTypeInfo;
|
1203 |
-
}
|
1204 |
-
|
1205 |
-
|
1206 |
-
public function toNVPString( $prefix = '' )
|
1207 |
-
{
|
1208 |
-
$str = '';
|
1209 |
-
$delim = '';
|
1210 |
-
for ( $i = 0; $i < count( $this->fundingTypeInfo ); $i++ ) {
|
1211 |
-
$newPrefix = $prefix . "fundingTypeInfo($i).";
|
1212 |
-
$str .= $delim . call_user_func( array( $this->fundingTypeInfo[ $i ], 'toNVPString' ), $newPrefix );
|
1213 |
-
$delim = '&';
|
1214 |
-
}
|
1215 |
-
|
1216 |
-
return $str;
|
1217 |
-
}
|
1218 |
-
|
1219 |
-
public function init( $map = null, $prefix = '' )
|
1220 |
-
{
|
1221 |
-
if ( $map != null ) {
|
1222 |
-
$i = 0;
|
1223 |
-
while ( true ) {
|
1224 |
-
if ( PPUtils::array_match_key( $map, $prefix . "fundingTypeInfo($i)" ) ) {
|
1225 |
-
$newPrefix = $prefix . "fundingTypeInfo($i).";
|
1226 |
-
$this->fundingTypeInfo[ $i ] = new FundingTypeInfo();
|
1227 |
-
$this->fundingTypeInfo[ $i ]->init( $map, $newPrefix );
|
1228 |
-
} else {
|
1229 |
-
break;
|
1230 |
-
}
|
1231 |
-
$i++;
|
1232 |
-
}
|
1233 |
-
|
1234 |
-
}
|
1235 |
-
}
|
1236 |
-
}
|
1237 |
-
|
1238 |
-
|
1239 |
-
/**
|
1240 |
-
* Describes the conversion between 2 currencies.
|
1241 |
-
*/
|
1242 |
-
class CurrencyConversion
|
1243 |
-
{
|
1244 |
-
|
1245 |
-
/**
|
1246 |
-
*
|
1247 |
-
* @access public
|
1248 |
-
* @var CurrencyType
|
1249 |
-
*/
|
1250 |
-
public $from;
|
1251 |
-
|
1252 |
-
/**
|
1253 |
-
*
|
1254 |
-
* @access public
|
1255 |
-
* @var CurrencyType
|
1256 |
-
*/
|
1257 |
-
public $to;
|
1258 |
-
|
1259 |
-
/**
|
1260 |
-
*
|
1261 |
-
* @access public
|
1262 |
-
* @var double
|
1263 |
-
*/
|
1264 |
-
public $exchangeRate;
|
1265 |
-
|
1266 |
-
|
1267 |
-
public function init( $map = null, $prefix = '' )
|
1268 |
-
{
|
1269 |
-
if ( $map != null ) {
|
1270 |
-
if ( PPUtils::array_match_key( $map, $prefix . "from." ) ) {
|
1271 |
-
$newPrefix = $prefix . "from.";
|
1272 |
-
$this->from = new CurrencyType();
|
1273 |
-
$this->from->init( $map, $newPrefix );
|
1274 |
-
}
|
1275 |
-
if ( PPUtils::array_match_key( $map, $prefix . "to." ) ) {
|
1276 |
-
$newPrefix = $prefix . "to.";
|
1277 |
-
$this->to = new CurrencyType();
|
1278 |
-
$this->to->init( $map, $newPrefix );
|
1279 |
-
}
|
1280 |
-
$mapKeyName = $prefix . 'exchangeRate';
|
1281 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1282 |
-
$this->exchangeRate = $map[ $mapKeyName ];
|
1283 |
-
}
|
1284 |
-
|
1285 |
-
}
|
1286 |
-
}
|
1287 |
-
}
|
1288 |
-
|
1289 |
-
|
1290 |
-
/**
|
1291 |
-
* Funding source information.
|
1292 |
-
*/
|
1293 |
-
class FundingSource
|
1294 |
-
{
|
1295 |
-
|
1296 |
-
/**
|
1297 |
-
*
|
1298 |
-
* @access public
|
1299 |
-
* @var string
|
1300 |
-
*/
|
1301 |
-
public $lastFourOfAccountNumber;
|
1302 |
-
|
1303 |
-
/**
|
1304 |
-
*
|
1305 |
-
* @access public
|
1306 |
-
* @var string
|
1307 |
-
*/
|
1308 |
-
public $type;
|
1309 |
-
|
1310 |
-
/**
|
1311 |
-
*
|
1312 |
-
* @access public
|
1313 |
-
* @var string
|
1314 |
-
*/
|
1315 |
-
public $displayName;
|
1316 |
-
|
1317 |
-
/**
|
1318 |
-
*
|
1319 |
-
* @access public
|
1320 |
-
* @var string
|
1321 |
-
*/
|
1322 |
-
public $fundingSourceId;
|
1323 |
-
|
1324 |
-
/**
|
1325 |
-
*
|
1326 |
-
* @access public
|
1327 |
-
* @var boolean
|
1328 |
-
*/
|
1329 |
-
public $allowed;
|
1330 |
-
|
1331 |
-
|
1332 |
-
public function init( $map = null, $prefix = '' )
|
1333 |
-
{
|
1334 |
-
if ( $map != null ) {
|
1335 |
-
$mapKeyName = $prefix . 'lastFourOfAccountNumber';
|
1336 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1337 |
-
$this->lastFourOfAccountNumber = $map[ $mapKeyName ];
|
1338 |
-
}
|
1339 |
-
$mapKeyName = $prefix . 'type';
|
1340 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1341 |
-
$this->type = $map[ $mapKeyName ];
|
1342 |
-
}
|
1343 |
-
$mapKeyName = $prefix . 'displayName';
|
1344 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1345 |
-
$this->displayName = $map[ $mapKeyName ];
|
1346 |
-
}
|
1347 |
-
$mapKeyName = $prefix . 'fundingSourceId';
|
1348 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1349 |
-
$this->fundingSourceId = $map[ $mapKeyName ];
|
1350 |
-
}
|
1351 |
-
$mapKeyName = $prefix . 'allowed';
|
1352 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1353 |
-
$this->allowed = $map[ $mapKeyName ];
|
1354 |
-
}
|
1355 |
-
|
1356 |
-
}
|
1357 |
-
}
|
1358 |
-
}
|
1359 |
-
|
1360 |
-
|
1361 |
-
/**
|
1362 |
-
* Amount to be charged to a particular funding source.
|
1363 |
-
*/
|
1364 |
-
class FundingPlanCharge
|
1365 |
-
{
|
1366 |
-
|
1367 |
-
/**
|
1368 |
-
*
|
1369 |
-
* @access public
|
1370 |
-
* @var CurrencyType
|
1371 |
-
*/
|
1372 |
-
public $charge;
|
1373 |
-
|
1374 |
-
/**
|
1375 |
-
*
|
1376 |
-
* @access public
|
1377 |
-
* @var FundingSource
|
1378 |
-
*/
|
1379 |
-
public $fundingSource;
|
1380 |
-
|
1381 |
-
|
1382 |
-
public function init( $map = null, $prefix = '' )
|
1383 |
-
{
|
1384 |
-
if ( $map != null ) {
|
1385 |
-
if ( PPUtils::array_match_key( $map, $prefix . "charge." ) ) {
|
1386 |
-
$newPrefix = $prefix . "charge.";
|
1387 |
-
$this->charge = new CurrencyType();
|
1388 |
-
$this->charge->init( $map, $newPrefix );
|
1389 |
-
}
|
1390 |
-
if ( PPUtils::array_match_key( $map, $prefix . "fundingSource." ) ) {
|
1391 |
-
$newPrefix = $prefix . "fundingSource.";
|
1392 |
-
$this->fundingSource = new FundingSource();
|
1393 |
-
$this->fundingSource->init( $map, $newPrefix );
|
1394 |
-
}
|
1395 |
-
|
1396 |
-
}
|
1397 |
-
}
|
1398 |
-
}
|
1399 |
-
|
1400 |
-
|
1401 |
-
/**
|
1402 |
-
* FundingPlan describes the funding sources to be used for a
|
1403 |
-
* specific payment.
|
1404 |
-
*/
|
1405 |
-
class FundingPlan
|
1406 |
-
{
|
1407 |
-
|
1408 |
-
/**
|
1409 |
-
*
|
1410 |
-
* @access public
|
1411 |
-
* @var string
|
1412 |
-
*/
|
1413 |
-
public $fundingPlanId;
|
1414 |
-
|
1415 |
-
/**
|
1416 |
-
*
|
1417 |
-
* @access public
|
1418 |
-
* @var CurrencyType
|
1419 |
-
*/
|
1420 |
-
public $fundingAmount;
|
1421 |
-
|
1422 |
-
/**
|
1423 |
-
*
|
1424 |
-
* @access public
|
1425 |
-
* @var FundingSource
|
1426 |
-
*/
|
1427 |
-
public $backupFundingSource;
|
1428 |
-
|
1429 |
-
/**
|
1430 |
-
*
|
1431 |
-
* @access public
|
1432 |
-
* @var CurrencyType
|
1433 |
-
*/
|
1434 |
-
public $senderFees;
|
1435 |
-
|
1436 |
-
/**
|
1437 |
-
*
|
1438 |
-
* @access public
|
1439 |
-
* @var CurrencyConversion
|
1440 |
-
*/
|
1441 |
-
public $currencyConversion;
|
1442 |
-
|
1443 |
-
/**
|
1444 |
-
*
|
1445 |
-
* @array
|
1446 |
-
* @access public
|
1447 |
-
* @var FundingPlanCharge
|
1448 |
-
*/
|
1449 |
-
public $charge;
|
1450 |
-
|
1451 |
-
|
1452 |
-
public function init( $map = null, $prefix = '' )
|
1453 |
-
{
|
1454 |
-
if ( $map != null ) {
|
1455 |
-
$mapKeyName = $prefix . 'fundingPlanId';
|
1456 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1457 |
-
$this->fundingPlanId = $map[ $mapKeyName ];
|
1458 |
-
}
|
1459 |
-
if ( PPUtils::array_match_key( $map, $prefix . "fundingAmount." ) ) {
|
1460 |
-
$newPrefix = $prefix . "fundingAmount.";
|
1461 |
-
$this->fundingAmount = new CurrencyType();
|
1462 |
-
$this->fundingAmount->init( $map, $newPrefix );
|
1463 |
-
}
|
1464 |
-
if ( PPUtils::array_match_key( $map, $prefix . "backupFundingSource." ) ) {
|
1465 |
-
$newPrefix = $prefix . "backupFundingSource.";
|
1466 |
-
$this->backupFundingSource = new FundingSource();
|
1467 |
-
$this->backupFundingSource->init( $map, $newPrefix );
|
1468 |
-
}
|
1469 |
-
if ( PPUtils::array_match_key( $map, $prefix . "senderFees." ) ) {
|
1470 |
-
$newPrefix = $prefix . "senderFees.";
|
1471 |
-
$this->senderFees = new CurrencyType();
|
1472 |
-
$this->senderFees->init( $map, $newPrefix );
|
1473 |
-
}
|
1474 |
-
if ( PPUtils::array_match_key( $map, $prefix . "currencyConversion." ) ) {
|
1475 |
-
$newPrefix = $prefix . "currencyConversion.";
|
1476 |
-
$this->currencyConversion = new CurrencyConversion();
|
1477 |
-
$this->currencyConversion->init( $map, $newPrefix );
|
1478 |
-
}
|
1479 |
-
$i = 0;
|
1480 |
-
while ( true ) {
|
1481 |
-
if ( PPUtils::array_match_key( $map, $prefix . "charge($i)" ) ) {
|
1482 |
-
$newPrefix = $prefix . "charge($i).";
|
1483 |
-
$this->charge[ $i ] = new FundingPlanCharge();
|
1484 |
-
$this->charge[ $i ]->init( $map, $newPrefix );
|
1485 |
-
} else {
|
1486 |
-
break;
|
1487 |
-
}
|
1488 |
-
$i++;
|
1489 |
-
}
|
1490 |
-
|
1491 |
-
}
|
1492 |
-
}
|
1493 |
-
}
|
1494 |
-
|
1495 |
-
|
1496 |
-
/**
|
1497 |
-
* Details about the party that initiated this payment. The API
|
1498 |
-
* user is making this payment on behalf of the initiator. The
|
1499 |
-
* initiator can simply be an institution or a customer of the
|
1500 |
-
* institution.
|
1501 |
-
*/
|
1502 |
-
class InitiatingEntity
|
1503 |
-
{
|
1504 |
-
|
1505 |
-
/**
|
1506 |
-
*
|
1507 |
-
* @access public
|
1508 |
-
* @var InstitutionCustomer
|
1509 |
-
*/
|
1510 |
-
public $institutionCustomer;
|
1511 |
-
|
1512 |
-
|
1513 |
-
public function toNVPString( $prefix = '' )
|
1514 |
-
{
|
1515 |
-
$str = '';
|
1516 |
-
$delim = '';
|
1517 |
-
if ( $this->institutionCustomer != null ) {
|
1518 |
-
$newPrefix = $prefix . 'institutionCustomer.';
|
1519 |
-
$str .= $delim . call_user_func( array( $this->institutionCustomer, 'toNVPString' ), $newPrefix );
|
1520 |
-
$delim = '&';
|
1521 |
-
}
|
1522 |
-
|
1523 |
-
return $str;
|
1524 |
-
}
|
1525 |
-
|
1526 |
-
public function init( $map = null, $prefix = '' )
|
1527 |
-
{
|
1528 |
-
if ( $map != null ) {
|
1529 |
-
if ( PPUtils::array_match_key( $map, $prefix . "institutionCustomer." ) ) {
|
1530 |
-
$newPrefix = $prefix . "institutionCustomer.";
|
1531 |
-
$this->institutionCustomer = new InstitutionCustomer();
|
1532 |
-
$this->institutionCustomer->init( $map, $newPrefix );
|
1533 |
-
}
|
1534 |
-
|
1535 |
-
}
|
1536 |
-
}
|
1537 |
-
}
|
1538 |
-
|
1539 |
-
|
1540 |
-
/**
|
1541 |
-
* The customer of the initiating institution
|
1542 |
-
*/
|
1543 |
-
class InstitutionCustomer
|
1544 |
-
{
|
1545 |
-
|
1546 |
-
/**
|
1547 |
-
* The unique identifier as assigned to the institution.
|
1548 |
-
* @access public
|
1549 |
-
* @var string
|
1550 |
-
*/
|
1551 |
-
public $institutionId;
|
1552 |
-
|
1553 |
-
/**
|
1554 |
-
* The first (given) name of the end consumer as known by the
|
1555 |
-
* institution.
|
1556 |
-
* @access public
|
1557 |
-
* @var string
|
1558 |
-
*/
|
1559 |
-
public $firstName;
|
1560 |
-
|
1561 |
-
/**
|
1562 |
-
* The last (family) name of the end consumer as known by the
|
1563 |
-
* institution.
|
1564 |
-
* @access public
|
1565 |
-
* @var string
|
1566 |
-
*/
|
1567 |
-
public $lastName;
|
1568 |
-
|
1569 |
-
/**
|
1570 |
-
* The full name of the end consumer as known by the
|
1571 |
-
* institution.
|
1572 |
-
* @access public
|
1573 |
-
* @var string
|
1574 |
-
*/
|
1575 |
-
public $displayName;
|
1576 |
-
|
1577 |
-
/**
|
1578 |
-
* The unique identifier as assigned to the end consumer by the
|
1579 |
-
* institution.
|
1580 |
-
* @access public
|
1581 |
-
* @var string
|
1582 |
-
*/
|
1583 |
-
public $institutionCustomerId;
|
1584 |
-
|
1585 |
-
/**
|
1586 |
-
* The two-character ISO country code of the home country of
|
1587 |
-
* the end consumer
|
1588 |
-
* @access public
|
1589 |
-
* @var string
|
1590 |
-
*/
|
1591 |
-
public $countryCode;
|
1592 |
-
|
1593 |
-
/**
|
1594 |
-
*
|
1595 |
-
* @access public
|
1596 |
-
* @var string
|
1597 |
-
*/
|
1598 |
-
public $email;
|
1599 |
-
|
1600 |
-
/**
|
1601 |
-
* Constructor with arguments
|
1602 |
-
*/
|
1603 |
-
public function __construct( $institutionId = null, $firstName = null, $lastName = null, $displayName = null, $institutionCustomerId = null, $countryCode = null )
|
1604 |
-
{
|
1605 |
-
$this->institutionId = $institutionId;
|
1606 |
-
$this->firstName = $firstName;
|
1607 |
-
$this->lastName = $lastName;
|
1608 |
-
$this->displayName = $displayName;
|
1609 |
-
$this->institutionCustomerId = $institutionCustomerId;
|
1610 |
-
$this->countryCode = $countryCode;
|
1611 |
-
}
|
1612 |
-
|
1613 |
-
|
1614 |
-
public function toNVPString( $prefix = '' )
|
1615 |
-
{
|
1616 |
-
$str = '';
|
1617 |
-
$delim = '';
|
1618 |
-
if ( $this->institutionId != null ) {
|
1619 |
-
$str .= $delim . $prefix . 'institutionId=' . urlencode( $this->institutionId );
|
1620 |
-
$delim = '&';
|
1621 |
-
}
|
1622 |
-
if ( $this->firstName != null ) {
|
1623 |
-
$str .= $delim . $prefix . 'firstName=' . urlencode( $this->firstName );
|
1624 |
-
$delim = '&';
|
1625 |
-
}
|
1626 |
-
if ( $this->lastName != null ) {
|
1627 |
-
$str .= $delim . $prefix . 'lastName=' . urlencode( $this->lastName );
|
1628 |
-
$delim = '&';
|
1629 |
-
}
|
1630 |
-
if ( $this->displayName != null ) {
|
1631 |
-
$str .= $delim . $prefix . 'displayName=' . urlencode( $this->displayName );
|
1632 |
-
$delim = '&';
|
1633 |
-
}
|
1634 |
-
if ( $this->institutionCustomerId != null ) {
|
1635 |
-
$str .= $delim . $prefix . 'institutionCustomerId=' . urlencode( $this->institutionCustomerId );
|
1636 |
-
$delim = '&';
|
1637 |
-
}
|
1638 |
-
if ( $this->countryCode != null ) {
|
1639 |
-
$str .= $delim . $prefix . 'countryCode=' . urlencode( $this->countryCode );
|
1640 |
-
$delim = '&';
|
1641 |
-
}
|
1642 |
-
if ( $this->email != null ) {
|
1643 |
-
$str .= $delim . $prefix . 'email=' . urlencode( $this->email );
|
1644 |
-
$delim = '&';
|
1645 |
-
}
|
1646 |
-
|
1647 |
-
return $str;
|
1648 |
-
}
|
1649 |
-
|
1650 |
-
public function init( $map = null, $prefix = '' )
|
1651 |
-
{
|
1652 |
-
if ( $map != null ) {
|
1653 |
-
$mapKeyName = $prefix . 'institutionId';
|
1654 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1655 |
-
$this->institutionId = $map[ $mapKeyName ];
|
1656 |
-
}
|
1657 |
-
$mapKeyName = $prefix . 'firstName';
|
1658 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1659 |
-
$this->firstName = $map[ $mapKeyName ];
|
1660 |
-
}
|
1661 |
-
$mapKeyName = $prefix . 'lastName';
|
1662 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1663 |
-
$this->lastName = $map[ $mapKeyName ];
|
1664 |
-
}
|
1665 |
-
$mapKeyName = $prefix . 'displayName';
|
1666 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1667 |
-
$this->displayName = $map[ $mapKeyName ];
|
1668 |
-
}
|
1669 |
-
$mapKeyName = $prefix . 'institutionCustomerId';
|
1670 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1671 |
-
$this->institutionCustomerId = $map[ $mapKeyName ];
|
1672 |
-
}
|
1673 |
-
$mapKeyName = $prefix . 'countryCode';
|
1674 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1675 |
-
$this->countryCode = $map[ $mapKeyName ];
|
1676 |
-
}
|
1677 |
-
$mapKeyName = $prefix . 'email';
|
1678 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1679 |
-
$this->email = $map[ $mapKeyName ];
|
1680 |
-
}
|
1681 |
-
|
1682 |
-
}
|
1683 |
-
}
|
1684 |
-
}
|
1685 |
-
|
1686 |
-
|
1687 |
-
/**
|
1688 |
-
* Describes an individual item for an invoice.
|
1689 |
-
*/
|
1690 |
-
class InvoiceItem
|
1691 |
-
{
|
1692 |
-
|
1693 |
-
/**
|
1694 |
-
*
|
1695 |
-
* @access public
|
1696 |
-
* @var string
|
1697 |
-
*/
|
1698 |
-
public $name;
|
1699 |
-
|
1700 |
-
/**
|
1701 |
-
*
|
1702 |
-
* @access public
|
1703 |
-
* @var string
|
1704 |
-
*/
|
1705 |
-
public $identifier;
|
1706 |
-
|
1707 |
-
/**
|
1708 |
-
*
|
1709 |
-
* @access public
|
1710 |
-
* @var double
|
1711 |
-
*/
|
1712 |
-
public $price;
|
1713 |
-
|
1714 |
-
/**
|
1715 |
-
*
|
1716 |
-
* @access public
|
1717 |
-
* @var double
|
1718 |
-
*/
|
1719 |
-
public $itemPrice;
|
1720 |
-
|
1721 |
-
/**
|
1722 |
-
*
|
1723 |
-
* @access public
|
1724 |
-
* @var integer
|
1725 |
-
*/
|
1726 |
-
public $itemCount;
|
1727 |
-
|
1728 |
-
|
1729 |
-
public function toNVPString( $prefix = '' )
|
1730 |
-
{
|
1731 |
-
$str = '';
|
1732 |
-
$delim = '';
|
1733 |
-
if ( $this->name != null ) {
|
1734 |
-
$str .= $delim . $prefix . 'name=' . urlencode( $this->name );
|
1735 |
-
$delim = '&';
|
1736 |
-
}
|
1737 |
-
if ( $this->identifier != null ) {
|
1738 |
-
$str .= $delim . $prefix . 'identifier=' . urlencode( $this->identifier );
|
1739 |
-
$delim = '&';
|
1740 |
-
}
|
1741 |
-
if ( $this->price != null ) {
|
1742 |
-
$str .= $delim . $prefix . 'price=' . urlencode( $this->price );
|
1743 |
-
$delim = '&';
|
1744 |
-
}
|
1745 |
-
if ( $this->itemPrice != null ) {
|
1746 |
-
$str .= $delim . $prefix . 'itemPrice=' . urlencode( $this->itemPrice );
|
1747 |
-
$delim = '&';
|
1748 |
-
}
|
1749 |
-
if ( $this->itemCount != null ) {
|
1750 |
-
$str .= $delim . $prefix . 'itemCount=' . urlencode( $this->itemCount );
|
1751 |
-
$delim = '&';
|
1752 |
-
}
|
1753 |
-
|
1754 |
-
return $str;
|
1755 |
-
}
|
1756 |
-
|
1757 |
-
public function init( $map = null, $prefix = '' )
|
1758 |
-
{
|
1759 |
-
if ( $map != null ) {
|
1760 |
-
$mapKeyName = $prefix . 'name';
|
1761 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1762 |
-
$this->name = $map[ $mapKeyName ];
|
1763 |
-
}
|
1764 |
-
$mapKeyName = $prefix . 'identifier';
|
1765 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1766 |
-
$this->identifier = $map[ $mapKeyName ];
|
1767 |
-
}
|
1768 |
-
$mapKeyName = $prefix . 'price';
|
1769 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1770 |
-
$this->price = $map[ $mapKeyName ];
|
1771 |
-
}
|
1772 |
-
$mapKeyName = $prefix . 'itemPrice';
|
1773 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1774 |
-
$this->itemPrice = $map[ $mapKeyName ];
|
1775 |
-
}
|
1776 |
-
$mapKeyName = $prefix . 'itemCount';
|
1777 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1778 |
-
$this->itemCount = $map[ $mapKeyName ];
|
1779 |
-
}
|
1780 |
-
|
1781 |
-
}
|
1782 |
-
}
|
1783 |
-
}
|
1784 |
-
|
1785 |
-
|
1786 |
-
/**
|
1787 |
-
* Describes a payment for a particular receiver (merchant),
|
1788 |
-
* contains list of additional per item details.
|
1789 |
-
*/
|
1790 |
-
class InvoiceData
|
1791 |
-
{
|
1792 |
-
|
1793 |
-
/**
|
1794 |
-
*
|
1795 |
-
* @array
|
1796 |
-
* @access public
|
1797 |
-
* @var InvoiceItem
|
1798 |
-
*/
|
1799 |
-
public $item;
|
1800 |
-
|
1801 |
-
/**
|
1802 |
-
*
|
1803 |
-
* @access public
|
1804 |
-
* @var double
|
1805 |
-
*/
|
1806 |
-
public $totalTax;
|
1807 |
-
|
1808 |
-
/**
|
1809 |
-
*
|
1810 |
-
* @access public
|
1811 |
-
* @var double
|
1812 |
-
*/
|
1813 |
-
public $totalShipping;
|
1814 |
-
|
1815 |
-
|
1816 |
-
public function toNVPString( $prefix = '' )
|
1817 |
-
{
|
1818 |
-
$str = '';
|
1819 |
-
$delim = '';
|
1820 |
-
for ( $i = 0; $i < count( $this->item ); $i++ ) {
|
1821 |
-
$newPrefix = $prefix . "item($i).";
|
1822 |
-
$str .= $delim . call_user_func( array( $this->item[ $i ], 'toNVPString' ), $newPrefix );
|
1823 |
-
$delim = '&';
|
1824 |
-
}
|
1825 |
-
if ( $this->totalTax != null ) {
|
1826 |
-
$str .= $delim . $prefix . 'totalTax=' . urlencode( $this->totalTax );
|
1827 |
-
$delim = '&';
|
1828 |
-
}
|
1829 |
-
if ( $this->totalShipping != null ) {
|
1830 |
-
$str .= $delim . $prefix . 'totalShipping=' . urlencode( $this->totalShipping );
|
1831 |
-
$delim = '&';
|
1832 |
-
}
|
1833 |
-
|
1834 |
-
return $str;
|
1835 |
-
}
|
1836 |
-
|
1837 |
-
public function init( $map = null, $prefix = '' )
|
1838 |
-
{
|
1839 |
-
if ( $map != null ) {
|
1840 |
-
$i = 0;
|
1841 |
-
while ( true ) {
|
1842 |
-
if ( PPUtils::array_match_key( $map, $prefix . "item($i)" ) ) {
|
1843 |
-
$newPrefix = $prefix . "item($i).";
|
1844 |
-
$this->item[ $i ] = new InvoiceItem();
|
1845 |
-
$this->item[ $i ]->init( $map, $newPrefix );
|
1846 |
-
} else {
|
1847 |
-
break;
|
1848 |
-
}
|
1849 |
-
$i++;
|
1850 |
-
}
|
1851 |
-
$mapKeyName = $prefix . 'totalTax';
|
1852 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1853 |
-
$this->totalTax = $map[ $mapKeyName ];
|
1854 |
-
}
|
1855 |
-
$mapKeyName = $prefix . 'totalShipping';
|
1856 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
1857 |
-
$this->totalShipping = $map[ $mapKeyName ];
|
1858 |
-
}
|
1859 |
-
|
1860 |
-
}
|
1861 |
-
}
|
1862 |
-
}
|
1863 |
-
|
1864 |
-
|
1865 |
-
/**
|
1866 |
-
* The error that resulted from an attempt to make a payment to
|
1867 |
-
* a receiver.
|
1868 |
-
*/
|
1869 |
-
class PayError
|
1870 |
-
{
|
1871 |
-
|
1872 |
-
/**
|
1873 |
-
*
|
1874 |
-
* @access public
|
1875 |
-
* @var Receiver
|
1876 |
-
*/
|
1877 |
-
public $receiver;
|
1878 |
-
|
1879 |
-
/**
|
1880 |
-
*
|
1881 |
-
* @access public
|
1882 |
-
* @var ErrorData
|
1883 |
-
*/
|
1884 |
-
public $error;
|
1885 |
-
|
1886 |
-
|
1887 |
-
public function init( $map = null, $prefix = '' )
|
1888 |
-
{
|
1889 |
-
if ( $map != null ) {
|
1890 |
-
if ( PPUtils::array_match_key( $map, $prefix . "receiver." ) ) {
|
1891 |
-
$newPrefix = $prefix . "receiver.";
|
1892 |
-
$this->receiver = new Receiver();
|
1893 |
-
$this->receiver->init( $map, $newPrefix );
|
1894 |
-
}
|
1895 |
-
if ( PPUtils::array_match_key( $map, $prefix . "error." ) ) {
|
1896 |
-
$newPrefix = $prefix . "error.";
|
1897 |
-
$this->error = new ErrorData();
|
1898 |
-
$this->error->init( $map, $newPrefix );
|
1899 |
-
}
|
1900 |
-
|
1901 |
-
}
|
1902 |
-
}
|
1903 |
-
}
|
1904 |
-
|
1905 |
-
|
1906 |
-
/**
|
1907 |
-
*
|
1908 |
-
*/
|
1909 |
-
class PayErrorList
|
1910 |
-
{
|
1911 |
-
|
1912 |
-
/**
|
1913 |
-
*
|
1914 |
-
* @array
|
1915 |
-
* @access public
|
1916 |
-
* @var PayError
|
1917 |
-
*/
|
1918 |
-
public $payError;
|
1919 |
-
|
1920 |
-
|
1921 |
-
public function init( $map = null, $prefix = '' )
|
1922 |
-
{
|
1923 |
-
if ( $map != null ) {
|
1924 |
-
$i = 0;
|
1925 |
-
while ( true ) {
|
1926 |
-
if ( PPUtils::array_match_key( $map, $prefix . "payError($i)" ) ) {
|
1927 |
-
$newPrefix = $prefix . "payError($i).";
|
1928 |
-
$this->payError[ $i ] = new PayError();
|
1929 |
-
$this->payError[ $i ]->init( $map, $newPrefix );
|
1930 |
-
} else {
|
1931 |
-
break;
|
1932 |
-
}
|
1933 |
-
$i++;
|
1934 |
-
}
|
1935 |
-
|
1936 |
-
}
|
1937 |
-
}
|
1938 |
-
}
|
1939 |
-
|
1940 |
-
|
1941 |
-
/**
|
1942 |
-
* PaymentInfo represents the payment attempt made to a
|
1943 |
-
* Receiver of a PayRequest. If the execution of the payment
|
1944 |
-
* has not yet completed, there will not be any transaction
|
1945 |
-
* details.
|
1946 |
-
*/
|
1947 |
-
class PaymentInfo
|
1948 |
-
{
|
1949 |
-
|
1950 |
-
/**
|
1951 |
-
*
|
1952 |
-
* @access public
|
1953 |
-
* @var string
|
1954 |
-
*/
|
1955 |
-
public $transactionId;
|
1956 |
-
|
1957 |
-
/**
|
1958 |
-
*
|
1959 |
-
* @access public
|
1960 |
-
* @var string
|
1961 |
-
*/
|
1962 |
-
public $transactionStatus;
|
1963 |
-
|
1964 |
-
/**
|
1965 |
-
*
|
1966 |
-
* @access public
|
1967 |
-
* @var Receiver
|
1968 |
-
*/
|
1969 |
-
public $receiver;
|
1970 |
-
|
1971 |
-
/**
|
1972 |
-
*
|
1973 |
-
* @access public
|
1974 |
-
* @var double
|
1975 |
-
*/
|
1976 |
-
public $refundedAmount;
|
1977 |
-
|
1978 |
-
/**
|
1979 |
-
*
|
1980 |
-
* @access public
|
1981 |
-
* @var boolean
|
1982 |
-
*/
|
1983 |
-
public $pendingRefund;
|
1984 |
-
|
1985 |
-
/**
|
1986 |
-
*
|
1987 |
-
* @access public
|
1988 |
-
* @var string
|
1989 |
-
*/
|
1990 |
-
public $senderTransactionId;
|
1991 |
-
|
1992 |
-
/**
|
1993 |
-
*
|
1994 |
-
* @access public
|
1995 |
-
* @var string
|
1996 |
-
*/
|
1997 |
-
public $senderTransactionStatus;
|
1998 |
-
|
1999 |
-
/**
|
2000 |
-
*
|
2001 |
-
* @access public
|
2002 |
-
* @var string
|
2003 |
-
*/
|
2004 |
-
public $pendingReason;
|
2005 |
-
|
2006 |
-
|
2007 |
-
public function init( $map = null, $prefix = '' )
|
2008 |
-
{
|
2009 |
-
if ( $map != null ) {
|
2010 |
-
$mapKeyName = $prefix . 'transactionId';
|
2011 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2012 |
-
$this->transactionId = $map[ $mapKeyName ];
|
2013 |
-
}
|
2014 |
-
$mapKeyName = $prefix . 'transactionStatus';
|
2015 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2016 |
-
$this->transactionStatus = $map[ $mapKeyName ];
|
2017 |
-
}
|
2018 |
-
if ( PPUtils::array_match_key( $map, $prefix . "receiver." ) ) {
|
2019 |
-
$newPrefix = $prefix . "receiver.";
|
2020 |
-
$this->receiver = new Receiver();
|
2021 |
-
$this->receiver->init( $map, $newPrefix );
|
2022 |
-
}
|
2023 |
-
$mapKeyName = $prefix . 'refundedAmount';
|
2024 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2025 |
-
$this->refundedAmount = $map[ $mapKeyName ];
|
2026 |
-
}
|
2027 |
-
$mapKeyName = $prefix . 'pendingRefund';
|
2028 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2029 |
-
$this->pendingRefund = $map[ $mapKeyName ];
|
2030 |
-
}
|
2031 |
-
$mapKeyName = $prefix . 'senderTransactionId';
|
2032 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2033 |
-
$this->senderTransactionId = $map[ $mapKeyName ];
|
2034 |
-
}
|
2035 |
-
$mapKeyName = $prefix . 'senderTransactionStatus';
|
2036 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2037 |
-
$this->senderTransactionStatus = $map[ $mapKeyName ];
|
2038 |
-
}
|
2039 |
-
$mapKeyName = $prefix . 'pendingReason';
|
2040 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2041 |
-
$this->pendingReason = $map[ $mapKeyName ];
|
2042 |
-
}
|
2043 |
-
|
2044 |
-
}
|
2045 |
-
}
|
2046 |
-
}
|
2047 |
-
|
2048 |
-
|
2049 |
-
/**
|
2050 |
-
*
|
2051 |
-
*/
|
2052 |
-
class PaymentInfoList
|
2053 |
-
{
|
2054 |
-
|
2055 |
-
/**
|
2056 |
-
*
|
2057 |
-
* @array
|
2058 |
-
* @access public
|
2059 |
-
* @var PaymentInfo
|
2060 |
-
*/
|
2061 |
-
public $paymentInfo;
|
2062 |
-
|
2063 |
-
|
2064 |
-
public function init( $map = null, $prefix = '' )
|
2065 |
-
{
|
2066 |
-
if ( $map != null ) {
|
2067 |
-
$i = 0;
|
2068 |
-
while ( true ) {
|
2069 |
-
if ( PPUtils::array_match_key( $map, $prefix . "paymentInfo($i)" ) ) {
|
2070 |
-
$newPrefix = $prefix . "paymentInfo($i).";
|
2071 |
-
$this->paymentInfo[ $i ] = new PaymentInfo();
|
2072 |
-
$this->paymentInfo[ $i ]->init( $map, $newPrefix );
|
2073 |
-
} else {
|
2074 |
-
break;
|
2075 |
-
}
|
2076 |
-
$i++;
|
2077 |
-
}
|
2078 |
-
|
2079 |
-
}
|
2080 |
-
}
|
2081 |
-
}
|
2082 |
-
|
2083 |
-
|
2084 |
-
/**
|
2085 |
-
* Receiver is the party where funds are transferred to. A
|
2086 |
-
* primary receiver receives a payment directly from the sender
|
2087 |
-
* in a chained split payment. A primary receiver should not be
|
2088 |
-
* specified when making a single or parallel split payment.
|
2089 |
-
*/
|
2090 |
-
class Receiver
|
2091 |
-
{
|
2092 |
-
|
2093 |
-
/**
|
2094 |
-
*
|
2095 |
-
* @access public
|
2096 |
-
* @var double
|
2097 |
-
*/
|
2098 |
-
public $amount;
|
2099 |
-
|
2100 |
-
/**
|
2101 |
-
*
|
2102 |
-
* @access public
|
2103 |
-
* @var string
|
2104 |
-
*/
|
2105 |
-
public $email;
|
2106 |
-
|
2107 |
-
/**
|
2108 |
-
*
|
2109 |
-
* @access public
|
2110 |
-
* @var PhoneNumberType
|
2111 |
-
*/
|
2112 |
-
public $phone;
|
2113 |
-
|
2114 |
-
/**
|
2115 |
-
*
|
2116 |
-
* @access public
|
2117 |
-
* @var boolean
|
2118 |
-
*/
|
2119 |
-
public $primary;
|
2120 |
-
|
2121 |
-
/**
|
2122 |
-
*
|
2123 |
-
* @access public
|
2124 |
-
* @var string
|
2125 |
-
*/
|
2126 |
-
public $invoiceId;
|
2127 |
-
|
2128 |
-
/**
|
2129 |
-
*
|
2130 |
-
* @access public
|
2131 |
-
* @var string
|
2132 |
-
*/
|
2133 |
-
public $paymentType;
|
2134 |
-
|
2135 |
-
/**
|
2136 |
-
*
|
2137 |
-
* @access public
|
2138 |
-
* @var string
|
2139 |
-
*/
|
2140 |
-
public $paymentSubType;
|
2141 |
-
|
2142 |
-
/**
|
2143 |
-
* Constructor with arguments
|
2144 |
-
*/
|
2145 |
-
public function __construct( $amount = null )
|
2146 |
-
{
|
2147 |
-
$this->amount = $amount;
|
2148 |
-
}
|
2149 |
-
|
2150 |
-
|
2151 |
-
public function toNVPString( $prefix = '' )
|
2152 |
-
{
|
2153 |
-
$str = '';
|
2154 |
-
$delim = '';
|
2155 |
-
if ( $this->amount != null ) {
|
2156 |
-
$str .= $delim . $prefix . 'amount=' . urlencode( $this->amount );
|
2157 |
-
$delim = '&';
|
2158 |
-
}
|
2159 |
-
if ( $this->email != null ) {
|
2160 |
-
$str .= $delim . $prefix . 'email=' . urlencode( $this->email );
|
2161 |
-
$delim = '&';
|
2162 |
-
}
|
2163 |
-
if ( $this->phone != null ) {
|
2164 |
-
$newPrefix = $prefix . 'phone.';
|
2165 |
-
$str .= $delim . call_user_func( array( $this->phone, 'toNVPString' ), $newPrefix );
|
2166 |
-
$delim = '&';
|
2167 |
-
}
|
2168 |
-
if ( $this->primary != null ) {
|
2169 |
-
$str .= $delim . $prefix . 'primary=' . urlencode( $this->primary );
|
2170 |
-
$delim = '&';
|
2171 |
-
}
|
2172 |
-
if ( $this->invoiceId != null ) {
|
2173 |
-
$str .= $delim . $prefix . 'invoiceId=' . urlencode( $this->invoiceId );
|
2174 |
-
$delim = '&';
|
2175 |
-
}
|
2176 |
-
if ( $this->paymentType != null ) {
|
2177 |
-
$str .= $delim . $prefix . 'paymentType=' . urlencode( $this->paymentType );
|
2178 |
-
$delim = '&';
|
2179 |
-
}
|
2180 |
-
if ( $this->paymentSubType != null ) {
|
2181 |
-
$str .= $delim . $prefix . 'paymentSubType=' . urlencode( $this->paymentSubType );
|
2182 |
-
$delim = '&';
|
2183 |
-
}
|
2184 |
-
|
2185 |
-
return $str;
|
2186 |
-
}
|
2187 |
-
|
2188 |
-
public function init( $map = null, $prefix = '' )
|
2189 |
-
{
|
2190 |
-
if ( $map != null ) {
|
2191 |
-
$mapKeyName = $prefix . 'amount';
|
2192 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2193 |
-
$this->amount = $map[ $mapKeyName ];
|
2194 |
-
}
|
2195 |
-
$mapKeyName = $prefix . 'email';
|
2196 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2197 |
-
$this->email = $map[ $mapKeyName ];
|
2198 |
-
}
|
2199 |
-
if ( PPUtils::array_match_key( $map, $prefix . "phone." ) ) {
|
2200 |
-
$newPrefix = $prefix . "phone.";
|
2201 |
-
$this->phone = new PhoneNumberType();
|
2202 |
-
$this->phone->init( $map, $newPrefix );
|
2203 |
-
}
|
2204 |
-
$mapKeyName = $prefix . 'primary';
|
2205 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2206 |
-
$this->primary = $map[ $mapKeyName ];
|
2207 |
-
}
|
2208 |
-
$mapKeyName = $prefix . 'invoiceId';
|
2209 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2210 |
-
$this->invoiceId = $map[ $mapKeyName ];
|
2211 |
-
}
|
2212 |
-
$mapKeyName = $prefix . 'paymentType';
|
2213 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2214 |
-
$this->paymentType = $map[ $mapKeyName ];
|
2215 |
-
}
|
2216 |
-
$mapKeyName = $prefix . 'paymentSubType';
|
2217 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2218 |
-
$this->paymentSubType = $map[ $mapKeyName ];
|
2219 |
-
}
|
2220 |
-
|
2221 |
-
}
|
2222 |
-
}
|
2223 |
-
}
|
2224 |
-
|
2225 |
-
|
2226 |
-
/**
|
2227 |
-
*
|
2228 |
-
*/
|
2229 |
-
class ReceiverList
|
2230 |
-
{
|
2231 |
-
|
2232 |
-
/**
|
2233 |
-
*
|
2234 |
-
* @array
|
2235 |
-
* @access public
|
2236 |
-
* @var Receiver
|
2237 |
-
*/
|
2238 |
-
public $receiver;
|
2239 |
-
|
2240 |
-
/**
|
2241 |
-
* Constructor with arguments
|
2242 |
-
*/
|
2243 |
-
public function __construct( $receiver = null )
|
2244 |
-
{
|
2245 |
-
$this->receiver = $receiver;
|
2246 |
-
}
|
2247 |
-
|
2248 |
-
|
2249 |
-
public function toNVPString( $prefix = '' )
|
2250 |
-
{
|
2251 |
-
$str = '';
|
2252 |
-
$delim = '';
|
2253 |
-
for ( $i = 0; $i < count( $this->receiver ); $i++ ) {
|
2254 |
-
$newPrefix = $prefix . "receiver($i).";
|
2255 |
-
$str .= $delim . call_user_func( array( $this->receiver[ $i ], 'toNVPString' ), $newPrefix );
|
2256 |
-
$delim = '&';
|
2257 |
-
}
|
2258 |
-
|
2259 |
-
return $str;
|
2260 |
-
}
|
2261 |
-
|
2262 |
-
}
|
2263 |
-
|
2264 |
-
|
2265 |
-
/**
|
2266 |
-
* The sender identifier type contains information to identify
|
2267 |
-
* a PayPal account.
|
2268 |
-
*/
|
2269 |
-
class ReceiverIdentifier extends AccountIdentifier
|
2270 |
-
{
|
2271 |
-
|
2272 |
-
|
2273 |
-
public function toNVPString( $prefix = '' )
|
2274 |
-
{
|
2275 |
-
$str = parent::toNVPString( $prefix );
|
2276 |
-
if ( strlen( $str ) > 0 ) {
|
2277 |
-
$delim = '&';
|
2278 |
-
} else {
|
2279 |
-
$delim = '';
|
2280 |
-
}
|
2281 |
-
|
2282 |
-
return $str;
|
2283 |
-
}
|
2284 |
-
|
2285 |
-
public function init( $map = null, $prefix = '' )
|
2286 |
-
{
|
2287 |
-
if ( $map != null ) {
|
2288 |
-
|
2289 |
-
}
|
2290 |
-
}
|
2291 |
-
}
|
2292 |
-
|
2293 |
-
|
2294 |
-
/**
|
2295 |
-
* Options that apply to the receiver of a payment, allows
|
2296 |
-
* setting additional details for payment using invoice.
|
2297 |
-
*/
|
2298 |
-
class ReceiverOptions
|
2299 |
-
{
|
2300 |
-
|
2301 |
-
/**
|
2302 |
-
*
|
2303 |
-
* @access public
|
2304 |
-
* @var string
|
2305 |
-
*/
|
2306 |
-
public $description;
|
2307 |
-
|
2308 |
-
/**
|
2309 |
-
*
|
2310 |
-
* @access public
|
2311 |
-
* @var string
|
2312 |
-
*/
|
2313 |
-
public $customId;
|
2314 |
-
|
2315 |
-
/**
|
2316 |
-
*
|
2317 |
-
* @access public
|
2318 |
-
* @var InvoiceData
|
2319 |
-
*/
|
2320 |
-
public $invoiceData;
|
2321 |
-
|
2322 |
-
/**
|
2323 |
-
*
|
2324 |
-
* @access public
|
2325 |
-
* @var ReceiverIdentifier
|
2326 |
-
*/
|
2327 |
-
public $receiver;
|
2328 |
-
|
2329 |
-
/**
|
2330 |
-
*
|
2331 |
-
* @access public
|
2332 |
-
* @var string
|
2333 |
-
*/
|
2334 |
-
public $referrerCode;
|
2335 |
-
|
2336 |
-
/**
|
2337 |
-
* Constructor with arguments
|
2338 |
-
*/
|
2339 |
-
public function __construct( $receiver = null )
|
2340 |
-
{
|
2341 |
-
$this->receiver = $receiver;
|
2342 |
-
}
|
2343 |
-
|
2344 |
-
|
2345 |
-
public function toNVPString( $prefix = '' )
|
2346 |
-
{
|
2347 |
-
$str = '';
|
2348 |
-
$delim = '';
|
2349 |
-
if ( $this->description != null ) {
|
2350 |
-
$str .= $delim . $prefix . 'description=' . urlencode( $this->description );
|
2351 |
-
$delim = '&';
|
2352 |
-
}
|
2353 |
-
if ( $this->customId != null ) {
|
2354 |
-
$str .= $delim . $prefix . 'customId=' . urlencode( $this->customId );
|
2355 |
-
$delim = '&';
|
2356 |
-
}
|
2357 |
-
if ( $this->invoiceData != null ) {
|
2358 |
-
$newPrefix = $prefix . 'invoiceData.';
|
2359 |
-
$str .= $delim . call_user_func( array( $this->invoiceData, 'toNVPString' ), $newPrefix );
|
2360 |
-
$delim = '&';
|
2361 |
-
}
|
2362 |
-
if ( $this->receiver != null ) {
|
2363 |
-
$newPrefix = $prefix . 'receiver.';
|
2364 |
-
$str .= $delim . call_user_func( array( $this->receiver, 'toNVPString' ), $newPrefix );
|
2365 |
-
$delim = '&';
|
2366 |
-
}
|
2367 |
-
if ( $this->referrerCode != null ) {
|
2368 |
-
$str .= $delim . $prefix . 'referrerCode=' . urlencode( $this->referrerCode );
|
2369 |
-
$delim = '&';
|
2370 |
-
}
|
2371 |
-
|
2372 |
-
return $str;
|
2373 |
-
}
|
2374 |
-
|
2375 |
-
public function init( $map = null, $prefix = '' )
|
2376 |
-
{
|
2377 |
-
if ( $map != null ) {
|
2378 |
-
$mapKeyName = $prefix . 'description';
|
2379 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2380 |
-
$this->description = $map[ $mapKeyName ];
|
2381 |
-
}
|
2382 |
-
$mapKeyName = $prefix . 'customId';
|
2383 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2384 |
-
$this->customId = $map[ $mapKeyName ];
|
2385 |
-
}
|
2386 |
-
if ( PPUtils::array_match_key( $map, $prefix . "invoiceData." ) ) {
|
2387 |
-
$newPrefix = $prefix . "invoiceData.";
|
2388 |
-
$this->invoiceData = new InvoiceData();
|
2389 |
-
$this->invoiceData->init( $map, $newPrefix );
|
2390 |
-
}
|
2391 |
-
if ( PPUtils::array_match_key( $map, $prefix . "receiver." ) ) {
|
2392 |
-
$newPrefix = $prefix . "receiver.";
|
2393 |
-
$this->receiver = new ReceiverIdentifier();
|
2394 |
-
$this->receiver->init( $map, $newPrefix );
|
2395 |
-
}
|
2396 |
-
$mapKeyName = $prefix . 'referrerCode';
|
2397 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2398 |
-
$this->referrerCode = $map[ $mapKeyName ];
|
2399 |
-
}
|
2400 |
-
|
2401 |
-
}
|
2402 |
-
}
|
2403 |
-
}
|
2404 |
-
|
2405 |
-
|
2406 |
-
/**
|
2407 |
-
* RefundInfo represents the refund attempt made to a Receiver
|
2408 |
-
* of a PayRequest.
|
2409 |
-
*/
|
2410 |
-
class RefundInfo
|
2411 |
-
{
|
2412 |
-
|
2413 |
-
/**
|
2414 |
-
*
|
2415 |
-
* @access public
|
2416 |
-
* @var Receiver
|
2417 |
-
*/
|
2418 |
-
public $receiver;
|
2419 |
-
|
2420 |
-
/**
|
2421 |
-
*
|
2422 |
-
* @access public
|
2423 |
-
* @var string
|
2424 |
-
*/
|
2425 |
-
public $refundStatus;
|
2426 |
-
|
2427 |
-
/**
|
2428 |
-
*
|
2429 |
-
* @access public
|
2430 |
-
* @var double
|
2431 |
-
*/
|
2432 |
-
public $refundNetAmount;
|
2433 |
-
|
2434 |
-
/**
|
2435 |
-
*
|
2436 |
-
* @access public
|
2437 |
-
* @var double
|
2438 |
-
*/
|
2439 |
-
public $refundFeeAmount;
|
2440 |
-
|
2441 |
-
/**
|
2442 |
-
*
|
2443 |
-
* @access public
|
2444 |
-
* @var double
|
2445 |
-
*/
|
2446 |
-
public $refundGrossAmount;
|
2447 |
-
|
2448 |
-
/**
|
2449 |
-
*
|
2450 |
-
* @access public
|
2451 |
-
* @var double
|
2452 |
-
*/
|
2453 |
-
public $totalOfAllRefunds;
|
2454 |
-
|
2455 |
-
/**
|
2456 |
-
*
|
2457 |
-
* @access public
|
2458 |
-
* @var boolean
|
2459 |
-
*/
|
2460 |
-
public $refundHasBecomeFull;
|
2461 |
-
|
2462 |
-
/**
|
2463 |
-
*
|
2464 |
-
* @access public
|
2465 |
-
* @var string
|
2466 |
-
*/
|
2467 |
-
public $encryptedRefundTransactionId;
|
2468 |
-
|
2469 |
-
/**
|
2470 |
-
*
|
2471 |
-
* @access public
|
2472 |
-
* @var string
|
2473 |
-
*/
|
2474 |
-
public $refundTransactionStatus;
|
2475 |
-
|
2476 |
-
/**
|
2477 |
-
*
|
2478 |
-
* @access public
|
2479 |
-
* @var ErrorList
|
2480 |
-
*/
|
2481 |
-
public $errorList;
|
2482 |
-
|
2483 |
-
|
2484 |
-
public function init( $map = null, $prefix = '' )
|
2485 |
-
{
|
2486 |
-
if ( $map != null ) {
|
2487 |
-
if ( PPUtils::array_match_key( $map, $prefix . "receiver." ) ) {
|
2488 |
-
$newPrefix = $prefix . "receiver.";
|
2489 |
-
$this->receiver = new Receiver();
|
2490 |
-
$this->receiver->init( $map, $newPrefix );
|
2491 |
-
}
|
2492 |
-
$mapKeyName = $prefix . 'refundStatus';
|
2493 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2494 |
-
$this->refundStatus = $map[ $mapKeyName ];
|
2495 |
-
}
|
2496 |
-
$mapKeyName = $prefix . 'refundNetAmount';
|
2497 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2498 |
-
$this->refundNetAmount = $map[ $mapKeyName ];
|
2499 |
-
}
|
2500 |
-
$mapKeyName = $prefix . 'refundFeeAmount';
|
2501 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2502 |
-
$this->refundFeeAmount = $map[ $mapKeyName ];
|
2503 |
-
}
|
2504 |
-
$mapKeyName = $prefix . 'refundGrossAmount';
|
2505 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2506 |
-
$this->refundGrossAmount = $map[ $mapKeyName ];
|
2507 |
-
}
|
2508 |
-
$mapKeyName = $prefix . 'totalOfAllRefunds';
|
2509 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2510 |
-
$this->totalOfAllRefunds = $map[ $mapKeyName ];
|
2511 |
-
}
|
2512 |
-
$mapKeyName = $prefix . 'refundHasBecomeFull';
|
2513 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2514 |
-
$this->refundHasBecomeFull = $map[ $mapKeyName ];
|
2515 |
-
}
|
2516 |
-
$mapKeyName = $prefix . 'encryptedRefundTransactionId';
|
2517 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2518 |
-
$this->encryptedRefundTransactionId = $map[ $mapKeyName ];
|
2519 |
-
}
|
2520 |
-
$mapKeyName = $prefix . 'refundTransactionStatus';
|
2521 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2522 |
-
$this->refundTransactionStatus = $map[ $mapKeyName ];
|
2523 |
-
}
|
2524 |
-
if ( PPUtils::array_match_key( $map, $prefix . "errorList." ) ) {
|
2525 |
-
$newPrefix = $prefix . "errorList.";
|
2526 |
-
$this->errorList = new ErrorList();
|
2527 |
-
$this->errorList->init( $map, $newPrefix );
|
2528 |
-
}
|
2529 |
-
|
2530 |
-
}
|
2531 |
-
}
|
2532 |
-
}
|
2533 |
-
|
2534 |
-
|
2535 |
-
/**
|
2536 |
-
*
|
2537 |
-
*/
|
2538 |
-
class RefundInfoList
|
2539 |
-
{
|
2540 |
-
|
2541 |
-
/**
|
2542 |
-
*
|
2543 |
-
* @array
|
2544 |
-
* @access public
|
2545 |
-
* @var RefundInfo
|
2546 |
-
*/
|
2547 |
-
public $refundInfo;
|
2548 |
-
|
2549 |
-
|
2550 |
-
public function init( $map = null, $prefix = '' )
|
2551 |
-
{
|
2552 |
-
if ( $map != null ) {
|
2553 |
-
$i = 0;
|
2554 |
-
while ( true ) {
|
2555 |
-
if ( PPUtils::array_match_key( $map, $prefix . "refundInfo($i)" ) ) {
|
2556 |
-
$newPrefix = $prefix . "refundInfo($i).";
|
2557 |
-
$this->refundInfo[ $i ] = new RefundInfo();
|
2558 |
-
$this->refundInfo[ $i ]->init( $map, $newPrefix );
|
2559 |
-
} else {
|
2560 |
-
break;
|
2561 |
-
}
|
2562 |
-
$i++;
|
2563 |
-
}
|
2564 |
-
|
2565 |
-
}
|
2566 |
-
}
|
2567 |
-
}
|
2568 |
-
|
2569 |
-
|
2570 |
-
/**
|
2571 |
-
* Options that apply to the sender of a payment.
|
2572 |
-
*/
|
2573 |
-
class SenderOptions
|
2574 |
-
{
|
2575 |
-
|
2576 |
-
/**
|
2577 |
-
* Require the user to select a shipping address during the web
|
2578 |
-
* flow.
|
2579 |
-
* @access public
|
2580 |
-
* @var boolean
|
2581 |
-
*/
|
2582 |
-
public $requireShippingAddressSelection;
|
2583 |
-
|
2584 |
-
/**
|
2585 |
-
*
|
2586 |
-
* @access public
|
2587 |
-
* @var string
|
2588 |
-
*/
|
2589 |
-
public $referrerCode;
|
2590 |
-
|
2591 |
-
|
2592 |
-
public function toNVPString( $prefix = '' )
|
2593 |
-
{
|
2594 |
-
$str = '';
|
2595 |
-
$delim = '';
|
2596 |
-
if ( $this->requireShippingAddressSelection != null ) {
|
2597 |
-
$str .= $delim . $prefix . 'requireShippingAddressSelection=' . urlencode( $this->requireShippingAddressSelection );
|
2598 |
-
$delim = '&';
|
2599 |
-
}
|
2600 |
-
if ( $this->referrerCode != null ) {
|
2601 |
-
$str .= $delim . $prefix . 'referrerCode=' . urlencode( $this->referrerCode );
|
2602 |
-
$delim = '&';
|
2603 |
-
}
|
2604 |
-
|
2605 |
-
return $str;
|
2606 |
-
}
|
2607 |
-
|
2608 |
-
public function init( $map = null, $prefix = '' )
|
2609 |
-
{
|
2610 |
-
if ( $map != null ) {
|
2611 |
-
$mapKeyName = $prefix . 'requireShippingAddressSelection';
|
2612 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2613 |
-
$this->requireShippingAddressSelection = $map[ $mapKeyName ];
|
2614 |
-
}
|
2615 |
-
$mapKeyName = $prefix . 'referrerCode';
|
2616 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2617 |
-
$this->referrerCode = $map[ $mapKeyName ];
|
2618 |
-
}
|
2619 |
-
|
2620 |
-
}
|
2621 |
-
}
|
2622 |
-
}
|
2623 |
-
|
2624 |
-
|
2625 |
-
/**
|
2626 |
-
* Details about the payer's tax info passed in by the merchant
|
2627 |
-
* or partner.
|
2628 |
-
*/
|
2629 |
-
class TaxIdDetails
|
2630 |
-
{
|
2631 |
-
|
2632 |
-
/**
|
2633 |
-
* Tax id of the merchant/business.
|
2634 |
-
* @access public
|
2635 |
-
* @var string
|
2636 |
-
*/
|
2637 |
-
public $taxId;
|
2638 |
-
|
2639 |
-
/**
|
2640 |
-
* Tax type of the Tax Id.
|
2641 |
-
* @access public
|
2642 |
-
* @var string
|
2643 |
-
*/
|
2644 |
-
public $taxIdType;
|
2645 |
-
|
2646 |
-
|
2647 |
-
public function toNVPString( $prefix = '' )
|
2648 |
-
{
|
2649 |
-
$str = '';
|
2650 |
-
$delim = '';
|
2651 |
-
if ( $this->taxId != null ) {
|
2652 |
-
$str .= $delim . $prefix . 'taxId=' . urlencode( $this->taxId );
|
2653 |
-
$delim = '&';
|
2654 |
-
}
|
2655 |
-
if ( $this->taxIdType != null ) {
|
2656 |
-
$str .= $delim . $prefix . 'taxIdType=' . urlencode( $this->taxIdType );
|
2657 |
-
$delim = '&';
|
2658 |
-
}
|
2659 |
-
|
2660 |
-
return $str;
|
2661 |
-
}
|
2662 |
-
|
2663 |
-
public function init( $map = null, $prefix = '' )
|
2664 |
-
{
|
2665 |
-
if ( $map != null ) {
|
2666 |
-
$mapKeyName = $prefix . 'taxId';
|
2667 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2668 |
-
$this->taxId = $map[ $mapKeyName ];
|
2669 |
-
}
|
2670 |
-
$mapKeyName = $prefix . 'taxIdType';
|
2671 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2672 |
-
$this->taxIdType = $map[ $mapKeyName ];
|
2673 |
-
}
|
2674 |
-
|
2675 |
-
}
|
2676 |
-
}
|
2677 |
-
}
|
2678 |
-
|
2679 |
-
|
2680 |
-
/**
|
2681 |
-
* The sender identifier type contains information to identify
|
2682 |
-
* a PayPal account.
|
2683 |
-
*/
|
2684 |
-
class SenderIdentifier extends AccountIdentifier
|
2685 |
-
{
|
2686 |
-
|
2687 |
-
/**
|
2688 |
-
*
|
2689 |
-
* @access public
|
2690 |
-
* @var boolean
|
2691 |
-
*/
|
2692 |
-
public $useCredentials;
|
2693 |
-
|
2694 |
-
/**
|
2695 |
-
*
|
2696 |
-
* @access public
|
2697 |
-
* @var TaxIdDetails
|
2698 |
-
*/
|
2699 |
-
public $taxIdDetails;
|
2700 |
-
|
2701 |
-
|
2702 |
-
public function toNVPString( $prefix = '' )
|
2703 |
-
{
|
2704 |
-
$str = parent::toNVPString( $prefix );
|
2705 |
-
if ( strlen( $str ) > 0 ) {
|
2706 |
-
$delim = '&';
|
2707 |
-
} else {
|
2708 |
-
$delim = '';
|
2709 |
-
}
|
2710 |
-
if ( $this->useCredentials != null ) {
|
2711 |
-
$str .= $delim . $prefix . 'useCredentials=' . urlencode( $this->useCredentials );
|
2712 |
-
$delim = '&';
|
2713 |
-
}
|
2714 |
-
if ( $this->taxIdDetails != null ) {
|
2715 |
-
$newPrefix = $prefix . 'taxIdDetails.';
|
2716 |
-
$str .= $delim . call_user_func( array( $this->taxIdDetails, 'toNVPString' ), $newPrefix );
|
2717 |
-
$delim = '&';
|
2718 |
-
}
|
2719 |
-
|
2720 |
-
return $str;
|
2721 |
-
}
|
2722 |
-
|
2723 |
-
public function init( $map = null, $prefix = '' )
|
2724 |
-
{
|
2725 |
-
if ( $map != null ) {
|
2726 |
-
$mapKeyName = $prefix . 'useCredentials';
|
2727 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2728 |
-
$this->useCredentials = $map[ $mapKeyName ];
|
2729 |
-
}
|
2730 |
-
if ( PPUtils::array_match_key( $map, $prefix . "taxIdDetails." ) ) {
|
2731 |
-
$newPrefix = $prefix . "taxIdDetails.";
|
2732 |
-
$this->taxIdDetails = new TaxIdDetails();
|
2733 |
-
$this->taxIdDetails->init( $map, $newPrefix );
|
2734 |
-
}
|
2735 |
-
|
2736 |
-
}
|
2737 |
-
}
|
2738 |
-
}
|
2739 |
-
|
2740 |
-
|
2741 |
-
/**
|
2742 |
-
*
|
2743 |
-
*/
|
2744 |
-
class UserLimit
|
2745 |
-
{
|
2746 |
-
|
2747 |
-
/**
|
2748 |
-
*
|
2749 |
-
* @access public
|
2750 |
-
* @var string
|
2751 |
-
*/
|
2752 |
-
public $limitType;
|
2753 |
-
|
2754 |
-
/**
|
2755 |
-
*
|
2756 |
-
* @access public
|
2757 |
-
* @var CurrencyType
|
2758 |
-
*/
|
2759 |
-
public $limitAmount;
|
2760 |
-
|
2761 |
-
|
2762 |
-
public function init( $map = null, $prefix = '' )
|
2763 |
-
{
|
2764 |
-
if ( $map != null ) {
|
2765 |
-
$mapKeyName = $prefix . 'limitType';
|
2766 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2767 |
-
$this->limitType = $map[ $mapKeyName ];
|
2768 |
-
}
|
2769 |
-
if ( PPUtils::array_match_key( $map, $prefix . "limitAmount." ) ) {
|
2770 |
-
$newPrefix = $prefix . "limitAmount.";
|
2771 |
-
$this->limitAmount = new CurrencyType();
|
2772 |
-
$this->limitAmount->init( $map, $newPrefix );
|
2773 |
-
}
|
2774 |
-
|
2775 |
-
}
|
2776 |
-
}
|
2777 |
-
}
|
2778 |
-
|
2779 |
-
|
2780 |
-
/**
|
2781 |
-
* This type contains the detailed warning information
|
2782 |
-
* resulting from the service operation.
|
2783 |
-
*/
|
2784 |
-
class WarningData
|
2785 |
-
{
|
2786 |
-
|
2787 |
-
/**
|
2788 |
-
*
|
2789 |
-
* @access public
|
2790 |
-
* @var integer
|
2791 |
-
*/
|
2792 |
-
public $warningId;
|
2793 |
-
|
2794 |
-
/**
|
2795 |
-
*
|
2796 |
-
* @access public
|
2797 |
-
* @var string
|
2798 |
-
*/
|
2799 |
-
public $message;
|
2800 |
-
|
2801 |
-
|
2802 |
-
public function init( $map = null, $prefix = '' )
|
2803 |
-
{
|
2804 |
-
if ( $map != null ) {
|
2805 |
-
$mapKeyName = $prefix . 'warningId';
|
2806 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2807 |
-
$this->warningId = $map[ $mapKeyName ];
|
2808 |
-
}
|
2809 |
-
$mapKeyName = $prefix . 'message';
|
2810 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
2811 |
-
$this->message = $map[ $mapKeyName ];
|
2812 |
-
}
|
2813 |
-
|
2814 |
-
}
|
2815 |
-
}
|
2816 |
-
}
|
2817 |
-
|
2818 |
-
|
2819 |
-
/**
|
2820 |
-
*
|
2821 |
-
*/
|
2822 |
-
class WarningDataList
|
2823 |
-
{
|
2824 |
-
|
2825 |
-
/**
|
2826 |
-
*
|
2827 |
-
* @array
|
2828 |
-
* @access public
|
2829 |
-
* @var WarningData
|
2830 |
-
*/
|
2831 |
-
public $warningData;
|
2832 |
-
|
2833 |
-
|
2834 |
-
public function init( $map = null, $prefix = '' )
|
2835 |
-
{
|
2836 |
-
if ( $map != null ) {
|
2837 |
-
$i = 0;
|
2838 |
-
while ( true ) {
|
2839 |
-
if ( PPUtils::array_match_key( $map, $prefix . "warningData($i)" ) ) {
|
2840 |
-
$newPrefix = $prefix . "warningData($i).";
|
2841 |
-
$this->warningData[ $i ] = new WarningData();
|
2842 |
-
$this->warningData[ $i ]->init( $map, $newPrefix );
|
2843 |
-
} else {
|
2844 |
-
break;
|
2845 |
-
}
|
2846 |
-
$i++;
|
2847 |
-
}
|
2848 |
-
|
2849 |
-
}
|
2850 |
-
}
|
2851 |
-
}
|
2852 |
-
|
2853 |
-
|
2854 |
-
/**
|
2855 |
-
* The request to cancel a Preapproval.
|
2856 |
-
*/
|
2857 |
-
class CancelPreapprovalRequest
|
2858 |
-
{
|
2859 |
-
|
2860 |
-
/**
|
2861 |
-
*
|
2862 |
-
* @access public
|
2863 |
-
* @var RequestEnvelope
|
2864 |
-
*/
|
2865 |
-
public $requestEnvelope;
|
2866 |
-
|
2867 |
-
/**
|
2868 |
-
*
|
2869 |
-
* @access public
|
2870 |
-
* @var string
|
2871 |
-
*/
|
2872 |
-
public $preapprovalKey;
|
2873 |
-
|
2874 |
-
/**
|
2875 |
-
* Constructor with arguments
|
2876 |
-
*/
|
2877 |
-
public function __construct( $requestEnvelope = null, $preapprovalKey = null )
|
2878 |
-
{
|
2879 |
-
$this->requestEnvelope = $requestEnvelope;
|
2880 |
-
$this->preapprovalKey = $preapprovalKey;
|
2881 |
-
}
|
2882 |
-
|
2883 |
-
|
2884 |
-
public function toNVPString( $prefix = '' )
|
2885 |
-
{
|
2886 |
-
$str = '';
|
2887 |
-
$delim = '';
|
2888 |
-
if ( $this->requestEnvelope != null ) {
|
2889 |
-
$newPrefix = $prefix . 'requestEnvelope.';
|
2890 |
-
$str .= $delim . call_user_func( array( $this->requestEnvelope, 'toNVPString' ), $newPrefix );
|
2891 |
-
$delim = '&';
|
2892 |
-
}
|
2893 |
-
if ( $this->preapprovalKey != null ) {
|
2894 |
-
$str .= $delim . $prefix . 'preapprovalKey=' . urlencode( $this->preapprovalKey );
|
2895 |
-
$delim = '&';
|
2896 |
-
}
|
2897 |
-
|
2898 |
-
return $str;
|
2899 |
-
}
|
2900 |
-
|
2901 |
-
}
|
2902 |
-
|
2903 |
-
|
2904 |
-
/**
|
2905 |
-
* The result of the CancelPreapprovalRequest.
|
2906 |
-
*/
|
2907 |
-
class CancelPreapprovalResponse
|
2908 |
-
{
|
2909 |
-
|
2910 |
-
/**
|
2911 |
-
*
|
2912 |
-
* @access public
|
2913 |
-
* @var ResponseEnvelope
|
2914 |
-
*/
|
2915 |
-
public $responseEnvelope;
|
2916 |
-
|
2917 |
-
/**
|
2918 |
-
*
|
2919 |
-
* @array
|
2920 |
-
* @access public
|
2921 |
-
* @var ErrorData
|
2922 |
-
*/
|
2923 |
-
public $error;
|
2924 |
-
|
2925 |
-
|
2926 |
-
public function init( $map = null, $prefix = '' )
|
2927 |
-
{
|
2928 |
-
if ( $map != null ) {
|
2929 |
-
if ( PPUtils::array_match_key( $map, $prefix . "responseEnvelope." ) ) {
|
2930 |
-
$newPrefix = $prefix . "responseEnvelope.";
|
2931 |
-
$this->responseEnvelope = new ResponseEnvelope();
|
2932 |
-
$this->responseEnvelope->init( $map, $newPrefix );
|
2933 |
-
}
|
2934 |
-
$i = 0;
|
2935 |
-
while ( true ) {
|
2936 |
-
if ( PPUtils::array_match_key( $map, $prefix . "error($i)" ) ) {
|
2937 |
-
$newPrefix = $prefix . "error($i).";
|
2938 |
-
$this->error[ $i ] = new ErrorData();
|
2939 |
-
$this->error[ $i ]->init( $map, $newPrefix );
|
2940 |
-
} else {
|
2941 |
-
break;
|
2942 |
-
}
|
2943 |
-
$i++;
|
2944 |
-
}
|
2945 |
-
|
2946 |
-
}
|
2947 |
-
}
|
2948 |
-
}
|
2949 |
-
|
2950 |
-
|
2951 |
-
/**
|
2952 |
-
* The request to confirm a Preapproval.
|
2953 |
-
*/
|
2954 |
-
class ConfirmPreapprovalRequest
|
2955 |
-
{
|
2956 |
-
|
2957 |
-
/**
|
2958 |
-
*
|
2959 |
-
* @access public
|
2960 |
-
* @var RequestEnvelope
|
2961 |
-
*/
|
2962 |
-
public $requestEnvelope;
|
2963 |
-
|
2964 |
-
/**
|
2965 |
-
*
|
2966 |
-
* @access public
|
2967 |
-
* @var string
|
2968 |
-
*/
|
2969 |
-
public $preapprovalKey;
|
2970 |
-
|
2971 |
-
/**
|
2972 |
-
*
|
2973 |
-
* @access public
|
2974 |
-
* @var string
|
2975 |
-
*/
|
2976 |
-
public $fundingSourceId;
|
2977 |
-
|
2978 |
-
/**
|
2979 |
-
*
|
2980 |
-
* @access public
|
2981 |
-
* @var string
|
2982 |
-
*/
|
2983 |
-
public $pin;
|
2984 |
-
|
2985 |
-
/**
|
2986 |
-
* Constructor with arguments
|
2987 |
-
*/
|
2988 |
-
public function __construct( $requestEnvelope = null, $preapprovalKey = null )
|
2989 |
-
{
|
2990 |
-
$this->requestEnvelope = $requestEnvelope;
|
2991 |
-
$this->preapprovalKey = $preapprovalKey;
|
2992 |
-
}
|
2993 |
-
|
2994 |
-
|
2995 |
-
public function toNVPString( $prefix = '' )
|
2996 |
-
{
|
2997 |
-
$str = '';
|
2998 |
-
$delim = '';
|
2999 |
-
if ( $this->requestEnvelope != null ) {
|
3000 |
-
$newPrefix = $prefix . 'requestEnvelope.';
|
3001 |
-
$str .= $delim . call_user_func( array( $this->requestEnvelope, 'toNVPString' ), $newPrefix );
|
3002 |
-
$delim = '&';
|
3003 |
-
}
|
3004 |
-
if ( $this->preapprovalKey != null ) {
|
3005 |
-
$str .= $delim . $prefix . 'preapprovalKey=' . urlencode( $this->preapprovalKey );
|
3006 |
-
$delim = '&';
|
3007 |
-
}
|
3008 |
-
if ( $this->fundingSourceId != null ) {
|
3009 |
-
$str .= $delim . $prefix . 'fundingSourceId=' . urlencode( $this->fundingSourceId );
|
3010 |
-
$delim = '&';
|
3011 |
-
}
|
3012 |
-
if ( $this->pin != null ) {
|
3013 |
-
$str .= $delim . $prefix . 'pin=' . urlencode( $this->pin );
|
3014 |
-
$delim = '&';
|
3015 |
-
}
|
3016 |
-
|
3017 |
-
return $str;
|
3018 |
-
}
|
3019 |
-
|
3020 |
-
}
|
3021 |
-
|
3022 |
-
|
3023 |
-
/**
|
3024 |
-
* The result of the ConfirmPreapprovalRequest.
|
3025 |
-
*/
|
3026 |
-
class ConfirmPreapprovalResponse
|
3027 |
-
{
|
3028 |
-
|
3029 |
-
/**
|
3030 |
-
*
|
3031 |
-
* @access public
|
3032 |
-
* @var ResponseEnvelope
|
3033 |
-
*/
|
3034 |
-
public $responseEnvelope;
|
3035 |
-
|
3036 |
-
/**
|
3037 |
-
*
|
3038 |
-
* @array
|
3039 |
-
* @access public
|
3040 |
-
* @var ErrorData
|
3041 |
-
*/
|
3042 |
-
public $error;
|
3043 |
-
|
3044 |
-
|
3045 |
-
public function init( $map = null, $prefix = '' )
|
3046 |
-
{
|
3047 |
-
if ( $map != null ) {
|
3048 |
-
if ( PPUtils::array_match_key( $map, $prefix . "responseEnvelope." ) ) {
|
3049 |
-
$newPrefix = $prefix . "responseEnvelope.";
|
3050 |
-
$this->responseEnvelope = new ResponseEnvelope();
|
3051 |
-
$this->responseEnvelope->init( $map, $newPrefix );
|
3052 |
-
}
|
3053 |
-
$i = 0;
|
3054 |
-
while ( true ) {
|
3055 |
-
if ( PPUtils::array_match_key( $map, $prefix . "error($i)" ) ) {
|
3056 |
-
$newPrefix = $prefix . "error($i).";
|
3057 |
-
$this->error[ $i ] = new ErrorData();
|
3058 |
-
$this->error[ $i ]->init( $map, $newPrefix );
|
3059 |
-
} else {
|
3060 |
-
break;
|
3061 |
-
}
|
3062 |
-
$i++;
|
3063 |
-
}
|
3064 |
-
|
3065 |
-
}
|
3066 |
-
}
|
3067 |
-
}
|
3068 |
-
|
3069 |
-
|
3070 |
-
/**
|
3071 |
-
* A request to convert one or more currencies into their
|
3072 |
-
* estimated values in other currencies.
|
3073 |
-
*/
|
3074 |
-
class ConvertCurrencyRequest
|
3075 |
-
{
|
3076 |
-
|
3077 |
-
/**
|
3078 |
-
*
|
3079 |
-
* @access public
|
3080 |
-
* @var RequestEnvelope
|
3081 |
-
*/
|
3082 |
-
public $requestEnvelope;
|
3083 |
-
|
3084 |
-
/**
|
3085 |
-
*
|
3086 |
-
* @access public
|
3087 |
-
* @var CurrencyList
|
3088 |
-
*/
|
3089 |
-
public $baseAmountList;
|
3090 |
-
|
3091 |
-
/**
|
3092 |
-
*
|
3093 |
-
* @access public
|
3094 |
-
* @var CurrencyCodeList
|
3095 |
-
*/
|
3096 |
-
public $convertToCurrencyList;
|
3097 |
-
|
3098 |
-
/**
|
3099 |
-
* The two-character ISO country code where fx suppposed to
|
3100 |
-
* happen
|
3101 |
-
* @access public
|
3102 |
-
* @var string
|
3103 |
-
*/
|
3104 |
-
public $countryCode;
|
3105 |
-
|
3106 |
-
/**
|
3107 |
-
*
|
3108 |
-
* @access public
|
3109 |
-
* @var string
|
3110 |
-
*/
|
3111 |
-
public $conversionType;
|
3112 |
-
|
3113 |
-
/**
|
3114 |
-
* Constructor with arguments
|
3115 |
-
*/
|
3116 |
-
public function __construct( $requestEnvelope = null, $baseAmountList = null, $convertToCurrencyList = null )
|
3117 |
-
{
|
3118 |
-
$this->requestEnvelope = $requestEnvelope;
|
3119 |
-
$this->baseAmountList = $baseAmountList;
|
3120 |
-
$this->convertToCurrencyList = $convertToCurrencyList;
|
3121 |
-
}
|
3122 |
-
|
3123 |
-
|
3124 |
-
public function toNVPString( $prefix = '' )
|
3125 |
-
{
|
3126 |
-
$str = '';
|
3127 |
-
$delim = '';
|
3128 |
-
if ( $this->requestEnvelope != null ) {
|
3129 |
-
$newPrefix = $prefix . 'requestEnvelope.';
|
3130 |
-
$str .= $delim . call_user_func( array( $this->requestEnvelope, 'toNVPString' ), $newPrefix );
|
3131 |
-
$delim = '&';
|
3132 |
-
}
|
3133 |
-
if ( $this->baseAmountList != null ) {
|
3134 |
-
$newPrefix = $prefix . 'baseAmountList.';
|
3135 |
-
$str .= $delim . call_user_func( array( $this->baseAmountList, 'toNVPString' ), $newPrefix );
|
3136 |
-
$delim = '&';
|
3137 |
-
}
|
3138 |
-
if ( $this->convertToCurrencyList != null ) {
|
3139 |
-
$newPrefix = $prefix . 'convertToCurrencyList.';
|
3140 |
-
$str .= $delim . call_user_func( array( $this->convertToCurrencyList, 'toNVPString' ), $newPrefix );
|
3141 |
-
$delim = '&';
|
3142 |
-
}
|
3143 |
-
if ( $this->countryCode != null ) {
|
3144 |
-
$str .= $delim . $prefix . 'countryCode=' . urlencode( $this->countryCode );
|
3145 |
-
$delim = '&';
|
3146 |
-
}
|
3147 |
-
if ( $this->conversionType != null ) {
|
3148 |
-
$str .= $delim . $prefix . 'conversionType=' . urlencode( $this->conversionType );
|
3149 |
-
$delim = '&';
|
3150 |
-
}
|
3151 |
-
|
3152 |
-
return $str;
|
3153 |
-
}
|
3154 |
-
|
3155 |
-
}
|
3156 |
-
|
3157 |
-
|
3158 |
-
/**
|
3159 |
-
* A response that contains a table of estimated converted
|
3160 |
-
* currencies based on the Convert Currency Request.
|
3161 |
-
*/
|
3162 |
-
class ConvertCurrencyResponse
|
3163 |
-
{
|
3164 |
-
|
3165 |
-
/**
|
3166 |
-
*
|
3167 |
-
* @access public
|
3168 |
-
* @var ResponseEnvelope
|
3169 |
-
*/
|
3170 |
-
public $responseEnvelope;
|
3171 |
-
|
3172 |
-
/**
|
3173 |
-
*
|
3174 |
-
* @access public
|
3175 |
-
* @var CurrencyConversionTable
|
3176 |
-
*/
|
3177 |
-
public $estimatedAmountTable;
|
3178 |
-
|
3179 |
-
/**
|
3180 |
-
*
|
3181 |
-
* @array
|
3182 |
-
* @access public
|
3183 |
-
* @var ErrorData
|
3184 |
-
*/
|
3185 |
-
public $error;
|
3186 |
-
|
3187 |
-
|
3188 |
-
public function init( $map = null, $prefix = '' )
|
3189 |
-
{
|
3190 |
-
if ( $map != null ) {
|
3191 |
-
if ( PPUtils::array_match_key( $map, $prefix . "responseEnvelope." ) ) {
|
3192 |
-
$newPrefix = $prefix . "responseEnvelope.";
|
3193 |
-
$this->responseEnvelope = new ResponseEnvelope();
|
3194 |
-
$this->responseEnvelope->init( $map, $newPrefix );
|
3195 |
-
}
|
3196 |
-
if ( PPUtils::array_match_key( $map, $prefix . "estimatedAmountTable." ) ) {
|
3197 |
-
$newPrefix = $prefix . "estimatedAmountTable.";
|
3198 |
-
$this->estimatedAmountTable = new CurrencyConversionTable();
|
3199 |
-
$this->estimatedAmountTable->init( $map, $newPrefix );
|
3200 |
-
}
|
3201 |
-
$i = 0;
|
3202 |
-
while ( true ) {
|
3203 |
-
if ( PPUtils::array_match_key( $map, $prefix . "error($i)" ) ) {
|
3204 |
-
$newPrefix = $prefix . "error($i).";
|
3205 |
-
$this->error[ $i ] = new ErrorData();
|
3206 |
-
$this->error[ $i ]->init( $map, $newPrefix );
|
3207 |
-
} else {
|
3208 |
-
break;
|
3209 |
-
}
|
3210 |
-
$i++;
|
3211 |
-
}
|
3212 |
-
|
3213 |
-
}
|
3214 |
-
}
|
3215 |
-
}
|
3216 |
-
|
3217 |
-
|
3218 |
-
/**
|
3219 |
-
* The request to execute the payment request.
|
3220 |
-
*/
|
3221 |
-
class ExecutePaymentRequest
|
3222 |
-
{
|
3223 |
-
|
3224 |
-
/**
|
3225 |
-
*
|
3226 |
-
* @access public
|
3227 |
-
* @var RequestEnvelope
|
3228 |
-
*/
|
3229 |
-
public $requestEnvelope;
|
3230 |
-
|
3231 |
-
/**
|
3232 |
-
*
|
3233 |
-
* @access public
|
3234 |
-
* @var string
|
3235 |
-
*/
|
3236 |
-
public $payKey;
|
3237 |
-
|
3238 |
-
/**
|
3239 |
-
* Describes the action that is performed by this API
|
3240 |
-
* @access public
|
3241 |
-
* @var string
|
3242 |
-
*/
|
3243 |
-
public $actionType;
|
3244 |
-
|
3245 |
-
/**
|
3246 |
-
*
|
3247 |
-
* @access public
|
3248 |
-
* @var string
|
3249 |
-
*/
|
3250 |
-
public $fundingPlanId;
|
3251 |
-
|
3252 |
-
/**
|
3253 |
-
* Constructor with arguments
|
3254 |
-
*/
|
3255 |
-
public function __construct( $requestEnvelope = null, $payKey = null )
|
3256 |
-
{
|
3257 |
-
$this->requestEnvelope = $requestEnvelope;
|
3258 |
-
$this->payKey = $payKey;
|
3259 |
-
}
|
3260 |
-
|
3261 |
-
|
3262 |
-
public function toNVPString( $prefix = '' )
|
3263 |
-
{
|
3264 |
-
$str = '';
|
3265 |
-
$delim = '';
|
3266 |
-
if ( $this->requestEnvelope != null ) {
|
3267 |
-
$newPrefix = $prefix . 'requestEnvelope.';
|
3268 |
-
$str .= $delim . call_user_func( array( $this->requestEnvelope, 'toNVPString' ), $newPrefix );
|
3269 |
-
$delim = '&';
|
3270 |
-
}
|
3271 |
-
if ( $this->payKey != null ) {
|
3272 |
-
$str .= $delim . $prefix . 'payKey=' . urlencode( $this->payKey );
|
3273 |
-
$delim = '&';
|
3274 |
-
}
|
3275 |
-
if ( $this->actionType != null ) {
|
3276 |
-
$str .= $delim . $prefix . 'actionType=' . urlencode( $this->actionType );
|
3277 |
-
$delim = '&';
|
3278 |
-
}
|
3279 |
-
if ( $this->fundingPlanId != null ) {
|
3280 |
-
$str .= $delim . $prefix . 'fundingPlanId=' . urlencode( $this->fundingPlanId );
|
3281 |
-
$delim = '&';
|
3282 |
-
}
|
3283 |
-
|
3284 |
-
return $str;
|
3285 |
-
}
|
3286 |
-
|
3287 |
-
}
|
3288 |
-
|
3289 |
-
|
3290 |
-
/**
|
3291 |
-
* The result of a payment execution.
|
3292 |
-
*/
|
3293 |
-
class ExecutePaymentResponse
|
3294 |
-
{
|
3295 |
-
|
3296 |
-
/**
|
3297 |
-
*
|
3298 |
-
* @access public
|
3299 |
-
* @var ResponseEnvelope
|
3300 |
-
*/
|
3301 |
-
public $responseEnvelope;
|
3302 |
-
|
3303 |
-
/**
|
3304 |
-
*
|
3305 |
-
* @access public
|
3306 |
-
* @var string
|
3307 |
-
*/
|
3308 |
-
public $paymentExecStatus;
|
3309 |
-
|
3310 |
-
/**
|
3311 |
-
*
|
3312 |
-
* @access public
|
3313 |
-
* @var PayErrorList
|
3314 |
-
*/
|
3315 |
-
public $payErrorList;
|
3316 |
-
|
3317 |
-
/**
|
3318 |
-
*
|
3319 |
-
* @array
|
3320 |
-
* @access public
|
3321 |
-
* @var ErrorData
|
3322 |
-
*/
|
3323 |
-
public $error;
|
3324 |
-
|
3325 |
-
|
3326 |
-
public function init( $map = null, $prefix = '' )
|
3327 |
-
{
|
3328 |
-
if ( $map != null ) {
|
3329 |
-
if ( PPUtils::array_match_key( $map, $prefix . "responseEnvelope." ) ) {
|
3330 |
-
$newPrefix = $prefix . "responseEnvelope.";
|
3331 |
-
$this->responseEnvelope = new ResponseEnvelope();
|
3332 |
-
$this->responseEnvelope->init( $map, $newPrefix );
|
3333 |
-
}
|
3334 |
-
$mapKeyName = $prefix . 'paymentExecStatus';
|
3335 |
-
if ( $map != null && array_key_exists( $mapKeyName, $map ) ) {
|
3336 |
-
$this->paymentExecStatus = $map[ $mapKeyName ];
|
3337 |
-
}
|
3338 |
-
if ( PPUtils::array_match_key( $map, $prefix . "payErrorList." ) ) {
|
3339 |
-
$newPrefix = $prefix . "payErrorList.";
|
3340 |
-
$this->payErrorList = new PayErrorList();
|
3341 |
-
$this->payErrorList->init( $map, $newPrefix );
|
3342 |
-
}
|
3343 |
-
$i = 0;
|
3344 |
-
while ( true ) {
|
3345 |
-
if ( PPUtils::array_match_key( $map, $prefix . "error($i)" ) ) {
|
3346 |
-
$newPrefix = $prefix . "error($i).";
|
3347 |
-
$this->error[ $i ] = new ErrorData();
|
3348 |
-
$this->error[ $i ]->init( $map, $newPrefix );
|
3349 |
-
} else {
|
3350 |
-
break;
|
3351 |
-
}
|
3352 |
-
$i++;
|
3353 |
-
}
|
3354 |
-
|
3355 |
-
}
|
3356 |
-
}
|
3357 |
-
}
|
3358 |
-
|
3359 |
-
|
3360 |
-
/**
|
3361 |
-
* The request to get the allowed funding sources available for
|
3362 |
-
* a preapproval.
|
3363 |
-
*/
|
3364 |
-
class GetAllowedFundingSourcesRequest
|
3365 |
-
{
|
3366 |
-
|
3367 |
-
/**
|
3368 |
-
*
|
3369 |
-
* @access public
|
3370 |
-
* @var RequestEnvelope
|
3371 |
-
*/
|
3372 |
-
public $requestEnvelope;
|
3373 |
-
|
3374 |
-
/**
|
3375 |
-
*
|
3376 |
-
* @access public
|
3377 |
-
* @var string
|
3378 |
-
*/
|
3379 |
-
public $key;
|
3380 |
-
|
3381 |
-
/**
|
3382 |
-
* Constructor with arguments
|
3383 |
-
*/
|
3384 |
-
public function __construct( $requestEnvelope = null, $key = null )
|
3385 |
-
{
|
3386 |
-
$this->requestEnvelope = $requestEnvelope;
|
3387 |
-
$this->key = $key;
|
3388 |
-
}
|
3389 |
-
|
3390 |
-
|
3391 |
-
public function toNVPString( $prefix = '' )
|
3392 |
-
{
|
3393 |
-
$str = '';
|
3394 |
-
$delim = '';
|
3395 |
-
if ( $this->requestEnvelope != null ) {
|
3396 |
-
$newPrefix = $prefix . 'requestEnvelope.';
|
3397 |
-
$str .= $delim . call_user_func( array( $this->requestEnvelope, 'toNVPString' ), $newPrefix );
|
3398 |
-
$delim = '&';
|
3399 |
-
}
|
3400 |
-
if ( $this->key != null ) {
|
3401 |
-
$str .= $delim . $prefix . 'key=' . urlencode( $this->key );
|
3402 |
-
$delim = '&';
|
3403 |
-
}
|
3404 |
-
|
3405 |
-
return $str;
|
3406 |
-
}
|
3407 |
-
|
3408 |
-
}
|
3409 |
-
|
3410 |
-
|
3411 |
-
/**
|
3412 |
-
* The response to get the backup funding sources available for
|
3413 |
-
* a preapproval.
|
3414 |
-
*/
|
3415 |
-
class GetAllowedFundingSourcesResponse
|
3416 |
-
{
|
3417 |
-
|
3418 |
-
/**
|
3419 |
-
*
|
3420 |
-
* @access public
|
3421 |
-
* @var ResponseEnvelope
|
3422 |
-
*/
|
3423 |
-
public $responseEnvelope;
|
3424 |
-
|
3425 |
-
/**
|
3426 |
-
*
|
3427 |
-
* @array
|
3428 |
-
* @access public
|
3429 |
-
* @var FundingSource
|
3430 |
-
*/
|
3431 |
-
public $fundingSource;
|
3432 |
-
|
3433 |
-
/**
|
3434 |
-
*
|
3435 |
-
* @array
|
3436 |
-
* @access public
|
3437 |
-
* @var ErrorData
|
3438 |
-
*/
|
3439 |
-
public $error;
|
3440 |
-
|
3441 |
-
|
3442 |
-
public function init( $map = null, $prefix = '' )
|
3443 |
-
{
|
3444 |
-
if ( $map != null ) {
|
3445 |
-
if ( PPUtils::array_match_key( $map, $prefix . "responseEnvelope." ) ) {
|
3446 |
-
$newPrefix = $prefix . "responseEnvelope.";
|
3447 |
-
$this->responseEnvelope = new ResponseEnvelope();
|
3448 |
-
$this->responseEnvelope->init( $map, $newPrefix );
|
3449 |
-
}
|
3450 |
-
$i = 0;
|
3451 |
-
while ( true ) {
|
3452 |
-
if ( PPUtils::array_match_key( $map, $prefix . "fundingSource($i)" ) ) {
|
3453 |
-
$newPrefix = $prefix . "fundingSource($i).";
|
3454 |
-
$this->fundingSource[ $i ] = new FundingSource();
|
3455 |
-
$this->fundingSource[ $i ]->init( $map, $newPrefix );
|
3456 |
-
} else {
|
3457 |
-
break;
|
3458 |
-
}
|
3459 |
-
$i++;
|
3460 |
-
}
|
3461 |
-
$i = 0;
|
3462 |
-
while ( true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|