PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / trunk
WCPOS – Point of Sale (POS) plugin for WooCommerce vtrunk
1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 1.10.1 1.10.0 1.9.17 1.9.15 1.9.16 1.9.14 1.9.13 1.9.12 1.9.11 1.9.10 1.9.9 All 158 releases
woocommerce-pos / templates / payment.php

payment.php in WCPOS – Point of Sale (POS) plugin for WooCommerce trunk, at templates/payment.php

355 lines 7.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * POS Order Pay template.
4 *
5 * This template can be overridden by copying it to yourtheme/woocommerce-pos/payment.php.
6 * HOWEVER, this is not recommended , don't be surprised if your POS breaks
7 */
8
9 \defined( 'ABSPATH' ) || exit;
10 ?>
11 <!doctype html>
12 <html <?php language_attributes(); ?>>
13 <head>
14 <meta charset="<?php bloginfo( 'charset' ); ?>"/>
15 <meta name="viewport" content="width=device-width, initial-scale=1"/>
16 <?php
17 if ( ! $this->disable_wp_head ) {
18 wp_head();
19 } else {
20 // Manually call necessary functions when wp_head is disabled.
21 if ( \function_exists( 'wp_enqueue_block_template_skip_link' ) ) {
22 wp_enqueue_block_template_skip_link();
23 }
24 }
25 ?>
26 <style>
27 html, body, ul, li, fieldset, address {
28 font-family: sans-serif;
29 font-size: 14px;
30 margin: 0 !important;
31 padding: 0 !important;
32 color: #000000 !important;
33 background-color: #ffffff !important;
34 }
35 h1, h2, h3, h4, h5, h6 {
36 margin: 0;
37 padding: 0;
38 font-weight: 600;
39 line-height: 1.3;
40 }
41 h1 {
42 font-size: 18px;
43 margin-bottom: 15px;
44 }
45 h2 {
46 font-size: 16px;
47 margin-bottom: 12px;
48 }
49 h3 {
50 font-size: 14px;
51 margin-bottom: 10px;
52 }
53 h4 {
54 font-size: 14px;
55 margin-bottom: 8px;
56 }
57 h5 {
58 font-size: 14px;
59 margin-bottom: 6px;
60 }
61 h6 {
62 font-size: 12px;
63 margin-bottom: 4px;
64 }
65
66 .woocommerce {
67 color: #000000 !important;
68 background-color: #ffffff !important;
69 }
70
71 .woocommerce-pos-troubleshooting h3 {
72 margin: 0.5em 0;
73 padding: 0;
74 font-size: 1em;
75 font-weight: 600;
76 }
77
78 .woocommerce-pos-troubleshooting input[type="checkbox"] {
79 margin-right: 5px;
80 }
81
82 .woocommerce-pos-troubleshooting button {
83 background: #007cba;
84 border: none;
85 color: #fff;
86 padding: 10px 15px;
87 border-radius: 3px;
88 cursor: pointer;
89 }
90
91 .woocommerce-pos-troubleshooting button:hover {
92 background: #005a87;
93 }
94
95 .troubleshooting-modal {
96 display: none; /* Hidden by default */
97 position: fixed; /* Stay in place */
98 z-index: 1000; /* Sit on top */
99 left: 0;
100 top: 0;
101 width: 100%; /* Full width */
102 height: 100%; /* Full height */
103 overflow: auto; /* Enable scroll if needed */
104 background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
105 }
106
107 .troubleshooting-modal-content {
108 background-color: #fefefe;
109 margin: 2% auto; /* Slight margin from the top */
110 padding: 20px;
111 border: 1px solid #888;
112 width: 90%; /* Full width with slight margin */
113 max-height: 90%; /* Full height with slight margin */
114 overflow: auto; /* Enable scroll for content */
115 position: relative;
116 }
117
118 .close-troubleshooting-modal {
119 position: absolute;
120 top: -5px;
121 right: 10px;
122 color: #aaa;
123 font-size: 28px;
124 font-weight: bold;
125 }
126
127 .close-troubleshooting-modal:hover,
128 .close-troubleshooting-modal:focus {
129 color: black;
130 text-decoration: none;
131 cursor: pointer;
132 }
133
134 .woocommerce-error {
135 background-color: #f8d7da;
136 color: #721c24;
137 border-color: #f5c6cb;
138 padding: 5px;
139 margin-bottom: 20px;
140 }
141
142 .woocommerce-info {
143 background-color: #d1ecf1;
144 color: #0c5460;
145 border-color: #bee5eb;
146 padding: 5px;
147 margin-bottom: 20px;
148 }
149
150 .cashier {
151 padding: 5px;
152 }
153
154 .cashier .cashier-name {
155 font-size: 14px;
156 font-weight: bold;
157 }
158
159 .current-user {
160 padding: 5px;
161 margin-bottom: 20px;
162 }
163
164 .current-user .user-name {
165 font-size: 14px;
166 font-weight: bold;
167 cursor: pointer;
168 color: #007acc; /* Change this color to your preferred link color */
169 text-decoration: underline;
170 }
171
172 .coupons {
173 text-align: right;
174 }
175 .coupons h3 {
176 margin: 10px 0;
177 }
178
179 /* Style for Customer Details */
180 .woocommerce-customer-details {
181 margin-bottom: 20px;
182 }
183 .woocommerce-columns {
184 display: flex;
185 justify-content: space-between;
186 margin-bottom: 10px;
187 }
188 .woocommerce-column {
189 flex: 0 0 calc(50% - 10px);
190 padding: 5px;
191 }
192 .woocommerce-column__title {
193 font-size: 14px;
194 font-weight: bold;
195 margin-bottom: 5px;
196 }
197 address {
198 font-size: 12px;
199 line-height: 1.4;
200 }
201 address p {
202 margin-bottom: 3px;
203 }
204 .woocommerce-customer-details--phone,
205 .woocommerce-customer-details--email {
206 font-size: 12px;
207 margin-bottom: 3px;
208 }
209
210 /* Style for Order Details Table */
211 table.shop_table {
212 border-collapse: collapse !important;
213 width: 100% !important;
214 margin-bottom: 20px;
215 }
216 table.shop_table thead tr th,
217 table.shop_table tbody tr td,
218 table.shop_table tfoot tr td {
219 border: none;
220 padding: 5px;
221 text-align: left;
222 }
223 table.shop_table thead tr th {
224 font-weight: bold;
225 border-bottom: 2px solid #ddd;
226 }
227 table.shop_table tbody tr td {
228 border-bottom: 1px solid #ddd;
229 }
230 table.shop_table tfoot tr th {
231 padding: 5px;
232 text-align: right;
233 }
234 table.shop_table ul.wc-item-meta {
235 padding: 0;
236 list-style: none;
237 margin-top: 5px !important;
238 }
239 table.shop_table ul.wc-item-meta li {
240 font-size: 12px;
241 }
242 table.shop_table ul.wc-item-meta p {
243 display: inline-block;
244 margin: 0;
245 }
246
247 /* Style for Payment List Accordion */
248 .wc_payment_methods ul {
249 padding: 0;
250 margin: 0;
251 }
252 .wc_payment_methods li {
253 border-top: 1px solid #ddd;
254 margin-bottom: 10px;
255 list-style: none;
256 }
257 .wc_payment_methods li label {
258 display: inline-block;
259 padding: 10px;
260 cursor: pointer;
261 margin-bottom: 0;
262 }
263 .wc_payment_methods li div.payment_box {
264 display: none;
265 padding: 10px;
266 }
267 .wc_payment_methods li input[type="radio"] {
268 display: inline-block;
269 margin-right: 10px;
270 vertical-align: middle;
271 }
272 .wc_payment_methods li input[type="radio"] + label {
273 display: inline-block;
274 vertical-align: middle;
275 }
276 .wc_payment_methods li input[type="radio"]:checked + label {
277 font-weight: bold;
278 }
279 .wc_payment_methods li input[type="radio"]:checked + label + div.payment_box {
280 display: block;
281 padding-left: 42px;
282 background-color: #f7f7f7;
283 }
284 .wc_payment_methods li fieldset {
285 border: none;
286 }
287 .woocommerce-page #payment button#place_order {
288 display: none;
289 }
290 </style>
291 <script>
292 window.addEventListener("message", ({data}) => {
293 if (data.action && data.action === "wcpos-process-payment") {
294 // submit checkout form
295 const button = document.getElementById('place_order');
296 if (button) {
297 const event = new MouseEvent('click', {
298 bubbles: true,
299 cancelable: true,
300 view: window
301 });
302
303 button.dispatchEvent(event);
304 }
305 }
306 }, false);
307 </script>
308 </head>
309
310 <body <?php body_class(); ?>>
311 <div class="woocommerce">
312 <?php
313 // Troubleshooting form section
314 echo $this->get_troubleshooting_form_html();
315 ?>
316
317 <?php woocommerce_output_all_notices(); ?>
318
319 <?php
320 // Cashier details section
321 echo $this->get_cashier_details_html();
322 ?>
323
324 <?php
325 // Paying customer details section
326 echo $this->get_paying_customer_details_html();
327 ?>
328
329 <?php
330 // Coupon form section
331 echo $this->get_coupon_form_html();
332 ?>
333
334 <?php
335 // WooCommerce payment form
336 wcpos_get_woocommerce_template(
337 'checkout/form-pay.php',
338 array(
339 'order' => $this->order,
340 'available_gateways' => $available_gateways,
341 'order_button_text' => $order_button_text,
342 )
343 );
344 ?>
345 </div>
346
347 <?php
348 if ( ! $this->disable_wp_footer ) {
349 wp_footer();
350 }
351 ?>
352
353 </body>
354 </html>
355