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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
|
<?php
use Objectiv\Plugins\Checkout\FormAugmenter; use Objectiv\Plugins\Checkout\Managers\SettingsManager;
/** * Takes a callable and excutes it, then returns the content inside * a row / max width column * * @param callback $callable */ function cfw_auto_wrap( callable $callable ) { if ( is_callable( $callable ) ) { ob_start();
call_user_func( $callable );
$func_output = ob_get_clean();
if ( ! empty( $func_output ) ) { $output = '<div class="row">'; $output .= '<div class="col-12">';
$output .= $func_output;
$output .= '</div>'; $output .= '</div>';
echo $output; } } }
/** * Thank you page section wrap open * * @param $class */ function cfw_thank_you_section_start( $class ) { echo "<section class=\"{$class}\">"; }
/** * Thank you page section wrapper * * @param callable $callable * @param $class * @param array $parameters */ function cfw_thank_you_section_auto_wrap( callable $callable, $class, $parameters = array() ) { if ( is_callable( $callable ) ) { ob_start();
call_user_func( $callable, ...$parameters );
$func_output = ob_get_clean();
if ( ! empty( $func_output ) ) { $output = "<section class=\"{$class}\">"; $output .= '<div class="inner">';
$output .= $func_output;
$output .= '</div>'; $output .= '</section>';
echo $output; } } }
/** * The mobile cart summary header * * Includes cart total and button to expand the cart summary * * @param bool $total */ function cfw_cart_summary_mobile_header( $total = false ) { ?> <div id="cfw-mobile-cart-header"> <div class="cfw-display-table cfw-w100"> <a id="cfw-expand-cart" class="cfw-display-table-row"> <span class="cfw-cart-icon cfw-display-table-cell"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-cart"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg> </span>
<span class="cfw-cart-summary-label-show cfw-small cfw-display-table-cell"> <span> <?php if ( ! empty( $cart_summary_mobile_label = SettingsManager::instance()->get_setting( 'cart_summary_mobile_label' ) ) ) : ?> <?php echo $cart_summary_mobile_label; ?> <?php else : ?> <?php /** * Filters show order summary link label * * @param string $show_order_summary_label The show order summary link label * @since 2.0.0 */ echo apply_filters( 'cfw_show_order_summary_link_text', esc_html__( 'Show order summary', 'checkout-wc' ) ); ?> <?php endif; ?> </span>
<svg width="11" height="6" xmlns="http://www.w3.org/2000/svg" class="cfw-arrow" fill="#000"><path d="M.504 1.813l4.358 3.845.496.438.496-.438 4.642-4.096L9.504.438 4.862 4.534h.992L1.496.69.504 1.812z"></path></svg> </span>
<span class="cfw-cart-summary-label-hide cfw-small cfw-display-table-cell"> <span> <?php /** * Filters hide order summary link label * * @param $hide_order_summary_label * @since 3.0.0 */ echo apply_filters( 'cfw_show_order_summary_hide_link_text', esc_html__( 'Hide order summary', 'checkout-wc' ) ); ?> </span>
<svg width="11" height="6" xmlns="http://www.w3.org/2000/svg" class="cfw-arrow" fill="#000"><path d="M.504 1.813l4.358 3.845.496.438.496-.438 4.642-4.096L9.504.438 4.862 4.534h.992L1.496.69.504 1.812z"></path></svg> </span>
<span id="cfw-mobile-total" class="total amount cfw-display-table-cell"> <?php echo empty( $total ) ? WC()->cart->get_total() : $total; ?> </span> </a> </div> </div> <?php }
/** * Helper function to output a close div tag */ function cfw_close_cart_summary_div() { /** * Fires after cart summary before closing </div> tag * * @since 3.0.0 */ do_action( 'cfw_after_cart_summary' ); ?> </div> <?php }
/** * The opening div tag for the cart summary content */ function cfw_cart_summary_content_open_wrap() { ?> <div id="cfw-cart-summary-content"> <?php }
/** * Handles WooCommerce before order review hooks * * This hook is in a different place on our checkout so * we have to wrap it with an ID and apply styles similar to native */ function cfw_cart_summary_before_order_review() { ?> <div id="cfw-checkout-before-order-review"> <?php do_action( 'woocommerce_checkout_before_order_review' ); ?> </div> <?php }
/** * Handles WooCommerce after order review hooks * * This hook is in a different place on our checkout so * we have to wrap it with an ID and apply styles similar to native */ function cfw_cart_summary_after_order_review() { ?> <div id="cfw-checkout-after-order-review"> <?php do_action( 'woocommerce_checkout_after_order_review' ); ?> </div> <?php }
/** * Print WooCommerce notices with placeholder div for JS behaviors */ function cfw_wc_print_notices() { $all_notices = WC()->session->get( 'wc_notices', array() ); $notice_types = apply_filters( 'woocommerce_notice_types', array( 'error', 'success', 'notice' ) ); $notices = array();
foreach ( $notice_types as $notice_type ) { if ( wc_notice_count( $notice_type ) > 0 ) { $notices[ $notice_type ] = $all_notices[ $notice_type ]; } }
$type_class_mapping = array( 'error' => 'cfw-alert-error', 'notice' => 'cfw-alert-info', 'success' => 'cfw-alert-success', );
$used_alert_ids = array();
wc_clear_notices();
// DO NOT REMOVE PLACEHOLDER BELOW // It is a template for new alerts ?> <div id="cfw-alert-placeholder"> <div class="cfw-alert"> <div class="message"></div> </div> </div>
<div id="cfw-alert-container" class="woocommerce-notices-wrapper"> <?php if ( ! empty( $notices ) ) : ?> <?php foreach ( $notices as $type => $messages ) : ?> <?php foreach ( $messages as $message ) : // In WooCommerce 3.9+, messages can be an array with two properties: // - notice // - data $message = isset( $message['notice'] ) ? $message['notice'] : $message; $alert_id = md5( $message . $type_class_mapping[ $type ] . $type );
if ( in_array( $alert_id, $used_alert_ids, true ) || empty( $message ) ) { continue; } ?>
<?php $used_alert_ids[] = $alert_id; ?> <div class="cfw-alert <?php echo $type_class_mapping[ $type ]; ?> cfw-alert-<?php echo $alert_id; ?>"> <div class="message"> <?php echo $message; ?> </div> </div> <?php endforeach; ?> <?php endforeach; ?> <?php endif; ?> </div> <?php }
/** * Notices with wrap */ function cfw_wc_print_notices_with_wrap() { cfw_auto_wrap( 'cfw_wc_print_notices' ); }
/** * Payment Request buttons (aka Express Checkout) */ function cfw_payment_request_buttons() { if ( ! has_action( 'cfw_payment_request_buttons' ) ) { return; } ?> <div id="cfw-payment-request-buttons"> <h2><?php _e( 'Express checkout', 'checkout-wc' ); ?></h2> <?php /** * Hook for adding payment request buttons * * @since 3.0.0 */ do_action( 'cfw_payment_request_buttons' ); ?> </div> <?php }
/** * Customer information tab heading */ function cfw_customer_info_tab_heading() { ?> <h3> <?php /** * Filters customer info tab heading * * @param $customer_info_heading string Customer info tab heading * @since 2.0.0 */ echo apply_filters( 'cfw_customer_information_heading', __( 'Information', 'checkout-wc' ) ); ?> </h3> <?php }
/** * Customer information tab heading */ function cfw_order_review_tab_heading() { ?> <h3> <?php /** * Filters order review tab heading * * @param $order_review_tab_heading Order review tab heading * @since 2.0.0 */ echo apply_filters( 'cfw_order_review_tab_heading', __( 'Order review', 'checkout-wc' ) ); ?> </h3> <?php }
/** * Customer information tab login area * * Includes billing_email, optional password field, and create account checkbox */ function cfw_customer_info_tab_login() { $billing_fields = WC()->checkout()->get_checkout_fields( 'billing' ); $email_field = $billing_fields['billing_email']; $enable_enhanced_login = cfw_is_enhanced_login_enabled() && cfw_is_login_at_checkout_allowed(); ?> <div id="cfw-login-details" class="cfw-module"> <?php /** * Fires at the start of login module container * * @since 3.0.0 */ do_action( 'cfw_before_customer_info_tab_login' ); ?>
<?php if ( ! is_user_logged_in() ) : ?> <?php if ( $enable_enhanced_login ) : ?> <div class="cfw-have-acc-text cfw-small"> <?php /** * Fires before enhanced login prompt * * @since 3.0.0 */ do_action( 'cfw_before_enhanced_login_prompt' ); ?>
<span> <?php /** * Filters already have account text * * @param string $already_have_account_text Already have an account text * @since 2.0.0 */ echo apply_filters( 'cfw_already_have_account_text', esc_html__( 'Already have an account with us?', 'checkout-wc' ) ); ?> </span>
<a id="cfw-ci-login" href="javascript:"> <?php /** * Filters login faster text * * @param string $login_faster_text Login faster text * @since 2.0.0 */ echo apply_filters( 'cfw_login_faster_text', esc_html__( 'Log in for a faster checkout experience.', 'checkout-wc' ) ); ?> </a>
<?php /** * Fires after enhanced login prompt * * @since 2.0.0 */ do_action( 'cfw_after_enhanced_login_prompt' ); ?> </div> <?php endif; ?>
<div class="cfw-input-container"> <div class="cfw-input-wrap-row"> <?php cfw_form_field( 'billing_email', $email_field, WC()->checkout()->get_value( 'billing_email' ) ); ?> </div>
<?php /** * Fires after email field output * * @since 3.0.0 */ do_action( 'cfw_checkout_after_email' ); ?>
<?php if ( $enable_enhanced_login ) : ?> <div id="cfw-login-slide"> <div class="cfw-input-wrap-row"> <div id="cfw-password-wrap" class="cfw-input-wrap cfw-password-input"> <label for="cfw-password"><?php esc_html_e( 'Password', 'checkout-wc' ); ?></label> <input type="password" name="cfw-password" id="cfw-password" autocomplete="off" title="<?php esc_attr_e( 'Password', 'checkout-wc' ); ?>" placeholder="<?php esc_attr_e( 'Password', 'checkout-wc' ); ?>"> </div> </div>
<?php do_action( 'woocommerce_login_form' ); ?>
<div class="cfw-input-wrap-row"> <div class="cfw-input-wrap cfw-button-input"> <input type="button" name="cfw-login-btn" id="cfw-login-btn" value="<?php esc_attr_e( 'Login', 'checkout-wc' ); ?>" /> <?php /** * Fires after email field output * * @since 5.0.0 */ do_action( 'cfw_after_login_button' );
if ( ! WC()->checkout()->is_registration_required() ) : ?> <span class="login-optional cfw-small"> <?php /** * Filters login optional text * * @param string $login_optional_text Login optional text * @since 2.0.0 */ echo apply_filters( 'cfw_login_optional_text', esc_html__( 'Login is optional. You may continue with your order below.', 'checkout-wc' ) ); ?> </span> <?php endif; ?> </div> </div>
<p> <a id="cfw_lost_password_trigger" href="#cfw_lost_password_form_wrap" class="cfw-small"><?php cfw_esc_html_e( 'Lost your password?', 'woocommerce' ); ?></a> </p> </div> <?php endif; ?>
<div id="cfw-account-password-slide" class="cfw-input-wrap-row"> <?php /** * Filters whether to automatically generate password for new accounts * * @param string $generate_password Automatically generate password for new accounts * @since 2.0.0 */ if ( ! apply_filters( 'cfw_registration_generate_password', SettingsManager::instance()->get_setting( 'registration_style' ) !== 'woocommerce' ) ) : cfw_form_field( 'account_password', array( 'type' => 'password', 'label' => cfw__( 'Create account password', 'woocommerce' ), 'required' => true, 'placeholder' => cfw__( 'Create account password', 'woocommerce' ), 'custom_attributes' => array( 'data-parsley-trigger' => 'keyup change focusout', 'data-parsley-group' => 'account', ), ) ); endif; ?> </div>
<div class="cfw-input-wrap cfw-check-input"> <?php if ( ! WC()->checkout()->is_registration_required() && WC()->checkout()->is_registration_enabled() ) : ?> <input type="checkbox" id="createaccount" class="cfw-create-account-checkbox garlic-auto-save" name="createaccount" /> <label class="cfw-small" for="createaccount"> <?php /** * Filters create account checkbox site name * * @param string $create_account_site_name Create account checkbox site name * @since 2.0.0 */ $create_account_site_name = apply_filters( 'cfw_create_account_site_name', get_bloginfo( 'name' ) );
/** * Filters create account checkbox label * * @param string $create_account_checkbox_label Create account checkbox label * @since 2.0.0 */ printf( apply_filters( 'cfw_create_account_checkbox_label', esc_html__( 'Create %s shopping account.', 'checkout-wc' ) ), $create_account_site_name ); ?> </label> <?php elseif ( WC()->checkout()->is_registration_required() ) : ?> <span class="cfw-small"> <?php /** * Filters create account statement * * @param string $create_account_statement Create account statement * @since 2.0.0 */ echo apply_filters( 'cfw_account_creation_statement', esc_html__( 'If you do not have an account, we will create one for you.', 'checkout-wc' ) ); ?> </span> <?php endif; ?> </div> </div>
<?php /** * Fires after login reminders, login form, create account checkbox, etc * * Only fires when customer is not logged in * * @since 3.0.0 */ do_action( 'cfw_checkout_after_login' ); ?> <?php else : ?> <div class="cfw-have-acc-text cfw-small"> <?php /** * Filters welcome back statement customer name * * @param string $welcome_back_name Welcome back statement customer name * @since 2.0.0 */ $welcome_back_name = apply_filters( 'cfw_welcome_back_name', wp_get_current_user()->display_name );
/** * Filters welcome back statement customer email * * @param string $welcome_back_email Welcome back statement customer email * @since 2.0.0 */ $welcome_back_email = apply_filters( 'cfw_welcome_back_email', wp_get_current_user()->user_email );
/* translators: %1 is the customer's name, %2 is their email address */ printf( esc_html__( 'Welcome back, %1$s (%2$s).', 'checkout-wc' ), '<strong>' . $welcome_back_name . '</strong>', $welcome_back_email ); ?> <input type="hidden" name="billing_email" id="billing_email" value="<?php echo wp_get_current_user()->user_email; ?>">
<?php /** * Filters whether to show logout link * * @param bool $show_logout_link Show logout link * @since 2.0.0 */ if ( apply_filters( 'cfw_show_logout_link', false ) ) : ?> <a href="<?php echo wp_logout_url( wc_get_checkout_url() ); ?>"><?php _e( 'Log out.', 'checkout-wc' ); ?></a> <?php endif; ?> </div> <?php endif; ?>
<?php /** * Fires at the bottom of login module before closing </div> tag * * @since 2.0.0 */ do_action( 'cfw_after_customer_info_tab_login' ); ?> </div> <?php }
/** * The address displayed on the Customer Info tab */ function cfw_customer_info_address() { /** * Fires before customer info address module * * @since 2.0.0 */ do_action( 'cfw_checkout_before_customer_info_address' ); ?>
<div id="cfw-customer-info-address" class="cfw-module"> <?php if ( WC()->cart->needs_shipping_address() ) { /** * Fires before shipping address * * @since 2.0.0 */ do_action( 'cfw_checkout_before_shipping_address' ); } else { /** * Fires before billing address * * @since 2.0.0 */ do_action( 'cfw_checkout_before_billing_address' ); } ?>
<h3> <?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?> <?php /** * Filters billing and shipping address heading * * @param string $billing_and_shipping_address_heading Billing and shipping address heading * @since 2.0.0 */ echo apply_filters( 'cfw_billing_shipping_address_heading', esc_html__( 'Billing and Shipping address', 'checkout-wc' ) ); ?> <?php elseif ( ! WC()->cart->needs_shipping() ) : ?> <?php /** * Filters billing address heading * * @param string $billing_address_heading Billing address heading * @since 2.0.0 */ echo apply_filters( 'cfw_billing_address_heading', esc_html__( 'Billing address', 'checkout-wc' ) ); ?> <?php else : ?> <?php /** * Filters shipping address heading * * @param string $shipping_address_heading Shipping address heading * @since 2.0.0 */ echo apply_filters( 'cfw_shipping_address_heading', esc_html__( 'Shipping address', 'checkout-wc' ) ); ?> <?php endif; ?> </h3>
<?php /** * Fires after customer info address heading * * @since 2.0.0 */ do_action( 'cfw_after_customer_info_address_heading' );
if ( WC()->cart->needs_shipping() ) { /** * Fires after customer info address shipping heading * * @since 4.0.4 */ do_action( 'cfw_after_customer_info_shipping_address_heading' ); } else { /** * Fires after customer info address billing heading * * @since 4.0.4 */ do_action( 'cfw_after_customer_info_billing_address_heading' ); } ?>
<div class="cfw-customer-info-address-container cfw-parsley-shipping-details <?php cfw_address_class_wrap( WC()->cart->needs_shipping() ); ?>"> <?php if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) : ?> <?php /** * Fires before billing address inside billing address container * * @since 4.0.4 */ do_action( 'cfw_start_billing_address_container' );
cfw_get_billing_checkout_fields( WC()->checkout() );
/** * Fires before billing address inside billing address container * * @since 4.0.4 */ do_action( 'cfw_end_billing_address_container' ); ?> <?php else : ?> <?php /** * Fires before billing address inside billing address container * * @since 4.0.4 */ do_action( 'cfw_start_shipping_address_container' );
cfw_get_shipping_checkout_fields( WC()->checkout() );
/** * Fires before billing address inside billing address container * * @since 4.0.4 */ do_action( 'cfw_end_shipping_address_container' ); ?> <?php endif; ?> </div>
<?php if ( WC()->cart->needs_shipping() ) { /** * Fires after shipping address * * @since 2.0.0 */ do_action( 'cfw_checkout_after_shipping_address' ); } else { /** * Fires after billing address * * @since 2.0.0 */ do_action( 'cfw_checkout_after_billing_address' ); } ?> </div>
<?php /** * Fires at the bottom of customer info address module after closing </div> * * @since 2.0.0 */ do_action( 'cfw_checkout_after_customer_info_address' ); }
/** * @return bool */ function cfw_show_shipping_tab():bool { /** * Filters whether to show shipping tab * * @param string $show_shipping_tab Show shipping tab * @since 2.0.0 */ return apply_filters( 'cfw_show_shipping_tab', WC()->cart->needs_shipping() && SettingsManager::instance()->get_setting( 'skip_shipping_step' ) !== 'yes' ) === true; }
/** * @return bool */ function cfw_show_shipping_total():bool { /** * Filters whether to show shipping total * * @param string $show_shipping_total Show shipping total * @since 2.0.0 */ return apply_filters( 'cfw_show_shipping_total', WC()->cart->needs_shipping() && wc_shipping_enabled() && WC()->cart->get_cart_contents() && count( WC()->shipping()->get_packages() ) > 0 ) === true; }
/** * Customer information tab nav * * Includes return to cart and next tab buttons */ function cfw_customer_info_tab_nav() { /** * Fires before customer info tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_before_customer_info_tab_nav' ); ?>
<div id="cfw-customer-info-action" class="cfw-bottom-controls"> <div class="previous-button"> <?php cfw_return_to_cart_link(); ?> </div>
<?php cfw_continue_to_shipping_button(); ?> <?php cfw_continue_to_payment_button(); ?> </div>
<?php /** * Fires after customer info tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_after_customer_info_tab_nav' ); }
/** * Customer information tab nav * * Includes return to cart and next tab buttons * @param bool $show_cart_return_link */ function cfw_payment_method_tab_review_nav( $show_cart_return_link = false ) { /** * Fires before payment method tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_before_payment_method_tab_nav' );
$show_customer_information_tab = cfw_show_customer_information_tab(); ?>
<div id="cfw-payment-method-action" class="cfw-bottom-controls"> <div class="previous-button"> <?php if ( $show_cart_return_link ) : ?> <?php cfw_return_to_cart_link(); ?> <?php elseif ( $show_customer_information_tab ) : ?> <?php cfw_return_to_customer_information_link(); ?> <?php endif; ?>
<?php cfw_return_to_shipping_method_link(); ?> </div>
<?php cfw_continue_to_order_review_button(); ?> </div>
<?php /** * Fires after payment method tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_after_payment_method_tab_nav' ); }
/** * Shipping method tab address review section */ function cfw_shipping_method_address_review_pane() { if ( ! wc_ship_to_billing_address_only() ) { $ship_to_label = __( 'Ship to', 'checkout-wc' ); } else { $ship_to_label = cfw__( 'Address', 'woocommerce' ); }
/** * Filters ship to label in review pane * * @param string $ship_to_label Ship to label * @since 3.0.0 */ $ship_to_label = apply_filters( 'cfw_ship_to_label', $ship_to_label );
$long_class = '';
if ( strlen( $ship_to_label ) > 9 ) { $long_class = ' shipping-details-label-long'; } ?> <ul class="cfw-review-pane cfw-module"> <li> <div class="col-10 inner"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php _e( 'Contact', 'checkout-wc' ); ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-contact-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <?php if ( ! is_user_logged_in() ) : ?> <a href="javascript:" data-tab="#cfw-customer-info" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> <?php endif; ?> </div> </li>
<?php if ( WC()->cart->needs_shipping() ) : ?> <li> <div class="col-10 inner"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php echo $ship_to_label; ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-shipping-address-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <a href="javascript:" data-tab="#cfw-customer-info" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> </div> </li> <?php endif; ?> </ul> <?php }
/** * Payment method tab address review section */ function cfw_payment_method_address_review_pane() { if ( ! wc_ship_to_billing_address_only() ) { $ship_to_label = __( 'Ship to', 'checkout-wc' ); } else { $ship_to_label = cfw__( 'Address', 'woocommerce' ); }
/** * Filters ship to label in review pane * * @param string $ship_to_label Ship to label * @since 3.0.0 */ $ship_to_label = apply_filters( 'cfw_ship_to_label', $ship_to_label );
$long_class = '';
if ( strlen( $ship_to_label ) > 9 ) { $long_class = ' shipping-details-label-long'; } ?> <ul class="cfw-review-pane cfw-module"> <li> <div class="inner col-10"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php _e( 'Contact', 'checkout-wc' ); ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-contact-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <?php if ( ! is_user_logged_in() ) : ?> <a href="javascript:" data-tab="#cfw-customer-info" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> <?php endif; ?> </div> </li>
<?php if ( WC()->cart->needs_shipping() ) : ?> <li> <div class="inner col-10"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php echo $ship_to_label; ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-shipping-address-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <a href="javascript:" data-tab="#cfw-customer-info" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> </div> </li>
<li class="shipping-method"> <div class="inner col-10"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php _e( 'Method', 'checkout-wc' ); ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-shipping-method-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <?php if ( cfw_show_shipping_tab() ) : ?> <a href="javascript:" data-tab="#cfw-shipping-method" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> <?php endif; ?> </div> </li> <?php endif; ?> </ul> <?php }
function cfw_order_review_step_review_pane() { if ( ! wc_ship_to_billing_address_only() ) { $ship_to_label = __( 'Ship to', 'checkout-wc' ); } else { $ship_to_label = cfw__( 'Address', 'woocommerce' ); }
/** * Filters ship to label in review pane * * @param string $ship_to_label Ship to label * @since 3.0.0 */ $ship_to_label = apply_filters( 'cfw_ship_to_label', $ship_to_label );
$long_class = '';
if ( strlen( $ship_to_label ) > 9 ) { $long_class = ' shipping-details-label-long'; } ?> <ul class="cfw-review-pane cfw-module"> <li> <div class="inner col-10"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php _e( 'Contact', 'checkout-wc' ); ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-contact-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <?php if ( ! is_user_logged_in() ) : ?> <a href="javascript:" data-tab="#cfw-customer-info" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> <?php endif; ?> </div> </li>
<?php if ( WC()->cart->needs_shipping() ) : ?> <li> <div class="inner col-10"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php echo $ship_to_label; ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-shipping-address-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <a href="javascript:" data-tab="#cfw-customer-info" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> </div> </li>
<li class="shipping-method"> <div class="inner col-10"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php _e( 'Method', 'checkout-wc' ); ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-shipping-method-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <?php if ( cfw_show_shipping_tab() ) : ?> <a href="javascript:" data-tab="#cfw-shipping-method" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> <?php endif; ?> </div> </li> <?php endif; ?>
<li class="cfw-review-pane-payment-row"> <div class="inner col-10"> <div role="rowheader" class="cfw-review-pane-label<?php echo $long_class; ?>"> <?php _e( 'Payment', 'checkout-wc' ); ?> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-payment-method-value"></div> </div>
<div role="cell" class="col-2 cfw-review-pane-link"> <a href="javascript:" data-tab="#cfw-payment-method" class="cfw-tab-link cfw-small"><?php esc_html_e( 'Change', 'checkout-wc' ); ?></a> </div> </li> </ul> <?php }
/** * @return string */ function cfw_get_review_pane_payment_method(): string { if ( WC()->cart->needs_payment() ) { $available_payment_methods = WC()->payment_gateways()->get_available_payment_gateways();
$title = $available_payment_methods[ WC()->session->get( 'chosen_payment_method' ) ]->title ?? ''; } else { $title = cfw__( 'Free', 'woocommerce' ); }
if ( $title ) { $title .= '<p class="cfw-small cfw-padding-top cfw-light-gray">' . cfw_get_review_pane_billing_address( WC()->checkout() ) . '</p>'; }
return $title; }
function cfw_order_review_step_totals_review_pane() { ?> <ul class="cfw-review-pane cfw-module" id="cfw-review-order-totals"> <li> <div class="inner cfw-no-border"> <div role="rowheader" class="cfw-review-pane-lab"> <?php cfw_e( 'Subtotal', 'woocommerce' ); ?> </div> </div>
<div role="cell" class="cfw-review-pane-content cfw-review-pane-right cfw-no-border"> <?php wc_cart_totals_subtotal_html(); ?> </div> </li>
<?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?> <li> <div class="inner cfw-no-border"> <div role="rowheader" class="cfw-review-pane-label"> <?php wc_cart_totals_coupon_label( $coupon ); ?> </div> </div> <div role="cell" class="cfw-review-pane-content cfw-review-pane-right cfw-no-border"> <?php wc_cart_totals_coupon_html( $coupon ); ?> </div> </li> <?php endforeach; ?>
<?php if ( cfw_show_shipping_total() ) : ?> <?php cfw_order_review_pane_shipping_totals(); ?> <?php endif; ?>
<?php foreach ( WC()->cart->get_fees() as $fee ) : ?> <li> <div class="inner cfw-no-border"> <div role="rowheader" class="cfw-review-pane-label"> <?php echo esc_html( $fee->name ); ?> </div> </div> <div role="cell" class="cfw-review-pane-content cfw-review-pane-right cfw-no-border"> <?php wc_cart_totals_fee_html( $fee ); ?> </div> </li> <?php endforeach; ?> <?php if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) : ?> <?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?> <?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : ?> <li> <div class="inner"> <div role="rowheader" class="cfw-review-pane-label"> <?php echo esc_html( $tax->label ); ?> </div> </div> <div role="cell" class="cfw-review-pane-content cfw-review-pane-right"> <?php echo wp_kses_post( $tax->formatted_amount ); ?> </div> </li> <?php endforeach; ?> <?php else : ?> <li> <div class="inner"> <div role="rowheader" class="cfw-review-pane-label"> <?php echo esc_html( WC()->countries->tax_or_vat() ); ?> </div> </div> <div role="cell" class="cfw-review-pane-content cfw-review-pane-right"> <?php wc_cart_totals_taxes_total_html(); ?> </div> </li> <?php endif; ?> <?php endif; ?>
<li> <div class="inner"> <div role="rowheader" class="cfw-order-review-total-label cfw-review-pane-label"> <?php cfw_e( 'Total', 'woocommerce' ); ?> </div> </div> <div role="cell" class="cfw-review-pane-content cfw-review-pane-right cfw-order-review-total"> <?php wc_cart_totals_order_total_html(); ?> </div> </li> </ul> <?php }
/** * Shipping method tab list of shipping methods * */ function cfw_shipping_methods() { /** * Fires before shipping methods heading * * @since 2.0.0 */ do_action( 'cfw_checkout_before_shipping_methods' ); ?> <h3> <?php /** * Filters shipping method heading * * @param string $shipping_method_heading Shipping method heading * @since 3.0.0 */ echo apply_filters( 'cfw_shipping_method_heading', esc_html__( 'Shipping method', 'checkout-wc' ) ); ?> </h3>
<?php do_action( 'cfw_after_shipping_method_heading' ); ?>
<div id="cfw-shipping-methods" class="cfw-module"> <?php cfw_shipping_methods_html(); ?> </div>
<?php /** * Fires after shipping methods * * @since 2.0.0 */ do_action( 'cfw_checkout_after_shipping_methods' ); }
/** * Shipping method tab navigation * * Includes previous and next tab buttons */ function cfw_shipping_method_tab_nav() { /** * Fires before shipping method tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_before_shipping_method_tab_nav' ); ?>
<div id="cfw-shipping-action" class="cfw-bottom-controls"> <div class="previous-button"> <?php cfw_return_to_customer_information_link(); ?> </div>
<?php cfw_continue_to_payment_button(); ?> </div>
<?php /** * Fires after shipping method tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_after_shipping_method_tab_nav' ); }
/** * Payment method tab payments list * * Includes payment method tab heading * * @param bool $available_gateways * @param bool $object * @param bool $show_title */ function cfw_payment_methods( $available_gateways = false, $object = false, $show_title = true ) { echo cfw_get_payment_methods( $available_gateways, $object, $show_title ); }
/** * Payment method tab billing address radio group */ function cfw_payment_tab_content_billing_address() { if ( WC()->cart->needs_shipping_address() ) : ?> <h3 class="cfw-billing-address-heading"> <?php /** * Filters billing address heading on payment method tab * * @param string $billing_address_heading Billing address heading on payment method tab * @since 3.0.0 */ echo apply_filters( 'cfw_billing_address_heading', esc_html__( 'Billing address', 'checkout-wc' ) ); ?> </h3>
<?php /** * Fires after the billing address heading on the payment tab * * @since 5.3.2 */ do_action( 'cfw_after_payment_information_address_heading' ); ?>
<h4 class="cfw-billing-address-description cfw-small"> <?php /** * Filters billing address description * * @param string $billing_address_description Billing address description * @since 3.0.0 */ echo apply_filters( 'cfw_billing_address_description', esc_html__( 'Select the address that matches your card or payment method.', 'checkout-wc' ) ); ?> </h4>
<?php cfw_billing_address_radio_group(); ?> <?php endif; ?>
<?php /** * Fires after payment method tab billing address * * @since 2.0.0 */ do_action( 'cfw_checkout_after_payment_tab_billing_address' ); }
/** * Payment method tab order notes * * This also handles any custom fields attached to order notes area */ function cfw_payment_tab_content_order_notes() { ?> <div id="cfw_additional_fields_container" class="cfw-additional-fields-container"> <?php do_action( 'woocommerce_before_order_notes', WC()->checkout() ); ?>
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', false ) ) : ?>
<div class="cfw-additional-information"> <?php foreach ( WC()->checkout()->get_checkout_fields( 'order' ) as $key => $field ) : ?> <?php cfw_form_field( $key, $field, WC()->checkout()->get_value( $key ) ); ?> <?php endforeach; ?> </div>
<?php endif; ?>
<div class="clear"></div>
<?php do_action( 'woocommerce_after_order_notes', WC()->checkout() ); ?> </div> <?php }
/** * Payment method tab terms and conditions */ function cfw_payment_tab_content_terms_and_conditions() { /** * Fires before payment method terms and conditions output * * @since 2.0.0 */ do_action( 'cfw_checkout_before_payment_method_terms_checkbox' );
wc_get_template( 'checkout/terms.php' ); }
/** * Payment method tab nav * * Includes previous tab and place order buttons * * @param bool $show_cart_return_link */ function cfw_payment_tab_nav( $show_cart_return_link = false ) { /** * Fires before payment method tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_before_payment_method_tab_nav' ); do_action( 'woocommerce_review_order_before_submit' );
$show_customer_information_tab = cfw_show_customer_information_tab(); ?>
<div id="cfw-payment-action" class="cfw-bottom-controls"> <div class="previous-button"> <?php if ( $show_cart_return_link ) : ?> <?php cfw_return_to_cart_link(); ?> <?php elseif ( $show_customer_information_tab ) : ?> <?php cfw_return_to_customer_information_link(); ?> <?php endif; ?>
<?php cfw_return_to_shipping_method_link(); ?> </div>
<div class="cfw-place-order-wrap"> <?php do_action( 'cfw_payment_nav_place_order_button' ); ?> </div> </div>
<?php /** * Fires after payment method tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_after_payment_method_tab_nav' ); }
/** * Order review tab nav * * Includes previous tab and place order buttons */ function cfw_order_review_tab_nav() { /** * Fires before payment method tab navigation container * * @since 2.0.0 */ do_action( 'woocommerce_review_order_before_submit' ); ?>
<div id="cfw-payment-action" class="cfw-bottom-controls"> <div class="previous-button"> <?php cfw_return_to_payment_method_link(); ?> </div>
<div class="cfw-place-order-wrap"> <?php do_action( 'cfw_payment_nav_place_order_button' ); ?> </div> </div>
<?php /** * Fires after payment method tab navigation container * * @since 2.0.0 */ do_action( 'cfw_checkout_after_payment_method_tab_nav' ); }
/** * Payment method tab nav for one page checkout * * Includes place order button */ function cfw_payment_tab_nav_one_page_checkout() { cfw_payment_tab_nav( true ); }
/** * Cart list */ function cfw_cart_html() { // Discard output of this hook for now because // we are adding this for Free Gifts for WooCommerce // and we don't know if other plugins are using this hook // in a way that we don't prefer ob_start(); do_action( 'woocommerce_review_order_before_cart_contents' ); $output = ob_get_clean();
/** * Filters whether woocommerce_review_order_before_cart_contents hook is allowed to output * * @since 4.3.2 * * @param bool $show_hook Whether to output hook */ echo apply_filters( 'cfw_show_review_order_before_cart_contents_hook', false ) ? $output : '';
echo cfw_get_item_summary_table( WC()->cart );
/** * After cart html table output * * @since 4.3.4 */ do_action( 'cfw_after_cart_html' ); }
/** * Coupon module * * @param bool $mobile */ function cfw_coupon_module( $mobile = false ) { /** * Fires before coupon module * * @since 2.0.0 */ do_action( 'cfw_before_coupon_module', $mobile );
$field_id = $mobile ? 'cfw-promo-code-mobile' : 'cfw-promo-code'; $button_id = $mobile ? 'cfw-promo-code-btn-mobile' : 'cfw-promo-code-btn';
/** * Filters whether to hide promo code until link is clicked * * @param bool $hide_promo_code Hide promo code until link is clicked * @since 3.0.0 */ $hide_promo_code_by_default = apply_filters( 'cfw_hide_promo_code_by_default', SettingsManager::instance()->get_setting( 'enable_coupon_code_link' ) === 'yes' );
/** * Filters promo code button label * * @param string $promo_code_button_label Promo code button label * @since 3.0.0 */ $promo_code_button_label = apply_filters( 'cfw_promo_code_apply_button_label', esc_attr__( 'Apply', 'checkout-wc' ) ); ?> <div id="<?php echo $mobile ? 'cfw-coupons-mobile' : 'cfw-coupons'; ?>" class="cfw-module"> <?php if ( wc_coupons_enabled() ) : ?> <?php if ( $mobile && $hide_promo_code_by_default ) : ?> <h3> <?php /** * Filters promo code mobile heading * * @param string $promo_code_mobile_heading Promo code mobile heading * @since 3.0.0 */ echo apply_filters( 'cfw_promo_code_mobile_heading', __( 'Promo code', 'checkout-wc' ) ); ?> </h3> <?php endif; ?>
<?php if ( $hide_promo_code_by_default ) : ?> <div class="row"> <div class="col-lg-12 no-gutters cfw-small"> <a class="cfw-show-coupons-module" href="javascript:"> <?php /** * Filters promo code toggle link text * * @param string $promo_code_toggle_link_text Filters promo code toggle link text * @since 3.0.0 */ echo apply_filters( 'cfw_promo_code_toggle_link_text', __( 'Have a promo code? Click here.', 'checkout-wc' ) ); ?> </a> </div> </div> <?php endif; ?> <div class="cfw-promo-wrap <?php echo $hide_promo_code_by_default ? 'cfw-hidden' : ''; ?>"> <div class="row cfw-promo-row cfw-input-wrap-row"> <div class="col-lg-8 no-gutters"> <?php $output = cfw_form_field( $field_id, array( 'type' => 'text', 'required' => false,
/** * Filters promo code label * * @param string $promo_code_label Promo code label * @since 3.0.0 */ 'label' => apply_filters( 'cfw_promo_code_label', __( 'Promo Code', 'checkout-wc' ) ),
/** * Filters promo code placeholder * * @param string $promo_code_placeholder Promo code placeholder * @since 3.0.0 */ 'placeholder' => apply_filters( 'cfw_promo_code_placeholder', __( 'Enter Promo Code', 'checkout-wc' ) ),
'label_class' => 'cfw-input-label', 'start' => false, 'end' => false, 'wrap' => FormAugmenter::instance()->input_wrap( 'text', 12, 10 ), 'return' => true, ) );
$output = str_replace( '(' . cfw_esc_html__( 'optional', 'woocommerce' ) . ')', '', $output );
echo $output; ?> </div> <div class="col-lg-4"> <div class="cfw-input-wrap cfw-button-input"> <input type="button" name="cfw-promo-code-btn" id="<?php echo $button_id; ?>" class="cfw-secondary-btn" value="<?php echo $promo_code_button_label; ?>" /> </div> </div> </div> </div> <?php endif; ?>
<?php /** * Fires at end of coupon module before closing </div> tag * * @since 2.0.0 */ do_action( 'cfw_coupon_module_end', $mobile ); ?> </div> <?php /** * Fires after coupon module * * @since 2.0.0 */ do_action( 'cfw_after_coupon_module' ); }
function cfw_maybe_show_coupon_module() { if ( SettingsManager::instance()->get_setting( 'show_mobile_coupon_field' ) === 'yes' ) { cfw_mobile_coupon_module(); } }
function cfw_mobile_coupon_module() { cfw_coupon_module( true ); }
/** * Cart summary totals */ function cfw_totals_html() { echo cfw_get_totals_html(); }
/** * The form attributes * * @param bool $id * @param bool $row * @param bool $action */ function cfw_form_attributes( $id = false, $row = true, $action = true ) { // @codingStandardsIgnoreStart ?> id="<?php echo $id ? $id : 'checkout'; ?>" name="<?php echo $id ? $id : 'checkout'; ?>" class="cfw-customer-info-active <?php echo ( 'order_review' !== $id ) ? 'woocommerce-checkout checkout' : ''; ?> <?php echo $row ? ' row' : ''; ?>" method="POST" formnovalidate="" <?php echo ( $id !== 'order_review' ) ? 'data-parsley-focus="first"': ''; ?> enctype="multipart/form-data" <?php echo $action ? 'action="' . esc_url( wc_get_checkout_url() ) . '"' : ''; ?> <?php // @codingStandardsIgnoreEnd }
/** * Shipping method tab container style attribute */ function cfw_shipping_method_tab_style_attribute() { ?> style="" <?php }
function cfw_customer_info_tab_style_attribute() { ?> style="<?php echo ( ! cfw_show_customer_information_tab() ) ? 'display: none' : ''; ?>" <?php }
/** * Render title with order number, checkbox graphic, and thank you statement. * * @param WC_Order $order */ function cfw_thank_you_title( WC_Order $order ) { ?> <div class="title"> <?php /** * Filters thank you page heading icon * * @param string $cfw_thank_you_heading_icon Thank you page heading icon output * @since 5.4.0 * */ echo apply_filters( 'cfw_thank_you_heading_icon', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50" fill="none" stroke-width="2" class="cfw-checkmark"><path class="checkmark__circle" d="M25 49c13.255 0 24-10.745 24-24S38.255 1 25 1 1 11.745 1 25s10.745 24 24 24z"></path><path class="checkmark__check" d="M15 24.51l7.307 7.308L35.125 19"></path></svg>', $order ); ?> <h5> <?php /** * Filters thank you page heading title * * @since 3.0.0 * * @param string $thank_you_title Thank you page heading title */ echo sprintf( apply_filters( 'cfw_thank_you_title', __( 'Order %s', 'checkout-wc' ) ), $order->get_order_number() ); ?> </h5> <h4> <?php /** * Filters thank you page heading subtitle * * @since 3.0.0 * * @param string $thank_you_subtitle Thank you page heading subtitle */ echo sprintf( apply_filters( 'cfw_thank_you_subtitle', __( 'Thank you %s!', 'checkout-wc' ) ), $order->get_billing_first_name() ); ?> </h4> </div> <?php }
/** * Thank you page section open * * @param $class */ function cfw_thank_you_section_wrap( $callable, $class ) { ?> <section class="<?php echo $class; ?>>"> <?php }
/** * Thank you page section close */ function cfw_thank_you_section_end() { ?> </section> <?php }
/** * Thank you page order status row * * Shows progression of order through statuses. * * @param WC_Order $order * @param array $order_statuses */ function cfw_thank_you_order_status_row( WC_Order $order, array $order_statuses ) { ?> <div class="inner status-row"> <?php if ( $order->needs_shipping_address() && function_exists( 'wc_order_status_manager' ) ) : ?> <ul class="status-steps"> <?php $count = 0; ?> <?php foreach ( $order_statuses as $order_status ) : $order_status = new \WC_Order_Status_Manager_Order_Status( $order_status ); ?> <li class="status-step <?php echo $order->get_status() === $order_status->get_slug() ? 'status-step-selected' : ''; ?>"> <i class="<?php echo $order_status->get_icon(); ?>"></i>
<span class="title"> <?php echo wc_get_order_status_name( $order_status->get_slug() ); ?> </span>
<span class="date"> <?php $date = cfw_order_status_date( $order->get_id(), wc_get_order_status_name( $order_status->get_slug() ) );
if ( $date ) { echo date_i18n( get_option( 'date_format' ), strtotime( $date ) ); } elseif ( 0 === $count ) { echo date_i18n( get_option( 'date_format' ), strtotime( $order->get_date_created() ) ); } ?> </span> </li> <?php $count++; ?> <?php endforeach; ?> </ul> <?php elseif ( $order->needs_shipping_address() ) : ?> <ul class="status-steps"> <?php $count = 0; ?> <?php foreach ( $order_statuses as $order_status ) : ?> <?php /** * Filters thank you status icon class * * @since 3.0.0 * * @param string $thank_you_status_icon Thank you status icon class */ $thank_you_status_icon = apply_filters( 'cfw_thank_you_status_icon_' . $order_status, 'fa fa-chevron-circle-right' ); ?> <li class="status-step <?php echo $order->get_status() === $order_status ? 'status-step-selected status-step-current' : ''; ?>"> <i class="<?php echo $thank_you_status_icon; ?>"></i>
<span class="title"> <?php echo wc_get_order_status_name( $order_status ); ?> </span>
<span class="date"> <?php $date = cfw_order_status_date( $order->get_id(), wc_get_order_status_name( $order_status ) );
if ( $date ) { echo date_i18n( get_option( 'date_format' ), strtotime( $date ) ); } elseif ( 0 === $count ) { echo date_i18n( get_option( 'date_format' ), strtotime( $order->get_date_created() ) ); } ?> </span> </li> <?php $count++; ?> <?php endforeach; ?> </ul> <?php else : ?> <h3><?php _e( 'Order status', 'checkout-wc' ); ?></h3> <p><?php echo wc_get_order_status_name( $order->get_status() ); ?></p> <?php endif; ?> </div> <?php }
/** * Thank you page map element * * @param WC_Order $order */ function cfw_thank_you_map( WC_Order $order ) { if ( $order->needs_shipping_address() ) : ?> <?php if ( SettingsManager::instance()->is_premium_feature_enabled( 'enable_map_embed' ) ) : ?> <div id="map"></div> <?php endif; ?>
<?php cfw_maybe_output_tracking_numbers( $order ); ?> <?php endif; }
/** * Thank you page order updates section * * @param WC_Order $order */ function cfw_thank_you_order_updates( WC_Order $order ) { ?> <h3><?php _e( 'Order updates', 'checkout-wc' ); ?></h3> <?php /** * Filters order updates text * * @since 3.0.0 * * @param string $order_updates_text Thank you page order updates text */ echo wpautop( apply_filters( 'cfw_order_updates_text', __( 'You’ll get shipping and delivery updates by email.', 'checkout-wc' ), $order ) ); }
/** * @param WC_Order $order * @param array $order_statues * @param boolean $show_downloads * @param array $downloads */ function cfw_thank_you_downloads( $order, $order_statues, $show_downloads, $downloads ) { ?> <h3 class="woocommerce-order-downloads__title"><?php cfw_esc_html_e( 'Downloads', 'woocommerce' ); ?></h3>
<table class="woocommerce-table woocommerce-table--order-downloads shop_table shop_table_responsive order_details"> <thead> <tr> <?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?> <th class="<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th> <?php endforeach; ?> </tr> </thead>
<?php foreach ( $downloads as $download ) : ?> <tr> <?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?> <td class="<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>"> <?php if ( has_action( 'woocommerce_account_downloads_column_' . $column_id ) ) { do_action( 'woocommerce_account_downloads_column_' . $column_id, $download ); } else { switch ( $column_id ) { case 'download-product': if ( $download['product_url'] ) { echo '<a href="' . esc_url( $download['product_url'] ) . '">' . esc_html( $download['product_name'] ) . '</a>'; } else { echo esc_html( $download['product_name'] ); } break; case 'download-file': echo '<a href="' . esc_url( $download['download_url'] ) . '" class="woocommerce-MyAccount-downloads-file alt">' . esc_html( $download['download_name'] ) . '</a>'; break; case 'download-remaining': echo is_numeric( $download['downloads_remaining'] ) ? esc_html( $download['downloads_remaining'] ) : cfw_esc_html__( '∞', 'woocommerce' ); break; case 'download-expires': if ( ! empty( $download['access_expires'] ) ) { echo '<time datetime="' . esc_attr( date( 'Y-m-d', strtotime( $download['access_expires'] ) ) ) . '" title="' . esc_attr( strtotime( $download['access_expires'] ) ) . '">' . esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ) . '</time>'; } else { cfw_esc_html_e( 'Never', 'woocommerce' ); } break; } } ?> </td> <?php endforeach; ?> </tr> <?php endforeach; ?> </table> <?php }
/** * Thank you page customer information * * @param WC_Order $order */ function cfw_thank_you_customer_information( WC_Order $order ) { ?> <h3><?php _e( 'Information', 'checkout-wc' ); ?></h3>
<?php /** * Fires before thank you customer information output (after Information heading) * * @since 2.0.0 * @param WC_Order $order The order object */ do_action( 'cfw_before_thank_you_customer_information', $order ); ?>
<div class="row"> <div class="col-lg-6"> <h6><?php _e( 'Contact information', 'checkout-wc' ); ?></h6> <p><?php echo $order->get_billing_email(); ?></p> </div> <div class="col-lg-6"> <h6><?php _e( 'Payment', 'checkout-wc' ); ?></h6> <p><?php echo $order->get_payment_method_title(); ?></p> </div> </div>
<div class="row"> <?php if ( $order->needs_shipping_address() ) : ?> <div class="col-lg-6"> <?php if ( wc_ship_to_billing_address_only() ) : ?> <h6> <?php /** This action is documented earlier in this file */ echo apply_filters( 'cfw_billing_shipping_address_heading', __( 'Billing and Shipping address', 'checkout-wc' ) ); ?> </h6> <?php else : ?> <h6> <?php /** This action is documented earlier in this file */ echo apply_filters( 'cfw_shipping_address_heading', esc_html__( 'Shipping address', 'checkout-wc' ) ); ?> </h6> <?php endif; ?>
<address> <?php echo wp_kses_post( $order->get_formatted_shipping_address( cfw_esc_html__( 'N/A', 'woocommerce' ) ) ); ?> </address> </div> <?php endif; ?>
<?php if ( ! wc_ship_to_billing_address_only() ) : ?> <div class="col-lg-6"> <h6> <?php /** This action is documented earlier in this file */ echo apply_filters( 'cfw_billing_address_heading', esc_html__( 'Billing address', 'checkout-wc' ) ); ?> </h6> <address> <?php echo wp_kses_post( $order->get_formatted_billing_address( cfw_esc_html__( 'N/A', 'woocommerce' ) ) ); ?> </address> </div> <?php endif; ?> </div>
<?php if ( $order->needs_shipping_address() ) : ?> <div class="row"> <div class="col-lg-6"> <h6><?php _e( 'Shipping', 'checkout-wc' ); ?></h6> <p> <?php echo $order->get_shipping_method(); ?> </p> </div> </div> <?php endif; ?>
<div class="clear"></div>
<?php do_action( 'woocommerce_order_details_after_customer_details', $order ); do_action( 'woocommerce_order_details_after_order_table', $order ); }
/** * Renders the buttons beneath the order details on the * thank you page */ function cfw_thank_you_bottom_controls() { /** * Filters thank you page continue shopping button text * * @since 3.0.0 * * @param string $cfw_thank_you_continue_shopping_text Thank you page continue shopping button text */ $cfw_thank_you_continue_shopping_text = apply_filters( 'cfw_thank_you_continue_shopping_text', cfw_esc_html__( 'Continue shopping', 'woocommerce' ) ); ?> <div id="cfw-thank-you-action" class="cfw-bottom-controls"> <?php $return_to = apply_filters( 'woocommerce_continue_shopping_redirect', wc_get_page_permalink( 'shop' ) ); $message = sprintf( '<a href="%s" tabindex="1" class="cfw-primary-btn cfw-next-tab">%s</a>', esc_url( $return_to ), $cfw_thank_you_continue_shopping_text ); ?> <!--- Placeholder --> <div></div> <?php echo $message; ?> </div> <?php }
/** * Thank you page cart summary content * * @param WC_Order $order */ function cfw_thank_you_cart_summary_content( WC_Order $order ) { if ( count( $order->get_items() ) > 0 ) { echo cfw_get_item_summary_table( $order ); } }
/** * Order pay heading */ function cfw_order_pay_heading() { ?> <h3><?php echo cfw__( 'Pay for order', 'woocommerce' ); ?></h3> <?php }
/** * Order pay login form * @param WC_Order $order */ function cfw_order_pay_login_form( WC_Order $order ) { ?> <form <?php cfw_form_attributes( 'login_form', false, false ); ?>> <?php do_action( 'woocommerce_login_form_start' ); ?>
<?php cfw_form_field( 'username', array( 'label' => 'Email', 'type' => 'text', 'required' => true, 'autocomplete' => 'username', ) );
cfw_form_field( 'password', array( 'label' => 'Password', 'type' => 'password', 'required' => true, 'autocomplete' => 'current-password', ) ); ?>
<div class="clear"></div>
<?php do_action( 'woocommerce_login_form' ); ?>
<p class="form-row"> <?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?> <input type="hidden" name="redirect" value="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" />
<button type="submit" class="woocommerce-button button woocommerce-form-login__submit" name="login" value="<?php cfw_esc_attr_e( 'Login', 'woocommerce' ); ?>"><?php esc_html_e( 'Login', 'woocommerce' ); ?></button>
<span class="login-optional cfw-small"><a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php cfw_esc_html_e( 'Lost your password?', 'woocommerce' ); ?></a></span> </p>
<div class="clear"></div>
<?php do_action( 'woocommerce_login_form_end' ); ?> </form> <?php }
/** * Order Pay payment form * * @param WC_Order $order * @param array $available_gateways * @param $order_button_text * @param $call_receipt_hook */ function cfw_order_pay_payment_form( WC_Order $order, array $available_gateways, $order_button_text, $call_receipt_hook ) { ?> <form <?php cfw_form_attributes( 'order_review', false, false ); ?>> <?php // Some gateways need this when they use order-pay // to take payment right after checkout if ( ! empty( $call_receipt_hook ) ) : ?> <?php do_action( 'woocommerce_receipt_' . $order->get_payment_method(), $order->get_id() ); ?> <?php else : ?> <?php cfw_payment_methods( $available_gateways, $order, false ); ?>
<?php wc_get_template( 'checkout/terms.php' ); ?>
<div id="cfw-payment-action" class="cfw-bottom-controls"> <div class="previous-button"></div>
<input type="hidden" name="woocommerce_pay" value="1" />
<div class="place-order" id="cfw-place-order"> <?php do_action( 'woocommerce_pay_order_before_submit' ); ?>
<?php echo apply_filters( 'woocommerce_pay_order_button_html', '<button type="submit" class="cfw-primary-btn cfw-next-tab validate" id="place_order" formnovalidate="formnovalidate" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
<?php do_action( 'woocommerce_pay_order_after_submit' ); ?>
<?php wp_nonce_field( 'woocommerce-pay', 'woocommerce-pay-nonce' ); ?> </div> </div> <?php endif; ?> </form> <?php }
/** * @param WC_Order $order * @param $call_receipt_hook * @param $available_gateways * @param $order_button_text */ function cfw_order_pay_form( WC_Order $order, $call_receipt_hook, $available_gateways, $order_button_text ) { if ( ! current_user_can( 'pay_for_order', $order->get_id() ) && ! is_user_logged_in() ) { cfw_order_pay_login_form( $order ); } elseif ( $call_receipt_hook ) { wc_get_template( 'checkout/order-receipt.php', array( 'order' => $order ) ); } else { cfw_order_pay_payment_form( $order, $available_gateways, $order_button_text, $call_receipt_hook ); } }
/** * Thank you page cart summary content * * @param WC_Order $order */ function cfw_order_pay_cart_summary_content( WC_Order $order ) { if ( count( $order->get_items() ) > 0 ) { echo cfw_get_item_summary_table( $order ); } }
function cfw_thank_you_section_start_order_status() { cfw_thank_you_section_start( 'cfw-order-status' ); }
/** * @param WC_Order $order */ function cfw_thank_you_order_updates_wrapped( WC_Order $order ) { if ( $order->needs_shipping_address() ) { cfw_thank_you_section_auto_wrap( 'cfw_thank_you_order_updates', 'cfw-order-updates', array( $order ) ); } }
function cfw_thank_you_downloads_wrapped( $order, $order_statues, $show_downloads, $downloads ) { if ( $show_downloads ) { cfw_thank_you_section_auto_wrap( 'cfw_thank_you_downloads', 'woocommerce-order-downloads', array( $order, $order_statues, $show_downloads, $downloads ) ); } }
function cfw_thank_you_customer_information_wrapped( $order ) { cfw_thank_you_section_auto_wrap( 'cfw_thank_you_customer_information', 'cfw-customer-information', array( $order ) ); }
function cfw_cart_summary_mobile_header_display( WC_Order $order ) { cfw_cart_summary_mobile_header( $order->get_formatted_order_total() ); }
function cfw_customer_info_tab() { ?> <!-- Customer Info Tab --> <div id="cfw-customer-info" class="cfw-panel" <?php cfw_customer_info_tab_style_attribute(); ?>> <?php /** * Outputs customer info tab content * * @since 2.0.0 */ do_action( 'cfw_checkout_customer_info_tab' ); ?> </div> <?php }
function cfw_shipping_methods_tab() { ?> <!-- Shipping Methods Tab --> <div id="cfw-shipping-method" class="cfw-panel" <?php cfw_shipping_method_tab_style_attribute(); ?>> <?php /** * Outputs shipping methods tab content * * @since 2.0.0 */ do_action( 'cfw_checkout_shipping_method_tab' ); ?> </div> <?php }
function cfw_payment_methods_tab() { ?> <!-- Payment Methods Tab --> <div id="cfw-payment-method" class="cfw-panel woocommerce-checkout-payment"> <?php /** * Outputs payment methods tab content * * @since 2.0.0 */ do_action( 'cfw_checkout_payment_method_tab' ); ?> </div> <?php }
function cfw_add_order_review_step_tab() { ?> <!-- Order Review Tab --> <div id="cfw-order-review" class="cfw-panel"> <?php /** * Outputs order review tab content * * @since 2.0.0 */ do_action( 'cfw_checkout_order_review_tab' ); ?> </div> <?php }
/** * @param $breadcrumbs * @return array */ function cfw_add_order_review_step_breadcrumb( array $breadcrumbs ): array { $breadcrumbs['cfw-order-review'] = array( 'href' => '#cfw-order-review', // must match tab ID 'label' => __( 'Review', 'checkout-wc' ), 'priority' => 50, // after payment );
return $breadcrumbs; }
function cfw_lost_password_modal() { ?> <div id="cfw_lost_password_form_wrap" style="display:none;"> <form method="post" target="_blank" id="cfw_lost_password_form"> <p style="margin-bottom: 1em"> <?php echo apply_filters( 'woocommerce_lost_password_message', cfw_esc_html__( 'Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.', 'woocommerce' ) ); ?> </p>
<?php cfw_form_field( 'user_login', array( 'type' => 'email', 'required' => true, 'autocomplete' => 'email', 'label' => cfw__( 'Email address', 'woocommerce' ), 'placeholder' => cfw__( 'Email address', 'woocommerce' ), ) ); ?>
<div class="clear"></div>
<?php do_action( 'woocommerce_lostpassword_form' ); ?>
<p class="woocommerce-form-row form-row"> <input type="hidden" name="wc_reset_password" value="true" /> <button type="submit" class="cfw-primary-btn" value="<?php cfw_esc_attr_e( 'Reset password', 'woocommerce' ); ?>"><?php cfw_esc_html_e( 'Reset password', 'woocommerce' ); ?></button> </p>
<?php wp_nonce_field( 'lost_password', 'woocommerce-lost-password-nonce' ); ?>
</form> </div> <?php }
function cfw_maybe_output_footer_nav_menu() { $location = 'cfw-footer-menu';
if ( has_nav_menu( $location ) ) { wp_nav_menu( array( 'theme_location' => $location, ) ); } }
|