Issues with Order Page Options and Confirmation Email in WordPress Plugin

Hello,

The selected options should appear on the edit order page and in the confirmation email.

Maybe there is a plugin that conflicts.
Try to disable other plugins.

Stanislav

Hi,
I have deactivated all plugins and it still does not work. I understand that I don’t get it in the confirmation email, what variable do I have to call inside $order or $product to retrieve it?

Thanks!

Hello,

They are saved as order meta with function:


 wc_add_order_item_meta($item_id, $value['name'], $value['value']);

in the file:
wp-content/plugins/product-options-for-woocommerce/Model/Observer.php

So you can get the select values with this code:


$order = wc_get_order($post->ID);
foreach ($order->get_items() as $item) {
  $selectedValue = $item['item_meta']['name_of_the_option'];
}

PS: You can contact me by email [email protected] and I will send you a screenshot with the selected product options on the edit order page.

Stanislav

Oh yes, I just realized that it shows up on that screen. Thank you very much, with this information I have been able to show it in the mail template.
Thanks for the support

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer