| 1 |
<?php |
| 2 |
/** |
| 3 |
* POS Order Received template. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/woocommerce-pos/received.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 wp_head(); ?> |
| 17 |
<style> |
| 18 |
* { |
| 19 |
padding: 0; |
| 20 |
margin: 0; |
| 21 |
} |
| 22 |
|
| 23 |
.wrapper { |
| 24 |
height: 100vh; |
| 25 |
display: flex; |
| 26 |
justify-content: center; |
| 27 |
align-items: center; |
| 28 |
background-color: #fff; |
| 29 |
} |
| 30 |
|
| 31 |
.checkmark__circle { |
| 32 |
stroke-dasharray: 166; |
| 33 |
stroke-dashoffset: 166; |
| 34 |
stroke-width: 2; |
| 35 |
stroke-miterlimit: 10; |
| 36 |
stroke: #0C6B58; |
| 37 |
fill: none; |
| 38 |
animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards; |
| 39 |
} |
| 40 |
|
| 41 |
.checkmark { |
| 42 |
width: 56px; |
| 43 |
height: 56px; |
| 44 |
border-radius: 50%; |
| 45 |
display: block; |
| 46 |
stroke-width: 2; |
| 47 |
stroke: #fff; |
| 48 |
stroke-miterlimit: 10; |
| 49 |
margin: 10% auto; |
| 50 |
box-shadow: inset 0px 0px 0px #0C6B58; |
| 51 |
animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both; |
| 52 |
} |
| 53 |
|
| 54 |
.checkmark__check { |
| 55 |
transform-origin: 50% 50%; |
| 56 |
stroke-dasharray: 48; |
| 57 |
stroke-dashoffset: 48; |
| 58 |
animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; |
| 59 |
} |
| 60 |
|
| 61 |
@keyframes stroke { |
| 62 |
100% { |
| 63 |
stroke-dashoffset: 0 |
| 64 |
} |
| 65 |
} |
| 66 |
|
| 67 |
@keyframes scale { |
| 68 |
0%, 100% { |
| 69 |
transform: none |
| 70 |
} |
| 71 |
50% { |
| 72 |
transform: scale3d(1.1, 1.1, 1) |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
@keyframes fill { |
| 77 |
100% { |
| 78 |
box-shadow: inset 0px 0px 0px 30px #0C6B58 |
| 79 |
} |
| 80 |
} |
| 81 |
</style> |
| 82 |
<?php if ( $order_complete ) { ?> |
| 83 |
<script> |
| 84 |
(function() { |
| 85 |
// Parse the order JSON from PHP |
| 86 |
var order = <?php echo $order_json; ?>; |
| 87 |
|
| 88 |
// Check if postMessage function exists for window.top |
| 89 |
if (typeof window.top.postMessage === 'function') { |
| 90 |
window.top.postMessage({ |
| 91 |
action: 'wcpos-payment-received', |
| 92 |
payload: order |
| 93 |
}, '*'); |
| 94 |
} |
| 95 |
|
| 96 |
// Check if ReactNativeWebView object and postMessage function exists |
| 97 |
if (typeof window.ReactNativeWebView !== 'undefined' && typeof window.ReactNativeWebView.postMessage === 'function') { |
| 98 |
window.ReactNativeWebView.postMessage(JSON.stringify({ |
| 99 |
action: 'wcpos-payment-received', |
| 100 |
payload: order |
| 101 |
})); |
| 102 |
} |
| 103 |
})(); |
| 104 |
</script> |
| 105 |
<?php } ?> |
| 106 |
</head> |
| 107 |
|
| 108 |
<body <?php body_class(); ?>> |
| 109 |
<div class="woocommerce"> |
| 110 |
<?php if ( $order_complete ) { ?> |
| 111 |
<div class="wrapper"> |
| 112 |
<svg class="checkmark" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 52 52"> |
| 113 |
<circle class="checkmark__circle" cx="26" cy="26" r="25" fill="none"/> |
| 114 |
<path class="checkmark__check" fill="none" d="M14.1 27.2l7.1 7.2 16.7-16.8"/> |
| 115 |
</svg> |
| 116 |
</div> |
| 117 |
<?php } else { ?> |
| 118 |
<?php woocommerce_output_all_notices(); ?> |
| 119 |
<?php wcpos_get_woocommerce_template( 'checkout/thankyou.php', array( 'order' => $order ) ); ?> |
| 120 |
<?php } ?> |
| 121 |
</div> |
| 122 |
|
| 123 |
<?php wp_footer(); ?> |
| 124 |
|
| 125 |
</body> |
| 126 |
</html> |
| 127 |
|
| 128 |
|