Skip to content

Conversation

@layoutd
Copy link
Contributor

@layoutd layoutd commented Oct 31, 2025

Summary

  • Adds error notification when order generation fails due to missing published products
  • Makes this failure case more visible than the current "Success: 0 orders generated..." message which can easily be overlooked

Test plan

  • Run order generation command with no published products
    wp wc generate orders 10
  • Verify clear error message is displayed
    # Error: No orders were generated. Make sure there are published products in your store.
  • Run order generation command with 0 requested orders
    wp wc generate orders 0
  • No error message since 0 orders was expected.
    # Success: 0 orders generated in 0 seconds
  • Add products and then generate orders to see the success message
    wp wc generate products 10
    wp wc generate orders 20
    # Success: 20 orders generated in 3.53 seconds

…orders are generated due to lack of published products.
@layoutd layoutd self-assigned this Oct 31, 2025
@layoutd layoutd requested a review from Copilot October 31, 2025 22:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds validation to the order generation CLI command to provide better user feedback when no orders are successfully generated despite a valid request amount.

  • Adds a check after order generation to detect when zero orders were created but a positive amount was requested
  • Provides an actionable error message directing users to verify published products exist

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants