Sha256: 8f8ebd9c0568027a6ed9c611e6bca3aa28d34db4d174b6331bb2fc30b4c1d685

Contents?: true

Size: 697 Bytes

Versions: 11

Compression:

Stored size: 697 Bytes

Contents

require "shopify_cli"

module Rails
  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(
            "rails.populate.product.added",
            ret["title"],
            ShopifyCli::Project.current.env.shop,
            admin_url,
            id
          )
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
shopify-cli-1.14.0 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.13.1 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.13.0 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.12.0 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.11.0 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.10.0 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.9.1 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.9.0 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.8.0 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.7.1 lib/project_types/rails/commands/populate/product.rb
shopify-cli-1.7.0 lib/project_types/rails/commands/populate/product.rb