Filters
wp_sms_notification_woocommerce_order_meta_key_KEYNAME
wp_sms_notification_woocommerce_order_item_meta_key_KEYNAME
The %order_meta_{key-name}%
and %order_item_meta_{key-name}%
variables (reference) can be used to display the value of the meta field of order and the ordered item in your messages.
Using the provided filters, you can modify the values of these meta fields before they are sent in the SMS.
Example Usage
To modify the meta field data in the SMS notification, add the following hooks to the functions.php
file of your active theme.
Order Meta
add_filter('wp_sms_notification_woocommerce_order_meta_key_is_vat_exempt', function($metaValue) {
if ($metaValue && $metaValue === "yes") {
return "Your order qualifies for VAT exemption.";
}
return ""; // display nothing if no value or if value is equal to "no"
});
Order Item Meta
add_filter('wp_sms_notification_woocommerce_order_item_meta_key_gift_wrapping', function($metaValue) {
return "Gift Wrapping: " . $metaValue;
});