Announcement

Collapse
No announcement yet.

Automating Product Import?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automating Product Import?

    Hello Everybody, hoping somebody can point me in the right direction here.

    Basically, we're trying to further automate the adding/updating of products to our miva store. Currently we use the flat file import and I'm wondering if there is a way or anyone has found out how to kick it off programmatically?

    We have a bunch of custom fields that we utilize and it's sometimes difficult/time consuming for the staff adding products to "map" all the fields in the import.

    Since the "mapping" never changes I'd love to be able to kick something off that imports a file using a predetermined criteria (without needing to go in and "map" each field each time)

    If we could figure this out it'd really streamline our ability to add products to the web.

    Thought about trying to write something in php/mysql but "uncomfortable" with which tables need to be touched when adding a product and figured it'd be easier to find a way to use Miva's built in import feature.

    Any ideas? Anybody tried anything similar?

    Thanks in advance Miva Community :)

    #2
    Re: Automating Product Import?

    There's a better way to do this using what we call "provisioning" which is fundamentally the XML Import routines you see in the Import system.

    First step would be to automate getting the data in the XML Format and running the Import manually to make sure it worked as expected.

    Then there's a process for putting the data in the right location and triggering it's import. I'm not in the office right now, but if that's of interest to you, I can have someone else chime in with more info.
    Thanks,

    Rick Wilson
    CEO
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Automating Product Import?

      Rick, that sounds like exactly what I need, VERY interested and any information would be much appreciated.

      Comment


        #4
        Re: Automating Product Import?

        and not to get ahead of myself but can you import inventory info and custom product field info as well? If all that is available it will be huge for us.

        Comment


          #5
          Re: Automating Product Import?

          Been fooling with it a little bit and called support to try to get more information. Waiting for a call back, but what's really needed is some documentation on all the available calls.

          Looks powerful for sure but can't find a resource to point me in the right direction on the calls for things like:

          - Updating Product Inventory Counts
          - Updating Product Inventory Settings
          - Updating Custom Product Fields

          Also, need to know what the header needs to be on the file, and how it gets triggered ( I saw something about logging into admin.mvc ... but is there another way to trigger the provide.xml without having to login? )

          Very excited about this as I'm just a few steps away from having all the info I need, but at the same time, not having the documentation is KILLING me right now :)

          Comment


            #6
            Re: Automating Product Import?

            I know nothing about xml, but would like to know about using it for import/export.
            Richard Waters

            www.MivaWebmaster.com
            [email protected]
            Tel: 541-943-3268

            Comment


              #7
              Re: Automating Product Import?

              Hi there cchobot,

              We have written some command line scripts that allow a scheduled task to interpret a flat file into XML and also import the data into MM. The script also clears out expired baskets and takes into account any OPEN baskets when bringing in an inventory level. Please contact me directly and we can discuss further. [email protected]

              Thanks and talk to you soon,

              -Philip
              Philip Hansen
              Strategy & Solutions Manager // [email protected]

              Comment


                #8
                Re: Automating Product Import?

                Rich,

                I'll bring you up to speed on what I've been able to find out, it looks like a great system that will fit our needs nicely:

                - "Import Data From XML" is a feature available under Utilities > Import Data > Import Data from XML

                - You can utilize this feature to make additions / updates / deletions to your miva store via a file that is found in your mivadata directory called provide.xml

                - Here's a great doc I found that highlights using it to add a new product:
                https://support.mivamerchant.com/sup...es-to-xml-file

                - You can insert XML fragments into the box provided or upload your own provide.xml file

                - one neat things about this file is that it appears miva merchant checks for it when you login to admin.mvc . So basically you could upload or ftp up a new provide.xml file to the appropriate folder, and then login to miva admin and your changes have been applied. (although I'm hoping there's another programatic way to trigger the import of provide.xml so I don't have to login everytime I create a new provide.xml file)

                - another great part of it is the process can send you a logfile so you can see if there were any errors in your provide.xml file. (I've noticed if you get a "blank" text file as the log it just means there were no errors)

                - So let's use the example from the page that was provided, it provides an xml fragment that you can "plug in" to the xml fragment box in the Import DATA from XML feature:

                Code:
                 
                <Product_Add>
                            <Code>test</Code>
                            <Name><![CDATA[My Test Product]]></Name>
                            <Price>1.00</Price>
                            <Cost>0.00</Cost>
                            <Weight>0.00</Weight>
                            <Description><![CDATA[My Test Description]]></Description>
                            <Taxable>Yes</Taxable>
                            <Active>Yes</Active>
                            <ThumbnailImage></ThumbnailImage>
                            <FullSizeImage></FullSizeImage>
                            <Product_Order>150</Product_Order>
                </Product_Add>
                Importing the above will add a new product named "test" to your store catalog

                - I intend to use this kind of like flat file import, but I beleive I'll be able to set it up to be "triggered" programatically, meaning our web team won't need to "map" a bunch of custom product fields every time they add a bunch of new products. This means they'll have more time to work on getting the products ready for import (taking photos/writing descriptions/ etc.) instead of actually importing the products.

                - I also think I'll be able to "tighten up" our inventory reconciliation and merchandizing processes and make them less database intensive.

                - and a final benefit I'm excited about is that I think I'll be able to combine multiple updates into one provide.xml file, for example: add new products, update inventory on existing products, and update pricing - all from the same provide.xml file.

                Also, I've found (since I'm no xml expert by any means) it helps me to think of the file kind of like a list of database comands (since I'm a bit of an sql guy lately).

                That code above, really relates to something like:

                Insert Into s01_Products (code,name,cost,weight,descrip,taxable,active,imag e) VALUES ('test','My Test Product',1.00,0.00,'My Test Description',1,1,'')

                That way there I just view the provide.xml file like a list of commands I want to run against our miva databases, only it's better because when you do things like insert a product, it will update ALL the databases that should be, just like when you enter one manually in the store.

                Hope this info helps, I did find some of the provisioning commands from miva 4 still "work" and will post the link to the documentation here for those interested, but should probably be cautious about using them as there have probably been updates for miva 5.5. But if you're interested:
                http://docs.mivamerchant.com/en-US/m...oning.htm#Post

                I couldn't find the corresponding doc in 5.5 knowledgebase.

                So there's everything I know so far :)

                Comment


                  #9
                  Re: Automating Product Import?

                  Originally posted by phansen View Post
                  Hi there cchobot,

                  We have written some command line scripts that allow a scheduled task to interpret a flat file into XML and also import the data into MM. The script also clears out expired baskets and takes into account any OPEN baskets when bringing in an inventory level. Please contact me directly and we can discuss further. [email protected]

                  Thanks and talk to you soon,

                  -Philip
                  Thanks Philip, I'll be emailing shortly :) ... Email sent
                  Last edited by cchobot; 07-28-11, 08:30 AM.

                  Comment


                    #10
                    Re: Automating Product Import?

                    Nice outline cchobot. I was going to try this method to post inventory quantitles to the inventory variant...have you tried that yet.

                    Thought I'd ask before I start from scratch.
                    Thanks
                    Thank You,
                    Rick Scofield -

                    Comment


                      #11
                      Re: Automating Product Import?

                      I treat each inventory variant like a seperate product. for the master product I do not track inventory. I only track the variants.
                      I can import this xml file to update quantities for the three variants of aa318.

                      <InventoryProductSettings_Update product_code="AA318-17">
                      <TrackProduct>1</TrackProduct>
                      <CurrentStock>80</CurrentStock>
                      </InventoryProductSettings_Update>
                      <InventoryProductSettings_Update product_code="AA318-35">
                      <TrackProduct>1</TrackProduct>
                      <CurrentStock>20</CurrentStock>
                      </InventoryProductSettings_Update>
                      <InventoryProductSettings_Update product_code="AA318-70">
                      <TrackProduct>1</TrackProduct>
                      <CurrentStock>50</CurrentStock>
                      </InventoryProductSettings_Update>

                      Comment


                        #12
                        Re: Automating Product Import?

                        Rick, We do it. Look up the forum posts that talk about provisioning xml. There is a lot of info in those posts and some undocumented stuff like deleting adding updating etc.
                        Basically the variants are separate products, so all you have to do is update their quantity like any other product in the store. There is a post about how to do it. Just search for "xml provisioning inventory", You'll see lots of my threads asking questions and miva support answering them in the forums. There are code examples too.

                        Comment


                          #13
                          Re: Automating Product Import?

                          kayakbabe, Thanks for all the input here. Thought I would update this thread with what we've done with the complete end-2-end process. I have created a compiled java class (also a XSL template) from a XQuery file that takes a specific flat fixed file format as input and transforms the file into a tab delimited file, which we also created a custom Miva import module that updates all of the product variants using the SKU/UPC code as the key. This process runs 3-4 times day to keep inventory quantities fresh. I have used the XML provisioning method many times, but the error level output is non-existent. So we created the module which will create two error files, one for missing/not found master product codes and the other for missing SKU/UPC codes.
                          Thank You,
                          Rick Scofield -

                          Comment


                            #14
                            Re: Automating Product Import?

                            Originally posted by rscof View Post
                            kayakbabe, Thanks for all the input here. Thought I would update this thread with what we've done with the complete end-2-end process. I have created a compiled java class (also a XSL template) from a XQuery file that takes a specific flat fixed file format as input and transforms the file into a tab delimited file, which we also created a custom Miva import module that updates all of the product variants using the SKU/UPC code as the key. This process runs 3-4 times day to keep inventory quantities fresh. I have used the XML provisioning method many times, but the error level output is non-existent. So we created the module which will create two error files, one for missing/not found master product codes and the other for missing SKU/UPC codes.
                            That's a way to tackle it alright. My choice would have probably a combo of provisioning, php, and cron jobs. We update our inventory every 15 minutes, we are more worried about quantity and inventory status. Our descriptive info on offered items isn't updated via provisioning unless we are adding a new item. We manufacture much of our own so we don't have the same issues you have, as we control our own skus and their UPC codes, our inventory offered doesn't change as much as yours.

                            I greatly prefer the XML format for importing into just about anything over a tab delimited. things like column order or missing data and sequence don't matter quite so much. I think XML is more flexible. I'm curious why you chose to transform the file you receive into a tab delimited file instead?

                            Isn't it awesome Merchant can support all levels from novice to total custom geekitude and in between!

                            Comment


                              #15
                              Re: Automating Product Import?

                              I noticed that Miva isn't automatically picking up my provide.xml file from the root folder when I login to the admin. Has this feature changed? Is there a size limit for the file? Should I remove the <Provision> and <Store code> tags?
                              Jamin Jones, CEO
                              the Appalachian Offroad Motorcycle Company

                              Comment

                              Working...
                              X