Class: BigcommerceAPI::OrderProduct
- Defined in:
- lib/bigcommerce_api/order_product.rb
Instance Attribute Summary collapse
-
#applied_discounts ⇒ Object
Returns the value of attribute applied_discounts.
-
#base_cost_price ⇒ Object
Returns the value of attribute base_cost_price.
-
#base_price ⇒ Object
Returns the value of attribute base_price.
-
#base_total ⇒ Object
Returns the value of attribute base_total.
-
#base_wrapping_cost ⇒ Object
Returns the value of attribute base_wrapping_cost.
-
#bin_picking_number ⇒ Object
Returns the value of attribute bin_picking_number.
-
#configurable_fields ⇒ Object
Returns the value of attribute configurable_fields.
-
#cost_price_ex_tax ⇒ Object
Returns the value of attribute cost_price_ex_tax.
-
#cost_price_inc_tax ⇒ Object
Returns the value of attribute cost_price_inc_tax.
-
#cost_price_tax ⇒ Object
Returns the value of attribute cost_price_tax.
-
#ebay_item_id ⇒ Object
Returns the value of attribute ebay_item_id.
-
#ebay_transaction_id ⇒ Object
Returns the value of attribute ebay_transaction_id.
-
#event_date ⇒ Object
Returns the value of attribute event_date.
-
#event_name ⇒ Object
Returns the value of attribute event_name.
-
#fixed_shipping_cost ⇒ Object
Returns the value of attribute fixed_shipping_cost.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_bundled_product ⇒ Object
Returns the value of attribute is_bundled_product.
-
#is_refunded ⇒ Object
Returns the value of attribute is_refunded.
-
#name ⇒ Object
Returns the value of attribute name.
-
#option_set_id ⇒ Object
Returns the value of attribute option_set_id.
-
#order_address_id ⇒ Object
Returns the value of attribute order_address_id.
-
#order_id ⇒ Object
Returns the value of attribute order_id.
-
#orderproduct_type ⇒ Object
reserved.
-
#parent_order_product_id ⇒ Object
Returns the value of attribute parent_order_product_id.
-
#price_ex_tax ⇒ Object
Returns the value of attribute price_ex_tax.
-
#price_inc_tax ⇒ Object
Returns the value of attribute price_inc_tax.
-
#price_tax ⇒ Object
Returns the value of attribute price_tax.
-
#product_id ⇒ Object
Returns the value of attribute product_id.
-
#product_options ⇒ Object
Returns the value of attribute product_options.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#quantity_shipped ⇒ Object
Returns the value of attribute quantity_shipped.
-
#refund_amount ⇒ Object
Returns the value of attribute refund_amount.
-
#return_id ⇒ Object
Returns the value of attribute return_id.
-
#sku ⇒ Object
Returns the value of attribute sku.
-
#total_ex_tax ⇒ Object
Returns the value of attribute total_ex_tax.
-
#total_inc_tax ⇒ Object
Returns the value of attribute total_inc_tax.
-
#total_tax ⇒ Object
Returns the value of attribute total_tax.
-
#type ⇒ Object
Returns the value of attribute type.
-
#weight ⇒ Object
Returns the value of attribute weight.
-
#wrapping_cost_ex_tax ⇒ Object
Returns the value of attribute wrapping_cost_ex_tax.
-
#wrapping_cost_inc_tax ⇒ Object
Returns the value of attribute wrapping_cost_inc_tax.
-
#wrapping_cost_tax ⇒ Object
Returns the value of attribute wrapping_cost_tax.
-
#wrapping_message ⇒ Object
Returns the value of attribute wrapping_message.
-
#wrapping_name ⇒ Object
Returns the value of attribute wrapping_name.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
- #create(params = {}) ⇒ Object
- #find_for_reload ⇒ Object
- #parent ⇒ Object
-
#resource_url ⇒ Object
this overrides the default method, since this has to come in with an order id.
-
#save ⇒ Object
TODO: these can probably go in a ReadOnly class.
- #shippingaddress ⇒ Object
Methods inherited from Resource
belongs_to, #changed, has_many, has_one, http_request, #initialize, #mark_dirty!, #reload, #resource, resource
Methods inherited from Base
#attributes, clean!, date_adjust, #initialize, #store, #time, to_rfc2822
Constructor Details
This class inherits a constructor from BigcommerceAPI::Resource
Instance Attribute Details
#applied_discounts ⇒ Object
Returns the value of attribute applied_discounts.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def applied_discounts @applied_discounts end |
#base_cost_price ⇒ Object
Returns the value of attribute base_cost_price.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def base_cost_price @base_cost_price end |
#base_price ⇒ Object
Returns the value of attribute base_price.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def base_price @base_price end |
#base_total ⇒ Object
Returns the value of attribute base_total.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def base_total @base_total end |
#base_wrapping_cost ⇒ Object
Returns the value of attribute base_wrapping_cost.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def base_wrapping_cost @base_wrapping_cost end |
#bin_picking_number ⇒ Object
Returns the value of attribute bin_picking_number.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def bin_picking_number @bin_picking_number end |
#configurable_fields ⇒ Object
Returns the value of attribute configurable_fields.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def configurable_fields @configurable_fields end |
#cost_price_ex_tax ⇒ Object
Returns the value of attribute cost_price_ex_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def cost_price_ex_tax @cost_price_ex_tax end |
#cost_price_inc_tax ⇒ Object
Returns the value of attribute cost_price_inc_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def cost_price_inc_tax @cost_price_inc_tax end |
#cost_price_tax ⇒ Object
Returns the value of attribute cost_price_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def cost_price_tax @cost_price_tax end |
#ebay_item_id ⇒ Object
Returns the value of attribute ebay_item_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def ebay_item_id @ebay_item_id end |
#ebay_transaction_id ⇒ Object
Returns the value of attribute ebay_transaction_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def ebay_transaction_id @ebay_transaction_id end |
#event_date ⇒ Object
Returns the value of attribute event_date.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def event_date @event_date end |
#event_name ⇒ Object
Returns the value of attribute event_name.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def event_name @event_name end |
#fixed_shipping_cost ⇒ Object
Returns the value of attribute fixed_shipping_cost.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def fixed_shipping_cost @fixed_shipping_cost end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def id @id end |
#is_bundled_product ⇒ Object
Returns the value of attribute is_bundled_product.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def is_bundled_product @is_bundled_product end |
#is_refunded ⇒ Object
Returns the value of attribute is_refunded.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def is_refunded @is_refunded end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def name @name end |
#option_set_id ⇒ Object
Returns the value of attribute option_set_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def option_set_id @option_set_id end |
#order_address_id ⇒ Object
Returns the value of attribute order_address_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def order_address_id @order_address_id end |
#order_id ⇒ Object
Returns the value of attribute order_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def order_id @order_id end |
#orderproduct_type ⇒ Object
reserved
8 9 10 |
# File 'lib/bigcommerce_api/order_product.rb', line 8 def orderproduct_type @orderproduct_type end |
#parent_order_product_id ⇒ Object
Returns the value of attribute parent_order_product_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def parent_order_product_id @parent_order_product_id end |
#price_ex_tax ⇒ Object
Returns the value of attribute price_ex_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def price_ex_tax @price_ex_tax end |
#price_inc_tax ⇒ Object
Returns the value of attribute price_inc_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def price_inc_tax @price_inc_tax end |
#price_tax ⇒ Object
Returns the value of attribute price_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def price_tax @price_tax end |
#product_id ⇒ Object
Returns the value of attribute product_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def product_id @product_id end |
#product_options ⇒ Object
Returns the value of attribute product_options.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def @product_options end |
#quantity ⇒ Object
Returns the value of attribute quantity.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def quantity @quantity end |
#quantity_shipped ⇒ Object
Returns the value of attribute quantity_shipped.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def quantity_shipped @quantity_shipped end |
#refund_amount ⇒ Object
Returns the value of attribute refund_amount.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def refund_amount @refund_amount end |
#return_id ⇒ Object
Returns the value of attribute return_id.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def return_id @return_id end |
#sku ⇒ Object
Returns the value of attribute sku.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def sku @sku end |
#total_ex_tax ⇒ Object
Returns the value of attribute total_ex_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def total_ex_tax @total_ex_tax end |
#total_inc_tax ⇒ Object
Returns the value of attribute total_inc_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def total_inc_tax @total_inc_tax end |
#total_tax ⇒ Object
Returns the value of attribute total_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def total_tax @total_tax end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def type @type end |
#weight ⇒ Object
Returns the value of attribute weight.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def weight @weight end |
#wrapping_cost_ex_tax ⇒ Object
Returns the value of attribute wrapping_cost_ex_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def wrapping_cost_ex_tax @wrapping_cost_ex_tax end |
#wrapping_cost_inc_tax ⇒ Object
Returns the value of attribute wrapping_cost_inc_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def wrapping_cost_inc_tax @wrapping_cost_inc_tax end |
#wrapping_cost_tax ⇒ Object
Returns the value of attribute wrapping_cost_tax.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def wrapping_cost_tax @wrapping_cost_tax end |
#wrapping_message ⇒ Object
Returns the value of attribute wrapping_message.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def @wrapping_message end |
#wrapping_name ⇒ Object
Returns the value of attribute wrapping_name.
4 5 6 |
# File 'lib/bigcommerce_api/order_product.rb', line 4 def wrapping_name @wrapping_name end |
Class Method Details
.all(order_id, params = {}) ⇒ Object
40 41 42 43 |
# File 'lib/bigcommerce_api/order_product.rb', line 40 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) ⇒ Object
45 46 47 48 |
# File 'lib/bigcommerce_api/order_product.rb', line 45 def find(order_id, id) r = BigcommerceAPI::Base.get("/orders/#{order_id}/products/#{id}") (r.success? and !r.nil?) ? self.new(r) : nil end |
Instance Method Details
#create(params = {}) ⇒ Object
21 22 23 24 |
# File 'lib/bigcommerce_api/order_product.rb', line 21 def create(params={}) self.errors = ["Shipping Addresses are readonly"] return false end |
#find_for_reload ⇒ Object
35 36 37 |
# File 'lib/bigcommerce_api/order_product.rb', line 35 def find_for_reload self.class.find(self.order_id, self.id) end |
#parent ⇒ Object
31 32 33 |
# File 'lib/bigcommerce_api/order_product.rb', line 31 def parent 'order' end |
#resource_url ⇒ Object
this overrides the default method, since this has to come in with an order id
27 28 29 |
# File 'lib/bigcommerce_api/order_product.rb', line 27 def resource_url "orders/#{self.order_id}/products" end |
#save ⇒ Object
TODO: these can probably go in a ReadOnly class
16 17 18 19 |
# File 'lib/bigcommerce_api/order_product.rb', line 16 def save self.errors = ["Shipping Addresses are readonly"] return false end |
#shippingaddress ⇒ Object
10 11 12 13 |
# File 'lib/bigcommerce_api/order_product.rb', line 10 def shippingaddress a = BigcommerceAPI::Base.get "/orders/#{self.order_id}/shippingaddresses/#{self.order_address_id}" (a.success? and !a.nil?) ? BigcommerceAPI::Shippingaddress.new(a) : nil end |