kohopetr
Forum Replies Created
-
Forum: Plugins
In reply to: [LearnPress - WordPress LMS Plugin] search results invalid JSON responseHi, i resolved it by downgrading the theme version.
Hi, this code does nothing in my case. I put this
$user_item_data = [ 'user_id' => $myuser_id, 'item_id' => $course_id, 'start_time' => time(), 'status' => LP_COURSE_ENROLLED, 'graduation' => LP_COURSE_GRADUATION_IN_PROGRESS, ]; $user_item_new_or_update = new LP_User_Item_Course( $user_item_data ); $result = $user_item_new_or_update->update();
but nothing happens. The order is not created so the courses are not added to the user. What am I missing?
Thanksplease check the above code and give me hint, how to call it (create order and add items with meta data i have) in new LP version. thanks
Hello, thanks but it how to call it in functions.php?
Previously i had code:$order_data = array( 'create_via' => 'MY CHANNEL', 'status' => 'completed' ); $order = learn_press_create_order( $order_data ); if ( !$order || !$order->id ) { return; }
$course_id = 123; $item = array( 'order_item_name' => 'MY COURSE', 'item_id' => $course_id, 'quantity' => 1, 'subtotal' => '99', 'total' => '99' ); $order->add_item( $item ); $user->enroll($course_id, $order->id);
now nothing works. Can you type how to change the code to make it work with new LP version?
Thankshi, and if i want to sort that at least by course category, or title, or progress (only one option?) any way in query?
thanks- This reply was modified 2 years, 8 months ago by kohopetr.
CAN i ask you which version od woocomerce payment intergration do you have? I can’t make IT work in this combination
Thank you saved me time! I had problems with this 2 weeks and now I know which previous version works, I was not able to make it work in any version, but 3.1.9 works, at least! I hope they will release update soon..
Good luck!Thanks it works:)