Sha256: 33b475c4827a9d031d897851158596e2f9d91c86df7ad683821d0316fef92ead

Contents?: true

Size: 721 Bytes

Versions: 57

Compression:

Stored size: 721 Bytes

Contents

require "shopify_cli"

module ShopifyCLI
  module Commands
    class Populate
      class DraftOrder < ShopifyCLI::AdminAPI::PopulateResourceCommand
        @input_type = :DraftOrderInput

        def defaults
          {
            lineItems: [{
              originalUnitPrice: price,
              quantity: 1,
              weight: { value: 10, unit: "GRAMS" },
              title: ShopifyCLI::Helpers::Haikunator.title,
            }],
          }
        end

        def message(data)
          ret = data["draftOrderCreate"]["draftOrder"]
          id = ShopifyCLI::API.gid_to_id(ret["id"])
          @ctx.message("core.populate.draft_order.added", @shop, admin_url, id)
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
shopify-cli-2.36.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.35.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.34.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.33.1 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.33.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.32.1 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.32.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.31.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.30.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.29.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.28.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.27.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.26.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.25.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.24.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.23.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.22.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.21.0 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.20.1 lib/shopify_cli/commands/populate/draft_order.rb
shopify-cli-2.20.0 lib/shopify_cli/commands/populate/draft_order.rb