Home > Docs > Smart Coupons for WooCommerce > Coupon Message Customization in WooCommerce

Coupon Message Customization in WooCommerce

Last updated on August 16, 2023

Coupon messages serve as a means of communication between the business and the customer. They provide context about the coupon, its benefits, and any specific terms and conditions. Smart Coupons for WooCommerce allows the customization of coupon messages as the need of the store owner. To customize coupon messages:

  • Navigate to Customize messages tab.
  • Click on the edit icon of the respective coupon message.
  • Key in a new coupon message.
  • Save the message.

Edit a custom message

To edit a coupon message:

  • From the WordPress dashboard, navigate to Smart Coupons > General settings > Customize messages.
  • Under the Actions section, click on Edit for the coupon message that you want to edit.
Smart Coupon for WooCommerce-Message customization panel
Smart Coupon for WooCommerce-Message customization panel
  • This will open a dialogue box.
Smart Coupon for WooCommerce- Message customization page
Smart Coupon for WooCommerce- Message customization page
  • You can Enter the required Custom message in the Message text box.
  • The custom message can also hold placeholders. The available placeholders are listed under the Available placeholder section. The plugin also allows creating custom placeholders, which will be discussed later in the article.
Smart Coupon for WooCommerce- Message customization page
Smart Coupon for WooCommerce- Message customization page
  • Click Save to save changes.
  • The changes will be reflected on the message tab as follows.
Smart Coupon for WooCommerce-After adding custom message
Smart Coupon for WooCommerce-After adding custom message

Add a custom placeholder

Using placeholders in messages can greatly enhance the ease of reusing the same variable in multiple locations, making them a valuable and helpful variable function. There are predefined placeholders given by WordPress as available values. A user can add a custom placeholder if they want to, using the wt_sc_add_placeholder_values filter.

Example:

  • The code snippet given below explains how to add a custom placeholder {try}.
  • "Sorry, the coupon {coupon_code} is not applicable for selected products.{try}." is a custom message with {coupon_code} (predefined placeholder) and {try} (custom placeholder).
Smart Coupon for WooCommerce-Message customization panel
Smart Coupon for WooCommerce-Message customization panel
  • For example, assume that the coupon code is FLAT30. In this case, the notification with the default placeholder will be "Sorry, the coupon flat30 is not applicable for selected products".
Smart Coupon for WooCommerce-Notification with default placeholder
Smart Coupon for WooCommerce-Notification with default placeholder
  • After adding a custom message with a custom placeholder, {try} will change the message to "Sorry, the coupon flat30 is not applicable for selected products. Please try another coupon".
Smart Coupon for WooCommerce-Notification with custom placeholder
Smart Coupon for WooCommerce-Notification with custom placeholder
  • Moreover, One can use the same placeholder in any message to display the message content ‘Please try another coupon’.