Documentation
¶
Index ¶
- Constants
- Variables
- type Address
- type Category
- type Chart
- type Collection
- type Color
- type ColorVariation
- type ColorVariationImage
- type ColorVariationImageStorage
- type FeeSetting
- type InfluencerCoupon
- type MediaLibrary
- type Order
- type OrderItem
- type Owner
- type PaypalPayer
- type PaypalPayment
- type Product
- type ProductImage
- func (productImage *ProductImage) GetMediaOption() (mediaOption media_library.MediaOption)
- func (productImage *ProductImage) GetSelectedType() string
- func (productImage *ProductImage) ScanMediaOptions(mediaOption media_library.MediaOption) error
- func (productImage *ProductImage) SetSelectedType(typ string)
- func (productImage ProductImage) Validate(db *gorm.DB)
- type ProductProperties
- type ProductProperty
- type SEOSetting
- type Setting
- type Size
- type SizeVariation
- type Store
- type Subscription
- type User
Constants ¶
View Source
const ( DescriptionPaypal string = "Registered Paypal Address" DescriptionDelivery string = "Delivery Address" )
Variables ¶
View Source
var ( OrderState = transition.New(&Order{}) ItemState = transition.New(&OrderItem{}) )
View Source
var Roles = []string{RoleAdmin, RoleCustomer, RoleReseller, RoleInfluencer, RoleSubscriber, RoleEditor, RoleServicer}
View Source
var (
SubscriptionState = transition.New(&Subscription{})
)
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Category ¶
type Chart ¶
func GetChartData ¶
date format 2015-01-23
type Collection ¶
type Color ¶
type ColorVariation ¶
type ColorVariation struct {
gorm.Model
ProductID uint
Product Product
ColorID uint
Color Color
ColorCode string
Images media_library.MediaBox
SizeVariations []SizeVariation
}
func (ColorVariation) MainImageURL ¶
func (colorVariation ColorVariation) MainImageURL() string
type ColorVariationImage ¶
type ColorVariationImage struct {
gorm.Model
ColorVariationID uint
Image ColorVariationImageStorage `sql:"type:varchar(4096)"`
}
type ColorVariationImageStorage ¶
type ColorVariationImageStorage struct{ media_library.FileSystem }
func (ColorVariationImageStorage) GetSizes ¶
func (ColorVariationImageStorage) GetSizes() map[string]media_library.Size
type FeeSetting ¶
type InfluencerCoupon ¶
type MediaLibrary ¶
type MediaLibrary struct {
Title string
media_library.MediaLibrary
}
type Order ¶
type Order struct {
gorm.Model
UserID uint
User User
PaymentAmount float32
AbandonedReason string
DiscountValue uint
TrackingNumber *string
ShippedAt *time.Time
ReturnedAt *time.Time
CancelledAt *time.Time
ShippingAddressID uint
ShippingAddress Address
BillingAddressID uint
BillingAddress Address
OrderItems []OrderItem
transition.Transition
}
type OrderItem ¶
type OrderItem struct {
gorm.Model
OrderID uint
ProductID uint
Product Product
SizeVariationID uint
SizeVariation SizeVariation
Quantity uint
Price float32
DiscountRate uint
transition.Transition
}
type PaypalPayer ¶
type PaypalPayer struct {
gorm.Model
PayerID string `sql:"size:13" gorm:"not null;unique;"`
UserID uint
User User
}
func NewPaypalPayer ¶
func NewPaypalPayer(payer string, db *gorm.DB) *PaypalPayer
NewPaypalPayer Create new PaypalPayer with PayerID, or fetch existing PaypalPayer
type PaypalPayment ¶
type PaypalPayment struct {
gorm.Model
UserID uint
User User `gorm:"save_associations:false"`
InfluencerID uint
Influencer User `gorm:"save_associations:false"`
TxnID string
SubscrID string
McCurrency string
McGross float32
McFee float32
PaymentStatus string
}
func NewPaypalPayment ¶
func NewPaypalPayment(coupon string, paypalPayer *PaypalPayer, db *gorm.DB) *PaypalPayment
NewPaypalPayment Creat PaypalPayment based on coupon and PaypalPayer
func (PaypalPayment) Net ¶
func (payment PaypalPayment) Net() float32
type Product ¶
type Product struct {
gorm.Model
l10n.Locale
publish.Status
sorting.SortingDESC
Name string
NameWithSlug slug.Slug `l10n:"sync"`
Code string `l10n:"sync"`
CategoryID uint `l10n:"sync"`
Category Category `l10n:"sync"`
Collections []Collection `l10n:"sync" gorm:"many2many:product_collections;"`
MadeCountry string `l10n:"sync"`
MainImage media_library.MediaBox
Price float32 `l10n:"sync"`
Description string `sql:"size:2000"`
ColorVariations []ColorVariation `l10n:"sync"`
ColorVariationsSorter sorting.SortableCollection
Enabled bool
ProductProperties ProductProperties `sql:"type:text"`
}
func (Product) DefaultPath ¶
func (Product) MainImageURL ¶
type ProductImage ¶
type ProductImage struct {
gorm.Model
Title string
Color Color
ColorID uint
Category Category
CategoryID uint
SelectedType string
File media_library.MediaLibraryStorage `sql:"size:4294967295;" media_library:"url:/system/{{class}}/{{primary_key}}/{{column}}.{{extension}}"`
}
func (*ProductImage) GetMediaOption ¶
func (productImage *ProductImage) GetMediaOption() (mediaOption media_library.MediaOption)
func (*ProductImage) GetSelectedType ¶
func (productImage *ProductImage) GetSelectedType() string
func (*ProductImage) ScanMediaOptions ¶
func (productImage *ProductImage) ScanMediaOptions(mediaOption media_library.MediaOption) error
func (*ProductImage) SetSelectedType ¶
func (productImage *ProductImage) SetSelectedType(typ string)
func (ProductImage) Validate ¶
func (productImage ProductImage) Validate(db *gorm.DB)
type ProductProperties ¶
type ProductProperties []ProductProperty
func (*ProductProperties) Scan ¶
func (productProperties *ProductProperties) Scan(value interface{}) error
type ProductProperty ¶
type SEOSetting ¶
type Size ¶
type SizeVariation ¶
type SizeVariation struct {
gorm.Model
ColorVariationID uint
ColorVariation ColorVariation
SizeID uint
Size Size
AvailableQuantity uint
}
func SizeVariations ¶
func SizeVariations() []SizeVariation
func (SizeVariation) Stringify ¶
func (sizeVariation SizeVariation) Stringify() string
type Subscription ¶
type Subscription struct {
gorm.Model
UserID uint
User User `gorm:"save_associations:false"`
InfluencerID uint
Influencer User `gorm:"save_associations:false"`
//SubscrPayments []PaypalPayment `gorm:"foreignkey:SubscrID;AssociationForeignKey:SubscrID"`
SubscrPayments []PaypalPayment `gorm:"ForeignKey:SubscrID"`
SubscrID string
RecurTimes int
Period string
SubscrDate time.Time
CancelledAt time.Time
EotAt time.Time
transition.Transition
}
func NewSubscription ¶
func NewSubscription(coupon string, paypalPayer *PaypalPayer, db *gorm.DB) *Subscription
NewSubscription Creat Subscription based on coupon and PaypalPayer
type User ¶
type User struct {
gorm.Model
Email string
Password string
Name sql.NullString
Gender string
Role string
Addresses []Address
// Confirm
ConfirmToken string
Confirmed bool
// Recover
RecoverToken string
RecoverTokenExpiry time.Time
}
func (User) AvailableLocales ¶
func (User) DisplayName ¶
Click to show internal directories.
Click to hide internal directories.