The Social Checkout for WooCommerce plugin allows you to create social sharing links at the end of your checkout process. The links that are shared bring people back into the WooCommerce product pages directly which is normally exactly what you want. However – sometimes you may want to send people to a different URL – maybe a membership page, a special offer landing page or your store front page.

The social checkout plugin includes filters that allow you to override the URL that is shared easily. The example below shows how you can change the URL to a “membership page” for all products.

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

Of course – you can do whatever you like with the URL – alter it only for some products (by checking the contents of the $product), or just add to it – for example to add tracking arguments or similar.


This entry was posted in .
Bookmark the permalink.