wpgenie

remove Lottery ends, Timezone, Minimum ticket number

Jul 15th, 2020 (edited)
1,518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.22 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Lottery info template where Lottery ends, Timezone, Minimum ticket number, This lottery is limited to, Tickets sold are removed. Template should be copied to your_child_theme\woocommerce\single-product\ folder. If it does not exists you need to create it.
  4.  *
  5.  * As you can see all content is commented out. You can also create empty file called lottery-info.php in that folder to accomplish removal of listed elements.
  6.  */
  7.  
  8. if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
  9. global $product, $post;
  10.  
  11. $min_tickets                = $product->get_min_tickets();
  12. $max_tickets                = $product->get_max_tickets();
  13. $lottery_participants_count = !empty($product->get_lottery_participants_count()) ? $product->get_lottery_participants_count() : '0';
  14. $lottery_dates_to           = $product->get_lottery_dates_to();
  15. $lottery_dates_from         = $product->get_lottery_dates_from();
  16. $lottery_num_winners        = $product->get_lottery_num_winners();
  17.  
  18. ?>
  19.  
  20. <?php /*
  21. <p class="lottery-end"><?php echo __( 'Lottery ends:', 'wc_lottery' ); ?> <?php echo  date_i18n( get_option( 'date_format' ),  strtotime( $lottery_dates_to ));  ?>  <?php echo  date_i18n( get_option( 'time_format' ),  strtotime( $lottery_dates_to ));  ?> <br />
  22.         <?php printf(__('Timezone: %s','wc_lottery') , get_option('timezone_string') ? get_option('timezone_string') : __('UTC+','wc_lottery').get_option('gmt_offset')) ?>
  23. </p>
  24.  
  25. <?php if($min_tickets &&($min_tickets > 0)  ) : ?>
  26.         <p class="min-pariticipants"><?php  printf( __( "This lottery has a minimum of %d tickets", 'wc_lottery'), $min_tickets ); ?></p>
  27. <?php endif; ?>
  28.  
  29. <?php if( $max_tickets  &&( $max_tickets > 0 )  ) : ?>
  30.         <p class="max-pariticipants"><?php  printf( __( "This lottery is limited to %s tickets", 'wc_lottery' ),$max_tickets ) ; ?></p>
  31. <?php endif; ?>
  32.  
  33. <p class="cureent-participating"> <?php _e( 'Tickets sold:', 'wc_lottery' )?> <?php echo  $lottery_participants_count ;?></p>
  34.  
  35. <?php if(  $lottery_num_winners > 0  ) : ?>
  36.  
  37. <p class="max-pariticipants"><?php  printf( _n( "This lottery will have %d winner" , "This lottery will have %d winners", $lottery_num_winners , 'wc_lottery' ) ,$lottery_num_winners ) ; ?></p>
  38.  
  39. <?php endif; ?>
  40. */ ?>
Add Comment
Please, Sign In to add comment