Sha256: 79dc495fdca0a9cbb0404ee34e9b033e51f81794265f7ffd57425b22f28dccf0

Contents?: true

Size: 598 Bytes

Versions: 9

Compression:

Stored size: 598 Bytes

Contents

require "shopify_cli"

module ShopifyCli
  module Commands
    class Populate
      class Product < ShopifyCli::AdminAPI::PopulateResourceCommand
        @input_type = :ProductInput

        def defaults
          {
            title: ShopifyCli::Helpers::Haikunator.title,
            variants: [{ price: price }],
          }
        end

        def message(data)
          ret = data["productCreate"]["product"]
          id = ShopifyCli::API.gid_to_id(ret["id"])
          @ctx.message("core.populate.product.added", ret["title"], @shop, admin_url, id)
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
shopify-cli-2.4.0 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.3.0 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.2.2 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.2.1 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.2.0 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.1.0 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.0.2 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.0.1 lib/shopify-cli/commands/populate/product.rb
shopify-cli-2.0.0 lib/shopify-cli/commands/populate/product.rb