other solution
-
because this plugin not work anymone , i suggest to any wp user my solution , it’s simple code can be added in you function.php in your theme , or by code snippet plugin :
add_action( ‘woocommerce_thankyou’, ‘ad_redirectcustom’);function ad_redirectcustom( $order_id ){
global $current_user;
$order = new WC_Order( $order_id );
$items = $order->get_items();
$product_id=223074;//id of your product
$product_id2=223076;// must be change by id of you product
foreach ( $items as $item ) {$url =”;
$url2=”;
if (($order->status!=’failed’)&&(product_id==$item[‘product_id’])) {
wp_redirect($url);
exit;
}
else if (($order->status!=’failed’)&&($product_id2==$item[‘product_id’])) {
wp_redirect($url2);
exit; //
}
}
}u can do many conditions as you want , if you don’t understand code , please give me comment in my gist : here https://gist.github.com/AladinDridi/442db23c731fae9d6dfb54e10f3e6014
- The topic ‘other solution’ is closed to new replies.