Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Create array for product list html */
- $products_list_html = array();
- /* Cycle the items inside the order */
- foreach($order->get_items('line_item') as $item) {
- $product_id = (true === isset($item['variation_id'])) ? $item['variation_id'] : $item['product_id'];
- $products_list_html[] = '<a href="' . get_permalink($product_id) . '">' . get_the_title($product_id) . '</a>';
- }
- echo implode('<br />', $products_list_html);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement