AbanteCart Community

Shopping Cart Operations => Support => Topic started by: arcano on March 21, 2018, 08:45:52 AM

Title: Update products using csv via cron
Post by: arcano on March 21, 2018, 08:45:52 AM
Hi.
Theres some way to do a nightly update (via cron) of the catalog using a csv?
We are resellers of some products and we update our stocks/prices based in a csv that is provided by another company.

It could be using a php script too. I searched in the documentation and theres a AData class that allows a method named CSV2ArrayFromFile to do that, but theres no examples or more documentation to know how to implement it.

Thanks in advance to anybody who can illuminate me.
Title: Re: Update products using csv via cron
Post by: arcano on March 21, 2018, 09:00:48 PM
Well, i guess that theres no answer. I expected that this platform has at least examples of using those classes.
Magento has docs everywhere, even a stackexchange
Title: Re: Update products using csv via cron
Post by: jaja on March 22, 2018, 02:18:08 AM
import can be scheduled by tasks
https://abantecart.atlassian.net/wiki/spaces/DOC/pages/18972714/Tasks+API
Title: Re: Update products using csv via cron
Post by: arcano on March 31, 2018, 07:46:47 AM
Thanks for your reply, Jaja.
maybe i didnt redact it well, sorry. I was not meaning as the set of the cron task itself. I was referring to the php script to do that.

What i need is to know how to import products from a remote csv not using any dashboard feature.

Theres little info regarding this topic, or maybe i didnt look for it well.
Theres a mention to that class (CSV2ArrayFromFile), but i found nothing else on how can i implement it, or any example.

Php import/sync script examples could be great too. Even .sh ones.

 
Title: Re: Update products using csv via cron
Post by: abolabo on April 02, 2018, 05:55:55 AM
AbanteCart have task.php file in your webroot. You can to create new task for import, set it to "ready to run" status and run via crontab periodically.
This means you should to create your own task controller that will do import ans put it into your newly created task as "setting".
Then just run php task.php and it will be run in background.

Use can set backup as scheduled task on admin side ( see menu System->Data->Backup/Restore ) and dig into database (tables tasks, task_steps etc) to see task settings.
Also you get dig into backup controller to see how to create new task on-the-fly.
Also do not forget about our docs (see post above).