forked from woocommerce/woocommerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin-settings.php
1132 lines (951 loc) · 38.2 KB
/
admin-settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* Functions for the settings page in admin.
*
* The settings page contains options for the WooCommerce plugin - this file contains functions to display
* and save the list of options.
*
* @author WooThemes
* @category Admin
* @package WooCommerce
*/
/**
* Define settings for the WooCommerce settings pages
*/
global $woocommerce_settings;
$woocommerce_settings['general'] = apply_filters('woocommerce_general_settings', array(
array( 'name' => __( 'General Options', 'woothemes' ), 'type' => 'title', 'desc' => '', 'id' => 'general_options' ),
array(
'name' => __( 'Base Country/Region', 'woothemes' ),
'desc' => __( 'This is the base country for your business. Tax rates will be based on this country.', 'woothemes' ),
'id' => 'woocommerce_default_country',
'css' => 'min-width:300px;',
'std' => 'GB',
'type' => 'single_select_country'
),
array(
'name' => __( 'Currency', 'woothemes' ),
'desc' => __("This controls what currency prices are listed at in the catalog and which currency gateways will take payments in.", 'woothemes' ),
'tip' => '',
'id' => 'woocommerce_currency',
'css' => 'min-width:300px;',
'std' => 'GBP',
'type' => 'select',
'class' => 'chosen_select',
'options' => array_unique(apply_filters('woocommerce_currencies', array(
'USD' => __( 'US Dollars ($)', 'woothemes' ),
'EUR' => __( 'Euros (€)', 'woothemes' ),
'GBP' => __( 'Pounds Sterling (£)', 'woothemes' ),
'AUD' => __( 'Australian Dollars ($)', 'woothemes' ),
'BRL' => __( 'Brazilian Real ($)', 'woothemes' ),
'CAD' => __( 'Canadian Dollars ($)', 'woothemes' ),
'CZK' => __( 'Czech Koruna', 'woothemes' ),
'DKK' => __( 'Danish Krone', 'woothemes' ),
'HKD' => __( 'Hong Kong Dollar ($)', 'woothemes' ),
'HUF' => __( 'Hungarian Forint', 'woothemes' ),
'ILS' => __( 'Israeli Shekel', 'woothemes' ),
'JPY' => __( 'Japanese Yen (¥)', 'woothemes' ),
'MYR' => __( 'Malaysian Ringgits', 'woothemes' ),
'MXN' => __( 'Mexican Peso ($)', 'woothemes' ),
'NZD' => __( 'New Zealand Dollar ($)', 'woothemes' ),
'NOK' => __( 'Norwegian Krone', 'woothemes' ),
'PHP' => __( 'Philippine Pesos', 'woothemes' ),
'PLN' => __( 'Polish Zloty', 'woothemes' ),
'SGD' => __( 'Singapore Dollar ($)', 'woothemes' ),
'SEK' => __( 'Swedish Krona', 'woothemes' ),
'CHF' => __( 'Swiss Franc', 'woothemes' ),
'TWD' => __( 'Taiwan New Dollars', 'woothemes' ),
'THB' => __( 'Thai Baht', 'woothemes' ),
'TRY' => __( 'Turkish Lira (TL)', 'woothemes' ),
'ZAR' => __( 'South African rand (R)', 'woothemes' ),
))
)
),
array(
'name' => __( 'Allowed Countries', 'woothemes' ),
'desc' => __( 'These are countries that you are willing to ship to.', 'woothemes' ),
'id' => 'woocommerce_allowed_countries',
'std' => 'all',
'type' => 'select',
'class' => 'chosen_select',
'css' => 'min-width:300px;',
'options' => array(
'all' => __( 'All Countries', 'woothemes' ),
'specific' => __( 'Specific Countries', 'woothemes' )
)
),
array(
'name' => __( 'Specific Countries', 'woothemes' ),
'desc' => '',
'id' => 'woocommerce_specific_allowed_countries',
'css' => '',
'std' => '',
'type' => 'multi_select_countries'
),
array(
'name' => __( 'Checkout', 'woothemes' ),
'desc' => __( 'Allow users to checkout without signing up for an account', 'woothemes' ),
'id' => 'woocommerce_enable_guest_checkout',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Allow users to create an account and login from the checkout page', 'woothemes' ),
'id' => 'woocommerce_enable_signup_and_login_from_checkout',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( '"Ship to same address option" checked by default', 'woothemes' ),
'id' => 'woocommerce_ship_to_same_address',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Show order comments section', 'woothemes' ),
'id' => 'woocommerce_enable_order_comments',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Force <abbr title="Secure Sockets Layer, a computing protocol that ensures the security of data sent via the Internet by using encryption">SSL</abbr>/HTTPS (an SSL Certificate is required)', 'woothemes' ),
'id' => 'woocommerce_force_ssl_checkout',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Un-force <abbr title="Secure Sockets Layer, a computing protocol that ensures the security of data sent via the Internet by using encryption">SSL</abbr>/HTTPS when leaving the checkout', 'woothemes' ),
'id' => 'woocommerce_unforce_ssl_checkout',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Customer Accounts', 'woothemes' ),
'desc' => __( 'Allow unregistered users to register from the My Account page', 'woothemes' ),
'id' => 'woocommerce_enable_myaccount_registration',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Clear cart when logging out', 'woothemes' ),
'id' => 'woocommerce_clear_cart_on_logout',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Prevent customers from accessing WordPress admin', 'woothemes' ),
'id' => 'woocommerce_lock_down_admin',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Shop Styling', 'woothemes' ),
'desc' => __( 'Enable WooCommerce CSS styles', 'woothemes' ),
'id' => 'woocommerce_frontend_css',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Enable AJAX add to cart buttons on product archives', 'woothemes' ),
'id' => 'woocommerce_enable_ajax_add_to_cart',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Enable WooCommerce lightbox on the product page', 'woothemes' ),
'id' => 'woocommerce_enable_lightbox',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Demo store notice', 'woothemes' ),
'desc' => __( 'Enable the "Demo Store" notice on your site', 'woothemes' ),
'id' => 'woocommerce_demo_store',
'std' => 'no',
'type' => 'checkbox'
),
array(
'name' => __('File downloads', 'woothemes'),
'desc' => __('Use <code>X-Accel-Redirect</code>/ <code>X-Sendfile</code> to serve downloads (server requires <code>mod_xsendfile</code>)', 'woothemes'),
'id' => 'woocommerce_mod_xsendfile_enabled',
'type' => 'checkbox',
'std' => 'no',
),
array(
'name' => __('Localisation', 'woothemes'),
'desc' => __('Use informal localisation file if it exists', 'woothemes'),
'id' => 'woocommerce_informal_localisation_type',
'type' => 'checkbox',
'std' => 'no',
),
array( 'type' => 'sectionend', 'id' => 'general_options'),
array( 'name' => __( 'ShareThis', 'woothemes' ), 'type' => 'title', 'desc' => '', 'id' => 'share_this' ),
array(
'name' => __( 'ShareThis Publisher ID', 'woothemes' ),
'desc' => sprintf( __( 'Enter your %1$sShareThis publisher ID%2$s to show social sharing buttons on product pages.', 'woothemes' ), '<a href="http://sharethis.com/account/">', '</a>' ),
'id' => 'woocommerce_sharethis',
'type' => 'text',
'std' => '',
'css' => 'min-width:300px;',
),
array( 'type' => 'sectionend', 'id' => 'share_this'),
array( 'name' => __( 'Google Analytics', 'woothemes' ), 'type' => 'title', 'desc' => '', 'id' => 'google_analytics' ),
array(
'name' => __('Google Analytics ID', 'woothemes'),
'desc' => __('Log into your google analytics account to find your ID. e.g. <code>UA-XXXXX-X</code>', 'woothemes'),
'id' => 'woocommerce_ga_id',
'type' => 'text',
'css' => 'min-width:300px;',
),
array(
'name' => __('Tracking code', 'woothemes'),
'desc' => __('Add tracking code to your site\'s footer. You don\'t need to enable this if using a 3rd party analytics plugin.', 'woothemes'),
'id' => 'woocommerce_ga_standard_tracking_enabled',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'name' => __('Tracking code', 'woothemes'),
'desc' => __('Add eCommerce tracking code to the thankyou page', 'woothemes'),
'id' => 'woocommerce_ga_ecommerce_tracking_enabled',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array( 'type' => 'sectionend', 'id' => 'google_analytics'),
)); // End general settings
$shop_page_id = get_option('woocommerce_shop_page_id');
$base_slug = ($shop_page_id > 0 && get_page( $shop_page_id )) ? get_page_uri( $shop_page_id ) : 'shop';
$woocommerce_settings['pages'] = apply_filters('woocommerce_page_settings', array(
array( 'name' => __( 'Page Setup', 'woothemes' ), 'type' => 'title', 'desc' => '', 'id' => 'page_options' ),
array(
'name' => __( 'Shop Base Page', 'woothemes' ),
'desc' => sprintf( __( 'This sets the base page of your shop.', 'woothemes' ), '<a target="_blank" href="options-permalink.php">', '</a>' ),
'id' => 'woocommerce_shop_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __( 'Base Page Title', 'woothemes' ),
'desc' => __( 'This title to show on the shop base page. Leave blank to use the page title.', 'woothemes' ),
'id' => 'woocommerce_shop_page_title',
'type' => 'text',
'css' => 'min-width:300px;',
'std' => 'All Products' // Default value for the page title - changed in settings
),
array(
'name' => __( 'Terms page ID', 'woothemes' ),
'desc' => __( 'If you define a "Terms" page the customer will be asked if they accept them when checking out.', 'woothemes' ),
'tip' => '',
'id' => 'woocommerce_terms_page_id',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
'type' => 'single_select_page'
),
array(
'name' => __( 'Logout link', 'woothemes' ),
'desc' => sprintf(__( 'Append a logout link to menus containing "My Account"', 'woothemes' ), $base_slug),
'id' => 'woocommerce_menu_logout_link',
'std' => 'yes',
'type' => 'checkbox',
),
array( 'type' => 'sectionend', 'id' => 'page_options' ),
array( 'name' => __( 'Permalinks', 'woothemes' ), 'type' => 'title', 'desc' => '', 'id' => 'permalink_options' ),
array(
'name' => __( 'Taxonomy base page', 'woothemes' ),
'desc' => sprintf(__( 'Prepend shop categories/tags with shop base page (<code>%s</code>)', 'woothemes' ), $base_slug),
'id' => 'woocommerce_prepend_shop_page_to_urls',
'std' => 'no',
'type' => 'checkbox',
),
array(
'name' => __( 'Product base page', 'woothemes' ),
'desc' => sprintf(__( 'Prepend product permalinks with shop base page (<code>%s</code>)', 'woothemes' ), $base_slug),
'id' => 'woocommerce_prepend_shop_page_to_products',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'name' => __( 'Product base category', 'woothemes' ),
'desc' => __( 'Prepend product permalinks with product category', 'woothemes' ),
'id' => 'woocommerce_prepend_category_to_products',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array( 'type' => 'sectionend', 'id' => 'permalink_options' ),
array( 'name' => __( 'Shop Pages', 'woothemes' ), 'type' => 'title', 'desc' => __( 'The following pages need selecting so that WooCommerce knows which are which. These pages should have been created upon installation of the plugin.', 'woothemes' ) ),
array(
'name' => __( 'Cart Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_cart]', 'woothemes' ),
'id' => 'woocommerce_cart_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __( 'Checkout Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_checkout]', 'woothemes' ),
'id' => 'woocommerce_checkout_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __( 'Pay Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_pay] Parent: "Checkout"', 'woothemes' ),
'id' => 'woocommerce_pay_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __('Thanks Page', 'woothemes'),
'desc' => __( 'Page contents: [woocommerce_thankyou] Parent: "Checkout"', 'woothemes' ),
'id' => 'woocommerce_thanks_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __( 'My Account Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_my_account]', 'woothemes' ),
'id' => 'woocommerce_myaccount_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __( 'Edit Address Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_edit_address] Parent: "My Account"', 'woothemes' ),
'id' => 'woocommerce_edit_address_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __( 'View Order Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_view_order] Parent: "My Account"', 'woothemes' ),
'id' => 'woocommerce_view_order_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array(
'name' => __( 'Change Password Page', 'woothemes' ),
'desc' => __( 'Page contents: [woocommerce_change_password] Parent: "My Account"', 'woothemes' ),
'id' => 'woocommerce_change_password_page_id',
'type' => 'single_select_page',
'std' => '',
'class' => 'chosen_select_nostd',
'css' => 'min-width:300px;',
),
array( 'type' => 'sectionend', 'id' => 'page_options'),
)); // End pages settings
$woocommerce_settings['catalog'] = apply_filters('woocommerce_catalog_settings', array(
array( 'name' => __( 'Catalog Options', 'woothemes' ), 'type' => 'title','desc' => '', 'id' => 'catalog_options' ),
array(
'name' => __( 'Subcategories', 'woothemes' ),
'desc' => __( 'Show subcategories on category pages', 'woothemes' ),
'id' => 'woocommerce_show_subcategories',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Show subcategories on the shop page', 'woothemes' ),
'id' => 'woocommerce_shop_show_subcategories',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'When showing subcategories, hide products', 'woothemes' ),
'id' => 'woocommerce_hide_products_when_showing_subcategories',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Product fields', 'woothemes' ),
'desc' => __( 'Enable the SKU field for products', 'woothemes' ),
'id' => 'woocommerce_enable_sku',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Enable the weight field for products', 'woothemes' ),
'id' => 'woocommerce_enable_weight',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Enable the dimension fields for products', 'woothemes' ),
'id' => 'woocommerce_enable_dimensions',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Show weight and dimension fields in product attributes tab', 'woothemes' ),
'id' => 'woocommerce_enable_dimension_product_attributes',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Weight Unit', 'woothemes' ),
'desc' => __( 'This controls what unit you will define weights in.', 'woothemes' ),
'id' => 'woocommerce_weight_unit',
'css' => 'min-width:150px;',
'std' => 'GBP',
'type' => 'select',
'options' => array(
'kg' => __( 'kg', 'woothemes' ),
'lbs' => __( 'lbs', 'woothemes' )
)
),
array(
'name' => __( 'Dimensions Unit', 'woothemes' ),
'desc' => __( 'This controls what unit you will define lengths in.', 'woothemes' ),
'id' => 'woocommerce_dimension_unit',
'css' => 'min-width:150px;',
'std' => 'GBP',
'type' => 'select',
'options' => array(
'cm' => __( 'cm', 'woothemes' ),
'in' => __( 'in', 'woothemes' )
)
),
array(
'name' => __( 'Cart redirect', 'woothemes' ),
'desc' => __( 'Redirect to cart after adding a product to the cart (on single product pages)', 'woothemes' ),
'id' => 'woocommerce_cart_redirect_after_add',
'std' => 'no',
'type' => 'checkbox'
),
array( 'type' => 'sectionend', 'id' => 'catalog_options' ),
array( 'name' => __( 'Pricing Options', 'woothemes' ), 'type' => 'title','desc' => '', 'id' => 'pricing_options' ),
array(
'name' => __( 'Currency Position', 'woothemes' ),
'desc' => __( 'This controls the position of the currency symbol.', 'woothemes' ),
'tip' => '',
'id' => 'woocommerce_currency_pos',
'css' => 'min-width:150px;',
'std' => 'left',
'type' => 'select',
'options' => array(
'left' => __( 'Left', 'woothemes' ),
'right' => __( 'Right', 'woothemes' ),
'left_space' => __( 'Left (with space)', 'woothemes' ),
'right_space' => __( 'Right (with space)', 'woothemes' )
)
),
array(
'name' => __( 'Thousand separator', 'woothemes' ),
'desc' => __( 'This sets the thousand separator of displayed prices.', 'woothemes' ),
'tip' => '',
'id' => 'woocommerce_price_thousand_sep',
'css' => 'width:30px;',
'std' => ',',
'type' => 'text',
),
array(
'name' => __( 'Decimal separator', 'woothemes' ),
'desc' => __( 'This sets the decimal separator of displayed prices.', 'woothemes' ),
'tip' => '',
'id' => 'woocommerce_price_decimal_sep',
'css' => 'width:30px;',
'std' => '.',
'type' => 'text',
),
array(
'name' => __( 'Number of decimals', 'woothemes' ),
'desc' => __( 'This sets the number of decimal points shown in displayed prices.', 'woothemes' ),
'tip' => '',
'id' => 'woocommerce_price_num_decimals',
'css' => 'width:30px;',
'std' => '2',
'type' => 'text',
),
array( 'type' => 'sectionend', 'id' => 'pricing_options' ),
array( 'name' => __( 'Image Options', 'woothemes' ), 'type' => 'title','desc' => sprintf(__('These settings affect the actual dimensions of images in your catalog - the display on the front-end will still be affected by CSS styles. After changing these settings you may need to <a href="%s">regenerate your thumbnails</a>.', 'woothemes'), 'http://wordpress.org/extend/plugins/regenerate-thumbnails/'), 'id' => 'image_options' ),
array(
'name' => __( 'Catalog Images', 'woothemes' ),
'desc' => __('This size is usually used in product listings', 'woothemes'),
'id' => 'woocommerce_catalog_image',
'css' => '',
'type' => 'image_width',
'std' => '150'
),
array(
'name' => __( 'Single Product Image', 'woothemes' ),
'desc' => __('This is the size used by the main image on the product page.', 'woothemes'),
'id' => 'woocommerce_single_image',
'css' => '',
'type' => 'image_width',
'std' => '300'
),
array(
'name' => __( 'Product Thumbnails', 'woothemes' ),
'desc' => __('This size is usually used for the gallery of images on the product page.', 'woothemes'),
'id' => 'woocommerce_thumbnail_image',
'css' => '',
'type' => 'image_width',
'std' => '90'
),
array( 'type' => 'sectionend', 'id' => 'image_options' ),
)); // End catalog settings
$woocommerce_settings['inventory'] = apply_filters('woocommerce_inventory_settings', array(
array( 'name' => __( 'Inventory Options', 'woothemes' ), 'type' => 'title','desc' => '', 'id' => 'inventory_options' ),
array(
'name' => __( 'Manage stock', 'woothemes' ),
'desc' => __( 'Enable stock management', 'woothemes' ),
'id' => 'woocommerce_manage_stock',
'std' => 'yes',
'type' => 'checkbox'
),
array(
'name' => __( 'Notifications', 'woothemes' ),
'desc' => __( 'Enable low stock notifications', 'woothemes' ),
'id' => 'woocommerce_notify_low_stock',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Enable out of stock notifications', 'woothemes' ),
'id' => 'woocommerce_notify_no_stock',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Low stock threshold', 'woothemes' ),
'desc' => '',
'tip' => '',
'id' => 'woocommerce_notify_low_stock_amount',
'css' => 'width:30px;',
'type' => 'text',
'std' => '2'
),
array(
'name' => __( 'Out of stock threshold', 'woothemes' ),
'desc' => '',
'tip' => '',
'id' => 'woocommerce_notify_no_stock_amount',
'css' => 'width:30px;',
'type' => 'text',
'std' => '0'
),
array(
'name' => __( 'Out of stock visibility', 'woothemes' ),
'desc' => __('Hide out of stock items from the catalog', 'woothemes'),
'id' => 'woocommerce_hide_out_of_stock_items',
'std' => 'no',
'type' => 'checkbox'
),
array( 'type' => 'sectionend', 'id' => 'inventory_options'),
)); // End inventory settings
$woocommerce_settings['shipping'] = apply_filters('woocommerce_shipping_settings', array(
array( 'name' => __( 'Shipping Options', 'woothemes' ), 'type' => 'title','desc' => '', 'id' => 'shipping_options' ),
array(
'name' => __( 'Shipping calculations', 'woothemes' ),
'desc' => __( 'Enable shipping', 'woothemes' ),
'id' => 'woocommerce_calc_shipping',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'name' => __( 'Shipping calculations', 'woothemes' ),
'desc' => __( 'Enable the shipping calculator on the cart page', 'woothemes' ),
'id' => 'woocommerce_enable_shipping_calc',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Shipping destination', 'woothemes' ),
'desc' => __( 'Only ship to the users billing address', 'woothemes' ),
'id' => 'woocommerce_ship_to_billing_address_only',
'std' => 'no',
'type' => 'checkbox'
),
array( 'type' => 'sectionend', 'id' => 'shipping_options' ),
)); // End shipping settings
$woocommerce_settings['tax'] = apply_filters('woocommerce_tax_settings', array(
array( 'name' => __( 'Tax Options', 'woothemes' ), 'type' => 'title','desc' => '', 'id' => 'tax_options' ),
array(
'name' => __( 'Tax calculations', 'woothemes' ),
'desc' => __( 'Enable taxes and tax calculations', 'woothemes' ),
'id' => 'woocommerce_calc_taxes',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Catalog Prices include tax', 'woothemes' ),
'id' => 'woocommerce_prices_include_tax',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'desc' => __( 'Round tax at subtotal level, instead of per line', 'woothemes' ),
'id' => 'woocommerce_tax_round_at_subtotal',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Frontend Tax display', 'woothemes' ),
'desc' => __( 'Always display cart contents excluding tax', 'woothemes' ),
'id' => 'woocommerce_display_cart_prices_excluding_tax',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start'
),
array(
'desc' => __( 'Always display cart totals excluding tax', 'woothemes' ),
'id' => 'woocommerce_display_totals_excluding_tax',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),
array(
'name' => __( 'Additional Tax classes', 'woothemes' ),
'desc' => __( 'List 1 per line. This is in addition to the default <em>Standard Rate</em>.', 'woothemes' ),
'tip' => __( 'List product and shipping tax classes here, e.g. Zero Tax, Reduced Rate.', 'woothemes' ),
'id' => 'woocommerce_tax_classes',
'css' => 'width:100%; height: 75px;',
'type' => 'textarea',
'std' => "Reduced Rate\nZero Rate"
),
array(
'name' => __( 'Tax rates', 'woothemes' ),
'desc' => __( 'All fields are required.', 'woothemes' ),
'tip' => __( 'To avoid rounding errors, insert tax rates with 4 decimal places.', 'woothemes' ),
'id' => 'woocommerce_tax_rates',
'css' => 'min-width:50px;',
'type' => 'tax_rates',
'std' => ''
),
array( 'type' => 'sectionend', 'id' => 'tax_options' ),
)); // End tax settings
$woocommerce_settings['email'] = apply_filters('woocommerce_email_settings', array(
array( 'name' => __( 'Email Recipient Options', 'woothemes' ), 'type' => 'title', '', 'id' => 'email_recipient_options' ),
array(
'name' => __( 'New order notifications', 'woothemes' ),
'desc' => __( 'The recipient of new order emails. Defaults to the admin email.', 'woothemes' ),
'id' => 'woocommerce_new_order_email_recipient',
'type' => 'text',
'css' => 'min-width:300px;',
'std' => esc_attr(get_option('admin_email'))
),
array(
'name' => __( 'Inventory notifications', 'woothemes' ),
'desc' => __( 'The recipient of stock emails. Defaults to the admin email.', 'woothemes' ),
'id' => 'woocommerce_stock_email_recipient',
'type' => 'text',
'css' => 'min-width:300px;',
'std' => esc_attr(get_option('admin_email'))
),
array( 'type' => 'sectionend', 'id' => 'email_recipient_options' ),
array( 'name' => __( 'Email Sender Options', 'woothemes' ), 'type' => 'title', '', 'id' => 'email_options' ),
array(
'name' => __( '"From" name', 'woothemes' ),
'desc' => __( 'The sender name for WooCommerce emails.', 'woothemes' ),
'id' => 'woocommerce_email_from_name',
'type' => 'text',
'css' => 'min-width:300px;',
'std' => esc_attr(get_bloginfo('name'))
),
array(
'name' => __( '"From" email address', 'woothemes' ),
'desc' => __( 'The sender email address for WooCommerce emails.', 'woothemes' ),
'id' => 'woocommerce_email_from_address',
'type' => 'text',
'css' => 'min-width:300px;',
'std' => get_option('admin_email')
),
array( 'type' => 'sectionend', 'id' => 'email_options' ),
array( 'name' => __( 'Email template', 'woothemes' ), 'type' => 'title', 'desc' => sprintf(__('This section lets you customise the WooCommerce emails. <a href="%s" target="_blank">Click here to preview your email template</a>. For more advanced control copy <code>woocommerce/templates/emails/</code> to <code>yourtheme/woocommmerce/emails/</code>.', 'woothemes'), wp_nonce_url(admin_url('?preview_woocommerce_mail=true'), 'preview-mail')), 'id' => 'email_template_options' ),
array(
'name' => __( 'Header image', 'woothemes' ),
'desc' => sprintf(__( 'Enter a URL to an image you want to show in the email\'s header. Upload your image using the <a href="%s">media uploader</a>.', 'woothemes' ), admin_url('media-new.php')),
'id' => 'woocommerce_email_header_image',
'type' => 'text',
'css' => 'min-width:300px;',
'std' => ''
),
array(
'name' => __( 'Email footer text', 'woothemes' ),
'desc' => __( 'The text to appear in the footer of WooCommerce emails.', 'woothemes' ),
'id' => 'woocommerce_email_footer_text',
'css' => 'width:100%; height: 75px;',
'type' => 'textarea',
'std' => get_bloginfo('name') . ' - ' . __('Powered by WooCommerce', 'woothemes')
),
array(
'name' => __( 'Base colour', 'woothemes' ),
'desc' => __( 'The base colour for WooCommerce email templates. Default <code>#557da1</code>.', 'woothemes' ),
'id' => 'woocommerce_email_base_color',
'type' => 'color',
'css' => 'width:6em;',
'std' => '#557da1'
),
array(
'name' => __( 'Background colour', 'woothemes' ),
'desc' => __( 'The background colour for WooCommerce email templates. Default <code>#eeeeee</code>.', 'woothemes' ),
'id' => 'woocommerce_email_background_color',
'type' => 'color',
'css' => 'width:6em;',
'std' => '#eeeeee'
),
array(
'name' => __( 'Email body background colour', 'woothemes' ),
'desc' => __( 'The main body background colour. Default <code>#fdfdfd</code>.', 'woothemes' ),
'id' => 'woocommerce_email_body_background_color',
'type' => 'color',
'css' => 'width:6em;',
'std' => '#fdfdfd'
),
array(
'name' => __( 'Email body text colour', 'woothemes' ),
'desc' => __( 'The main body text colour. Default <code>#505050</code>.', 'woothemes' ),
'id' => 'woocommerce_email_text_color',
'type' => 'color',
'css' => 'width:6em;',
'std' => '#505050'
),
array( 'type' => 'sectionend', 'id' => 'email_template_options' ),
)); // End email settings
/**
* Settings page
*
* Handles the display of the main woocommerce settings page in admin.
*/
if (!function_exists('woocommerce_settings')) {
function woocommerce_settings() {
global $woocommerce, $woocommerce_settings;
$current_tab = (isset($_GET['tab'])) ? $_GET['tab'] : 'general';
if( isset( $_POST ) && $_POST ) :
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-settings' ) ) die( __( 'Action failed. Please refresh the page and retry.', 'woothemes' ) );
switch ( $current_tab ) :
case "general" :
case "pages" :
case "catalog" :
case "inventory" :
case "shipping" :
case "tax" :
case "email" :
woocommerce_update_options( $woocommerce_settings[$current_tab] );
break;
endswitch;
do_action( 'woocommerce_update_options' );
do_action( 'woocommerce_update_options_' . $current_tab );
flush_rewrite_rules( false );
wp_redirect( add_query_arg( 'subtab', esc_attr(str_replace('#', '', $_POST['subtab'])), add_query_arg( 'saved', 'true', admin_url( 'admin.php?page=woocommerce&tab=' . $current_tab ) )) );
endif;
if (isset($_GET['saved']) && $_GET['saved']) :
echo '<div id="message" class="updated fade"><p><strong>' . __( 'Your settings have been saved.', 'woothemes' ) . '</strong></p></div>';
flush_rewrite_rules( false );
endif;
// Install/page installer
$install_complete = false;
$show_page_installer = false;
// Add pages button
if (isset($_GET['install_woocommerce_pages']) && $_GET['install_woocommerce_pages']) :
woocommerce_create_pages();
update_option('skip_install_woocommerce_pages', 1);
$install_complete = true;
// Skip button
elseif (isset($_GET['skip_install_woocommerce_pages']) && $_GET['skip_install_woocommerce_pages']) :
update_option('skip_install_woocommerce_pages', 1);
$install_complete = true;
// If we have just activated WooCommerce...
elseif (isset($_GET['installed']) && $_GET['installed']) :
flush_rewrite_rules( false );
if (get_option('woocommerce_shop_page_id')) :
$install_complete = true;
else :
$show_page_installer = true;
endif;
// If we havn't just installed, but page installed has not been skipped and shop page does not exist...
elseif (!get_option('skip_install_woocommerce_pages') && !get_option('woocommerce_shop_page_id')) :
$show_page_installer = true;
endif;
if ($show_page_installer) :
echo '<div id="message" class="updated fade">
<p><strong>' . __( 'Welcome to WooCommerce!', 'woothemes' ) . '</strong></p>
<p>'. __('WooCommerce requires several WordPress pages containing shortcodes in order to work correctly; these include Shop, Cart, Checkout and My Account. To add these pages automatically please click the \'Automatically add pages\' button below, otherwise you can set them up manually. See the \'Pages\' tab in settings for more information.', 'woothemes') .'</p>
<p><a href="'.remove_query_arg('installed', add_query_arg('install_woocommerce_pages', 'true')).'" class="button button-primary">'. __('Automatically add pages', 'woothemes') .'</a> <a href="'.remove_query_arg('installed', add_query_arg('skip_install_woocommerce_pages', 'true')).'" class="button">'. __('Skip setup', 'woothemes') .'</a></p>
</div>';
elseif ($install_complete) :
echo '<div id="message" class="updated fade">
<p style="float:right;">' . __( 'Like WooCommerce? <a href="http://wordpress.org/extend/plugins/woocommerce/">Support us by leaving a rating!</a>', 'woothemes' ) . '</p>
<p><strong>' . __( 'WooCommerce has been installed and setup. Enjoy :)', 'woothemes' ) . '</strong></p>
</div>';
flush_rewrite_rules( false );
endif;
?>
<div class="wrap woocommerce">
<form method="post" id="mainform" action="">
<div class="icon32 icon32-woocommerce-settings" id="icon-woocommerce"><br></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
<?php
$tabs = array(
'general' => __( 'General', 'woothemes' ),
'pages' => __( 'Pages', 'woothemes' ),
'catalog' => __( 'Catalog', 'woothemes' ),
'inventory' => __( 'Inventory', 'woothemes' ),
'shipping' => __( 'Shipping', 'woothemes' ),
'tax' => __( 'Tax', 'woothemes'),
'shipping_methods' => __( 'Shipping Methods', 'woothemes' ),
'payment_gateways' => __( 'Payment Gateways', 'woothemes' ),
'email' => __( 'Emails', 'woothemes' ),
);
$tabs = apply_filters('woocommerce_settings_tabs_array', $tabs);
foreach ($tabs as $name => $label) :
echo '<a href="' . admin_url( 'admin.php?page=woocommerce&tab=' . $name ) . '" class="nav-tab ';
if( $current_tab==$name ) echo 'nav-tab-active';
echo '">' . $label . '</a>';
endforeach;
do_action( 'woocommerce_settings_tabs' );
?>
</h2>
<?php wp_nonce_field( 'woocommerce-settings', '_wpnonce', true, true ); ?>
<?php
switch ($current_tab) :