Announcement

Collapse
No announcement yet.

Using the MMLSK CSV Product Import

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

    Using the MMLSK CSV Product Import

    Is it possible to not use an Import Setting config to map columns to product fields? The Import Settings config will need to be set to Automap?

    I have consistent CSV field names but some of these brand exports CSVs don't have the fields in the same column. Example, one brand has the weight in column N while a different brand has the weight in column J. There are also columns where the field name doesn't match a standard field name. This example: RETAILPrice is the column name and has to map to price.

    If I customized the Build_Column_Info function, will it map RETAILPrice to PRICE regardless of what the column position is?

    Code:
    <MvEVAL EXPR = "{ Add_Standard_Column( l.columns,    'RETAILPrice', 'Price', 'PRICE', 0, 0, 'currency' ) }">
    Thanks,

    Scott
    Last edited by ids; 04-27-23, 10:17 AM.
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    #2
    Yes, that's one of the things I did.
    When I work on the Build_Column_Info function, I always stretch my text editor window out really wide, so that I can see the code without extra line breaks. That makes it easier to read and edit. I also added some more descriptive labels in the comment lines above the code. Here's a screen shot (below).
    My client's CSV files use the column label "ItemNum" for the product code. So I changed "PRODUCT_CODE" to "ItemNum" in the parameter of the Add_Standard_Column function.
    This works as expected. The ItemNum column can appear anywhere in the file, and the module will find it (as long as you've set the import to use automatic column selection).

    CSV column info.png
    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


      #3
      Thank You, Kent. Very helpful.

      Now I have non-standard fields which are key to this project. The Main image type and image and Custom Product fields. I haven't tried to map CPFs yet. I'm working the MAIN atm. It's also possible to have alternate images too, so that might be fun if it's possible. Using the "Add_standard_column" function doesn't seem to map. But, I don't know what the field member name should be. I've tried: images and IMAGE_TYPE:_MAIN_IMAGE. I don't know what to guess here.

      Scott
      Need to offer Shipping Insurance?
      Interactive Design Solutions https://www.myids.net
      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
      Competitive Rates, Custom Modules and Integrations, Store Integration
      AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
      My T-shirt Collection is mostly MivaCon T-shirts!!

      Comment


        #4
        All the column data is in the Build_Column_Info function. The module has columns for the old legacy image and thumbnail, but it doesn't support the newer managed images. I had to write my own code for that.
        The LSK module does support custom product fields. I don't recall how it determines the column headers; I think it just takes the field codes and converts them to upper case, but I might be mistaken about that.
        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