logovaz
Forum Replies Created
-
Decided without the aid of a support
who are interested
file woocommerce-funtstions.phpelseif (get_option(‘woocommerce_cart_redirect_after_add’)==’yes’ && $woocommerce->error_count() == 0) {
wp_safe_redirect( $woocommerce->cart->get_cart_url(”) );
exit;
}
replace with
elseif (get_option(‘woocommerce_cart_redirect_after_add’)==’yes’ && $woocommerce->error_count() == 0)
$url = get_post_meta($product_id, ‘url’, $single = true);
{wp_redirect( $url);
exit;
}
Add an additional field url
add to cart and redirects where necessaryAs far as I knew. I have to create a field such as “link”. insert a reference to the value of such http://musite.ru/1 . And redirect to it after a function to add to the cart. I can not figure out how to catch the end of the function to add product to cart in your single-produtst.php. because the output <?php echo get_post_meta($post->ID, “link”, $single = true); ?> only works in single-produtst.php
Just thought there is a simpler solution is just built-in function redirect, you can add to any product one additional field and change the function toelseif (get_option(‘woocommerce_cart_redirect_after_add’)==’yes’ && $woocommerce->error_count() == 0)
{wp_safe_redirect( ‘field’);
exit;
}
Sorry again for my english