Sha256: e4c9e00beaf6bdd76f023e62c035e13d60927555cf52da2d4467d2ffad5198f0

Contents?: true

Size: 695 Bytes

Versions: 20

Compression:

Stored size: 695 Bytes

Contents

require 'shopify_cli'

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shopify-cli-1.6.0 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.5.0 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.4.1 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.4.0 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.3.1 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.3.0 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.2.0 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.1.2 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.1.1 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.1.0 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.0.5 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.0.4 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.0.3 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.0.2 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.0.1 lib/project_types/node/commands/populate/product.rb
shopify-cli-1.0.0 lib/project_types/node/commands/populate/product.rb
shopify-cli-0.9.3 lib/project_types/node/commands/populate/product.rb
shopify-cli-0.9.2 lib/project_types/node/commands/populate/product.rb
shopify-cli-0.9.1 lib/project_types/node/commands/populate/product.rb
shopify-cli-0.9.0 lib/project_types/node/commands/populate/product.rb