class BigcommerceAPI::OrderProduct

Attributes

applied_discounts[RW]
base_cost_price[RW]
base_price[RW]
base_total[RW]
base_wrapping_cost[RW]
bin_picking_number[RW]
configurable_fields[RW]
cost_price_ex_tax[RW]
cost_price_inc_tax[RW]
cost_price_tax[RW]
ebay_item_id[RW]
ebay_transaction_id[RW]
event_date[RW]
event_name[RW]
fixed_shipping_cost[RW]
id[RW]
is_bundled_product[RW]
is_refunded[RW]
name[RW]
option_set_id[RW]
order_address_id[RW]
order_id[RW]
orderproduct_type[RW]

reserved

parent_order_product_id[RW]
price_ex_tax[RW]
price_inc_tax[RW]
price_tax[RW]
product_id[RW]
product_options[RW]
quantity[RW]
quantity_shipped[RW]
refund_amount[RW]
return_id[RW]
sku[RW]
total_ex_tax[RW]
total_inc_tax[RW]
total_tax[RW]
type[RW]
weight[RW]
wrapping_cost_ex_tax[RW]
wrapping_cost_inc_tax[RW]
wrapping_cost_tax[RW]
wrapping_message[RW]
wrapping_name[RW]

Public Class Methods

all(order_id, params={}) click to toggle source
# File lib/bigcommerce_api/order_product.rb, line 88
   def all(order_id, params={})
  resources = BigcommerceAPI::Base.get("/orders/#{order_id}/products", query: date_adjust(params))
  (resources.success? and !resources.nil?) ? resources.collect{|r| self.new(r)} : []
end
find(order_id, id) click to toggle source
# File lib/bigcommerce_api/order_product.rb, line 93
def find(order_id, id)
  r = BigcommerceAPI::Base.get("/orders/#{order_id}/products/#{id}")
  (r.success? and !r.nil?) ? self.new(r) : nil
end

Public Instance Methods

create(params={}) click to toggle source
# File lib/bigcommerce_api/order_product.rb, line 69
def create(params={})
    self.errors = ["Shipping Addresses are readonly"]
    return false
end
find_for_reload() click to toggle source
# File lib/bigcommerce_api/order_product.rb, line 83
def find_for_reload
  self.class.find(self.order_id, self.id)
end
parent() click to toggle source
# File lib/bigcommerce_api/order_product.rb, line 79
def parent
  'order'
end
resource_url() click to toggle source

this overrides the default method, since this has to come in with an order id

# File lib/bigcommerce_api/order_product.rb, line 75
def resource_url
  "orders/#{self.order_id}/products"
end
save() click to toggle source

TODO: these can probably go in a ReadOnly class

# File lib/bigcommerce_api/order_product.rb, line 64
def save
    self.errors = ["Shipping Addresses are readonly"]
    return false
end
shipping_address() click to toggle source
# File lib/bigcommerce_api/order_product.rb, line 58
def shipping_address
  a = BigcommerceAPI::Base.get "/orders/#{self.order_id}/shipping_addresses/#{self.order_address_id}"
  (a.success? and !a.nil?) ? BigcommerceAPI::Shippingaddress.new(a) : nil
end