Ecommerce Shopify WordPress Discussion

Add a linebreaks in Whatsapp url message using sprintf

I wanted to do a line break in the Whatsapp URL message while the message is generated in sprintf and then goes through the urlencode. code below $msg = sprintf( __("Hello %s %s, your order #%s has been received. The order amount is %s %s. Your payment method is %s. Please Confirm your order by replying *Confirm*. Please contact us if you have any question regarding your order. You can view your order here ".$orderlink." Thank you.", "woocommerce"), $order->get_billing_first_name(), $order->get_billing_last_name(), $order->get_order_number(), $order->get_currency(), $order->get_total(), $order->get_payment_method_title(), ); $whatsappnum = WC()->countries->get_country_calling_code( $order->get_billing_country() ) . $order->get_billing_phone(); update_post_meta( $_GET['order_id'], '_wapp_sent_processing', 'true' ); // Mark order as WhatsApp message sent wp_redirect( '' . $whatsappnum . '?text=' . urlencode($msg) ); // Redirect WhatsApp this message is generated for woocommerce orders and a action button is sending it to buyers whatsapp. currently, the message is displayed in WhatsApp without any linebreak please check image I want this message to have linebreaks to look more clean and easy to read. Thanks
I have no experience with woocommerce but maybe this post helps: Using end of line in PHP echo string There could be some things to try like the <pre> element or nl2br() function or <br> element?

January 27, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.