Plugin Contributor
Ewout
(@pomegranate)
Hello Victor,
The _payment_method_title
field is a core WooCommerce Order Property that is normally already displayed in the invoice (source):
<?php $this->payment_method(); ?>
If you want to call this separately somewhere else, you could retrieve it with:
$payment_method = $order->get_payment_method_title();
or display it directly:
echo $order->get_payment_method_title();
For the woocommerce_customized_payment_data
, it depends on the contents of this field. The _data
suffix makes me suspect that it may be an array with information rather than a flat piece of text (string).
If it’s just a string you can follow the documentation: Displaying a custom field
Otherwise I recommend contacting the developers of the WooCommerce Custom Payment Gateway Pro plugin to ask for the best way to include the data (you can mention our action hooks reference)
Hope that helps!
in fact, later I noticed that the toolkits shows the following information:
woocommerce_customized_payment_data
»I switch to:
is exactly the answer that appears in the field “I change to:” that I need to show in my pdf.
I tried using the code
add_action ('wpo_wcpdf_after_order_data', 'wpo_wcpdf_woocommerce_customized_payment_data', 10, 2);
function wpo_wcpdf_woocommerce_customized_payment_data ($ template_type, $ order) {
if ($ template_type == 'packing-slip') {
?>
<tr class = "troco">
<th> troco: </ th>
<td> <? php echo $ order-> get_meta ('troco'); ?> </ td>
</ tr>
<? php
}
}
but it did not work
I tried contacting the plugin support, but I could not get a return, I’m desperate! LOL
thanksssss
-
This reply was modified 5 years, 1 month ago by victorfpaula.