Plugin Contributor
Ewout
(@pomegranate)
Hi! The complete order object is in:
<?php $this->order; ?>
and subsequently, the order_id is:
<?php $this->order->id; ?>
If you’re doing something outside of the template (in a filter that doesn’t have the order passed as an argument), you can replace $this with $wpo_wcpdf->export:
<?php $wpo_wcpdf->export->order->id; ?>
Happy holidays 🙂
Plugin Contributor
Ewout
(@pomegranate)
You’re welcome! If you can spare a minute, I would really appreciate a review here on ww.wp.xz.cn.
Thanks and have a great day!
sorry, i had no time to test this before. with this code I also don’t have it in a variable.
I need it this way:
<?php $test = $this->order->id;
echo $test; ?>
how is that possible?
Plugin Contributor
Ewout
(@pomegranate)
Hi!
$this->order->id; is the variable. So you can just do:
<?php echo $this->order->id; ?>