Shopify / shopify_transporter

The Transporter tool allows you to convert data from a third-party platform into a format that can be imported into Shopify.
MIT License
98 stars 43 forks source link

Convert from external CSV to Shopify CSV #156

Open nystromb opened 1 year ago

nystromb commented 1 year ago

I'm looking to just use the convert command to be able to basically map data from one csv to a shopify formatted csv for me to upload. I created a custom pipeline with my already existing dataset. In my convert function, I get my input and records as the docs expect. When I set the record with the data I want, it does not actually transfer over as the docs indicate.

Do I have to use the extract command in order to get a JSON formatted file in order to convert?

Steps to Reproduce:

List the steps we can take to reproduce the problem:

Ruby 3.1.3

shopify_transporter convert --object=product ./godaddy_products.csv

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Handle,Title,Body (HTML),Vendor,Type,Tags,Template Suffix,Published Scope,Published,Published At,Option1 Name,Option1 Value,Option2 Name,Option2 Value,Option3 Name,Option3 Value,Variant SKU,Metafields Global Title Tag,Metafields Global Description Tag,Metafield Namespace,Metafield Key,Metafield Value,Metafield Value Type,Variant Grams,Variant Inventory Tracker,Variant Inventory Qty,Variant Inventory Policy,Variant Fulfillment Service,Variant Price,Variant Compare At Price,Variant Requires Shipping,Variant Taxable,Variant Barcode,Image Attachment,Image Src,Image Position,Image Alt Text,Variant Image,Variant Weight,Variant Weight Unit,Variant Tax Code
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
module CustomPipeline
  module Product
    class GodaddyProductConverter < ShopifyTransporter::Pipeline::Stage
      def convert(input, record)
        record['Title'] = input['Name']
        record['Variant SKU'] = input['SKU']
        record['Handle'] = input['Parent Product SKU']
      end
    end
  end
end