Bulk Specials
Posted: Fri Aug 15, 2025 11:56 am
How about a new system that allows the Admin user to bulk add/edit specials, and also delete specials.
Concept
1. 3 new Buttons in the specials.php page
Easy, no core code changes in recent versions of Phoenix.
Each of these Buttons does something "special", from left to right;
1a/ Red button will delete all specials that are INACTIVE.
Self Explanatory, right?
1b/ Blue Export button will popup a modal that allows admin user to select what fields should be included in the Download and what format (whichever admin user is more comfortable with, I personally prefer and use JSON, but CSV is also included);
On clicking the "Download" button, the JSON or CSV file is downloaded, including all the info requested. EG JSON:
Or EG CSV
At this point, the Admin User can change any of the details. EG: change product ID 7 from $1.25 to $3.00 (or whatever). The Admin User can also add NEW specials in here, for example an extra JSON block as so;
This block says put Product ID 3 onto active special at $2.00 special price. NOTE there is no "expiration" as this is an open ended offer, and no Special ID as this is a NEW special.
1c/ Blue Import button will popup a modal that allows admin user to select a file. This could be the File you previously downloaded and amended, or it could be a new file you created from scratch.
Clicking will result in the usual file explorer, allowing you to select a CSV or JSON file.
Click Upload will result in an error or success message in the Modal. If Fail, a message will be shown allowing you to fix your file and try again. If success, the page will reload and your Specials will be updated appropriately, notice in the image, the new special at a cost of $2 and the updated special at a cost of $3 (as per my JSON file).
Conclusion
Faster and easier updates of Specials.
Concept
1. 3 new Buttons in the specials.php page
Easy, no core code changes in recent versions of Phoenix.
Each of these Buttons does something "special", from left to right;
1a/ Red button will delete all specials that are INACTIVE.
Self Explanatory, right?
1b/ Blue Export button will popup a modal that allows admin user to select what fields should be included in the Download and what format (whichever admin user is more comfortable with, I personally prefer and use JSON, but CSV is also included);
On clicking the "Download" button, the JSON or CSV file is downloaded, including all the info requested. EG JSON:
Code: Select all
[
{
"specials_id": 7,
"products_id": 1,
"price": 2.99,
"status": 1
},
{
"specials_id": 8,
"products_id": 8,
"price": 3.5,
"status": 0
},
{
"specials_id": 9,
"products_id": 7,
"price": 1.25,
"expires": "2025-08-31 23:59:59",
"status": 1
}
]
Code: Select all
specials_id,products_id,price,expires_date,status
7,1,2.9900,1
8,8,3.5000,0
9,7,1.2500,"2025-08-31 23:59:59",1
Code: Select all
{
"products_id": 3,
"price": 2.00,
"status": 1
}
1c/ Blue Import button will popup a modal that allows admin user to select a file. This could be the File you previously downloaded and amended, or it could be a new file you created from scratch.
Clicking will result in the usual file explorer, allowing you to select a CSV or JSON file.
Click Upload will result in an error or success message in the Modal. If Fail, a message will be shown allowing you to fix your file and try again. If success, the page will reload and your Specials will be updated appropriately, notice in the image, the new special at a cost of $2 and the updated special at a cost of $3 (as per my JSON file).
Conclusion
Faster and easier updates of Specials.