There is an old customer who uses wordpress as a foreign trade station. Because the product involves copyright issues, he dares not use the normal Paypal standard to collect money, but uses encrypted paypal to receive payment. After encryption, paypal cannot trace the source, so the customer cannot refund payment.
The thought process of payment:
1. When the user adds to the shopping cart, checkout and select offline payment (bank transfer)
2. At this time, the order is reserved in the background
3. An email that will automatically trigger the "order reservation" will be sent to the customer
4. The customer clicks the payment through the link in the email, which successfully leads the customer to the encrypted Paypal payment channel.
At this point, one thing we need is to modify the woocommerce email order details template and add a dynamic amount interface to the Paypal payment link
Modify the email template
/wp-content/plugins/woocommerce/templates/emails/email-order-details.php
Get the total amount of the order, dynamic interface
get_total()); ?>
xxxx%40gmail.com 是Paypal收款账户,需要修改
USD currency
handbag product name
Add a custom button link where you want to display
<a href=”https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=xxxx%40gmail.com&amount= get_total()); ?>¤cy_code=USD&item_name=handbag&item_number=&quantity=1&shipping=0.00&no_shipping=0&pbtype=product&bn=paywiz0105xx-px”>Click to pay</a>