i want to page redirect given url(send a product id with url) when click add to cart button in content-single-product
i can’t redirect with product id,this is a sample code for i testing
function my_custom_add_to_cart_redirect( $url ,$pid) {
$pid = $_POST['product_id'];
$url1 = get_permalink( 453 );
$url=$url1."&p_id=".$pid;
return $url;
}