Bulk Specials

Open to all! Ask other shopowners for help.
Post Reply
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Bulk Specials

Post by burt »

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.
spec_buttons.png

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);
spec_download.png
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
    }
]
Or EG CSV

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
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;

Code: Select all

{
  "products_id": 3,
  "price": 2.00,
  "status": 1
}
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.

spec_upload.png

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

spec_updated.png

Faster and easier updates of Specials.
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Bulk Specials

Post by burt »

This is all coded and working, but only as what I call "proof of concept" code - in other words, quite ugly, hardcoded to one language and so on. If there is interest, I'll update the code, put it out for some testing and then if testing come back OK, put it into the August Code Drops.

But I don't want to spend more time if there is little interest!
I am not here to build for you.
I am here to build with you. Let's help each other.
azpro
Contributor
Posts: 177
Joined: Fri Nov 06, 2020 8:25 am
Phoenix Version: v1.1.0.6
Has thanked: 30 times
Been thanked: 34 times

Re: Bulk Specials

Post by azpro »

For shopowners with lot's of products I can't imagine there would be little interest - But I understand if you need more commitment :+1:
radhavallabh
Senior Contributor
Posts: 466
Joined: Tue Oct 27, 2020 4:09 am
Phoenix Version: 1.1.0.6
Has thanked: 29 times
Been thanked: 3 times

Re: Bulk Specials

Post by radhavallabh »

Cool concept dear but would prefer this type for products upload.. that is an area that requires more of such inclusions I think...
Thank you in advance;
Warm Regds./
radhavallabh
raiwa
Certified Developer
Posts: 1640
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Bulk Specials

Post by raiwa »

radhavallabh wrote: Sat Aug 16, 2025 7:01 am Cool concept dear but would prefer this type for products upload.. that is an area that requires more of such inclusions I think...
Thank you in advance;
Warm Regds./
radhavallabh
It exists already:
https://phoenixcart.org/forum/app.php/ ... _phoenix_3
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Bulk Specials

Post by burt »

It was done on this page as proof of concept as it's a simple page that updates a simple database table.

Products is far more complicated as need to factor in a number of things; languages and attributes and downloads and images and more. I can't imagine taking the time/effort to make that - the ROI of my time/effort would be zero.
I am not here to build for you.
I am here to build with you. Let's help each other.
Dan Cole
Senior Contributor
Posts: 498
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Bulk Specials

Post by Dan Cole »

burt wrote: Fri Aug 15, 2025 12:18 pm This is all coded and working, but only as what I call "proof of concept" code - in other words, quite ugly, hardcoded to one language and so on. If there is interest, I'll update the code, put it out for some testing and then if testing come back OK, put it into the August Code Drops.

But I don't want to spend more time if there is little interest!
I like this idea Gary and I think it would be helpful. As a suggestion it might be nice to have the ability (if it doesn't already) to select by say manufacturer and perhaps category to slim up the download a bit and hence items to look through.

Dan
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Bulk Specials

Post by burt »

spec_with_brand.png

Now with Brand/Manufacturer selector.
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.
14Steve14
Senior Contributor
Posts: 922
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Bulk Specials

Post by 14Steve14 »

May seem a silly question but in your example Gary you mention product with an ID of 7. How does the store owner know what that product is? Could the product name be included?
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Bulk Specials

Post by burt »

Adding the Product Name is easy enough;

with_name.png

Obviously the name could not be updated using this script, as this updates specials for Price, Expiration, Status.
You do not have the required permissions to view the files attached to this post.
I am not here to build for you.
I am here to build with you. Let's help each other.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply