Skip to content

Instantly share code, notes, and snippets.

@speedguy
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save speedguy/b7822cbb0da7fd8aef8e to your computer and use it in GitHub Desktop.

Select an option

Save speedguy/b7822cbb0da7fd8aef8e to your computer and use it in GitHub Desktop.
$id = $_GET['product_id']; //Get the product that we need to show from the URL query string
$WooProduct = new WC_Product_Factory(); //Create a new instance of the Woo product object
$product = $WooProduct->get_product($id); // Get the product details for the product in which we are interested
echo '<h1 class="popup-heading"><a href="'.get_permalink($id).'">'.get_the_title($id).'</a></h1><br />'; //Get the name of the product and link to the actual product
echo $product->post->post_excerpt; // Get the product description (or any other field for that product that you may want - even the images for that product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment