Announcement

Collapse
No announcement yet.

Setting up Custom Fields by import?

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

    Setting up Custom Fields by import?

    I need to transfer my custom fields from my live store to my dev store. I have about 80 custom fields, so I'd rather not do them one at a time.

    What's the best course of action?

    In my live store, I can go to Utilites > Custom Fields > Select All > csv export

    Can I just import this file into my dev store, too?

    #2
    Re: Setting up Custom Fields by import?

    There is no csv import for custom fields. You can create them via XML and then import your XML file.

    Here is an example of the XML to create a new custom product field:

    Code:
    <Module code="customfields" feature="fields_prod">
    	<ProductField_Add>
    		<Code>product-flag</Code>
    		<Name>Product Flag</Name>
    		<FieldType>dropdown</FieldType>
    	</ProductField_Add>
    	<ProductFieldTypeOption_Add code="product-flag" value="HOT" />
    	<ProductFieldTypeOption_Add code="product-flag" value="NEW" />
    	<ProductFieldTypeOption_Add code="product-flag" value="none" />
    	<ProductFieldTypeOption_Add code="product-flag" value="SALE" />
    </Module>
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Setting up Custom Fields by import?

      80 Custom Fields!
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        Re: Setting up Custom Fields by import?

        Thanks Brennan. That'll do.

        Bruce, the 85 (!) custom fields I have is a total of product, category and customer . . . not that it makes the task any shorter.

        Comment


          #5
          Re: Setting up Custom Fields by import?

          I had the same problem and resolved it by exporting the custom fields table called s01_CFM_ProdFields from the store via mySQL database via phpMyAdmin. You can open the table and click on Export and then import it in the new store.
          Omar Waheed
          http://dar-us-salam.com
          ~~~~~~~~~~~~~~~~~~
          Dar-us-Salam Publications
          Worship the Creator, not the Creations!

          Comment


            #6
            Re: Setting up Custom Fields by import?

            I wondered about doing that, but I didn't know if there would be an unintended consequence. Thanks for the tip!

            Comment


              #7
              Re: Setting up Custom Fields by import?

              There could definitely be unintended consequences. Direct copying of database tables will work, but only in very specific situations.

              Many of these tables identify products by their numeric ID, not by their code. The ID numbers are assigned by the store when products are created; the users have no control over them.

              If the dev store was created by taking a direct copy of the entire live store's DB, then the IDs will all be the same -- at that time. But after that, when you create new products in either store, the IDs will get out of synch, unless you always create the same products in both stores, in the same order.

              For more general cases, e.g. an auto-parts dealer trying to copy data from the Chevy store into the Ford store, this wouldn't work at all, because the IDs might be totally out of synch. And these same concerns apply to Categories, Customers, Orders, and most other types of store data. So in general, this is a last resort, and has to be done carefully. It's usually better to use a plain-text export and import, e.g. CSV or XML.
              Kent Multer
              Magic Metal Productions
              http://TheMagicM.com
              * Web developer/designer
              * E-commerce and Miva
              * Author, The Official Miva Web Scripting Book -- available on-line:
              http://www.amazon.com/exec/obidos/IS...icmetalproducA

              Comment

              Working...
              X