Author Topic: Update products using csv via cron  (Read 933 times)

Offline arcano

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Update products using csv via cron
« 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.

Offline arcano

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Update products using csv via cron
« Reply #1 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

Offline jaja

  • Newbie
  • *
  • Posts: 33
  • Karma: +10/-0
    • View Profile
Re: Update products using csv via cron
« Reply #2 on: March 22, 2018, 02:18:08 AM »

Offline arcano

  • Newbie
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Update products using csv via cron
« Reply #3 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.

 

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1783
  • Karma: +248/-11
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Update products using csv via cron
« Reply #4 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).
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

 

Powered by SMFPacks Social Login Mod