Sometimes you may want to customise the sharing message per product when creating sharing links with the Social Checkout for WooCommerce plugin. The plugin includes filters to allow you to change the message however you want.

The snippet below shows how you can provide a custom message for a specific product – of course you can make this logic as simple – or as complex as you like:

function lw_woocommerce_sc_twitter_message( $message, $order, $product ) {
    if ( $product->id == 248 ) {
        return 'Custom message for product 248';
    return $message;
add_filter( 'woocommerce_sc_twitter_message', 'lw_woocommerce_sc_twitter_message', 10, 3 );

This entry was posted in .
Bookmark the permalink.