Hi Thanks for quick reply, could not get that to work… but got this working in the end. Needed a GDPR anon lable printed to attach to order in letters not numeric. below works if anyone else needs
add_action( 'wpo_wcpdf_before_order_data', 'wpo_wcpdf_customer_number', 10, 2 );
function wpo_wcpdf_customer_number ($template_type, $order) {
$numarr=array('A' => 0,
'B' => 1,
'C' => 2,
'D' => 3,
'E' => 4,
'F' => 5,
'G' => 6,
'H' => 7,
'I' => 8,
'J' => 9);
$narr = array_flip($numarr);
$order_id = $order->get_id();
$arr = str_split($order_id);
$str = '';
foreach($arr as $s)
$str .= $narr[$s];
?>
<div>
<h2>Customer REF:</h2>
<h1><?php echo $str . "\n"; ?></h1>
</div>
<?php
}
-
This reply was modified 6 years, 6 months ago by wesitegeezer.
-
This reply was modified 6 years, 6 months ago by wesitegeezer.