Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created March 14, 2016 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/d1e0a267afeedd9232b7 to your computer and use it in GitHub Desktop.
Save mikejolley/d1e0a267afeedd9232b7 to your computer and use it in GitHub Desktop.
add_filter( 'woocommerce_product_add_to_cart_url', 'custom_woocommerce_product_add_to_cart_url', 10, 2 );
function custom_woocommerce_product_add_to_cart_url( $url, $product ) {
if ( $product->is_type( 'simple' ) ) {
$url = get_permalink( $product->id );
}
return $url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment