• it has to enroll student, but it is enrolling the admin when orders placed via WooCommerce api call

    we have emailed you the concern. no solution till date.

    we paid for lifetime license then it’s useless

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello @promax12 !

    Tutor lms already added a option in the settings section to control this.

    Disable the option Generate WooCommerce Order from settings, then check.

    Please! see the attachment : https://prnt.sc/Lq6mHK3o5PQ1

    Thank you!

    Thread Starter promax12

    (@promax12)

    no, we tried that, that’s not working,

    we are creating a woocommerce order by A’s Email ID but Admin is getting enrolled, Which is wrong.

    Only A has to be enrolled

    this is the issue.

    Thread Starter promax12

    (@promax12)

    bug has been fixed by our developer

    you can add this in your upcoming release

    thanks, close this ticket

    
    public function course_placing_order_from_customer( $item_id, $item, $order_id ) {
    
    ? ? ? ? if ( is_admin() ) {
    
    ? ? ? ? ? ? return;
    
    ? ? ? ? }
    
    ? ? ? ? $item ? ? ? ? ?= new \WC_Order_Item_Product( $item );
    
    ? ? ? ? $product_id ? ?= $item->get_product_id();
    
    ? ? ? ? $if_has_course = tutor_utils()->product_belongs_with_course( $product_id );
    
    ? ? ? ? $order = wc_get_order( $order_id );
    
    ? ? ? ? $customer_id = $order->get_customer_id();
    
    ? ? ? ? if ( $if_has_course ) {
    
    ? ? ? ? ? ? $course_id = $if_has_course->post_id;
    
    ? ? ? ? ? ? tutor_utils()->do_enroll( $course_id, $order_id, $customer_id );
    
    ? ? ? ? }
    
    ? ? }
    Plugin Support Md. Jobayer Al Mahmud

    (@jobayertuser)

    Hello @promax12

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘enrolling admin when an order is placed via api call’ is closed to new replies.