By default, the Social Checkout for WooCommerce plugin shares the main product image, the product title, and the standard product URL. In some situations you may want to override those values with something else. Perhaps you want to provide a more engaging product title – or direct customers to a special Social Media focussed landing page for a product.

The plugin provides filters for you to change the information that is used. The filter receives the calculated values for the item, the product that’s being shown (Note: this may be empty if an order contains more than five items and a single share link is being shown), and the full WooCommerce order.

In the following example, we’re overriding the product URL to send shares to a specific product landing page.

function lw_woo_sc_item( $item, $product, $order ) {
    $item->permalink = 'http://www.example.com/social-media-landing-page';
    return $item;
}
add_filter( 'woo_sc_item', 'lw_woo_sc_item', 10, 3 );

You can change any of the following properties on the item object:

  • image
  • title
  • permalink

This entry was posted in .
Bookmark the permalink.