Documentation
¶
Index ¶
- Variables
- func Query(db *datastore.Datastore) datastore.Query
- type Cart
- func (c *Cart) Defaults()
- func (c Cart) Description() string
- func (c Cart) DisplayCreatedAt() string
- func (c Cart) DisplayDiscount() string
- func (c Cart) DisplayId() string
- func (c Cart) DisplayShipping() string
- func (c Cart) DisplaySubtotal() string
- func (c Cart) DisplayTax() string
- func (c Cart) DisplayTotal() string
- func (c *Cart) Init(db *datastore.Datastore)
- func (c Cart) IntId() int
- func (c Cart) ItemsJSON() string
- func (c Cart) Kind() string
- func (c *Cart) Load(ps []datastore.Property) (err error)
- func (c *Cart) RemoveItem(id string) (err error)
- func (c *Cart) Save() (ps []datastore.Property, err error)
- func (c *Cart) SetItem(db *datastore.Datastore, id string, typ string, quantity int) (err error)
- func (c *Cart) SetProduct(db *datastore.Datastore, id string, quantity int) (err error)
- func (c *Cart) SetVariant(db *datastore.Datastore, id string, quantity int) (err error)
- func (c *Cart) Validator() *val.Validator
- type Document
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var IgnoreFieldMismatch = datastore.IgnoreFieldMismatch
Functions ¶
Types ¶
type Cart ¶
type Cart struct {
mixin.Model
// Store this was sold from (if any)
StoreId string `json:"storeId,omitempty"`
// Associated campaign
CampaignId string `json:"campaignId,omitempty"`
// Associated Crowdstart user or buyer.
UserId string `json:"userId,omitempty"`
// Email of the user or someone else if no user id exists
Email string `json:"email,omitempty"`
// Associated order ID, if any
OrderId string `json:"orderId,omitempty"`
// Status
Status Status `json:"status"`
// 3-letter ISO currency code (lowercase).
Currency currency.Type `json:"currency"`
// Sum of the line item amounts. Amount in cents.
LineTotal currency.Cents `json:"lineTotal"`
// Discount amount applied to the order. Amount in cents.
Discount currency.Cents `json:"discount"`
// Sum of line totals less discount. Amount in cents.
Subtotal currency.Cents `json:"subtotal"`
// Shipping cost applied. Amount in cents.
Shipping currency.Cents `json:"shipping"`
// Sales tax applied. Amount in cents.
Tax currency.Cents `json:"tax"`
// Total = subtotal + shipping + taxes + adjustments. Amount in cents.
Total currency.Cents `json:"total"`
Company string `json:"company,omitempty"`
BillingAddress Address `json:"billingAddress,omitempty"`
ShippingAddress Address `json:"shippingAddress,omitempty"`
// Individual line items
Items []lineitem.LineItem `json:"items" datastore:"-"`
Items_ string `json:"-" datastore:",noindex"`
Coupons []coupon.Coupon `json:"coupons,omitempty" datastore:",noindex"`
CouponCodes []string `json:"couponCodes,omitempty" datastore:",noindex"`
ReferrerId string `json:"referrerId,omitempty"`
// Series of events that have occured relevant to this order
History []Event `json:"-,omitempty" datastore:",noindex"`
// Arbitrary key/value pairs associated with this order
Metadata Map `json:"metadata" datastore:"-"`
Metadata_ string `json:"-" datastore:",noindex"`
Gift bool `json:"gift"` // Is this a gift?
GiftMessage string `json:"giftMessage,omitempty" datastore:",noindex"` // Message to go on gift
GiftEmail string `json:"giftEmail,omitempty"` // Email for digital gifts
Mailchimp struct {
Id string `json:"id,omitempty" datastore:",noindex"`
CampaignId string `json:"campaignId,omitempty"`
CheckoutUrl string `json:"checkoutUrl,omitempty" datastore:",noindex"`
} `json:"mailchimp,omitempty"`
}
func (Cart) Description ¶
func (Cart) DisplayCreatedAt ¶
func (Cart) DisplayDiscount ¶
func (Cart) DisplayShipping ¶
func (Cart) DisplaySubtotal ¶
func (Cart) DisplayTax ¶
func (Cart) DisplayTotal ¶
func (*Cart) RemoveItem ¶
func (*Cart) SetProduct ¶
func (*Cart) SetVariant ¶
type Document ¶
type Document struct {
Id_ string
UserId string
ProductIds string
BillingAddressLine1 string
BillingAddressLine2 string
BillingAddressCity string
BillingAddressState string
BillingAddressCountryCode string
BillingAddressCountry string
BillingAddressPostalCode string
ShippingAddressLine1 string
ShippingAddressLine2 string
ShippingAddressCity string
ShippingAddressState string
ShippingAddressCountryCode string
ShippingAddressCountry string
ShippingAddressPostalCode string
Type string
CreatedAt time.Time
UpdatedAt time.Time
Currency string
Total float64
CouponCodes string
ReferrerId string
Status string
PaymentStatus string
FulfillmentStatus string
Preorder string
Confirmed string
}
Click to show internal directories.
Click to hide internal directories.