Track Woocommerce Products prices history and display the lowest price in the last 30 days. This plugin allows your WC shop to be compliant with European Commision Directive 98/6/EC Article 6a which specyfies price reduction annoucment policy.
MIT License
6
stars
4
forks
source link
Sweep: First price change: store "old price" also with the past date (✓ Sandbox Passed) #82
This pull request includes changes to the HistoryStorage.php file in the app/PriorPrice directory. The changes involve adding a condition to store the "old price" with the past date when adding the first price for a product.
Summary
Modified the add_first_price method in HistoryStorage.php to include a condition for storing the "old price" with the past date.
Added an if statement to check if the $history array is empty.
If the $history array is empty, the code calculates the previous day's timestamp and assigns the last price to the $history array with the previous day's timestamp.
The code then proceeds to add the current price to the $history array with the current timestamp.
Finally, the modified $history array is saved using the save_history method.
Fixes #80.
🎉 Latest improvements to Sweep:
New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
PR Feedback: 👎
Description
This pull request includes changes to the
HistoryStorage.php
file in theapp/PriorPrice
directory. The changes involve adding a condition to store the "old price" with the past date when adding the first price for a product.Summary
add_first_price
method inHistoryStorage.php
to include a condition for storing the "old price" with the past date.$history
array is empty.$history
array is empty, the code calculates the previous day's timestamp and assigns the last price to the$history
array with the previous day's timestamp.$history
array with the current timestamp.$history
array is saved using thesave_history
method.Fixes #80.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: