Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter bolzo5

    (@bolzo5)

    hi,
    thanks that would be very helpful,
    I’m using woocommerce and its plugin simple auction and the code which adds the timer it’s in the theme function.php and it goes like this.

    add_action( 'woocommerce_before_shop_loop_item_title','wpgenie_show_counter_in_loop');
    
    		function wpgenie_show_counter_in_loop(){
    
    			global $product;
    
    			$time = '';
    
    			if(!isset ($product))
    				return;
    			if('auction' != $product->product_type)
    				return;
    
    			$timetext = __('Time left', 'wc_simple_auctions');
    
    			if(!$product->is_started()){
    				$timetext = __('Starting in', 'wc_simple_auctions');
    				$counter_time = $product->get_seconds_to_auction();
    			} else{
    				$counter_time = $product->get_seconds_remaining();
    			}
    
    			$time = '<span class="time-left">'.$timetext.'</span>
    			<div class="auction-time-countdown"
    			data-time="'.$counter_time.'"
    			data-auctionid="'.$product->id.'" data-format="'.get_option(
    			'simple_auctions_countdown_format' ).'"></div>';
    
    			if($product->is_closed()){
    				$time = '<span class="has-finished">'.__('Auction finished','wc_simple_auctions').'</span>';
    			}
    			echo $time;
    		} 

    thank you again for your time!

Viewing 1 replies (of 1 total)