1

We have a Magento1 store that sells shirts. The customers can upload a logo, or send some text that we will print on the shirt for them.

Currently, for each order that needs a print job (as opposed to just picking an item off the shelf and shipping it), we print the shirt, then set the order status to "printed" and then the warehouse knows to ship out the order. When we're dealing with 10 orders a day, that's feasible, but dealing with 1000 orders a day, means that a lot of orders that need a print job get skipped until the shipping staff realizes it, orders get delayed and customers aren't happy. We want to create a new grid in the admin that will loop through all non completed orders, and find items that need to be printed, this way no items get overlooked. Once the item is printed, a team member can mark it (the item not the order) as printed and it won't show on that grid.

My question is what's the best programming approach from the following two options:

Option 1: Every time the new grid is loading, it will just loop through the sales_flat_order_item table and pull all the relevant products from there - we would add a print_status column to that table so that we could know what was printed already and not display it.

Option 2: We create a new table in the database called items_to_print and we add an observer after each order that will populate that table with the necessary information (order number, the logo file, customer comments...). Then when we load our new grid it will simply load the items_to_print table.

The advantage of option 1 is that we're not adding extra tables and duplicate data to the database, but I'm concerned that the load time on that grid will be too heavy if it's loading a table of which it only needs a fraction, since not all items need a print job.

The advantage of option 2 is that getting the data into our new grid should be super fast, but I'm concerned about unnecessary and duplicate data in the database. I'm also concerned about orders failing if the observer runs into an error for some reason (we could use a cron instead of an observer)

I hope my question is clear enough, I just want to know programmatically speaking, what would be the best approach - thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.