thankyou.php
3.52 KB
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
<?php
/**
* Thankyou page
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
*
* @see http://docs.woothemes.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.2.0
*/
if (!defined('ABSPATH')) {
exit;
}
//use Optimizely\Optimizely;
if ($order) :
?>
<?php if ($order->has_status('failed')) : ?>
<p class="woocommerce-thankyou-order-failed"><?php _e('Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce'); ?></p>
<p class="woocommerce-thankyou-order-failed-actions">
<a href="<?php echo esc_url($order->get_checkout_payment_url()); ?>" class="button pay"><?php _e('Pay', 'woocommerce') ?></a>
<?php if (is_user_logged_in()) : ?>
<a href="<?php echo esc_url(wc_get_page_permalink('myaccount')); ?>" class="button pay"><?php _e('My Account', 'woocommerce'); ?></a>
<?php endif; ?>
</p>
<?php
else :
// if (isset($_SESSION['optUserData'])) {
// $userId = $_SESSION['optUserData']['userId'];
// $sku = $_SESSION['optUserData']['sku'];
// $user_id = get_current_user_id();
// $optDataFile = file_get_contents("https://cdn.optimizely.com/json/8164295340.json");
// $optimizely = new Optimizely($optDataFile, null, null, null, true);
// $total = $order->get_total();
// $totalShipping = $order->get_total_shipping();
// $totalExcludeShipping = (int) (($total - $totalShipping) * 100);
// $optimizely->track('subscriptions', $userId, null, $totalExcludeShipping);
//
// echo "<!--OPT: WPUSER:" . $user_id . ", USER:" . $userId . ", VAR:" . $variationKey . "-->";
// }
?>
<div class="order-confirm-page ">
<div class="shop-step-1" style="padding: 0px 32px;">
<h5 class="shop-step-title">all done!</h5>
<h1 class="page-title shop-page-title">earn free reize</h1>
<p><b>Share the REIZE club with your friends and earn free REIZE</b></p>
<div class="innercontent">
<?php echo do_shortcode('[jpshare]'); ?>
<?php // echo sharing_display(); ?>
<p>For every friend you refer that joins the REIZE club, you get $15 credit to spend on REIZE.</p>
<div class="contentline">
<input value="<?php echo do_shortcode('[affiliates_url]') ?>" id="link_affiliates"/>
<input value="<?php echo Affiliates_Shortcodes::affiliates_id('') ?>" id="id_affiliates" type="hidden"/>
</div>
<p>Here's your unique link, click to copy and share it with your friends.</p>
</div>
</div>
</div>
<?php endif; ?>
<?php else : ?>
<p class="woocommerce-thankyou-order-received"><?php echo apply_filters('woocommerce_thankyou_order_received_text', __('Thank you. Your order has been received.', 'woocommerce'), null); ?></p>
<?php endif; ?>