stathis Posted April 27, 2015 Share Posted April 27, 2015 Hi, I need to create a script (probably module) in order to be able to create & update product combinations and it's quantities automatically. The idea is to have a csv file that will be exported from another source/system that will contain detailed quantities for each product combination. The script will have to check if the product combination exists and if not, it will create it and then, it will update the quantity. Also, i would like to add functionality in order to insert product images too, specifically for each product combination. I would like prior to start developing to check if something similar exists, it's always a bad idea to reinvent the wheel! Do you have something in mind to begin with? Link to comment Share on other sites More sharing options...
prestatent Posted April 28, 2015 Share Posted April 28, 2015 Hi We created exactly this for our website updates (on a nightly basis). Everything is automated by scheduled cron jobs which update all products and combinations with values in the csv import files. Process is: 1. Export CSV files from source system. 2. Run via cron, conversion programs to convert CSV files to Prestashop formatted CSV files. 3. Run automated update process to update website. I created the automated update process from the PS AdminImportcontroller.php script so that it can run from the command line. That's how I did it, but there may be some modules out there which do exactly this. Not a simple process, but it saves us a lot of time. Cheers Link to comment Share on other sites More sharing options...
thepofo Posted December 16, 2015 Share Posted December 16, 2015 Hi We created exactly this for our website updates (on a nightly basis). Everything is automated by scheduled cron jobs which update all products and combinations with values in the csv import files. Process is: 1. Export CSV files from source system. 2. Run via cron, conversion programs to convert CSV files to Prestashop formatted CSV files. 3. Run automated update process to update website. I created the automated update process from the PS AdminImportcontroller.php script so that it can run from the command line. That's how I did it, but there may be some modules out there which do exactly this. Not a simple process, but it saves us a lot of time. Cheers Hi would you like to share your solution? Building the same thin but I got stuck. Thanks Link to comment Share on other sites More sharing options...
-=peter=- Posted December 17, 2015 Share Posted December 17, 2015 I did this too. Just override AdminImportController.php. If it's hard for you to hack it in overriding class, copy entire class and add your functionality. Basically you will be calling methods on Product and StockAvailable classes (getAttributeCombinations, updateQuantity, etc). I recommend doing this in transaction. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now