Created
April 26, 2021 05:51
-
-
Save woogists/6f17d0979ec9810d3860d5c22c730e94 to your computer and use it in GitHub Desktop.
For the Facebook for WooCommerce extension. By default, the link that is shared with Facebook is an “Add to Cart” URL for your product to speed up the checkout process. You may want this to be the product URL for a number of reasons. If so, you can use this code snippet to send the product URL to Facebook instead - https://docs.woocommerce.com/d…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // only copy this line if needed | |
/** | |
* Change checkout URLs to product URLs for Facebook products | |
*/ | |
function sv_fbw_checkout_url_to_product( $product_data, $id ){ | |
$product_data['checkout_url'] = $product_data['url']; | |
return $product_data; | |
} | |
add_filter( 'facebook_for_woocommerce_integration_prepare_product', 'sv_fbw_checkout_url_to_product', 100, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment