Advertisement
Guest User

Untitled

a guest
Oct 31st, 2015
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. <?php
  2.  
  3. /* Create array for product list html */
  4. $products_list_html = array();
  5.  
  6. /* Cycle the items inside the order */
  7. foreach($order->get_items('line_item') as $item) {
  8.     $product_id = (true === isset($item['variation_id'])) ? $item['variation_id'] : $item['product_id'];
  9.     $products_list_html[] = '<a href="' . get_permalink($product_id) . '">' . get_the_title($product_id) . '</a>';
  10. }
  11. echo implode('<br />', $products_list_html);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement