Student buys woocommerce product. We linked the courses to 1 product in the background, but the student's order was completed, but it was not added to the course. What is the problem? I want urgent solution.
This reply has been marked as private.
This reply has been marked as private.
hi
for that make sure that you have also associate the product in the course
edit the course and add product there
both are necessary
add course in product
and add product in course
This reply has been marked as private.
hi
it looks like that you are using a bundle product can you please share the product URL(backend) with us so we can replicate the issue
also for this:
But the problem goes away when you get the order from Woocommerce>Orders to wait and then complete again. The problem may originate from here.
is this is the same course that you have showed us in previous reply?
can you share a video of this?(when it is working and when not)
also give us permission to create a new product and courses accordingly to replicate this issue on your site
Yes, we identified the problem correctly. When you put it on hold and then complete it, the problem goes away. I probably added this code in fuctions.php. It could also be caused by this. The reason I added the code; 70% of my customers reach my products with free coupon codes. If the person has used a coupon code and does not need to pay, I want the order to be marked as complete. If there's another way to do it, I can do that too.
add_filter( 'woocommerce_payment_complete_order_status', 'my_change_status_function', 10, 2 );
function my_change_status_function ($order_status, $order_id) {
$order = new WC_Order($order_id);
return 'completed';
so have you tried to remove the code?
or give us permission to remove this one and then proceed to the testing
When you remove the code, the courses of the users who complete their payment with coupons are not opened automatically. If you can fix this problem, we can remove it. By the way, removing the code fixed the problem.
hi
the course has to be selected in associated course setting in product edit page before user purchase the course
if you select any course before user purchase the course it wont be added automatically to all students who have already purchased the course before