woocommerce / facebook-for-woocommerce

A first-party extension plugin built for WooCommerce. Development is managed by Ventures.
https://woocommerce.com/products/facebook/
GNU General Public License v2.0
211 stars 140 forks source link

Fix - Sale price effective date #2809

Open vinkmeta opened 1 month ago

vinkmeta commented 1 month ago

Changes proposed in this Pull Request:

When User doesn't provide any value for sale price start/end dates then by default we set Start Date as 1970-01-29 and End Date as 2038-01-17 which is incorrect. Instead we should not pass any value for sale price effective date, start date and end date when sale price is not populated.

Screenshots:

Screenshots from Meta Commerce Manager

Before:

Screenshot 2024-08-19 at 10 17 14

After:

Screenshot 2024-08-19 at 10 17 30

Detailed test instructions:

  1. Unit test - ./vendor/bin/phpunit --filter test_sale_price_and_effective_date
  2. This change only impacts sale_price_effective_date and no other product fields or user experience
  3. Earlier default value for sale_price_effective_date use to be '1970-01-29T00:00+00:00/2038-01-17T23:59+00:00' when no value was set for $sale_price_start_date and $sale_price_end_date by the plugin user but now this will set as empty in that case.

Changelog entry

Fix - Sale price effective date