Skip to content

["FEAT"] RFC Change Open edX course from simple to a virtual product #119

Closed as not planned

Description

@MaferMazu

This is more of a request for comments.

Summary
I think we want the Open edX Courses products to behave similarly to virtual products (examples: mark as completed an order if it is the only product, don't send emails of "the store received the order", and other behaviors more related to physical products)

Antecedents
We have issue #116, which leads to PR #117. From that PR, we identified that we need to change more behaviors of the Open edX Courses product.

Proposal
Have a PR with the change that makes the Open edX course behave as a virtual product (make sure that the purchase flows work with this new approach), updated the doc, and have a brief ADR about this decision.

Quick implementation thought: when marking products as an Open edX course, force the option to mark the virtual product. Illustrative link: https://docs.openedx.org/projects/wordpress-ecommerce-plugin/en/latest/tutorials/configuration_to_automate_enrolls.html#create-an-open-edx-course-in-wordpress

Comparison

Parameter "Open edX Course" (as Simple Product) "Open edX Course" (as Virtual and Downloadable Product)
Order Status after payment Processing (default for simple items). Completed (default for digital items).
Emails Sends Order Received email by default. Sends Order Completed email. Order Received email is skipped.
Inventory Tracks inventory, requires manual disabling. No inventory tracking by default.
Shipping Shipping fields appear in checkout. Shipping is automatically disabled in checkout.
User Flow User receives an email that may suggest a physical item is shipping. User experience is clean and consistent with a digital purchase.
API Failure (in our case) Processing status acts as a visible error flag. Order goes to Completed despite API failure, requiring a custom error log and notification system.

Consequences

  • If we convert the Open edX courses into virtual products, it skips the "processing" change of status, and right now it's what we use to trigger the creation of the enrollment request (we should change that).
  • It would be a nice-to-have feature to trigger some kind of alert if an enrollment request object fails from an order flow.

References

Activity

  1. added
    enhancementRelates to new features or improvements to existing features
    on Aug 26, 2025
  2. MaferMazu commented on Aug 26, 2025

    @MaferMazu
    ContributorAuthor

    I would like your thoughts here @felipemontoya @amirnafees88 @feanil

  3. changed the title [-]["FEAT"] RFC Convert the Open edX Course in a Virtual product[/-] [+]["FEAT"] RFC Change Open edX course from simple to a virtual product[/+] on Aug 26, 2025
  4. amirnafees88 commented on Aug 27, 2025

    @amirnafees88

    Thank you for sharing the request for comments and the detailed summary regarding making Open edX Course products behave like virtual products. I’ve reviewed your points, examined the WooCommerce documentation, and validated the behavior by placing test orders. Here are my findings and recommendations:

    Findings

    • WooCommerce’s Order Status Behavior: According to WooCommerce’s documentation, an order is marked as Completed automatically only when every item in the order is both Virtual and Downloadable. See this statement "All orders require processing except those in which all products are both Virtual and Downloadable." in the documentation.
    • Virtual-Only Products: If a product is marked Virtual but not Downloadable, WooCommerce still sets the order status to Processing after payment. I verified it by placing a test order.
    • Test Validation: I confirmed this behavior by creating test products and placing orders. In all cases, the order only moved to Completed when both the Virtual and Downloadable flags were enabled.

    Impact on the Current Implementation

    • Converting courses to Virtual products without enabling Downloadable will not achieve the goal of automatically completing the order, as WooCommerce still keeps such orders in the Processing state.
    • If we force both Virtual and Downloadable flags to achieve auto-completion, we risk losing the “Processing” checkpoint that currently flags enrollment creation and potential API failures. Without this intermediate status, we would need to design and implement an alternate error-handling or alert system, which could add complexity.

    Recommendation

    Given these factors, my recommendation is to stay with the current implementation with the "Open edX Course" checkbox.

  5. amirnafees88 commented on Aug 27, 2025

    @amirnafees88

    @MaferMazu, regarding these two points from the comparison:

    Inventory Tracks inventory, requires manual disabling. No inventory tracking by default.
    Shipping Shipping fields appear in checkout. Shipping is automatically disabled in checkout.

    I verified that inventory remains there for virtual products.
    We can remove the shipping field from the WooCommerce add product screen and checkout page if the product is an Open edX Course.

  6. MaferMazu commented on Sep 9, 2025

    @MaferMazu
    ContributorAuthor

    @amirnafees88, thanks for looking into this. I checked again, and you are right; between the simple product and a virtual product (without the downloadable option), it doesn't change much, at least not something valuable that makes us want to change or alter how the "Open edX courses" work.

    I agree with you that the Open edX course should be its own type and manage its behavior.
    I'll close this because I'm no longer interested in changing the open edx course to a virtual product.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRelates to new features or improvements to existing features

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions