5 | * @copyright Copyright 2014 vendocrat. All Rights Reserved.
6 | */
7 | .payment-methods{padding-left:0;list-style:none;margin-left:-2px}.payment-methods>li{display:inline-block;padding:2px;vertical-align:top}.payment-methods>li>i{display:block!important;cursor:default;padding:4px;border-radius:4px;background:0 0;border:1px solid transparent}.payment-methods-i>li>i,.payment-methods-inverse>li>i{color:#fff;background:#333;border-color:#333}.payment-methods-o>li>i,.payment-methods-outline>li>i{border-color:#777}.payment-methods>li>i{font-size:1.5em;line-height:1}.widget_vendocrat_payment_methods ul{margin-bottom:0}#payment ul.payment_methods .payment_method_ClickAndBuy label img,#payment ul.payment_methods .payment_method_amazon>label img,#payment ul.payment_methods .payment_method_amazon_fps>label img,#payment ul.payment_methods .payment_method_bacs label img,#payment ul.payment_methods .payment_method_bitpay label img,#payment ul.payment_methods .payment_method_cash_on_delivery label img,#payment ul.payment_methods .payment_method_cheque label img,#payment ul.payment_methods .payment_method_coinbase label img,#payment ul.payment_methods .payment_method_mijireh_checkout label img,#payment ul.payment_methods .payment_method_paypal label img,#payment ul.payment_methods .payment_method_pbx>label img,#payment ul.payment_methods .payment_method_sofortgateway label img,#payment ul.payment_methods .payment_method_stripe label img,#payment ul.payment_methods .payment_method_wirecard label img,#payment ul.payment_methods .payment_method_wirecard_checkout_page label img{display:none}#payment ul.payment_methods .payment_method_ClickAndBuy>label:before,#payment ul.payment_methods .payment_method_amazon>label:before,#payment ul.payment_methods .payment_method_amazon_fps>label:before,#payment ul.payment_methods .payment_method_bacs>label:before,#payment ul.payment_methods .payment_method_bitpay>label:before,#payment ul.payment_methods .payment_method_cash_on_delivery>label:before,#payment ul.payment_methods .payment_method_ccard>label:before,#payment ul.payment_methods .payment_method_cheque>label:before,#payment ul.payment_methods .payment_method_coinbase>label:before,#payment ul.payment_methods .payment_method_mijireh_checkout>label:before,#payment ul.payment_methods .payment_method_paypal>label:before,#payment ul.payment_methods .payment_method_pbx>label:before,#payment ul.payment_methods .payment_method_sofortgateway>label:before,#payment ul.payment_methods .payment_method_sofortueberweisung>label:before,#payment ul.payment_methods .payment_method_stripe>label:before,#payment ul.payment_methods .payment_method_wirecard>.payment_method_select>label:before,#payment ul.payment_methods .payment_method_wirecard>label:before,#payment ul.payment_methods .payment_method_wirecard_checkout_page>label:before{display:inline;margin-right:10px;padding:2px 6px;vertical-align:middle;border-radius:3px;color:#fff;background:#333;font-family:PaymentFont;font-size:1.5em;font-style:normal;font-weight:400;line-height:1;text-decoration:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#payment ul.payment_methods .payment_method_bacs>label:before{content:'\f005'}#payment ul.payment_methods .payment_method_cheque>label:before{content:'\f00a'}#payment ul.payment_methods .payment_method_ccard>label:before,#payment ul.payment_methods .payment_method_mijireh_checkout>label:before{content:'\f012'}#payment ul.payment_methods .payment_method_paypal>label:before{content:'\f033'}#payment ul.payment_methods .payment_method_stripe>label:before{content:'\f03e'}#payment ul.payment_methods .payment_method_wirecard>.payment_method_select>label:before,#payment ul.payment_methods .payment_method_wirecard>label:before,#payment ul.payment_methods .payment_method_wirecard_checkout_page>label:before{content:'\f049'}#payment ul.payment_methods .payment_method_amazon>label:before,#payment ul.payment_methods .payment_method_amazon_fps>label:before{content:'\f000'}#payment ul.payment_methods .payment_method_pbx>label:before{content:'\f031'}#payment ul.payment_methods .payment_method_ClickAndBuy>label:before{content:'\f011'}#payment ul.payment_methods .payment_method_sofortgateway>label:before,#payment ul.payment_methods .payment_method_sofortueberweisung>label:before{content:'\f03c'}#payment ul.payment_methods .payment_method_cash_on_delivery>label:before{content:'\f00d'}#payment ul.payment_methods .payment_method_bitpay>label:before,#payment ul.payment_methods .payment_method_coinbase>label:before{content:'\f006'}
8 | /*
9 | * E fatto!
10 | */
--------------------------------------------------------------------------------
/assets/css/payment-methods.css:
--------------------------------------------------------------------------------
1 | /**
2 | * vendocrat Payment Methods styles
3 | *
4 | * @package vendocrat
5 | * @subpackage Payment Methods
6 | *
7 | * @since 2014-09-08
8 | * @version 2015-04-24
9 | *
10 | * @author Poellmann Alexander Manfred (@AMPoellmann)
11 | * @copyright Copyright 2015 vendocrat. All Rights Reserved.
12 | * @link https://vendocr.at/
13 | */
14 |
15 | /**** Base Styles */
16 | .payment-methods {
17 | padding-left:0;
18 | list-style:none;
19 | margin-left:-2px;}
20 |
21 | .payment-methods > li {
22 | display:inline-block;
23 | padding:2px;
24 |
25 | vertical-align:top;}
26 |
27 | .payment-methods > li > i {
28 | display:block !important;
29 | cursor:default;
30 | padding:4px;
31 |
32 | font-size:1.5em;
33 | line-height:1;
34 |
35 | background:transparent;
36 | border:1px solid transparent;
37 | border-radius:4px;}
38 |
39 | .payment-methods-inverse > li > i,
40 | .payment-methods-i > li > i {
41 | color:#fff;
42 | background:#333;
43 | border-color:#333;}
44 |
45 | .payment-methods-outline > li > i,
46 | .payment-methods-o > li > i {
47 | border-color:#777;}
48 |
49 | /**** Widget */
50 | .widget_vendocrat_payment_methods {}
51 |
52 | .widget_vendocrat_payment_methods ul {
53 | margin-bottom:0;}
54 |
55 | /**** WooCommerce Checkout */
56 | #payment ul.payment_methods .payment_method_bacs label img,
57 | #payment ul.payment_methods .payment_method_cheque label img,
58 | #payment ul.payment_methods .payment_method_mijireh_checkout label img,
59 | #payment ul.payment_methods .payment_method_paypal label img,
60 | #payment ul.payment_methods .payment_method_stripe label img,
61 | #payment ul.payment_methods .payment_method_wirecard label img,
62 | #payment ul.payment_methods .payment_method_wirecard_checkout_page label img,
63 | #payment ul.payment_methods .payment_method_amazon > label img,
64 | #payment ul.payment_methods .payment_method_amazon_fps > label img,
65 | #payment ul.payment_methods .payment_method_pbx > label img,
66 | #payment ul.payment_methods .payment_method_ClickAndBuy label img,
67 | #payment ul.payment_methods .payment_method_sofortgateway label img,
68 | #payment ul.payment_methods .payment_method_cash_on_delivery label img,
69 | #payment ul.payment_methods .payment_method_bitpay label img,
70 | #payment ul.payment_methods .payment_method_coinbase label img {
71 | display:none;}
72 |
73 | #payment ul.payment_methods .payment_method_bacs > label:before,
74 | #payment ul.payment_methods .payment_method_cheque > label:before,
75 | #payment ul.payment_methods .payment_method_mijireh_checkout > label:before,
76 | #payment ul.payment_methods .payment_method_ccard > label:before,
77 | #payment ul.payment_methods .payment_method_paypal > label:before,
78 | #payment ul.payment_methods .payment_method_stripe > label:before,
79 | #payment ul.payment_methods .payment_method_wirecard > label:before,
80 | #payment ul.payment_methods .payment_method_wirecard > .payment_method_select > label:before,
81 | #payment ul.payment_methods .payment_method_wirecard_checkout_page > label:before,
82 | #payment ul.payment_methods .payment_method_amazon > label:before,
83 | #payment ul.payment_methods .payment_method_amazon_fps > label:before,
84 | #payment ul.payment_methods .payment_method_pbx > label:before,
85 | #payment ul.payment_methods .payment_method_ClickAndBuy > label:before,
86 | #payment ul.payment_methods .payment_method_sofortgateway > label:before,
87 | #payment ul.payment_methods .payment_method_sofortueberweisung > label:before,
88 | #payment ul.payment_methods .payment_method_cash_on_delivery > label:before,
89 | #payment ul.payment_methods .payment_method_bitpay > label:before,
90 | #payment ul.payment_methods .payment_method_coinbase > label:before {
91 | display:inline;
92 | margin-right:10px;padding:2px 6px;
93 | vertical-align:middle;
94 | border-radius:3px;
95 |
96 | color:#fff;
97 | background:#333;
98 |
99 | font-family:PaymentFont;
100 | font-size:1.5em;
101 | font-style:normal;
102 | font-weight:normal;
103 | line-height:1;
104 | text-decoration:none;
105 |
106 | -webkit-font-smoothing:antialiased;
107 | -moz-osx-font-smoothing:grayscale;}
108 |
109 | #payment ul.payment_methods .payment_method_bacs > label:before {
110 | content:'\f005';}
111 |
112 | #payment ul.payment_methods .payment_method_cheque > label:before {
113 | content:'\f00a';}
114 |
115 | #payment ul.payment_methods .payment_method_mijireh_checkout > label:before,
116 | #payment ul.payment_methods .payment_method_ccard > label:before {
117 | content:'\f012';}
118 |
119 | #payment ul.payment_methods .payment_method_paypal > label:before {
120 | content:'\f033';}
121 |
122 | #payment ul.payment_methods .payment_method_stripe > label:before {
123 | content:'\f03e';}
124 |
125 | #payment ul.payment_methods .payment_method_wirecard > label:before,
126 | #payment ul.payment_methods .payment_method_wirecard > .payment_method_select > label:before,
127 | #payment ul.payment_methods .payment_method_wirecard_checkout_page > label:before {
128 | content:'\f049';}
129 |
130 | #payment ul.payment_methods .payment_method_amazon > label:before,
131 | #payment ul.payment_methods .payment_method_amazon_fps > label:before {
132 | content:'\f000';}
133 |
134 | #payment ul.payment_methods .payment_method_pbx > label:before {
135 | content:'\f031';}
136 |
137 | #payment ul.payment_methods .payment_method_ClickAndBuy > label:before {
138 | content:'\f011';}
139 |
140 | #payment ul.payment_methods .payment_method_sofortgateway > label:before,
141 | #payment ul.payment_methods .payment_method_sofortueberweisung > label:before {
142 | content:'\f03c';}
143 |
144 | #payment ul.payment_methods .payment_method_cash_on_delivery > label:before {
145 | content:'\f00d';}
146 |
147 | #payment ul.payment_methods .payment_method_bitpay > label:before,
148 | #payment ul.payment_methods .payment_method_coinbase > label:before {
149 | content:'\f006';}
150 |
151 | /*
152 | * NO MORE LOVE TO GIVE
153 | */
--------------------------------------------------------------------------------
/readme.txt:
--------------------------------------------------------------------------------
1 | === WooCommerce Payment Methods ===
2 | Contributors: vendocrat, AlexanderPoellmann
3 | Donate link: http://vendocr.at/donate/
4 | Tags: woocommerce, credit card, logo, payment
5 | Requires at least: 3.5
6 | Tested up to: 4.2
7 | Stable tag: 1.1.2
8 | License: GNU General Public License v3.0
9 | License URI: http://www.gnu.org/licenses/gpl-3.0.html
10 |
11 | Easily display your accepted payment methods via shortcode, widget or template tag. Of course, it also works without WooCommerce ;)
12 |
13 | == Description ==
14 |
15 | WooCommerce Payment Methods allows you to display your accepted payment methods. By default the plugin shows all available payment methods, but you can also specify or override them manually.
16 |
17 | You can display them via shortcode, widget or template tag in three available styles (default, inverse and outline). We`ve added several classes, so you can easily style the output to your pleasure.
18 |
19 | You are using the famous Bootstrap framework? Awesome, cause we`ve added the markup for tooltips, so that users can see the payment methods name on hover.
20 |
21 | **PaymentFont webfont**
22 |
23 | This plugin uses the webfont [PaymentFont](https://github.com/vendocrat/PaymentFont) by [vendocrat](http://vendocr.at) to display the brand icons, making them look good on every screen.
24 |
25 | **Contributions**
26 |
27 | Contributions are warmly welcome via [GitHub](https://github.com/vendocrat/WooCommerce-Payment-Methods).
28 |
29 | **Translations**
30 |
31 | Translations included:
32 |
33 | * English
34 | * German
35 | * Italian
36 | * Greek (thanks to [Anestis Samourkasidis](https://wordpress.org/support/profile/samourkasidis))
37 | * Portuguese (thanks to [Luis Martins](https://github.com/lmartins))
38 |
39 | All our plugins are fully localized/translateable by default and include a .pot-file! Please contact us via [Twitter](https://twitter.com/vendocrat) or hit us on [GitHub](https://github.com/vendocrat), if you have a translation you want to contribute!
40 |
41 | = We`d love to hear from you! =
42 |
43 | Follow us on [Twitter](https://twitter.com/vendocrat), like us on [Facebook](https://www.facebook.com/vendocrat), circle us on [Google+](https://plus.google.com/+vendocrat) or fork us on [GitHub](https://github.com/vendocrat)!
44 |
45 | == Installation ==
46 |
47 | 1. Upload `woocommerce-payment-methods` to the `/wp-content/plugins/` directory
48 | 2. Activate the plugin through the `Plugins` menu in WordPress
49 | 3. Display your accepted methods via: Shortcode [wc_payment_methods], Widget or template tag `.
50 | 4. Done!
51 |
52 | == Frequently Asked Questions ==
53 |
54 | = Why is payment method {XYZ} missing? =
55 |
56 | Miss some payment methods? Let me have a look at it by opening an issue on GitHub or hit us at @vendocrat .
57 |
58 | = How to display the payment methods? =
59 |
60 | You can use the function `wc_payment_methods( $atts )`, the shortcode `[wc_payment_methods]` or the widget.
61 |
62 | = What function/shortcode attributes are available? =
63 |
64 | 1. `methods` => Comma separated list of payment methods icon slugs to be displayed, see http://paymentfont.io for available icons, defaults to false
65 | 2. `style` => How shall the icons be displayed? Available options are default, inverse and outline.
66 | 3. `tooltip` => Adds data attributes to icon to be used for diplaying tooltips (made for Bootstrap), defaults to false
67 | 4. `placement` => Set tooltip placement, defaults to bottom
68 | 5. `xclass` => Add any extra classes, seperated by a space, defaults to false
69 |
70 | = How can I manually specify or override the displayed methods? =
71 |
72 | In the function and the shortcode use the attribute `methods`. In the widget there is a field for that. If you don`t specify any methods manually, the plugin will try to fetch the available payment methods from WooCommerce. Oh, and there are also two filters available (see beneath).
73 |
74 | = Are Filters/Hooks available? =
75 |
76 | Yep, there is first of all the filter `vendocrat_filter_wc_payment_methods` which expects an array. Use this to specify/override the methods to be shown globally.
77 |
78 | With the filter `vendocrat_filter_wc_payment_methods_icons` you can modify the html markup for all icons to be displayed. This will look somehow like ` ` for the icons PayPal, Visa and MasterCard.
79 |
80 | == Screenshots ==
81 |
82 | 1. Shortcode output (top-down: default, inverse, outline style)
83 | 2. Widgets (top-down: default, inverse, outline style)
84 | 3. WooCommerce Checkout
85 | 3. WooCommerce Checkout in action
86 |
87 | == Changelog ==
88 |
89 | = 0.1.0 =
90 | Initial release.
91 |
92 | = 0.1.1 =
93 | Fixed wrong url and typo in readme, updated shortcode and screenshots.
94 |
95 | = 0.1.2 =
96 | Fixed an error in widget class, added placement option to tooltips, updated language files.
97 |
98 | = 0.2.0 =
99 | Now using PaymentFont to display brand icons. Fixed textdomain issue plus some minor fixes and enhancements. Added new screenshots!
100 |
101 | = 0.2.1 =
102 | Fixed typo.
103 |
104 | = 0.2.2 =
105 | Added CSS to replace payment provider images on WooCommerce Checkout with PaymentFont icons (see screenshots).
106 |
107 | = 0.3.0 =
108 | Improved payment gateway function. Partial rewrite to fit our internal plugin standard. Improved l10n handling.
109 |
110 | = 1.0.0 =
111 | Minor fixes, updated PaymentFont and included Portuguese translation (thanks Luis Martins).
112 |
113 | = 1.0.1 =
114 | Minor fixes, added Greek translation (thanks to Anestis Samourkasidis).
115 |
116 | = 1.1.0 =
117 | Minor fixes, added multiselect to widget to manually pick payment methods, update to PaymentFont v1.1.1 for better performance.
118 |
119 | = 1.1.1 =
120 | Minor fixes, enhanced widget.
121 |
122 | = 1.1.2 =
123 | Updated language files for German.
--------------------------------------------------------------------------------
/assets/css/paymentfont.css:
--------------------------------------------------------------------------------
1 | /**
2 | * PaymentFont Styles 1.1.0
3 | *
4 | * @since 2014-09-21
5 | * @version 2015-04-24
6 | *
7 | * @author Poellmann Alexander Manfred (@AMPoellmann)
8 | * @copyright Copyright 2015 vendocrat. All Rights Reserved.
9 | * @link https://vendocr.at/
10 | *
11 | * @license Font: SIL OFL 1.1, CSS: MIT License
12 | */
13 |
14 | @font-face {
15 | font-family:'PaymentFont';
16 | src:url('../fonts/paymentfont-webfont.eot');
17 | src:url('../fonts/paymentfont-webfont.eot?#iefix') format('embedded-opentype'),
18 | url('../fonts/paymentfont-webfont.woff') format('woff2'),
19 | url('../fonts/paymentfont-webfont.woff') format('woff'),
20 | url('../fonts/paymentfont-webfont.ttf') format('truetype'),
21 | url('../fonts/paymentfont-webfont.svg#paymentfont-webfont') format('svg');
22 | font-weight:normal;
23 | font-style:normal;}
24 |
25 | .pf {
26 | display:inline-block;
27 | font:normal normal normal 14px/1 PaymentFont;
28 | font-size:inherit;
29 | text-rendering:auto;
30 | -webkit-font-smoothing:antialiased;
31 | -moz-osx-font-smoothing:grayscale;}
32 |
33 | .pf-amazon:before {
34 | content: "\f000";
35 | }
36 | .pf-american-express:before {
37 | content: "\f001";
38 | }
39 | .pf-american-express-alt:before {
40 | content: "\f002";
41 | }
42 | .pf-atm:before {
43 | content: "\f003";
44 | }
45 | .pf-bankomat:before {
46 | content: "\f004";
47 | }
48 | .pf-bank-transfer:before {
49 | content: "\f005";
50 | }
51 | .pf-bitcoin:before {
52 | content: "\f006";
53 | }
54 | .pf-bitcoin-sign:before {
55 | content: "\f007";
56 | }
57 | .pf-braintree:before {
58 | content: "\f008";
59 | }
60 | .pf-btc:before {
61 | content: "\f009";
62 | }
63 | .pf-card:before {
64 | content: "\f00a";
65 | }
66 | .pf-carta-si:before {
67 | content: "\f00b";
68 | }
69 | .pf-cash:before {
70 | content: "\f00c";
71 | }
72 | .pf-cash-on-delivery:before {
73 | content: "\f00d";
74 | }
75 | .pf-cb:before {
76 | content: "\f00e";
77 | }
78 | .pf-cirrus:before {
79 | content: "\f00f";
80 | }
81 | .pf-cirrus-alt:before {
82 | content: "\f010";
83 | }
84 | .pf-clickandbuy:before {
85 | content: "\f011";
86 | }
87 | .pf-credit-card:before {
88 | content: "\f012";
89 | }
90 | .pf-diners:before {
91 | content: "\f013";
92 | }
93 | .pf-discover:before {
94 | content: "\f014";
95 | }
96 | .pf-ec:before {
97 | content: "\f015";
98 | }
99 | .pf-eps:before {
100 | content: "\f016";
101 | }
102 | .pf-eur:before {
103 | content: "\f017";
104 | }
105 | .pf-facture:before {
106 | content: "\f018";
107 | }
108 | .pf-fattura:before {
109 | content: "\f019";
110 | }
111 | .pf-flattr:before {
112 | content: "\f01a";
113 | }
114 | .pf-giropay:before {
115 | content: "\f01b";
116 | }
117 | .pf-gittip:before,
118 | .pf-gratipay:before {
119 | content: "\f01c";
120 | }
121 | .pf-google-wallet:before {
122 | content: "\f01d";
123 | }
124 | .pf-google-wallet-alt:before {
125 | content: "\f01e";
126 | }
127 | .pf-gpb:before {
128 | content: "\f01f";
129 | }
130 | .pf-ideal:before {
131 | content: "\f020";
132 | }
133 | .pf-ils:before {
134 | content: "\f021";
135 | }
136 | .pf-inr:before {
137 | content: "\f022";
138 | }
139 | .pf-invoice:before {
140 | content: "\f023";
141 | }
142 | .pf-invoice-sign:before {
143 | content: "\f024";
144 | }
145 | .pf-invoice-sign-alt:before {
146 | content: "\f025";
147 | }
148 | .pf-invoice-sign-alt-o:before {
149 | content: "\f026";
150 | }
151 | .pf-invoice-sign-o:before {
152 | content: "\f027";
153 | }
154 | .pf-jcb:before {
155 | content: "\f028";
156 | }
157 | .pf-jpy:before {
158 | content: "\f029";
159 | }
160 | .pf-krw:before {
161 | content: "\f02a";
162 | }
163 | .pf-maestro:before {
164 | content: "\f02b";
165 | }
166 | .pf-maestro-alt:before {
167 | content: "\f02c";
168 | }
169 | .pf-mastercard:before {
170 | content: "\f02d";
171 | }
172 | .pf-mastercard-alt:before {
173 | content: "\f02e";
174 | }
175 | .pf-mastercard-securecode:before {
176 | content: "\f02f";
177 | }
178 | .pf-ogone:before {
179 | content: "\f030";
180 | }
181 | .pf-paybox:before {
182 | content: "\f031";
183 | }
184 | .pf-paylife:before {
185 | content: "\f032";
186 | }
187 | .pf-paypal:before {
188 | content: "\f033";
189 | }
190 | .pf-paypal-alt:before {
191 | content: "\f034";
192 | }
193 | .pf-paysafecard:before {
194 | content: "\f035";
195 | }
196 | .pf-postepay:before {
197 | content: "\f036";
198 | }
199 | .pf-quick:before {
200 | content: "\f037";
201 | }
202 | .pf-rechnung:before {
203 | content: "\f038";
204 | }
205 | .pf-ripple:before {
206 | content: "\f039";
207 | }
208 | .pf-rub:before {
209 | content: "\f03a";
210 | }
211 | .pf-skrill:before {
212 | content: "\f03b";
213 | }
214 | .pf-sofort:before {
215 | content: "\f03c";
216 | }
217 | .pf-square:before {
218 | content: "\f03d";
219 | }
220 | .pf-stripe:before {
221 | content: "\f03e";
222 | }
223 | .pf-truste:before {
224 | content: "\f03f";
225 | }
226 | .pf-try:before {
227 | content: "\f040";
228 | }
229 | .pf-unionpay:before {
230 | content: "\f041";
231 | }
232 | .pf-usd:before {
233 | content: "\f042";
234 | }
235 | .pf-verified-by-visa:before {
236 | content: "\f043";
237 | }
238 | .pf-verisign:before {
239 | content: "\f044";
240 | }
241 | .pf-visa:before {
242 | content: "\f045";
243 | }
244 | .pf-visa-electron:before {
245 | content: "\f046";
246 | }
247 | .pf-western-union:before {
248 | content: "\f047";
249 | }
250 | .pf-western-union-alt:before {
251 | content: "\f048";
252 | }
253 | .pf-wirecard:before {
254 | content: "\f049";
255 | }
256 | .pf-sepa:before {
257 | content: "\f04a";
258 | }
259 | .pf-sepa-alt:before {
260 | content: "\f04b";
261 | }
262 | .pf-apple-pay:before {
263 | content: "\f04c";
264 | }
265 | .pf-interac:before {
266 | content: "\f04d";
267 | }
268 | .pf-paymill:before {
269 | content: "\f04e";
270 | }
271 | .pf-dankort:before {
272 | content: "\f04f";
273 | }
274 | .pf-bancontact-mister-cash:before {
275 | content: "\f050";
276 | }
277 | .pf-moip:before {
278 | content: "\f051";
279 | }
280 | .pf-pagseguro:before {
281 | content: "\f052";
282 | }
283 | .pf-cash-on-pickup:before {
284 | content: "\f053";
285 | }
286 | .pf-sage:before {
287 | content: "\f054";
288 | }
289 | .pf-elo:before {
290 | content: "\f055";
291 | }
292 | .pf-elo-alt:before {
293 | content: "\f056";
294 | }
295 | .pf-payu:before {
296 | content: "\f057";
297 | }
298 | .pf-mercado-pago:before {
299 | content: "\f058";
300 | }
301 | .pf-mercado-pago-sign:before {
302 | content: "\f059";
303 | }
304 | .pf-payshop:before {
305 | content: "\f05a";
306 | }
307 | .pf-multibanco:before {
308 | content: "\f05b";
309 | }
310 | .pf-gratipay-sign:before {
311 | content: "\f05c";
312 | }
313 | .pf-six:before {
314 | content: "\f05d";
315 | }
316 | .pf-cashcloud:before {
317 | content: "\f05e";
318 | }
319 |
320 | /*
321 | * Finito!
322 | */
--------------------------------------------------------------------------------
/classes/class-widget-wc-payment-methods.php:
--------------------------------------------------------------------------------
1 | slug = 'vendocrat_payment_methods';
33 | $this->name = __( 'Payment Methods', 'woocommerce-payment-methods' );
34 | $this->desc = __( 'Easily display your accepted payment methods', 'woocommerce-payment-methods' );
35 | $this->title = __( 'Accepted Payment Methods', 'woocommerce-payment-methods' );
36 |
37 | parent::__construct(
38 | $this->slug,
39 | 'vendocrat: '. $this->name,
40 | array(
41 | 'description' => $this->desc,
42 | )
43 | );
44 | }
45 |
46 | /**
47 | * Front-end display of widget
48 | *
49 | * @param array $args Widget arguments.
50 | * @param array $instance Saved values from database.
51 | * @return void
52 | *
53 | * @since 2014-09-08
54 | * @version 2014-09-15
55 | **************************************************/
56 | public function widget( $args, $instance ) {
57 | $title = apply_filters( 'widget_title', $instance['title'] );
58 |
59 | $methods = $instance['methods'];
60 | $style = $instance['style'];
61 | $tooltip = ($instance['tooltip'] != 'true') ? false : true;
62 | $placement = $instance['placement'];
63 | $xclass = $instance['xclass'];
64 |
65 | extract($args);
66 |
67 | echo $before_widget;
68 |
69 | if ( $title ) {
70 | echo $before_title . $title . $after_title;
71 | }
72 |
73 | global $vendocrat_wc_payment_methods;
74 |
75 | $atts = array(
76 | 'methods' => $methods,
77 | 'style' => $style,
78 | 'tooltip' => $tooltip,
79 | 'placement' => $placement,
80 | 'xclass' => $xclass,
81 | );
82 | echo $vendocrat_wc_payment_methods->get_payment_methods( $atts );
83 |
84 | echo $after_widget;
85 | }
86 |
87 | /**
88 | * Back-end widget form
89 | *
90 | * @param array $instance Previously saved values from database.
91 | *
92 | * @since 2014-09-08
93 | * @version 2014-09-15
94 | **************************************************/
95 | public function form( $instance ) {
96 | $defaults = array(
97 | 'title' => $this->title,
98 | 'methods' => '',
99 | 'style' => 'default',
100 | 'tooltip' => 'false',
101 | 'placement' => 'bottom',
102 | 'xclass' => '',
103 | );
104 | $instance = wp_parse_args( (array) $instance, $defaults );
105 | ?>
106 |
107 | :
108 |
109 |
110 |
111 | :
112 |
113 | >
114 | >
115 | >
116 |
117 |
118 |
119 |
120 |
121 | >
122 | >
123 |
124 |
125 |
126 | :
127 |
128 | >
129 | >
130 | >
131 | >
132 |
133 |
134 |
135 | :
136 |
137 |
138 |
139 | :
140 |
141 | '. __( 'Optional', 'woocommerce-payment-methods' ) . ': ' . sprintf( __( 'Specify payment methods to be shown manually by entering their slugs comma separated (eg. "paypal,visa,mastercard" for PayPal, Visa and MasterCard). See %s for available payment methods an their slugs! If left blank the widget will try to automatically fetch available payment methods from WooCommerce.', 'woocommerce-payment-methods' ), 'PaymentFont.io ' ); ?>
142 |
143 | file = $file;
42 | $this->plugin_url = trailingslashit( plugins_url( '', $plugin = $file ) );
43 | $this->plugin_dir = trailingslashit( dirname( $file ) );
44 |
45 | // definitions
46 | $this->defines();
47 |
48 | // load functions and classes
49 | $this->load_functions();
50 | $this->load_classes();
51 |
52 | // load text domain
53 | $this->load_plugin_textdomain();
54 |
55 | $this->available_methods = array(
56 | 'amazon' => 'Amazon',
57 | 'american-express' => 'American Express',
58 | 'atm' => 'ATM',
59 | 'bank-transfer' => __( 'Bank Transfer', 'woocommerce-payment-methods' ),
60 | 'bankomat' => 'Bankomat',
61 | 'bitcoin' => 'Bitcoin',
62 | 'braintree' => 'Braintree',
63 | 'carta-si' => 'Carta Si',
64 | 'cash' => __( 'Cash', 'woocommerce-payment-methods' ),
65 | 'cash-on-delivery' => __( 'Cash on Delivery', 'woocommerce-payment-methods' ),
66 | 'cb' => 'CB',
67 | 'cirrus' => 'Cirrus',
68 | // 'cheque' => __( 'Pay with Cheque', 'woocommerce-payment-methods' ),
69 | 'clickandbuy' => 'ClickAndBuy',
70 | 'credit-card' => __( 'Credit Card', 'woocommerce-payment-methods' ),
71 | 'diners' => 'Diners Club',
72 | 'discover' => 'Discover',
73 | 'ec' => 'EC (Electronic Cash)',
74 | 'eps' => 'Eps',
75 | 'fattura' => __( 'Invoice', 'woocommerce-payment-methods' ),
76 | 'facture' => __( 'Invoice', 'woocommerce-payment-methods' ),
77 | 'flattr' => 'Flattr',
78 | 'giropay' => 'Giropay',
79 | 'gittip' => 'Gittip',
80 | 'google-wallet' => 'Google Wallet',
81 | 'ideal' => 'Ideal',
82 | 'invoice' => __( 'Invoice', 'woocommerce-payment-methods' ),
83 | 'jcb' => 'JCB',
84 | 'maestro' => 'Maestro',
85 | 'mastercard' => 'MasterCard',
86 | 'mastercard-securecode' => 'MasterCard Securecode',
87 | 'ogone' => 'Ogone',
88 | 'paybox' => 'Paybox',
89 | 'paylife' => 'Paylife',
90 | 'paymill' => 'Paymill',
91 | 'paypal' => 'PayPal',
92 | 'paysafecard' => 'paysafecard',
93 | 'postepay' => 'postepay',
94 | 'quick' => 'Quick',
95 | 'invoice' => __( 'Invoice', 'woocommerce-payment-methods' ),
96 | 'ripple' => 'Ripple',
97 | 'skrill' => 'Skrill',
98 | 'sofort' => 'SofortÜberweisung',
99 | 'square' => 'Square',
100 | 'stripe' => 'Stripe',
101 | 'truste' => 'Truste',
102 | 'unionpay' => 'Unionpay',
103 | 'verified-by-visa' => 'Verified By Visa',
104 | 'verisign' => 'Verisign',
105 | 'visa' => 'Visa',
106 | 'visa-electron' => 'Visa Electron',
107 | 'western-union' => 'Western Union',
108 | 'wirecard' => 'Wirecard',
109 | );
110 |
111 | // scripts and styles
112 | if ( ! is_admin() ) :
113 | add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_styles' ) );
114 | add_action( 'wp_enqueue_scripts', array( &$this, 'enqueue_scripts' ) );
115 | endif;
116 |
117 | // register widgets
118 | add_action( 'widgets_init', array( &$this, 'register_widgets' ) );
119 |
120 | // add shortcode
121 | add_shortcode( 'v_woo_payment_methods', array( &$this, 'get_payment_methods' ) );
122 | add_shortcode( 'wc_payment_methods', array( &$this, 'get_payment_methods' ) );
123 | }
124 |
125 | /**
126 | * Definitions
127 | *
128 | * @return void
129 | *
130 | * @since 2014-09-22
131 | * @version 2014-09-22
132 | **************************************************/
133 | function defines() {
134 | // Plugin
135 | define( 'WC_PAYMENT_METHODS_DIR', $this->plugin_dir );
136 | define( 'WC_PAYMENT_METHODS_URI', $this->plugin_url );
137 |
138 | // Assets
139 | define( 'WC_PAYMENT_METHODS_CSS_URI', trailingslashit( WC_PAYMENT_METHODS_URI . 'assets/css' ) );
140 | define( 'WC_PAYMENT_METHODS_IMG_URI', trailingslashit( WC_PAYMENT_METHODS_URI . 'assets/img' ) );
141 | }
142 |
143 | /**
144 | * Load functions
145 | *
146 | * @return void
147 | *
148 | * @since 2014-09-07
149 | * @version 2014-09-07
150 | **************************************************/
151 | function load_functions() {}
152 |
153 | /**
154 | * Load classes
155 | *
156 | * @return void
157 | *
158 | * @since 2014-09-07
159 | * @version 2014-09-07
160 | **************************************************/
161 | function load_classes() {}
162 |
163 | /**
164 | * Load theme textdomain
165 | *
166 | * @return void
167 | *
168 | * @since 2014-09-08
169 | * @version 2014-10-23
170 | **************************************************/
171 | public function load_plugin_textdomain() {
172 | $locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce-payment-methods' );
173 | $dir = trailingslashit( WP_LANG_DIR );
174 |
175 | /**
176 | * Frontend/global Locale. Looks in:
177 | * - WP_LANG_DIR/woocommerce-payment-methods/woocommerce-payment-methods-LOCALE.mo
178 | * - woocommerce-payment-methods/languages/woocommerce-payment-methods-LOCALE.mo (which if not found falls back to:)
179 | * - WP_LANG_DIR/plugins/woocommerce-payment-methods-LOCALE.mo
180 | */
181 | load_textdomain( 'woocommerce-payment-methods', $dir .'woocommerce-payment-methods/woocommerce-payment-methods-'. $locale .'.mo' );
182 | load_plugin_textdomain( 'woocommerce-payment-methods', false, plugin_basename( $this->plugin_dir ) .'/languages/' );
183 | }
184 |
185 | /**
186 | * Enqueue Styles
187 | *
188 | * @return void
189 | *
190 | * @since 2014-09-07
191 | * @version 2014-09-21
192 | **************************************************/
193 | function enqueue_styles() {
194 | if ( ! wp_style_is( 'vendocrat-paymentfont', 'registered' ) ) {
195 | wp_register_style( 'vendocrat-paymentfont', WC_PAYMENT_METHODS_CSS_URI .'paymentfont.min.css', array(), false, 'all' );
196 | }
197 | wp_enqueue_style( 'vendocrat-paymentfont' );
198 |
199 | wp_register_style( 'payment-methods', WC_PAYMENT_METHODS_CSS_URI .'payment-methods.min.css', array(), false, 'all' );
200 | wp_enqueue_style( 'payment-methods' );
201 | }
202 |
203 | /**
204 | * Enqueue Scripts
205 | *
206 | * @return void
207 | *
208 | * @since 2014-09-07
209 | * @version 2014-09-07
210 | **************************************************/
211 | function enqueue_scripts() {}
212 |
213 | /**
214 | * Register Widgets
215 | *
216 | * @return void
217 | *
218 | * @since 2014-09-07
219 | * @version 2014-09-08
220 | **************************************************/
221 | function register_widgets() {
222 | require_once WC_PAYMENT_METHODS_DIR .'classes/class-widget-wc-payment-methods.php';
223 | register_widget( 'vendocrat_Widget_WC_Payment_Methods' );
224 | }
225 |
226 | /**
227 | * Woo Accepted Payment Methods
228 | *
229 | * @since 2014-09-07
230 | * @version 2015-04-24
231 | **************************************************/
232 | function get_payment_methods( $atts = array(), $content = null ) {
233 | extract(
234 | shortcode_atts(
235 | array(
236 | 'methods' => false, // comma separated list of payment methods icon slugs to be displayed, see http://paymentfont.io for available icons (new since 0.2.0)
237 | 'style' => 'default', // default, i/inverse, o/outline
238 | 'tooltip' => false, // adds data attributes to icon to be used for diplaying tooltips (made for Bootstrap)
239 | 'placement' => 'bottom', // set tooltip placement (new since 0.1.2)
240 | 'xclass' => false, // add any extra classes, seperated by a space
241 | ), $atts
242 | )
243 | );
244 |
245 | $class = 'payment-methods';
246 | $class.= ($style) ? ' payment-methods-'. $style : '';
247 | $class.= ($xclass) ? ' '. $xclass : '';
248 |
249 | // use the passed methods array if it's not empty, otherwhise use available gateways/methods
250 | if ( ! $methods ) {
251 | $gateways = $this->get_available_gateways();
252 | $methods = $gateways['methods'];
253 | }
254 |
255 | if ( $methods ) {
256 | $methods = explode( ',', $methods );
257 |
258 | foreach ( $methods as $key => $slug ) {
259 | if ( $slug )
260 | $methods[$slug] = $slug;
261 | }
262 |
263 | $methods = array_flip( $methods );
264 | }
265 |
266 | // Filter for methods (new as of v1.1.0)
267 | $methods = apply_filters( 'vendocrat_filter_wc_payment_methods', $methods );
268 |
269 | if ( ! is_array($methods) OR count($methods) <= 0 )
270 | return __( 'No Payment Methods available or specified.', 'woocommerce-payment-methods' );
271 |
272 | // remove duplicate methods
273 | $methods = array_unique($methods);
274 |
275 | // sort array
276 | ksort($methods);
277 |
278 | // let the magic happen
279 | $icons = '';
280 | foreach ( $methods as $slug ) {
281 | $icon = '';
282 |
283 | // continue if we have no corresponding icon
284 | if ( ! array_key_exists ( $slug, $this->available_methods ) )
285 | continue;
286 |
287 | // retrieve title
288 | $title = $this->available_methods[$slug];
289 |
290 | // build icon class
291 | $iclass = 'pf pf-'. $slug .' '. $slug;
292 |
293 | // icon markup
294 | $icon = ' ';
299 |
300 | // wrap in list item tags and append to $icons
301 | $icons.= ''. $icon .' ';
302 | }
303 |
304 | $icons = apply_filters( 'vendocrat_filter_wc_payment_methods_icons', $icons );
305 |
306 | // return $output if we have icons
307 | if ( $icons ) {
308 | $output = '';
311 |
312 | return $output;
313 | }
314 | }
315 |
316 | /**
317 | * Get available gateways
318 | *
319 | * @todo refactor automatic display of payment methods, eg. for PayPal & Stripe
320 | *
321 | * @since 2014-09-07
322 | * @version 2015-04-24
323 | **************************************************/
324 | function get_available_gateways() {
325 | $gateways = array();
326 | $methods = '';
327 |
328 | // check dependencies
329 | if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) )
330 | return $gateways;
331 |
332 | if ( $available_gateways = WC()->payment_gateways->get_available_payment_gateways() ) {
333 |
334 | foreach ( $available_gateways as $gateway ) {
335 | $gateway_id = $gateway->id;
336 | $gateway_title = $gateway->get_title();
337 | $gateway_desc = $gateway->get_description();
338 | $gateway_icon = $gateway->get_icon();
339 |
340 | switch ( $gateway_id ) {
341 | case 'bacs' :
342 | $methods.= ' bank-transfer';
343 | break;
344 |
345 | case 'cheque' :
346 | $methods.= ' cheque';
347 | break;
348 |
349 | case 'paymill' :
350 | $methods.= ' paymill';
351 | /* $methods.= ' credit-card';
352 | $methods.= ' visa';
353 | $methods.= ' mastercard';
354 | $methods.= ' american-express';
355 | $methods.= ' discover';
356 | $methods.= ' diners';
357 | $methods.= ' jcb';*/
358 | break;
359 |
360 | case 'paypal' :
361 | // $methods.= ' credit-card';
362 | $methods.= ' paypal';
363 | /* $methods.= ' visa';
364 | $methods.= ' mastercard';
365 | $methods.= ' american-express';
366 | $methods.= ' discover';
367 | $methods.= ' diners';
368 | $methods.= ' jcb';*/
369 | break;
370 |
371 | case 'stripe' :
372 | $methods.= ' stripe';
373 | /* $methods.= ' visa';
374 | $methods.= ' mastercard';
375 | $methods.= ' american-express';
376 | $methods.= ' discover';
377 | $methods.= ' diners';
378 | $methods.= ' jcb';*/
379 | break;
380 |
381 | case 'wirecard' :
382 | $options = get_option('woocommerce_wirecard_settings');
383 |
384 | if ( is_array($options) AND array_key_exists( 'paymenttype_available', $options ) AND is_array( $options['paymenttype_available'] ) ) {
385 | $wirecard_gateways = $options['paymenttype_available'];
386 | } else {
387 | $wirecard_gateways = array();
388 | }
389 |
390 | if ( is_array($options) AND array_key_exists( 'subs_paymenttype_options', $options ) AND is_array( $options['subs_paymenttype_options'] ) ) {
391 | $wirecard_gateways_subscription = $options['subs_paymenttype_options'];
392 | } else {
393 | $wirecard_gateways_subscription = array();
394 | }
395 |
396 | $wirecard_gateways = array_merge( $wirecard_gateways, $wirecard_gateways_subscription );
397 |
398 | if ( count($wirecard_gateways) > 0 ) {
399 | foreach ( $wirecard_gateways as $wirecard_gateway ) {
400 | $wirecard_gateway = strtolower( $wirecard_gateway );
401 |
402 | switch ( $wirecard_gateway ) {
403 | case 'select' :
404 | break;
405 |
406 | case 'ccard' :
407 | $methods.= ' credit-card';
408 | // $methods.= ' visa';
409 | // $methods.= ' mastercard';
410 | break;
411 |
412 | case 'idl' :
413 | $methods.= ' ideal';
414 | break;
415 |
416 | case 'paymill' :
417 | $methods.= ' paymill';
418 | /* $methods.= ' credit-card';
419 | $methods.= ' visa';
420 | $methods.= ' mastercard';
421 | $methods.= ' american-express';
422 | $methods.= ' discover';
423 | $methods.= ' diners';
424 | $methods.= ' jcb';*/
425 | break;
426 |
427 | case 'paypal' :
428 | // $methods.= ' credit-card';
429 | $methods.= ' paypal';
430 | /* $methods.= ' visa';
431 | $methods.= ' mastercard';
432 | $methods.= ' american-express';
433 | $methods.= ' discover';
434 | $methods.= ' diners';
435 | $methods.= ' jcb';*/
436 | break;
437 |
438 | case 'pbx' :
439 | $methods.= ' paybox';
440 | break;
441 |
442 | case 'psc' :
443 | $methods.= ' paysafecard';
444 | break;
445 |
446 | case 'skrilldirect' :
447 | case 'skrillwallet' :
448 | $methods.= ' skrill';
449 | break;
450 |
451 | case 'sofortueberweisung' :
452 | $methods.= ' sofort';
453 | $methods.= ' bank-transfer';
454 | break;
455 |
456 | case 'elv' :
457 | case 'przelewy24' :
458 | case 'moneta' :
459 | case 'c2p' :
460 | case 'bancontact_mistercash' :
461 | case 'przelewy24' :
462 | case 'installment' :
463 | case 'poli' :
464 | case 'ekonto' :
465 | case 'instantbank' :
466 | case 'mpass' :
467 | break;
468 |
469 | default :
470 | $methods.= ' '. $wirecard_gateway;
471 | break;
472 | }
473 | }
474 | }
475 | break;
476 |
477 | case 'ClickAndBuy' :
478 | case 'clickandbuy' :
479 | $methods.= ' clickandbuy';
480 | $methods.= ' bank-transfer';
481 | break;
482 |
483 | case 'sofortgateway' :
484 | $methods.= ' sofort';
485 | $methods.= ' bank-transfer';
486 | break;
487 |
488 | case 'amazon' :
489 | case 'amazon_fps' :
490 | $methods.= ' amazon';
491 | break;
492 |
493 | case 'google' :
494 | case 'wallet' :
495 | case 'google-wallet' :
496 | $methods.= ' clickandbuy';
497 | break;
498 |
499 | case 'bitpay' :
500 | case 'coinbase' :
501 | case 'bitcoin' :
502 | $methods.= ' bitcoin';
503 | break;
504 |
505 | case 'cash_on_delivery' :
506 | $methods.= ' cash-on-delivery';
507 | break;
508 |
509 | default :
510 | break;
511 | }
512 |
513 | $methods = str_replace( ' ', ',', trim($methods) );
514 |
515 | $gateways[$gateway_id] = array(
516 | 'id' => $gateway_id,
517 | 'title' => $gateway_title,
518 | 'desc' => $gateway_desc,
519 | 'icon' => $gateway_icon,
520 | );
521 | }
522 |
523 | }
524 |
525 | // add methods array to gateways array
526 | $gateways['methods'] = $methods;
527 |
528 | return $gateways;
529 | }
530 |
531 | } // END Class
532 |
533 | /**
534 | * Output payment methods
535 | *
536 | * @since 2014-09-08
537 | * @version 2014-10-23
538 | **************************************************/
539 | function wc_payment_methods( $atts = array() ) {
540 | global $vendocrat_wc_payment_methods;
541 |
542 | echo $vendocrat_wc_payment_methods->get_payment_methods( $atts );
543 | }
544 |
545 | /**
546 | * Output payment methods
547 | *
548 | * @deprecated 2014-10-23
549 | * @since 2014-09-08
550 | * @version 2014-09-08
551 | **************************************************/
552 | function v_woo_payment_methods( $atts = array() ) {
553 | wc_payment_methods( $atts );
554 | }
555 |
556 | endif;
557 |
558 | /*
559 | * E fatto!
560 | */
--------------------------------------------------------------------------------