In this blog post we have something a little different than normal. We are going to be showing you how you can automatically export Inventory or Customer data from Magento at set times, and also get the exported data emailed to you.
The Video Tutorial
The video on how to do this is a Premium tutorial as it is quite an advanced area and smaller businesses will not need this functionality. If you have premium membership you will be able to watch this below.
In this video tutorial you will learn how to:
- Setup this script and obtain the copy & paste cron job link you need
- Identify the Magento Dataflow profile ID
- Customise the settings as needed
- Create a cron job in cPanel
Note: If you don’t see the step-by-step video tutorial above, you needed to be logged in and have an active Premium account.
What Can You Export?
The export tool that we’re using is the Dataflow profile from Magento and by applying a cron job to this we can set the export to run at set times throughout the day / week or month.
By using the dataflow profile we have access to two different banks of information. We have:
1. Inventory data – Such as SKU, Stock quantity and pricing etc
2. Customer data – Such as customer name, address, email address etc
What could we use this for?
There are a number of reasons why you may find this type of information useful and you could apply it in a number of different ways.
Just a few of the reasons that we brainstormed in a matter of minutes were:
- Monitoring stock levels – receiving emails for products that were running low on stock notifying you to order in more
- Setting up an export to notify your trade customers of quantities and pricing amongst your lines
- Sending pricing and stock updates to any external websites you may have not managed on Magento.
- Downloading a CSV of prices for an Amazon repricing tool
- To email product data to your remote staff members daily or weekly depending on their job roles
- For external processing ( export > process > magmi import folder )
- Using the code as base to make it do what you want ( it’s written in PHP and can be modified accordingly )
If you are following us along in the video above then you will need the code. As promised just click the button below and you can gain instant access to the code.
A Special Note for Large Amounts of Customers/Products
We’re adding this as a sensible note if you have thousands of products and/or customers then go careful with this script.
This PHP script will do what it’s told to do and if your webhosting has no time out on running cron jobs (which all decent Magento hosting won’t) and depending on the numbers of products or customers that are met by the conditions you set in your Magento Dataflow profile, you could export all of your inventory or customers and the file sizes and time it takes to run this export could become large and take quite some time.
Be sensible here and try and limit the number of products you are exporting on large catalogs as the likelihood is that you don’t need to know about ALL the customers or ALL the products. and always allow a sensible amount of time for the script to complete.
Oh and a little tip not mentioned in the video tutorial, you can set Magento Dataflow profiles to FTP the completed file for you to a remote host.
Matt & Dave