Created
November 3, 2021 07:51
-
-
Save mohammadYousefiDev/8cefa607d5c603f64df2b2a7991c3684 to your computer and use it in GitHub Desktop.
change external product url in woocommerce
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
function override_external_product_url( $url, $product ) | |
{ | |
if ( 'external' === $product->get_type() ) | |
{ | |
$url = 'https://biawp.ir'; | |
} | |
return $url; | |
} | |
add_filter( 'woocommerce_product_add_to_cart_url', 'override_external_product_url', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment