OC 2.3.0.2
I am a bit lost on how to approach logging products ordered. This is a pretty specific thing as I am attempting to get a simple text file of all product models ordered that day. This is for statistics gathering and is just an idea, not anything completely thought out...
It doesn't need to have anything besides the model. I don't care about options.
My initial thought was after the order is processed to write all models to a txt file but I am drawing a blank on what would be the best way to go about this.
Would anyone be kind enough to give me their opinion?
Thank you,
Mike
I am a bit lost on how to approach logging products ordered. This is a pretty specific thing as I am attempting to get a simple text file of all product models ordered that day. This is for statistics gathering and is just an idea, not anything completely thought out...
It doesn't need to have anything besides the model. I don't care about options.
My initial thought was after the order is processed to write all models to a txt file but I am drawing a blank on what would be the best way to go about this.
Would anyone be kind enough to give me their opinion?
Thank you,
Mike
cue4cheap not cheap quality
May not be the best but for now put a function to be called in catalog/model/checkout/order.php
under
// Products
To log the model into a simple text file.
On to figure out how to do it the right way tomorrow.
Mike
under
// Products
To log the model into a simple text file.
On to figure out how to do it the right way tomorrow.
Mike
cue4cheap not cheap quality
Or, by creating an Event trigger whenever the addOrderHistory method is being called from the OC admin API orders: https://github.com/opencart/opencart/wiki/Events-System
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Just find a reports extension that does this.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Hi Mike,
I don't know if you are already aware, but opencart ships with a Products Purchased Report feature. It is quite rudimentary for a report, but might just be enough for what you need.
Alternatively, as paulfeakins said, there are ready-made solutions on the Marketplace. For example, the more advanced Import/Export tools on the Marketplace let you set up csv exports from any database table / combinations thereof with functionality to set up cron jobs, etc.
Of course, if you are looking for the right way to develop such functionality, go with straightlight's suggestion.
Hope this adds some useful info!
Gergely
I don't know if you are already aware, but opencart ships with a Products Purchased Report feature. It is quite rudimentary for a report, but might just be enough for what you need.
Alternatively, as paulfeakins said, there are ready-made solutions on the Marketplace. For example, the more advanced Import/Export tools on the Marketplace let you set up csv exports from any database table / combinations thereof with functionality to set up cron jobs, etc.
Of course, if you are looking for the right way to develop such functionality, go with straightlight's suggestion.
Hope this adds some useful info!
Gergely
A cron job may not be necessary in this case since the addOrderHistory can already be triggered upon every transactions. Which means, a TXT file can be created and appended from an Event Trigger automatically based on each purchased products on-the-fly. It's just not a compliant way, at least not anymore, to output data into an archived file in regards of POS transactions but rather to use a service.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 318 guests