Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2008
    Posts
    569
    Plugin Contributions
    0

    Default Cron Job for Updating QTY

    Hello! My supplier gives my access to a excel file in ftp there they created for me. It has the model number I use and the qty and some more info. They also give me a link to download a tabbed txt file that has the same information. How hard would it be to setup a cron job to update my quantity daily from their info? Where do I even begin? They told me its pretty simple to do, but didnt offer any help

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Cron Job for Updating QTY

    How hard would it be to setup a cron job to update my quantity daily from their info
    Would not be an automated cron

    Get the 3rd party module - -easy populate

    Review the wiki article on using it

    I recommend that you practice on a second install of your cart versus the live site until you have mastered it
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Aug 2010
    Location
    Fredericksburg, VA
    Posts
    3
    Plugin Contributions
    0

    Default Re: Cron Job for Updating QTY

    This should be fairly straight forward if you want to automate it.

    Lookup the man pages for crontab and have it launch a php script. The script can use cURL to download the txt version and then use built in functions to parse the file if you can get a CSV version. Most places use CSV these days as opposed to TSV but if it is TSV a quick google searched turned up a ready to go class to parse it:

    http://enarion.net/programming/php/csv-import/

    I assume you have a spot in your products table where you are storing their part #? If so simply run an update query against the part # from the file against the part # in your DB (and their vendor # if you have more than one so you don't get product ID collisions).

    As a recommendation you may want to ask them what they do with products once they are phased out - I've ran into vendors who entirely remove them from the file and don't bother notifying the end user so you may want to disable any product who's stock wasn't updated. If you go this route you need to do a lot of error/logic checking to make sure you dont' mass disable their products if their feed isn't available, corrupt, fails to parse, etc.

 

 

Similar Threads

  1. Replies: 10
    Last Post: 31 Oct 2015, 08:09 PM
  2. cron job for Recover Cart Sale add-on
    By pdxdoug in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 19 Sep 2015, 02:18 AM
  3. Admin auto login for a cron job
    By Gigo in forum Customization from the Admin
    Replies: 20
    Last Post: 9 Aug 2012, 07:39 AM
  4. Setting up a cron job for the Snapshot add-on?
    By RescoCCC in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 3 Jan 2012, 06:19 PM
  5. Cron Job for Optimize Database
    By Convergence in forum General Questions
    Replies: 4
    Last Post: 24 Jan 2011, 09:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR