Payment Method
Posted: Wed Apr 06, 2022 1:03 am
Hello,
I find that when my customers use a 100% discount code to pay for items, the payment method stored with order is the default payment method I use. I was wondering how I'd change the value of the payment method to something like "Discount Code - Free Item" and save that to the database instead.
I believe this is handled on the checkout_confirmation.php page with something like:
<p class="w-100 mb-1">' . $order->info['payment_method'] . '</p>
So, how would I change this to insert a custom entry in database? I already have this code checking if item is zero rated or not, and it work on my checkout page:
$total_amount = preg_replace('/[^0-9-.]+/ ', '', $currencies->format($order->info['total']));
if ($total_amount > 1.00) {
echo '<p class="w-100 mb-1">' . $order->info['payment_method'] . '</p>';
} else {
echo '<p class="w-100 mb-1">Free Product</p>'; // I want this in database if item is free
}
Thank you for help in advance.
I find that when my customers use a 100% discount code to pay for items, the payment method stored with order is the default payment method I use. I was wondering how I'd change the value of the payment method to something like "Discount Code - Free Item" and save that to the database instead.
I believe this is handled on the checkout_confirmation.php page with something like:
<p class="w-100 mb-1">' . $order->info['payment_method'] . '</p>
So, how would I change this to insert a custom entry in database? I already have this code checking if item is zero rated or not, and it work on my checkout page:
$total_amount = preg_replace('/[^0-9-.]+/ ', '', $currencies->format($order->info['total']));
if ($total_amount > 1.00) {
echo '<p class="w-100 mb-1">' . $order->info['payment_method'] . '</p>';
} else {
echo '<p class="w-100 mb-1">Free Product</p>'; // I want this in database if item is free
}
Thank you for help in advance.