Conditional text depending on shipping and payment method
-
Hello!
I want to send a customer the order confirmation but also depending on the payment and shipping method, i need to have different texts for each Shipping and Payment method.
Example1: When a customer create a new order and chooses to pay Cash on Delivery and the Shipping method is Local Pickup. I need to send the Store Address and to remind them to pay by cash at the store.
Example2: When a customer create a new order and chooses to pay Bank transfer and the Shipping method is Delivery. I need to send the bank account information only.
So basically, have custom texts depending on the shipping and payment variables.
How can i do that?
I use another sms gateway with an api endpoint and i have a custom function that sends the SMS and the following Variables.
if ($payment_menthod == 'bacs' ){ $sms_txt .= 'Bank '.$bacs_account_bank.' '.$bacs_account_number.' and send of the confirmation'; } if ($payment_menthod == 'cod' ){ $sms_txt .= 'Pay in cash at delivery.'; } if( $order->has_shipping_method('local_pickup') ) { $store_address = get_option( 'woocommerce_store_address' ); $store_address_2 = get_option( 'woocommerce_store_address_2' ); $sms_txt .= 'Pickup at: '.$store_address.($store_address_2 <> "" ? ', '.$store_address_2 : ""); }
The page I need help with: [log in to see the link]
- The topic ‘Conditional text depending on shipping and payment method’ is closed to new replies.