Sha256: 7431d0fac732d6e8961a66756425a876b258d62f6e401cf055935e1c96c7ac88

Contents?: true

Size: 1021 Bytes

Versions: 2

Compression:

Stored size: 1021 Bytes

Contents

# frozen_string_literal: true

json.cache! [I18n.locale, line_item] do
  json.(line_item, *line_item_attributes)
  json.single_display_amount(line_item.single_display_amount.to_s)
  json.display_amount(line_item.display_amount.to_s)
  json.total(line_item.total)
  json.variant do
    json.partial!("spree/api/variants/small", variant: line_item.variant)
    json.(line_item.variant, :product_id)
    json.images(line_item.variant.gallery.images) do |image|
      json.partial!("spree/api/images/image", image: image)
    end
  end
  json.adjustments(line_item.adjustments) do |adjustment|
    json.partial!("spree/api/adjustments/adjustment", adjustment: adjustment)
  end
  json.kit_requirement do
    json.id line_item.kit_requirement.id
    json.name line_item.kit_requirement.name
    json.required_product_id line_item.kit_requirement.required_product_id
  end if line_item.kit_requirement
  json.kit do |kit|
    json.partial!("spree/api/line_items/line_item", line_item: line_item.kit) if line_item.kit
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_configurable_kits-0.1.1 app/views/spree/api/line_items/_line_item.json.jbuilder
solidus_configurable_kits-0.1.0 app/views/spree/api/line_items/_line_item.json.jbuilder