Automattic / sensei

Sensei LMS - Online Courses, Quizzes, & Learning
https://senseilms.com
GNU General Public License v2.0
540 stars 198 forks source link

User gets access to course when order status is Processing (Grouped or Variable product + Cash on delivery) #4068

Closed amroland closed 3 years ago

amroland commented 3 years ago

User gets access to the course when he order a Grouped or Variable product (Virtual product + Physical product) and he choose Cash on delivery. His order is set to Processing status. The payment hasn't arrived, but he still gets access to his course.

Steps to Reproduce

  1. Create a Grouped or Variable product that includes a Virtual product (a course) and a physical product
  2. Order this product and choose cash on delivery.
  3. You get access to the course immediately

What I Expected

Orders with Processing status shouldn't give access to the course.

What Happened Instead

Orders with Processing status gives access to the course.

PHP / WordPress / Sensei LMS version

WordPress 5.6.2 WooCommerce Paid Courses Version: 2.3.2

donnapep commented 3 years ago

According to the WooCommerce docs, Processing status indicates that payment has been made. As such, Sensei gives access to the course when an order has this status:

Processing — Payment received (paid) and stock has been reduced; order is awaiting fulfillment. All product orders require processing, except those that only contain products which are both Virtual and Downloadable.

Because the grouped product contains both a virtual product and a physical product, the status necessarily goes to Processing until the physical product has shipped. I'm not sure what the solution is here, but we can't change Sensei to not give access when the order status is Processing. I wonder if a plugin like WooCommerce Order Status Control might help?

amroland commented 3 years ago

That is the problem. That's why Processing status is inappropriate for COD (Cash on delivery), because payment HASN'T RECEIVED YET. On-hold is better describe the situation of COD:

On hold — Awaiting payment – stock is reduced, but you need to confirm payment.

donnapep commented 3 years ago

On-hold is better describe the situation of COD

Then perhaps this issue should be moved to the WooCommerce repo. Sensei doesn't manipulate order statuses, but rather enrolls / unenrolls learners based on the status set by Woo.

alexsanford commented 3 years ago

Closing as this seems to be better suited by a change in WooCommerce, or a customization.