first commit
This commit is contained in:
60
public/templates/privacy-policy.html
Normal file
60
public/templates/privacy-policy.html
Normal file
@@ -0,0 +1,60 @@
|
||||
<!-- wp:paragraph -->
|
||||
<h2>Privacy Policy for {$site_name}</h2>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<p><strong>Effective Date:</strong> [current-date]</p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<h3>1. Data Collection</h3>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:list -->
|
||||
<ul>
|
||||
<li><strong>Order Information:</strong> We collect order details including items purchased, total amount, and payment method</li>
|
||||
<li><strong>Technical Data:</strong> Automatically collected information includes IP address, browser type, device information, and referring URLs</li>
|
||||
<li><strong>User Data:</strong> For logged-in users, we store WordPress user ID associated with transactions</li>
|
||||
</ul>
|
||||
<!-- /wp:list -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<h3>2. Data Usage</h3>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:list -->
|
||||
<ul>
|
||||
<li>Process and fulfill orders</li>
|
||||
<li>Prevent fraud and ensure transaction security</li>
|
||||
<li>Improve our services through analytics</li>
|
||||
<li>Comply with legal obligations</li>
|
||||
</ul>
|
||||
<!-- /wp:list -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<h3>3. Data Sharing</h3>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:list -->
|
||||
<ul>
|
||||
<li>Payment processors (Stripe/PayPal) for transaction processing</li>
|
||||
<li>Shipping providers for order fulfillment</li>
|
||||
<li>Legal authorities when required by law</li>
|
||||
</ul>
|
||||
<!-- /wp:list -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<h3>4. Your Rights</h3>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:list -->
|
||||
<ul>
|
||||
<li>Request access to your personal data</li>
|
||||
<li>Request correction of inaccurate data</li>
|
||||
<li>Request deletion of your data (subject to legal requirements)</li>
|
||||
</ul>
|
||||
<!-- /wp:list -->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<p>For data requests, contact us at: <a href="mailto:{$admin_email}">{$admin_email}</a></p>
|
||||
<!-- /wp:paragraph -->
|
||||
238
public/templates/single-formipay.php
Normal file
238
public/templates/single-formipay.php
Normal file
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
get_header(); // Add your header template if needed
|
||||
$form_settings = get_post_meta(get_the_ID(), 'formipay_settings', true);
|
||||
$post_id = get_the_ID();
|
||||
?>
|
||||
<div id="primary" class="content-area">
|
||||
<main id="main" class="site-main">
|
||||
<?php
|
||||
while (have_posts()) :
|
||||
the_post();
|
||||
?>
|
||||
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<div class="entry-content">
|
||||
<div class="formipay-form-wrapper">
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
<form class="formipay-form" data-form-id="<?php echo intval($post_id) ?>">
|
||||
<input type="hidden" id="product_name" value="<?php echo esc_attr(formipay_get_post_meta($post_id, 'product_title')); ?>">
|
||||
<input type="hidden" id="product_price" value="<?php echo esc_attr(formipay_get_post_meta($post_id, 'product_price')); ?>">
|
||||
<?php
|
||||
|
||||
$timezone = new DateTimeZone( wp_timezone_string() );
|
||||
|
||||
$require_login = false;
|
||||
if(formipay_get_post_meta($post_id, 'require_login') == 'on'){
|
||||
$require_login = true;
|
||||
}
|
||||
|
||||
$scheduled = false;
|
||||
$date_range = '';
|
||||
$date_from = '';
|
||||
$date_to = '';
|
||||
if(formipay_get_post_meta($post_id, 'schedule_toggle') == 'on'){
|
||||
$scheduled = true;
|
||||
if(false !== formipay_get_post_meta($post_id, 'daterange')){
|
||||
$date_range = explode(' - ', formipay_get_post_meta($post_id, 'daterange') );
|
||||
$date_from = DateTime::createFromFormat('m/d/Y', $date_range[0], $timezone);
|
||||
$date_to = DateTime::createFromFormat('m/d/Y', $date_range[1], $timezone);
|
||||
|
||||
$timestamp_from = $date_from ? $date_from->getTimestamp() : false;
|
||||
$timestamp_to = $date_to ? $date_to->getTimestamp() : false;
|
||||
}
|
||||
}
|
||||
|
||||
$render = true;
|
||||
|
||||
if($require_login && !is_user_logged_in()){
|
||||
$render = false;
|
||||
?>
|
||||
<div class="formipay-message">
|
||||
<?php echo wp_kses_post( formipay_get_post_meta($post_id, 'require_login_message')); ?>
|
||||
</div>
|
||||
<?php
|
||||
}elseif($scheduled) {
|
||||
if($timestamp_from > time()) {
|
||||
$render = false;
|
||||
?>
|
||||
<div class="formipay-message">
|
||||
<?php echo wp_kses_post(formipay_get_post_meta($post_id, 'waiting_message')); ?>
|
||||
</div>
|
||||
<?php
|
||||
}elseif(time() > $timestamp_to){
|
||||
$render = false;
|
||||
?>
|
||||
<div class="formipay-message">
|
||||
<?php echo wp_kses_post(formipay_get_post_meta($post_id, 'expired_message')); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
if($render) {
|
||||
if(false !== $form_settings && is_array($form_settings['fields']) && count($form_settings['fields']) > 0){
|
||||
foreach($form_settings['fields'] as $field_id => $field){
|
||||
$field_id = str_replace('_config', '', $field_id);
|
||||
$not_input = ['select', 'checkbox', 'radio', 'textarea'];
|
||||
$required = '';
|
||||
if($field['is_required'] == 'yes'){
|
||||
$required = ' required';
|
||||
}
|
||||
$asterisk = '(*)';
|
||||
if(formipay_get_post_meta($post_id, 'required_field_sign') == 'text'){
|
||||
$asterisk = formipay_get_post_meta($post_id, 'required_text');
|
||||
}
|
||||
$placeholder = $field['placeholder'];
|
||||
if(formipay_get_post_meta($post_id, 'field_placeholder') == 'label'){
|
||||
$placeholder = $field['label'].' '.$asterisk;
|
||||
}
|
||||
$label_show = true;
|
||||
if(formipay_get_post_meta($post_id, 'label_visibility') == 'hide'){
|
||||
$label_show = false;
|
||||
}
|
||||
$display_label = '';
|
||||
if($label_show) {
|
||||
$display_label = 'd-none';
|
||||
}
|
||||
$calculable = '';
|
||||
if(in_array($field['field_type'], ['number', 'hidden', 'select', 'checkbox', 'radio'])){
|
||||
$calculable = ' formipay-input-calculable';
|
||||
}
|
||||
$calc = '';
|
||||
if(!isset($field['calc_value'])){
|
||||
$field['calc_value'] = 0;
|
||||
}
|
||||
if(in_array($field['field_type'], ['number', 'hidden'])){
|
||||
$calc = 'data-calc-value="'.$field['calc_value'].'"';
|
||||
}
|
||||
if(!in_array($field['field_type'], $not_input)){
|
||||
$show = '';
|
||||
if($field['field_type'] == 'hidden'){
|
||||
$show = ' formipay-hidden-group';
|
||||
}
|
||||
?>
|
||||
<div class="formipay-field-group<?php echo esc_attr($show); ?>">
|
||||
<label for="<?php echo esc_attr($field_id); ?>" class="formipay-label <?php echo esc_attr($display_label); ?>"><?php echo esc_html($field['label']); ?> <?php echo ('' !== $required) ? '<span class="formipay-asterisk">'.esc_html($asterisk).'</span>' : '' ?></label>
|
||||
<input type="<?php echo esc_attr($field['field_type']); ?>" name="<?php echo esc_attr($field_id); ?>" class="formipay-input<?php echo esc_attr($calculable); ?>" value="<?php echo esc_attr($field['default_value']); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" data-label="<?php echo esc_attr($field['label']); ?>"<?php echo esc_attr($calc) . esc_attr($required); ?>>
|
||||
<p class="formipay-input-desc mb-0"><?php echo esc_html($field['description']); ?></p>
|
||||
<p class="formipay-validate-field"></p>
|
||||
</div>
|
||||
<?php
|
||||
}else{
|
||||
if($field['field_type'] == 'textarea'){
|
||||
?>
|
||||
<div class="formipay-field-group">
|
||||
<label for="<?php echo esc_attr($field_id); ?>" class="formipay-label <?php echo esc_attr($display_label); ?>"><?php echo esc_html($field['label']); ?> <?php echo ('' !== $required) ? '<span class="formipay-asterisk">'.esc_html($asterisk).'</span>' : '' ?></label>
|
||||
<textarea class="formipay-input" name="<?php echo esc_attr($field_id) ?>" placeholder="<?php echo esc_attr($placeholder); ?>" data-label="<?php echo esc_attr($field['label']); ?>"<?php echo esc_attr($required); ?> rows="4"><?php echo esc_html($field['default_value']); ?></textarea>
|
||||
<p class="formipay-input-desc mb-0"><?php echo esc_html($field['description']); ?></p>
|
||||
<p class="formipay-validate-field"></p>
|
||||
</div>
|
||||
<?php
|
||||
}elseif($field['field_type'] == 'select'){
|
||||
$options = '';
|
||||
if(!empty($field['field_options'])){
|
||||
$field_options = explode(PHP_EOL, $field['field_options']);
|
||||
foreach($field_options as $option){
|
||||
$explode = explode('|', $option);
|
||||
$label = $explode[0];
|
||||
$value = $label;
|
||||
$calc = 0;
|
||||
if(isset($explode[1])){
|
||||
$value = $explode[1];
|
||||
}
|
||||
if(isset($explode[2])){
|
||||
$calc = $explode[2];
|
||||
}
|
||||
$selected = '';
|
||||
if($field['default_value'] == $value){
|
||||
$selected = ' selected';
|
||||
}
|
||||
$options .= '<option value="'.$value.'" data-label="'.$label.'" data-calc-value="'.$calc.'" '.$selected.'>'.$label.'</option>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="formipay-field-group">
|
||||
<label for="<?php echo esc_attr($field_id); ?>" class="formipay-label <?php echo esc_attr($display_label); ?>"><?php echo esc_html($field['label']); ?> <?php echo ('' !== $required) ? '<span class="formipay-asterisk">'.esc_html($asterisk).'</span>' : '' ?></label>
|
||||
<select id="<?php echo esc_attr($field_id); ?>" name="<?php echo esc_attr($field_id); ?>" class="formipay-input formipay-select<?php echo esc_attr($calculable); ?>" data-label="<?php echo esc_attr($field['label']); ?>"<?php echo esc_attr($required); ?>><?php echo wp_kses_post($options); ?></select>
|
||||
<p class="formipay-input-desc mb-0"><?php echo esc_html($field['description']); ?></p>
|
||||
<p class="formipay-validate-field"></p>
|
||||
</div>
|
||||
<?php
|
||||
}elseif($field['field_type'] == 'radio'){
|
||||
?>
|
||||
<div class="formipay-field-group">
|
||||
<label class="formipay-label <?php echo esc_attr($display_label); ?>">
|
||||
<span class="label-text"><?php echo esc_html($field['label']); ?></span>
|
||||
<?php echo ('' !== $required) ? '<span class="formipay-asterisk">'.esc_html($asterisk).'</span>' : '' ?>
|
||||
</label>
|
||||
<?php
|
||||
$field_options = explode(PHP_EOL, $field['field_options']);
|
||||
foreach($field_options as $index => $option){
|
||||
$explode = explode('|', $option);
|
||||
$label = $explode[0];
|
||||
$value = $label;
|
||||
$calc = 0;
|
||||
if(isset($explode[1])){
|
||||
$value = $explode[1];
|
||||
}
|
||||
if(isset($explode[2])){
|
||||
$calc = 'data-calc-value="'.$explode[2].'"';;
|
||||
}
|
||||
$checked = '';
|
||||
if($field['default_value'] == $value){
|
||||
$checked = ' checked';
|
||||
}
|
||||
?>
|
||||
<div class="formipay-radio-option-group">
|
||||
|
||||
<input type="radio" name="<?php echo esc_attr($field_id); ?>" id="<?php echo esc_attr($field_id).'-'.esc_attr($index); ?>" class="formipay-input<?php echo esc_attr($calculable); ?>" value="<?php echo esc_attr($value); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" data-label="<?php echo esc_attr($label); ?>"<?php echo esc_attr($calc) . esc_attr($required) . esc_attr($checked); ?>>
|
||||
|
||||
<label for="<?php echo esc_attr($field_id).'-'.esc_attr($index); ?>" class="formipay-label <?php echo esc_attr($display_label); ?>"><?php echo esc_html($label); ?></label>
|
||||
|
||||
<p class="formipay-input-desc mb-0"><?php echo esc_html($field['description']); ?></p>
|
||||
<p class="formipay-validate-field"></p>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div class="form-calculation form-calculate-<?php echo intval($post_id) ?>">
|
||||
<h4><?php echo esc_html__('Your Order', 'formipay'); ?></h4>
|
||||
<table id="formipay-review-order">
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<?php if(formipay_get_post_meta($post_id, 'product_type') == 'physical') { ?>
|
||||
<input type="hidden" class="form-control" id="formipay-shipping-cost" value="0">
|
||||
<?php } ?>
|
||||
|
||||
<input type="hidden" class="form-control" id="formipay-total">
|
||||
<button
|
||||
data-button-text="<?php echo esc_attr(formipay_get_post_meta($post_id, 'button_text')); ?>"
|
||||
type="submit"
|
||||
class="formipay-submit-button"
|
||||
style="background-color: <?php echo esc_attr(formipay_get_post_meta($post_id, 'button_bg_color')); ?>; color: <?php echo esc_attr(formipay_get_post_meta($post_id, 'button_text_color')); ?>; width: <?php echo (formipay_get_post_meta($post_id, 'button_width') == 'fit-content') ? 'fit-content' : '100%'; ?>; margin-left: <?php echo (formipay_get_post_meta($post_id, 'button_position') !== 'left') ? 'auto' : 'unset'; ?>; margin-right: <?php echo (formipay_get_post_meta($post_id, 'button_position') !== 'right') ? 'auto' : 'unset'; ?>;"
|
||||
>
|
||||
<?php echo esc_html(formipay_get_post_meta($post_id, 'button_text')); ?>
|
||||
</button>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
<div class="submit-response formipay-message" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
get_footer(); // Add your footer template if needed
|
||||
?>
|
||||
59
public/templates/thank-you.php
Normal file
59
public/templates/thank-you.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="robots" content="noindex">
|
||||
<title>Thankyou for your order #<?php echo intval($order_id); ?></title>
|
||||
<?php wp_head(); ?>
|
||||
<style>
|
||||
body {
|
||||
--formipay-button-submit-bg-color: <?php echo esc_html($button_background_color['regular']) ?? '#000000'; ?>;
|
||||
--formipay-button-submit-bg-color-hover: <?php echo esc_html($button_background_color['hover']) ?? '#ffffff'; ?>;
|
||||
--formipay-button-submit-bg-color-active: <?php echo esc_html($button_background_color['active']) ?? '#ffffff'; ?>;
|
||||
--formipay-button-submit-text-color: <?php echo esc_html($button_text_color['regular']) ?? '#ffffff'; ?>;
|
||||
--formipay-button-submit-text-color-hover: <?php echo esc_html($button_text_color['hover']) ?? '#000000'; ?>;
|
||||
--formipay-button-submit-text-color-active: <?php echo esc_html($button_text_color['active']) ?? '#000000'; ?>;
|
||||
--formipay-button-submit-border-color: <?php echo esc_html($button_border_color['regular']) ?? '#000000'; ?>;
|
||||
--formipay-button-submit-border-color-hover: <?php echo esc_html($button_border_color['hover']) ?? '#ffffff'; ?>;
|
||||
--formipay-button-submit-border-color-hover: <?php echo esc_html($button_border_color['hover']) ?? '#ffffff'; ?>;
|
||||
--formipay-button-submit-border-color-active: <?php echo esc_html($button_border_color['active']) ?? '#ffffff'; ?>;
|
||||
--formipay-thankyou-screen-width: <?php echo intval($formipay_settings['thankyou_page_wrapper_max_width']) ?? 600 ?>px;
|
||||
--formipay-thankyou-container-bg-color: <?php echo esc_html($formipay_settings['thankyou_page_container_bg_color']) ?? '#808080'; ?>;
|
||||
--formipay-thankyou-wrapper-bg-color: <?php echo esc_html($formipay_settings['thankyou_page_wrapper_bg_color']) ?? '#ffffff'; ?>;
|
||||
--formipay-thankyou-table-alignment: <?php echo esc_html(formipay_get_post_meta($form_id, 'thankyou_screen_table_alignment')) ?? 'center'; ?>;
|
||||
--formipay-confirm-dropzone-bg-color: <?php echo esc_html($formipay_settings['bank_transfer_confirmation_dropzone_color']) ?? '#cccccc'; ?>;
|
||||
--formipay-confirm-dropzone-text-color: <?php echo esc_html($formipay_settings['bank_transfer_confirmation_dropzone_text_color']) ?? '#808080'; ?>;
|
||||
<?php
|
||||
switch (formipay_get_post_meta($form_id, 'thankyou_screen_table_alignment')) {
|
||||
case 'left':
|
||||
?>
|
||||
--formipay-thankyou-table-alignment-left: unset;
|
||||
--formipay-thankyou-table-alignment-right: auto;
|
||||
<?php
|
||||
break;
|
||||
case 'right':
|
||||
?>
|
||||
--formipay-thankyou-table-alignment-left: auto;
|
||||
--formipay-thankyou-table-alignment-right: unset;
|
||||
<?php
|
||||
break;
|
||||
|
||||
default:
|
||||
?>
|
||||
--formipay-thankyou-table-alignment-left: auto;
|
||||
--formipay-thankyou-table-alignment-right: auto;
|
||||
<?php
|
||||
break;
|
||||
}
|
||||
?>
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="formipay-container">
|
||||
<?php
|
||||
$this->view_access();
|
||||
wp_footer();
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user