Advertisement
rejuancse

fund-campaign-btn

Sep 2nd, 2020
1,140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.14 KB | None | 0 0
  1. <?php
  2.     if ( ! defined( 'ABSPATH' ) ) {
  3.         exit; # Exit if accessed directly
  4.    }
  5.     global $post, $woocommerce, $product;
  6.     $currency = '$';
  7.     if ($product->get_type() == 'crowdfunding') {
  8.         if (WPNEOCF()->campaignValid()) {
  9.             $recomanded_price = get_post_meta($post->ID, 'wpneo_funding_recommended_price', true);
  10.             $min_price = get_post_meta($post->ID, 'wpneo_funding_minimum_price', true);
  11.             $max_price = get_post_meta($post->ID, 'wpneo_funding_maximum_price', true);
  12.             if(function_exists( 'get_woocommerce_currency_symbol' )){
  13.                 $currency = get_woocommerce_currency_symbol();
  14.             }
  15.  
  16.             if (! empty($_GET['reward_min_amount'])){
  17.                 $recomanded_price = (int) esc_html($_GET['reward_min_amount']);
  18.             } ?>
  19.  
  20.             <div id="backnow_project" class="quantity_box">
  21.                 <span class="wpneo-tooltip">
  22.                     <span class="wpneo-tooltip-min"><?php _e('Minimum amount is ','backnow'); echo esc_attr($currency.$min_price); ?></span>
  23.                     <span class="wpneo-tooltip-max"><?php _e('Maximum amount is ','backnow'); echo esc_attr($currency.$max_price); ?></span>
  24.                 </span>
  25.                 <form enctype="multipart/form-data" method="post" class="cart">
  26.                     <?php do_action('before_wpneo_donate_field'); ?>
  27.                     <input type="number" min="0" placeholder="" name="wpneo_donate_amount_field" class="input-text amount wpneo_donate_amount_field text" value="<?php echo esc_attr($recomanded_price); ?>" data-min-price="<?php echo esc_attr($min_price) ?>" data-max-price="<?php echo esc_attr($max_price) ?>" >
  28.                     <?php do_action('after_wpneo_donate_field'); ?>
  29.                     <input type="hidden" value="<?php echo esc_attr($post->ID); ?>" name="add-to-cart">
  30.                     <button type="submit" class="q<?php echo apply_filters('add_to_donate_button_class', 'wpneo_donate_button'); ?>"><i class="fa fa-long-arrow-right"></i></button>
  31.                 </form>
  32.             </div>
  33.            
  34.         <?php }
  35.     }
  36. ?>
  37. <!-- Quantity Box End -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement