Sammy30
10/6/2019 - 7:46 PM

Fund-campaign-btn 2

/*
ethis.co.id / httpdocs / wp-content / plugins / wp-crowdfunding / wpneotemplate / woocommerce / ethis / include / fund-campaign-btn.php
*/

<?php
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly
}
?>
<div class="wpneo-single-sidebar">
    <?php
    global $post, $woocommerce, $product;
    $currency = 'Rp.';
    if ($product->product_type == 'crowdfunding') {
        if (WPNEOCF()->campaignValid()) {
            $recomanded_price = get_post_meta($post->ID, 'wpneo_funding_recommended_price', true);
            $min_price = get_post_meta($post->ID, 'wpneo_funding_minimum_price', true);
            $max_price = get_post_meta($post->ID, 'wpneo_funding_maximum_price', true);
            if(function_exists( 'get_woocommerce_currency_symbol' )){
                $currency = get_woocommerce_currency_symbol();
            }

            if (! empty($_GET['reward_min_amount'])){
                $recomanded_price = (int) esc_html($_GET['reward_min_amount']);
            } ?>

            <span class="wpneo-tooltip">
                <span class="wpneo-tooltip-min"><?php _e('Minimum nominal adalah ','wp-crowdfunding'); echo $currency.$min_price; ?></span>
                <span class="wpneo-tooltip-max"><?php _e('Maximum nominal adalah ','wp-crowdfunding'); echo $currency.$max_price; ?></span>
            </span>
            
            <!-- Modal HTML -->
                <div id="investpop" style="display:none;">
                    <?php echo do_shortcode('[gravityform id="5" title="true" description="false" ajax="true"]'); ?>
                </div>
            <!-- Link to open the modal -->

            <form enctype="multipart/form-data" method="post" class="cart">
				<span style="font-size:12px;">Masukan jumlah investasi anda :</span><br>
                <?php do_action('before_wpneo_donate_field'); ?>
				<span style="padding: 0 0 0 0px;">Jumlah Rp. </span>
                <input type="number" min="1000000" placeholder="<?php echo  get_woocommerce_currency_symbol().' '.$recomanded_price; ?>" 		name="wpneo_donate_amount_field"  
style="max-width:150px;"
class="input-text amount wpneo_donate_amount_field text" 
value="<?php echo $recomanded_price; ?>" data-min-price="
<?php echo $min_price ?>" data-max-price="<?php echo $max_price ?>" >
                <?php do_action('after_wpneo_donate_field'); ?>
				 <!-- <span style="padding: 0 0 0 10px;">Jumlah</span> -->
                <input type="hidden" value="<?php echo esc_attr($post->ID); ?>" name="add-to-cart">
		
		<!--
                <button type="submit" aria-disabled="true" class="<?php echo apply_filters('add_to_donate_button_class', 'wpneo_donate_button'); ?>">
               
					<?php _e(' Invest Sekarang ', 'wp-crowdfunding'); ?></button>
				-->
				
            </form>
	
            
            <?php if( get_field('invest_popup') ): ?> <!-- Show popup only if it's checked in the edit panel -->
                <?php { ?>
                <a class="wpneo_donate_button donate_offline" href="#investpop" rel="modal:open">Investment Application</a>
                <p style="clear: both;"><i>Submit Investment Application for amounts higher than SGD $250.</i></p>
                <?php } ?>
                <?php endif; ?>
            <?php
        } else {
            _e('This campaigns is over.','wp-crowdfunding');
        }
    }

    ?>
</div>