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.
- #shipping_address ⇒ Object
Methods inherited from Resource
#assign_attributes, belongs_to, #changed, #delete, has_many, has_one, http_request, #initialize, #mark_dirty!, #reload, #resource, resource, #update_attributes
Methods inherited from Base
#attributes, clean!, date_adjust, default_options, #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.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def applied_discounts @applied_discounts end |
#base_cost_price ⇒ Object
Returns the value of attribute base_cost_price.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def base_cost_price @base_cost_price end |
#base_price ⇒ Object
Returns the value of attribute base_price.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def base_price @base_price end |
#base_total ⇒ Object
Returns the value of attribute base_total.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def base_total @base_total end |
#base_wrapping_cost ⇒ Object
Returns the value of attribute base_wrapping_cost.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def base_wrapping_cost @base_wrapping_cost end |
#bin_picking_number ⇒ Object
Returns the value of attribute bin_picking_number.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def bin_picking_number @bin_picking_number end |
#configurable_fields ⇒ Object
Returns the value of attribute configurable_fields.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def configurable_fields @configurable_fields end |
#cost_price_ex_tax ⇒ Object
Returns the value of attribute cost_price_ex_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def cost_price_ex_tax @cost_price_ex_tax end |
#cost_price_inc_tax ⇒ Object
Returns the value of attribute cost_price_inc_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def cost_price_inc_tax @cost_price_inc_tax end |
#cost_price_tax ⇒ Object
Returns the value of attribute cost_price_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def cost_price_tax @cost_price_tax end |
#ebay_item_id ⇒ Object
Returns the value of attribute ebay_item_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def ebay_item_id @ebay_item_id end |
#ebay_transaction_id ⇒ Object
Returns the value of attribute ebay_transaction_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def ebay_transaction_id @ebay_transaction_id end |
#event_date ⇒ Object
Returns the value of attribute event_date.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def event_date @event_date end |
#event_name ⇒ Object
Returns the value of attribute event_name.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def event_name @event_name end |
#fixed_shipping_cost ⇒ Object
Returns the value of attribute fixed_shipping_cost.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def fixed_shipping_cost @fixed_shipping_cost end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def id @id end |
#is_bundled_product ⇒ Object
Returns the value of attribute is_bundled_product.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def is_bundled_product @is_bundled_product end |
#is_refunded ⇒ Object
Returns the value of attribute is_refunded.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def is_refunded @is_refunded end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def name @name end |
#option_set_id ⇒ Object
Returns the value of attribute option_set_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def option_set_id @option_set_id end |
#order_address_id ⇒ Object
Returns the value of attribute order_address_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def order_address_id @order_address_id end |
#order_id ⇒ Object
Returns the value of attribute order_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def order_id @order_id end |
#orderproduct_type ⇒ Object
reserved
56 57 58 |
# File 'lib/bigcommerce_api/order_product.rb', line 56 def orderproduct_type @orderproduct_type end |
#parent_order_product_id ⇒ Object
Returns the value of attribute parent_order_product_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def parent_order_product_id @parent_order_product_id end |
#price_ex_tax ⇒ Object
Returns the value of attribute price_ex_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def price_ex_tax @price_ex_tax end |
#price_inc_tax ⇒ Object
Returns the value of attribute price_inc_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def price_inc_tax @price_inc_tax end |
#price_tax ⇒ Object
Returns the value of attribute price_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def price_tax @price_tax end |
#product_id ⇒ Object
Returns the value of attribute product_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def product_id @product_id end |
#product_options ⇒ Object
Returns the value of attribute product_options.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def @product_options end |
#quantity ⇒ Object
Returns the value of attribute quantity.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def quantity @quantity end |
#quantity_shipped ⇒ Object
Returns the value of attribute quantity_shipped.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def quantity_shipped @quantity_shipped end |
#refund_amount ⇒ Object
Returns the value of attribute refund_amount.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def refund_amount @refund_amount end |
#return_id ⇒ Object
Returns the value of attribute return_id.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def return_id @return_id end |
#sku ⇒ Object
Returns the value of attribute sku.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def sku @sku end |
#total_ex_tax ⇒ Object
Returns the value of attribute total_ex_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def total_ex_tax @total_ex_tax end |
#total_inc_tax ⇒ Object
Returns the value of attribute total_inc_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def total_inc_tax @total_inc_tax end |
#total_tax ⇒ Object
Returns the value of attribute total_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def total_tax @total_tax end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def type @type end |
#weight ⇒ Object
Returns the value of attribute weight.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def weight @weight end |
#wrapping_cost_ex_tax ⇒ Object
Returns the value of attribute wrapping_cost_ex_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def wrapping_cost_ex_tax @wrapping_cost_ex_tax end |
#wrapping_cost_inc_tax ⇒ Object
Returns the value of attribute wrapping_cost_inc_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def wrapping_cost_inc_tax @wrapping_cost_inc_tax end |
#wrapping_cost_tax ⇒ Object
Returns the value of attribute wrapping_cost_tax.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def wrapping_cost_tax @wrapping_cost_tax end |
#wrapping_message ⇒ Object
Returns the value of attribute wrapping_message.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def @wrapping_message end |
#wrapping_name ⇒ Object
Returns the value of attribute wrapping_name.
3 4 5 |
# File 'lib/bigcommerce_api/order_product.rb', line 3 def wrapping_name @wrapping_name end |
Class Method Details
.all(order_id, params = {}) ⇒ Object
88 89 90 91 |
# 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) ⇒ Object
93 94 95 96 |
# 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 |
Instance Method Details
#create(params = {}) ⇒ Object
69 70 71 72 |
# File 'lib/bigcommerce_api/order_product.rb', line 69 def create(params={}) self.errors = ["Shipping Addresses are readonly"] return false end |
#find_for_reload ⇒ Object
83 84 85 |
# File 'lib/bigcommerce_api/order_product.rb', line 83 def find_for_reload self.class.find(self.order_id, self.id) end |
#parent ⇒ Object
79 80 81 |
# File 'lib/bigcommerce_api/order_product.rb', line 79 def parent 'order' end |
#resource_url ⇒ Object
this overrides the default method, since this has to come in with an order id
75 76 77 |
# File 'lib/bigcommerce_api/order_product.rb', line 75 def resource_url "orders/#{self.order_id}/products" end |
#save ⇒ Object
TODO: these can probably go in a ReadOnly class
64 65 66 67 |
# File 'lib/bigcommerce_api/order_product.rb', line 64 def save self.errors = ["Shipping Addresses are readonly"] return false end |
#shipping_address ⇒ Object
58 59 60 61 |
# 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 |