Advertisement
BakerMan

Don't show sold out tickets

Mar 20th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. if ( ( !$product->is_in_stock() ) || ( empty( $start_date ) || time() > $start_date ) && (  empty( $end_date ) || time() < $end_date ) ) {
  2.  
  3.     $is_there_any_product = true;
  4.  
  5.     echo sprintf( "<input type='hidden' name='product_id[]' value='%d'>", $ticket->ID );
  6.  
  7.     if ( $product->is_in_stock() ) {
  8.        
  9.         echo "<tr>";
  10.         echo "<td width='75' class='woocommerce'>";
  11.        
  12.         woocommerce_quantity_input( array( 'input_name'  => 'quantity_' . $ticket->ID,
  13.                                            'input_value' => 0,
  14.                                            'min_value'   => 0,
  15.                                            'max_value'   => $product->backorders_allowed() ? '' : $product->get_stock_quantity(), ) );
  16.  
  17.         $is_there_any_product_to_sell = true;
  18.  
  19.         echo "</td>";
  20.  
  21.         echo "<td nowrap='nowrap' class='tickets_name'>";
  22.         echo $ticket->name;
  23.         echo "</td>";
  24.  
  25.         echo "<td class='tickets_price'>";
  26.         echo $this->get_price_html( $product );
  27.         echo "</td>";
  28.  
  29.         echo "<td class='tickets_description'>";
  30.         echo $ticket->description;
  31.         echo "</td>";
  32.  
  33.         echo "</tr>";
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement