I found a script that helps me get the information I need: the payment methods the customer has historically used on orders.
$order = new WC_Order( $order_id ); $payment_title = $order->get_payment_method_title();`
Unfortunately, I don't know where to start with this information. Where should I post this string so that it does my expected output?
I want to export this to a .csv file so it can be imported into a spreadsheet.
Everything I've found so far seems to assume I already know where to start. I'm just looking for a simple pointer on where to start.
To get the customer history payment gateway you need:
Try the following: