Ejemplo n.º 1
0
        function wa_mail_data($user_id, $bid_price, $product, $mailTemp = 'mail_won')
        {
            $this->user = get_userdata($user_id);
            $this->product_link = get_permalink($product->id);
            $this->to = $this->user->user_email;
            $this->subject = get_option('wa_mail_subject', 'Auction');
            $this->headers = array('Content-Type: text/html; charset=UTF-8');
            // body
            switch ($mailTemp) {
                case 'mail_lost':
                    $order = array('[username]', '[product_name]', '[price]', '[link]');
                    $replace = array($this->user->user_login, $product->post->post_title, WA_Helper::currency($bid_price), $this->product_link);
                    $temp_default = '<p>Hello [username],</p>
								<p>you\'ve lost in auctions: [product_name]</p>
								<p>Price: [price]</p>
								<p>Link product auction: [link]</p>
								&nbsp;
								<p>Thank you.</p>';
                    $this->body = str_replace($order, $replace, get_option('wa_content_mail_lost_template', $temp_default));
                    break;
                default:
                    $order = array('[username]', '[product_name]', '[price]', '[link]');
                    $replace = array($this->user->user_login, $product->post->post_title, WA_Helper::currency($bid_price), $this->product_link);
                    $temp_default = '<p>Hello [username],</p>
								<p>You are  the winner in the auction: [product_name]</p>
								<p>Price: [price]</p>
								<p>Link order: [link]</p>
								&nbsp;
								<p>Thank you.</p>';
                    $this->body = str_replace($order, $replace, get_option('wa_content_mail_won_template', $temp_default));
                    break;
            }
            return $this->wa_send_mail();
        }
							<i class="ion-ribbon-b"></i> <?php 
_e('Bids', 'wa');
?>
						</span> 
						<span class="wa-info-field-content">
							0
						</span>
					</li>
					<li>
						<span class="wa-info-field">
							<i class="ion-social-usd"></i> <?php 
_e('Current Bid', 'wa');
?>
						</span> 
						<span class="wa-info-field-content"><?php 
echo WA_Helper::currency($meta_fields['_wa_reserve_price'][0]);
?>
</span>
					</li>
					<li>
						<span class="wa-info-field">
							<i class="ion-clock"></i> <?php 
_e('Time Remaining', 'wa');
?>
						</span>
						<span class="countdown wa-info-field-content" data-datatime="<?php 
echo "{$dates['end']}";
?>
" data-format="%-w week%!w %-d day%!d %H:%M:%S">
						  	<span class="clock"></span>
						</span>
Ejemplo n.º 3
0
_e('Current price', 'wa');
?>
</p></div>
							<span class="wa-info-field-content">
								<?php 
echo empty($current_price) ? WA_Helper::currency($meta_fields['_wa_start_price'][0]) : WA_Helper::currency($current_price);
?>
							</span>
						</div>
						<div class="wa-buy-bow-content">
							<div><i class="ion-ios-heart-outline"></i> <p><?php 
_e('Buy now price', 'wa');
?>
</p></div>
							<span class="wa-info-field-content"><?php 
echo WA_Helper::currency($meta_fields['_wa_buy_it_now_price'][0]);
?>
</span>
						</div>
					</li>
				</ul>
			</div>
			<div class="col-md-4">
				<div class="wa-product-entry-title">
					<a class="wa-url" href="<?php 
echo esc_url(get_permalink($posts->ID));
?>
">
						<h2><?php 
the_title();
?>
                                            <div class="wa-highest-bid-price-product"></div>
                                            <div class="wa-text-center">
                                                <p><label for="wa-product-bid-price"><?php 
    _e('Bid price', 'wa');
    ?>
 (<?php 
    echo WA_Helper::currency();
    ?>
)</label></p>
                                                <p style="width: 200px; margin: auto;">
                                                    <input type="number" name="price" class="form-control wa-text-center" id="wa-product-bid-price" placeholder="00.00" required>
                                                    <small><i>(<?php 
    _e('increment price');
    ?>
 <span><?php 
    echo WA_Helper::currency($meta_fields['_wa_bid_increment'][0]);
    ?>
)</i></span></small>
                                                </p>
                                            </div>
                                        </div>
                                        <div class="modal-footer">
                                            <input type="hidden" name="product_id" value="<?php 
    echo esc_attr($post->ID);
    ?>
"/>
                                            
                                            <button type="button" class="btn btn-default" data-dismiss="modal"><?php 
    _e('Close', 'wa');
    ?>
</button>
Ejemplo n.º 5
0
 function wa_save_price_bid_product()
 {
     extract($_POST);
     $check_price = $this->wa_check_bid_product($product_id, $price);
     $result_arr = array();
     do_action('after_wa_bid');
     if ($check_price == false) {
         $next_price = $this->wa_next_price_bid_product(false);
         $highest_price = $this->wa_get_highest_bid_by_productid($product_id);
         $result_arr['st'] = 'fail';
         $result_arr['ico'] = '<i class="ion-ios-close" style="color: red"></i>';
         $result_arr['mess'] = 'Bid fail.';
         $result_arr['next_price'] = $next_price;
         $result_arr['highest_price'] = WA_Helper::currency($highest_price[0]['price']);
     } else {
         global $user_ID;
         require_once WA_PLUGIN_DIR . '/includes/class-wa-db.php';
         $db = new WA_Db();
         $arr_query = array("tableName" => "wa_product_bids", "arrItems" => array("product_id" => $product_id, "user_id" => $user_ID, "date" => date('Y-m-d H:i:s'), "price" => $price, "status" => 1));
         $rowID = $db->insert($arr_query);
         $result_arr['st'] = 'success';
         $result_arr['ico'] = '<i class="ion-ios-checkmark" style="color: green"></i>';
         $result_arr['mess'] = 'Bid success, thank you!';
     }
     do_action('before_wa_bid');
     echo json_encode(apply_filters('before_wa_result_bid_data', $result_arr));
     exit;
 }