jimleeder123 Posted July 8, 2016 Share Posted July 8, 2016 I'm editing the e-mail templates on WordPress. I want to be able to get the product info from the order that the e-mail is about, so I can do stuff with it. I need the product name/title, and can go on with it from there. Any help greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/301454-wordpress-get-product-info-from-the-order-on-the-e-mail-template/ Share on other sites More sharing options...
maxxd Posted July 8, 2016 Share Posted July 8, 2016 We're going to need a lot more information than this to help at all. What theme are you using? Have you created a child theme (you should have, if you're editing the files)? What e-commerce plugin are you using? Have you read the documentation for the theme and plugin? Quote Link to comment https://forums.phpfreaks.com/topic/301454-wordpress-get-product-info-from-the-order-on-the-e-mail-template/#findComment-1534357 Share on other sites More sharing options...
jimleeder123 Posted July 8, 2016 Author Share Posted July 8, 2016 Sorry, I'm using WooCommerce, and my own custom theme. I'm trying to enter this into the admin order e-mail file, and will carry it into the customer one later when ready. I've googled a lot and tried a lot, but nothings working. What I need is the product name(s) in the order. Because of the nature of the business, it's likely only one product will be bought (or multiple of a single product). Quote Link to comment https://forums.phpfreaks.com/topic/301454-wordpress-get-product-info-from-the-order-on-the-e-mail-template/#findComment-1534358 Share on other sites More sharing options...
maxxd Posted July 8, 2016 Share Posted July 8, 2016 I've not got a lot of experience with WooCommerce, but what I've found is that the product is a custom post type. Have you tried "get_posts( [productID] )"? It should return a WP_Post object - the post_title attribute should be the product name. Quote Link to comment https://forums.phpfreaks.com/topic/301454-wordpress-get-product-info-from-the-order-on-the-e-mail-template/#findComment-1534363 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.