-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckout.php
More file actions
57 lines (39 loc) · 1.02 KB
/
checkout.php
File metadata and controls
57 lines (39 loc) · 1.02 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
<?php
/*
Template Name: Checkout
*/
// empty checkout not allowed!
if (empty($_SESSION['cart']) || $_SESSION['ocart_cart_count'] == 0) {
wp_redirect ( home_url() );
exit;
}
// redirect to checkout step
if (!isset($_GET['checkout_step'])) {
if (is_user_logged_in()) {
$url = add_query_arg( array ( 'checkout_step' => 2 ) );
} else {
$url = add_query_arg( array ( 'checkout_step' => 1 ) );
}
wp_redirect( $url );
exit;
} else {
if ($_GET['checkout_step'] == 1 && is_user_logged_in()) {
wp_redirect( add_query_arg( array ( 'checkout_step' => 2 ) ) );
}
}
?>
<?php get_header(); ?>
<?php get_template_part('template','header'); ?>
<?php ocart_display_super_nav() ?>
<div id="blog">
<div class="wrap">
<div class="checkout_left">
<?php get_template_part('checkout', 'form'); ?>
</div>
<div class="checkout_right">
<?php get_template_part('checkout', 'summary'); ?>
</div><div class="clear"></div>
</div>
</div>
<?php get_template_part('template','footer'); ?>
<?php get_footer(); ?>