daily pastebin goal
44%
SHARE
TWEET

Alt ticket form: link to product page (see: qrsEM14Q)

BakerMan Mar 10th, 2014 641 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $count = 0;
  3. echo '<ul>';
  4.  
  5. foreach ( $tickets as $ticket ) {
  6.         global $product;
  7.         $count++;
  8.  
  9.         if ( class_exists( 'WC_Product_Simple' ) ) $product = new WC_Product_Simple( $ticket->ID );
  10.         else $product = new WC_Product( $ticket->ID );
  11.  
  12.         $price = $product->get_price_html();
  13.         $link = '<a href="' . $product->get_permalink() . '">Buy!</a>';
  14.         echo "<li> $ticket->name $price $link </li>";
  15. }
  16.  
  17. if ( 0 === $count )
  18.         echo '<li> There are no tickets available for this event </li>';
  19.  
  20. echo '</ul>';
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top