-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-payment.php
108 lines (89 loc) · 4.38 KB
/
template-payment.php
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
<?php
/**
* Template Name: Payment Page
* Created by PhpStorm.
* User: waqasriaz
* Date: 06/09/16
* Time: 3:27 PM
*/
$selected_package_id = isset( $_GET['selected_package'] ) ? $_GET['selected_package'] : '';
$property_id = isset( $_GET['prop-id'] ) ? $_GET['prop-id'] : '';
$upgrade_id = isset( $_GET['upgrade_id'] ) ? $_GET['upgrade_id'] : '';
if( empty( $selected_package_id ) && empty( $property_id ) && empty( $upgrade_id ) ) {
wp_redirect( home_url() );
}
set_time_limit (600);
$houzez_need_register = false;
if ( !is_user_logged_in() ) {
$houzez_need_register = true;
}
get_header();
global $houzez_local;
$user_id = get_current_user_id();
$user_pack_id = get_the_author_meta( 'package_id' , $user_id );
$user_package_activation = get_the_author_meta( 'package_activation' , $user_id );
$user_registered = get_the_author_meta( 'user_registered' , $user_id );
$package_price = get_post_meta( $selected_package_id, 'fave_package_price', true );
$is_membership = 0;
$paid_submission_type = esc_html ( houzez_option('enable_paid_submission','') );
$membership_currency = houzez_option( 'currency_paid_submission' );
$currency_symbol = houzez_option( 'currency_symbol' );
$where_currency = houzez_option( 'currency_position' );
$enable_wireTransfer = houzez_option('enable_wireTransfer');
$enable_paypal = houzez_option('enable_paypal');
$enable_stripe = houzez_option('enable_stripe');
$user_show_roles = houzez_option('user_show_roles');
$show_hide_roles = houzez_option('show_hide_roles');
$enable_paid_submission = houzez_option('enable_paid_submission');
$packages_page_link = houzez_get_template_link('template/template-packages.php');
$stripe_processor_link = houzez_get_template_link('template/template-stripe-charge.php');
$panel_class = '';
$houzez_loggedin = false;
if ( is_user_logged_in() ) {
$houzez_loggedin = true;
} else {
}
?>
<section class="frontend-submission-page">
<div class="container">
<div id="packmem-msgs"></div>
<div class="d-flex display-block-on-tablet">
<div class="order-2">
<?php
if( $enable_paid_submission == 'membership' ) {
get_template_part('template-parts/membership/price');
} else if ( $enable_paid_submission == 'per_listing' || $enable_paid_submission == 'free_paid_listing' ) {
get_template_part('template-parts/membership/per-listing/price');
}
?>
</div><!-- order-2 -->
<div class="order-1 flex-grow-1">
<form name="houzez_checkout" method="post" class="houzez_payment_form" action="<?php echo $stripe_processor_link; ?>">
<?php if ( $houzez_need_register ) { ?>
<div class="dashboard-content-block-wrap">
<h2><?php esc_html_e('Account Information', 'houzez'); ?></h2>
<div class="dashboard-content-block">
<?php get_template_part('template-parts/membership/create-account-form'); ?>
</div>
</div>
<?php } ?>
<div class="dashboard-content-block-wrap">
<?php if( $package_price > 0 || $enable_paid_submission == 'per_listing' || $enable_paid_submission == 'free_paid_listing') { ?>
<h2><?php echo $houzez_local['payment_method']; ?></h2>
<?php } ?>
<div class="dashboard-content-block">
<?php
if( $enable_paid_submission == 'membership' ) {
get_template_part('template-parts/membership/payment-method');
} elseif($enable_paid_submission == 'per_listing' || $enable_paid_submission == 'free_paid_listing') {
get_template_part('template-parts/membership/per-listing/payment-method');
}
?>
</div><!-- dashboard-content-block -->
</div><!-- dashboard-content-block-wrap -->
</form>
</div><!-- order-1 -->
</div><!-- d-flex -->
</div><!-- container -->
</section><!-- frontend-submission-page -->
<?php get_footer(); ?>