Skip to content

[Bug] - Date on sale to shouldnt set dates in the past #171

@masteradhoc

Description

@masteradhoc

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

After setting up a fresh wordpress site i installed Woo and WC Smooth Generator and let it generate around 1k fake products.

Noticed on a quite a few products have quite old sale to dates. What i notice:

  1. if no sale price is set setting a sale to price doesnt make sense
  2. date shouldnt be in the past

Few examples on simple products:

  1. Image
  2. Image

See codepart: https://github.com/woocommerce/wc-smooth-generator/blob/trunk/includes/Generator/Product.php#L389C4-L389C90

Same happens also on variable products:
Image

WordPress Environment

No response

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce and WooCommerce Smooth Generator plugins are active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions