WPSlash

Integrate Twilio for WooCommerce with WooFood

Here is small code snippet to be able to use WooFood custom variables like Order Type (Delivery or Pickup), Date To Deliver and Time To Deliver .

function wpslash_woofood_twilio_woocommerce_custom_variables( $message, $order ) {

        if ( ! class_exists( 'SV_WC_Order_Compatibility' ) ) {
                return $message;
        }

        $woofood_order_type     = woofood_get_order_type_by_key(SV_WC_Order_Compatibility::get_meta( $order, 'woofood_order_type' ));
	$woofood_date_to_deliver = SV_WC_Order_Compatibility::get_meta( $order, 'woofood_date_to_deliver' );
	$woofood_time_to_deliver = SV_WC_Order_Compatibility::get_meta( $order, 'woofood_time_to_deliver' );


        $message = str_replace( '%order_type%', $woofood_order_type, $message );
        $message = str_replace( '%date_to_deliver%', $woofood_date_to_deliver, $message );
        $message = str_replace( '%time_to_deliver%', $woofood_time_to_deliver, $message );

    

        return $message;
}
add_filter( 'wc_twilio_sms_customer_sms_before_variable_replace', 'wpslash_woofood_twilio_woocommerce_custom_variables', 10, 2 );

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Articles

Tutorials

How to Optimize Restaurant Food Photography and Image Compression for Faster WooCommerce Menu Pages (Complete Guide)

Why High-Quality Food Images Make or Break Your Restaurant’s Online Orders Here’s a stat that should grab your attention: studies consistently show that menu items with high-quality photos receive up to 30% more orders than those without images. When customers can’t smell or taste your food through a screen, photography becomes your most powerful selling […]
March 25, 2026
Tutorials

How to Customize Colors, Images, and Branding for Your Restaurant Ordering Website in WooCommerce (Complete Visual Guide)

Your restaurant’s food might be incredible, but if your restaurant ordering website isn’t a one-afternoon project — it’s an ongoing process of refinement. Start with the highest-impact changes: set your brand colors, upload optimized food photography, and make sure your buttons and checkout page look polished. Then layer in custom CSS tweaks and email branding […]
March 25, 2026
Tutorials

How to Set Up a Multilingual Restaurant Menu and Online Ordering System in WordPress (Step-by-Step Guide)

Running a restaurant in a diverse neighborhood or a tourist-heavy area? Chances are, a good chunk of your potential customers speak a language other than English at home. If your online menu and ordering system only speaks one language, you’re leaving money on the table — literally. Setting up a multilingual restaurant website in WordPress […]
March 25, 2026