ecommerce

package module
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 12 Imported by: 0

README

eCommerce Package

Our eCommerce Template, built on NextJS and React, provides a powerful solution for online stores, enabling comprehensive management of products, categories, and customer interactions. This template is designed for seamless integration with spurtCMS Admin, enhancing content management capabilities.

Features

  • Integration with spurtCMS Admin: Use the template seamlessly with spurtCMS Admin to manage product listings, categories, pricing, and other eCommerce content efficiently.
  • Standalone Usage: The eCommerce Template can also be used independently, offering flexibility to manage your online store according to your specific requirements.
  • Product Management: Easily add, edit, and remove products, manage product categories, and display detailed product information.
  • Cart and Checkout: Features include an intuitive add-to-cart function and a streamlined checkout process to enhance the customer shopping experience.

Installation

go get github.com/spurtcms/ecommerce

Create new product

Getting help

If you encounter a problem with the package,please refer [Please refer [(https://www.spurtcms.com/documentation/cms-admin)] or you can create a new Issue in this repo[https://github.com/spurtcms/ecommerce/issues].

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorAuth       = errors.New("auth enabled not initialised")
	ErrorPermission = errors.New("permissions enabled not initialised")
	ErrorEmpty      = errors.New("given some values is empty")
	TZONE, _        = time.LoadLocation(os.Getenv("TIME_ZONE"))
)

Functions

func AuthandPermission

func AuthandPermission(ecommerce *Ecommerce) error

func HashingPassword

func HashingPassword(pass string) string

Hass Password

func MigrateTables

func MigrateTables(db *gorm.DB)

MigrateTable creates this package related tables in your database

Types

type Config

type Config struct {
	AuthEnable       bool
	PermissionEnable bool
	DB               *gorm.DB
	Auth             *auth.Auth
	Permissions      *role.PermissionConfig
}

type CreateCurrencyReq added in v0.0.5

type CreateCurrencyReq struct {
	Id              int
	CurrencyName    string
	CurrencyType    string
	CurrencySymbol  string
	CurrencyDefault int
	CreatedBy       int
	ModifiedBy      int
	IsActive        int
}

type CreateCustomerReq

type CreateCustomerReq struct {
	MemberId         int
	FirstName        string
	LastName         string
	Email            string
	MobileNo         string
	Username         string
	Password         string
	StreetAddress    string
	City             string
	State            string
	Country          string
	ZipCode          string
	IsActive         int
	ProfileImage     string
	ProfileImagePath string
	CreatedBy        int
	ModifiedBy       int
}

type CreateOrderReq

type CreateOrderReq struct {
	CustomerId      int
	Status          string
	ShippingAddress string
	Price           int
	Tax             int
	TotalCost       int
	CreatedBy       int
	ModifiedBy      int
	DeletedBy       int
}

type CreatePaymentReq added in v0.0.5

type CreatePaymentReq struct {
	Id           int
	PaymentName  string
	Description  string
	PaymentImage string
	CreatedBy    int
	ModifiedBy   int
	IsActive     int
}

type CreateProductReq

type CreateProductReq struct {
	CategoriesId       string
	ProductName        string
	ProductDescription string
	ProductImagePath   string
	ProductYoutubePath string
	ProductVimeoPath   string
	Sku                string
	ProductPrice       int
	Tax                int
	Totalcost          int
	Status             int
	CreatedBy          int
	ModifiedBy         int
	DeletedBy          int
	ProductId          int
	Priority           int
	Price              int
	StartDate          time.Time
	EndDate            time.Time
	Type               string
	Stock              int
	IsActive           int
	PricingId          int
}

type CreateSettingReq added in v0.0.5

type CreateSettingReq struct {
	Id              int
	StoreName       string
	CurrencyDefault int
	PaymentDefault  int
	StatusDefault   int
	DisplayStock    int
	StockWarning    int
	StockCheckout   int
	CreatedBy       int
	ModifiedBy      int
}

type CreateStatusReq added in v0.0.5

type CreateStatusReq struct {
	Id          int
	Status      string
	Description string
	Priority    int
	ColorCode   string
	CreatedBy   int
	ModifiedBy  int
	IsActive    int
}

type CustomerDetails added in v0.0.7

type CustomerDetails struct {
	Id               int
	FirstName        string
	LastName         string
	MobileNo         string
	Email            string
	Username         string
	Password         string
	IsActive         int
	ProfileImage     string
	ProfileImagePath string
	CreatedOn        time.Time
	CreatedBy        int
	ModifiedOn       time.Time
	IsDeleted        int
	DeletedOn        time.Time
	ModifiedBy       int
	HouseNo          string
	Area             string
	City             string
	State            string
	Country          string
	ZipCode          string
	StreetAddress    string
	MemberID         int
}

type Ecommerce

type Ecommerce struct {
	AuthEnable       bool
	PermissionEnable bool
	AuthFlg          bool
	PermissionFlg    bool
	DB               *gorm.DB
	Auth             *auth.Auth
	Permissions      *role.PermissionConfig
}

func EcommerceSetup

func EcommerceSetup(config Config) *Ecommerce

EcommerceSetup used initialize Ecommerce configruation

func (*Ecommerce) AddToCart added in v0.0.2

func (Ecommerce *Ecommerce) AddToCart(cart EcommerceCart) (boolean bool, err error)

func (*Ecommerce) CheckCurrencyName added in v0.0.5

func (ecommerce *Ecommerce) CheckCurrencyName(id int, name string) (flgs bool, err error)

func (*Ecommerce) CheckCurrencySymbol added in v0.0.5

func (ecommerce *Ecommerce) CheckCurrencySymbol(id int, csymbol string) (flgs bool, err error)

func (*Ecommerce) CheckCurrencyType added in v0.0.5

func (ecommerce *Ecommerce) CheckCurrencyType(id int, currencytype string) (flgs bool, err error)

CheckCurrencyType

func (*Ecommerce) CheckDuplicateValue

func (ecommerce *Ecommerce) CheckDuplicateValue(memberid int, email string, username string, mobileno string) (bool, error)

To Check email , username, mobileno ia already exists

func (*Ecommerce) CheckPaymentName added in v0.0.5

func (ecommerce *Ecommerce) CheckPaymentName(id int, name string) (flgs bool, err error)

func (*Ecommerce) CheckSkuName

func (ecommerce *Ecommerce) CheckSkuName(sku string, id int) (bool, error)

check sku name already exists

func (*Ecommerce) CheckStatusName added in v0.0.5

func (ecommerce *Ecommerce) CheckStatusName(id int, name string) (flgs bool, err error)

func (*Ecommerce) CheckStatusPriority added in v0.0.5

func (ecommerce *Ecommerce) CheckStatusPriority(id int, priority int) (flgs bool, err error)

func (*Ecommerce) CreateCurrency added in v0.0.5

func (ecommerce *Ecommerce) CreateCurrency(Cc CreateCurrencyReq) error

Create Currency

func (*Ecommerce) CreateCustomer

func (ecommerce *Ecommerce) CreateCustomer(Cc CreateCustomerReq) error

func (*Ecommerce) CreateMember added in v0.0.3

func (ecommerce *Ecommerce) CreateMember(Cc CreateCustomerReq) (ccmember member.Tblmember, err error)

func (*Ecommerce) CreateOrderDetails added in v0.0.3

func (Ecommerce *Ecommerce) CreateOrderDetails(orderDetails OrderProduct) (err error)

func (*Ecommerce) CreateOrderPayment added in v0.0.3

func (Ecommerce *Ecommerce) CreateOrderPayment(orderPayment OrderPayment) (err error)

func (*Ecommerce) CreateOrderStatus added in v0.0.3

func (Ecommerce *Ecommerce) CreateOrderStatus(orderStatus TblEcomOrderStatus) (err error)

func (*Ecommerce) CreatePayment added in v0.0.5

func (ecommerce *Ecommerce) CreatePayment(Cp CreatePaymentReq) error

Create Payment

func (*Ecommerce) CreateProduct

func (ecommerce *Ecommerce) CreateProduct(Pc CreateProductReq) error

func (*Ecommerce) CreateSettings added in v0.0.5

func (ecommerce *Ecommerce) CreateSettings(Ss CreateSettingReq) error

Create Setting

func (*Ecommerce) CurrencyIsActive added in v0.0.5

func (ecommerce *Ecommerce) CurrencyIsActive(Cc CreateCurrencyReq) (flgs bool, err error)

func (*Ecommerce) CurrencyList added in v0.0.5

func (ecommerce *Ecommerce) CurrencyList(offset, limit int) (currencylists []TblEcomCurrency, err error)

Status List

func (*Ecommerce) CustomerInfo

func (ecommerce *Ecommerce) CustomerInfo(limit, offset, customerid int) (customers TblEcomCustomers, products []TblEcomProductOrders, totalcount int64, err error)

To get customer details

func (*Ecommerce) CustomerList

func (ecommerce *Ecommerce) CustomerList(limit, offset int, filter Filter) (customer []TblEcomCustomers, count int64, err error)

func (*Ecommerce) CustomerOrderInfo

func (ecommerce *Ecommerce) CustomerOrderInfo(uuid string) (productorder []TblEcomProducts, order TblEcomProductOrders, address ShippingAddress, laststatus string, err error)

To Get Customer order info details

func (*Ecommerce) DBconf

func (ecommerce *Ecommerce) DBconf() *member.Member

func (*Ecommerce) DeleteCurrency added in v0.0.5

func (ecommerce *Ecommerce) DeleteCurrency(id int, userid int) error

func (*Ecommerce) DeleteCustomer

func (ecommerce *Ecommerce) DeleteCustomer(id int, deletedby int) error

func (*Ecommerce) DeleteFromCartAfterOrder added in v0.0.3

func (Ecommerce *Ecommerce) DeleteFromCartAfterOrder(orderedproductIds []int, customerId int) (err error)

func (*Ecommerce) DeleteOrder

func (ecommerce *Ecommerce) DeleteOrder(id int, deletedby int) error

func (*Ecommerce) DeletePayment added in v0.0.5

func (ecommerce *Ecommerce) DeletePayment(id int, userid int) error

Delete Payment

func (*Ecommerce) DeleteProduct

func (ecommerce *Ecommerce) DeleteProduct(productid int, id int) error

func (*Ecommerce) EditCurrency added in v0.0.5

func (ecommerce *Ecommerce) EditCurrency(id int) (currencys TblEcomCurrency, err error)

func (*Ecommerce) EditCustomer

func (ecommerce *Ecommerce) EditCustomer(id int) (customers TblEcomCustomers, err error)

func (*Ecommerce) EditPayment added in v0.0.5

func (ecommerce *Ecommerce) EditPayment(id int) (payments TblEcomPayment, err error)

Edit Payment

func (*Ecommerce) EditProduct

func (ecommerce *Ecommerce) EditProduct(productid int) (products TblEcomProducts, discountprice []TblEcomProductPricings, price []TblEcomProductPricings, err error)

func (*Ecommerce) EditStatus added in v0.0.5

func (ecommerce *Ecommerce) EditStatus(id int) (statuss TblEcomStatus, err error)

Edit Status

func (*Ecommerce) GetCartListById added in v0.0.2

func (Ecommerce *Ecommerce) GetCartListById(customerId, limit, offset int) (cartList []EcommerceProduct, err error)

Get cart list

func (*Ecommerce) GetCartListCountById added in v0.0.5

func (Ecommerce *Ecommerce) GetCartListCountById(customerId int) (count int64, err error)

func (*Ecommerce) GetCustomer added in v0.0.5

func (Ecommerce *Ecommerce) GetCustomer(memberId int) (customer TblEcomCustomers, err error)

Get Customer details

func (*Ecommerce) GetCustomerDetailsById added in v0.0.7

func (Ecommerce *Ecommerce) GetCustomerDetailsById(memberId int) (customer CustomerDetails, err error)

Get Customer Details by Id

func (*Ecommerce) GetOrderByOrderId added in v0.0.3

func (Ecommerce *Ecommerce) GetOrderByOrderId(orderId string) (order EcommerceOrder, err error)

func (*Ecommerce) GetOrderStatusList added in v0.0.4

func (Ecommerce *Ecommerce) GetOrderStatusList() (orderStatus []OrderStatusNames, err error)

Get Order status list

func (*Ecommerce) GetProduct added in v0.0.5

func (Ecommerce *Ecommerce) GetProduct(productId int, productSlug string) (product EcommerceProduct, err error)

Get Product details

func (*Ecommerce) GetProductOrderDetailsById added in v0.0.7

func (Ecommerce *Ecommerce) GetProductOrderDetailsById(productId int, productSlug string, customerId int, orderId int) (product EcommerceProduct, productOrderStatus []OrderStatus, err error)

Get Product Order Details By Id

func (*Ecommerce) GetProductOrdersList added in v0.0.2

func (Ecommerce *Ecommerce) GetProductOrdersList(filter ProductFilter, sort ProductSort, customerId int, limit int, offset int) (orderedProductList []EcommerceProduct, count int64, err error)

Get product order list

func (*Ecommerce) GetProductdetailsById added in v0.0.5

func (Ecommerce *Ecommerce) GetProductdetailsById(productId int, productSlug string) (product EcommerceProduct, err error)

Get Product Details By ID

func (*Ecommerce) HashingPassword added in v0.0.2

func (ecommerce *Ecommerce) HashingPassword(pass string) string

Password Hasing

func (*Ecommerce) MultiDeleteProduct added in v0.0.4

func (ecommerce *Ecommerce) MultiDeleteProduct(productid []int, id int) error

func (*Ecommerce) MultiSelectCustomerDelete

func (ecommerce *Ecommerce) MultiSelectCustomerDelete(id []int, deletedby int) (flgs bool, err error)

multi customer delete

func (*Ecommerce) MultiSelectCustomersStatus

func (ecommerce *Ecommerce) MultiSelectCustomersStatus(customerid []int, status int) error

multi customer status change

func (*Ecommerce) MultiSelectOrdersDelete

func (ecommerce *Ecommerce) MultiSelectOrdersDelete(orderids []int, deletedby int) error

multi delete order

func (*Ecommerce) OrderInfo

func (ecommerce *Ecommerce) OrderInfo(id string) (orderlists TblEcomProductOrders, product []tblEcomProducts, Address OrderShippingAddress, count int, status []TblEcomOrderStatus, err error)

func (*Ecommerce) OrdersList

func (ecommerce *Ecommerce) OrdersList(offset int, limit int, filter Filter) (order []TblEcomProductOrders, count int64, err error)

pass limit , offset get orderslist

func (*Ecommerce) PaymentIsActive added in v0.0.5

func (ecommerce *Ecommerce) PaymentIsActive(Cp CreatePaymentReq) (flgs bool, err error)

Payment isactive

func (*Ecommerce) PaymentList added in v0.0.5

func (ecommerce *Ecommerce) PaymentList(offset, limit int) (paymentlists []TblEcomPayment, err error)

func (*Ecommerce) PlaceOrder added in v0.0.3

func (Ecommerce *Ecommerce) PlaceOrder(orderPlaced EcommerceOrder) (err error)

func (*Ecommerce) ProductsList

func (ecommerce *Ecommerce) ProductsList(offset int, limit int, filter Filter) (productlists []TblEcomProducts, totalcount int64, err error)

pass limit , offset get productslist

func (*Ecommerce) RemoveProductFromCartlist added in v0.0.2

func (Ecommerce *Ecommerce) RemoveProductFromCartlist(productId int, memberId int) (err error)

Remove product forom cart list

func (*Ecommerce) SelectProductsChangeStatus

func (ecommerce *Ecommerce) SelectProductsChangeStatus(status int, productid []int) error

product status change

func (*Ecommerce) StatusCreate added in v0.0.5

func (ecommerce *Ecommerce) StatusCreate(Cs CreateStatusReq) error

Create Status

func (*Ecommerce) StatusDelete added in v0.0.5

func (ecommerce *Ecommerce) StatusDelete(id int, userid int) error

Delete Status

func (*Ecommerce) StatusIsActive added in v0.0.5

func (ecommerce *Ecommerce) StatusIsActive(Cs CreateStatusReq) (flgs bool, err error)

Status IsActive

func (*Ecommerce) StatusList added in v0.0.5

func (ecommerce *Ecommerce) StatusList(offset, limit int) (statuslists []TblEcomStatus, err error)

Status List

func (*Ecommerce) StatusUpdate added in v0.0.5

func (ecommerce *Ecommerce) StatusUpdate(Cs CreateStatusReq) error

Update Status

func (*Ecommerce) StoreList added in v0.0.5

func (ecommerce *Ecommerce) StoreList() (storlis TblEcomSettings, err error)

Store list

func (*Ecommerce) UpdateCurrency added in v0.0.5

func (ecommerce *Ecommerce) UpdateCurrency(Cc CreateCurrencyReq) error

Update Currency

func (*Ecommerce) UpdateCustomer

func (ecommerce *Ecommerce) UpdateCustomer(Cc CreateCustomerReq) error

func (*Ecommerce) UpdateCustomerAndMemberDetails added in v0.0.7

func (Ecommerce *Ecommerce) UpdateCustomerAndMemberDetails(memberId int, memberDetails map[string]interface{}, customerDetails map[string]interface{}) (err error)

Update member and customer details

func (*Ecommerce) UpdateMember added in v0.0.10

func (ecommerce *Ecommerce) UpdateMember(Cc CreateCustomerReq, memberid int) error

func (*Ecommerce) UpdateOrderStatus

func (ecommerce *Ecommerce) UpdateOrderStatus(orderid, status int) error

Update Order status

func (*Ecommerce) UpdatePayment added in v0.0.5

func (ecommerce *Ecommerce) UpdatePayment(Cp CreatePaymentReq) error

Update Payment

func (*Ecommerce) UpdateProduct

func (ecommerce *Ecommerce) UpdateProduct(Pc CreateProductReq, removeoff []int) error

func (*Ecommerce) UpdateProductViewCount added in v0.0.3

func (Ecommerce *Ecommerce) UpdateProductViewCount(productId int, productSlug string) (err error)

update product count

func (*Ecommerce) UpdateSettings added in v0.0.5

func (ecommerce *Ecommerce) UpdateSettings(Ss CreateSettingReq) error

Create Setting

func (*Ecommerce) UpdateStock added in v0.0.3

func (Ecommerce *Ecommerce) UpdateStock(productId, quantity int) (err error)

type EcommerceCart added in v0.0.2

type EcommerceCart struct {
	ID         int
	ProductID  int
	CustomerID int
	Quantity   int
	CreatedOn  time.Time
	ModifiedOn *time.Time
	IsDeleted  int
	DeletedOn  *time.Time
}

type EcommerceModel

type EcommerceModel struct{}
var Ecommercemodel EcommerceModel

func (EcommerceModel) AddToCart added in v0.0.2

func (ecommerceModel EcommerceModel) AddToCart(count int64, cart EcommerceCart, DB *gorm.DB) error

Add to product in cart

func (EcommerceModel) ChangeDefaultValue added in v0.0.5

func (ecommerce EcommerceModel) ChangeDefaultValue(currency TblEcomCurrency, DB *gorm.DB) error

func (EcommerceModel) CheckCurrencyName added in v0.0.5

func (ecommerce EcommerceModel) CheckCurrencyName(id int, name string, currency TblEcomCurrency, DB *gorm.DB) (bool, error)

func (EcommerceModel) CheckCurrencySymbol added in v0.0.5

func (ecommerce EcommerceModel) CheckCurrencySymbol(id int, currencysymbol string, currency TblEcomCurrency, DB *gorm.DB) (bool, error)

func (EcommerceModel) CheckCurrencyType added in v0.0.5

func (ecommerce EcommerceModel) CheckCurrencyType(id int, ctype string, currency TblEcomCurrency, DB *gorm.DB) (bool, error)

func (EcommerceModel) CheckPaymentName added in v0.0.5

func (ecommerce EcommerceModel) CheckPaymentName(id int, name string, payment TblEcomPayment, DB *gorm.DB) (bool, error)

func (EcommerceModel) CheckStatusName added in v0.0.5

func (ecommerce EcommerceModel) CheckStatusName(id int, name string, status TblEcomStatus, DB *gorm.DB) (bool, error)

func (EcommerceModel) CheckStatusPriority added in v0.0.5

func (ecommerce EcommerceModel) CheckStatusPriority(id int, priority int, status TblEcomStatus, DB *gorm.DB) (bool, error)

func (EcommerceModel) CreateOrderDetails added in v0.0.3

func (ecommerce EcommerceModel) CreateOrderDetails(orderDetails OrderProduct, DB *gorm.DB) (err error)

create order

func (EcommerceModel) CreateOrderPayment added in v0.0.3

func (ecommerce EcommerceModel) CreateOrderPayment(orderpayment OrderPayment, DB *gorm.DB) (err error)

create order payment

func (EcommerceModel) CreateOrderStatus

func (ecommerceModel EcommerceModel) CreateOrderStatus(status TblEcomOrderStatus, DB *gorm.DB) error

func (EcommerceModel) CreateProductPricing

func (ecommerceModel EcommerceModel) CreateProductPricing(pricing TblEcomProductPricings, DB *gorm.DB) error

func (EcommerceModel) CreateSetting added in v0.0.5

func (ecommerce EcommerceModel) CreateSetting(setting TblEcomSettings, DB *gorm.DB) error

Create Setting

func (EcommerceModel) CreateStatus added in v0.0.5

func (ecommerce EcommerceModel) CreateStatus(status TblEcomStatus, DB *gorm.DB) error

Create Status

func (EcommerceModel) CurrencyCreate added in v0.0.5

func (ecommerce EcommerceModel) CurrencyCreate(money TblEcomCurrency, DB *gorm.DB) error

Create Currency

func (EcommerceModel) CurrencyDelete added in v0.0.5

func (ecommerce EcommerceModel) CurrencyDelete(money TblEcomCurrency, DB *gorm.DB) error

func (EcommerceModel) CurrencyGet added in v0.0.5

func (ecommerce EcommerceModel) CurrencyGet(id int, DB *gorm.DB) (currency TblEcomCurrency, err error)

func (EcommerceModel) CurrencyLists added in v0.0.5

func (ecommerce EcommerceModel) CurrencyLists(offset, limit int, DB *gorm.DB) (money []TblEcomCurrency, err error)

Get Order list

func (EcommerceModel) CustomerCreate

func (ecommerceModel EcommerceModel) CustomerCreate(customer TblEcomCustomers, DB *gorm.DB) error

func (EcommerceModel) CustomerDelete

func (ecommerceModel EcommerceModel) CustomerDelete(customer TblEcomCustomers, DB *gorm.DB) error

func (EcommerceModel) CustomerEdit

func (ecommerceModel EcommerceModel) CustomerEdit(id int, DB *gorm.DB) (customer TblEcomCustomers, err error)

func (EcommerceModel) CustomerUpdate

func (ecommerceModel EcommerceModel) CustomerUpdate(customer TblEcomCustomers, DB *gorm.DB) error

func (EcommerceModel) CustomersList

func (ecommerceModel EcommerceModel) CustomersList(offset int, limit int, filter Filter, DB *gorm.DB) (customer []TblEcomCustomers, totalcustomer int64, err error)

pass limit , offset get customerlist

func (EcommerceModel) DeleteFromCartAfterOrder added in v0.0.3

func (ecommerce EcommerceModel) DeleteFromCartAfterOrder(orderedProductIds []int, customerId int, DB *gorm.DB) (err error)

Delete form cart after order

func (EcommerceModel) DeletePayment added in v0.0.5

func (ecommerce EcommerceModel) DeletePayment(payment TblEcomPayment, DB *gorm.DB) error

func (EcommerceModel) DeleteSelectedProducts

func (ecommerceModel EcommerceModel) DeleteSelectedProducts(product TblEcomProducts, productIds []int, DB *gorm.DB) error

func (EcommerceModel) DeleteSingleProducts added in v0.0.4

func (ecommerceModel EcommerceModel) DeleteSingleProducts(product TblEcomProducts, DB *gorm.DB) error

func (EcommerceModel) DeleteStatus added in v0.0.5

func (ecommerce EcommerceModel) DeleteStatus(status TblEcomStatus, DB *gorm.DB) error

func (EcommerceModel) FindDefault added in v0.0.5

func (ecommerce EcommerceModel) FindDefault(DB *gorm.DB) (money TblEcomCurrency, err error)

Create Currency

func (EcommerceModel) GetCartCount added in v0.0.2

func (ecommerce EcommerceModel) GetCartCount(customerId int, productId int, DB *gorm.DB) (count int64, err error)

Get Cart Count

func (EcommerceModel) GetCartListById added in v0.0.2

func (ecommerce EcommerceModel) GetCartListById(customerId int, limit int, offset int, DB *gorm.DB) (cartList []EcommerceProduct, err error)

Get Cart list

func (EcommerceModel) GetCartListCountById added in v0.0.5

func (ecommerce EcommerceModel) GetCartListCountById(customerId int, DB *gorm.DB) (count int64, err error)

func (EcommerceModel) GetCustomer added in v0.0.5

func (ecommerceModel EcommerceModel) GetCustomer(memberId int, DB *gorm.DB) (customer TblEcomCustomers, err error)

Get Customer details

func (EcommerceModel) GetCustomerDetails

func (ecommerceModel EcommerceModel) GetCustomerDetails(id int, DB *gorm.DB) (customer TblEcomCustomers, err error)

Get Customer details pass customerid

func (EcommerceModel) GetCustomerDetailsById added in v0.0.7

func (ecommerce EcommerceModel) GetCustomerDetailsById(memberId int, DB *gorm.DB) (customer CustomerDetails, err error)

get Customer Details by Id

func (EcommerceModel) GetOrderByOrderId added in v0.0.3

func (ecommerce EcommerceModel) GetOrderByOrderId(orderId string, DB *gorm.DB) (order EcommerceOrder, err error)

get order list

func (EcommerceModel) GetOrderDetailsbyCustomerId

func (ecommerceModel EcommerceModel) GetOrderDetailsbyCustomerId(limit, offset int, customerid int, DB *gorm.DB) (order []TblEcomProductOrders, totalorder int64, err error)

Get order details pass customer id

func (EcommerceModel) GetOrderDetailsbyuuid

func (ecommerceModel EcommerceModel) GetOrderDetailsbyuuid(uuid string, DB *gorm.DB) (order TblEcomProductOrders, err error)

func (EcommerceModel) GetOrderStatusList added in v0.0.4

func (ecommerce EcommerceModel) GetOrderStatusList(DB *gorm.DB) (orderStatus []OrderStatusNames, err error)

Get Status list

func (EcommerceModel) GetProduct added in v0.0.5

func (ecommerceModel EcommerceModel) GetProduct(productId int, productSlug string, DB *gorm.DB) (product EcommerceProduct, err error)

Get Product details

func (EcommerceModel) GetProductDetailsAndOrderStatus added in v0.0.7

func (ecommerce EcommerceModel) GetProductDetailsAndOrderStatus(productId int, productSlug string, customerId int, orderId int, DB *gorm.DB) (product EcommerceProduct, productOrderStatus []OrderStatus, err error)

Get Product Details and Order status by Id

func (EcommerceModel) GetProductOrdersList added in v0.0.2

func (ecommerce EcommerceModel) GetProductOrdersList(filter ProductFilter, sort ProductSort, customerId int, limit int, offset int, DB *gorm.DB) (productOrdersList []EcommerceProduct, count int64, err error)

Get Product order list

func (EcommerceModel) GetProductdetailsById added in v0.0.5

func (ecommerce EcommerceModel) GetProductdetailsById(productId int, productSlug string, DB *gorm.DB) (product EcommerceProduct, err error)

func (EcommerceModel) GetProductdetailsByOrderId

func (ecommerceModel EcommerceModel) GetProductdetailsByOrderId(orderid int, DB *gorm.DB) (orders []TblEcomProductOrderDetails, err error)

func (EcommerceModel) GetProductdetailsByProductId

func (ecommerceModel EcommerceModel) GetProductdetailsByProductId(productid []int, DB *gorm.DB) (product []TblEcomProducts, err error)

func (EcommerceModel) InActiveCurrency added in v0.0.5

func (ecommerce EcommerceModel) InActiveCurrency(money TblEcomCurrency, DB *gorm.DB) (bool, error)

func (EcommerceModel) MultiSelectCustomerIsactive

func (ecommerceModel EcommerceModel) MultiSelectCustomerIsactive(customer TblEcomCustomers, customerid []int, DB *gorm.DB) error

func (EcommerceModel) MultiSelectDeleteCustomers

func (ecommerceModel EcommerceModel) MultiSelectDeleteCustomers(customer TblEcomCustomers, customerid []int, DB *gorm.DB) (flg bool, err error)

Multiple delete

func (EcommerceModel) MultiSelectDeleteOrder

func (ecommerceModel EcommerceModel) MultiSelectDeleteOrder(order TblEcomProductOrders, id []int, DB *gorm.DB) error

MULTISELECT ORDER DELETE

func (EcommerceModel) OrderDelete

func (ecommerceModel EcommerceModel) OrderDelete(productorder TblEcomProductOrders, DB *gorm.DB) error

Delete the order

func (EcommerceModel) OrderEdit

func (ecommerceModel EcommerceModel) OrderEdit(id string, DB *gorm.DB) (productord TblEcomProductOrders, err error)

func (EcommerceModel) OrderList

func (ecommerceModel EcommerceModel) OrderList(offset int, limit int, filter Filter, DB *gorm.DB) (tblorders []TblEcomProductOrders, ordercount int64, err error)

Order list

func (EcommerceModel) OrderStatusDetails added in v0.0.12

func (ecommerceModel EcommerceModel) OrderStatusDetails(id string, DB *gorm.DB) (status []TblEcomOrderStatus, err error)

func (EcommerceModel) OrderStatusIsActive added in v0.0.5

func (ecommerce EcommerceModel) OrderStatusIsActive(status TblEcomStatus, DB *gorm.DB) (bool, error)

func (EcommerceModel) OrderStatusUpdate

func (ecommerceModel EcommerceModel) OrderStatusUpdate(orderstatus TblEcomProductOrders, DB *gorm.DB) error

func (EcommerceModel) PaymentCreate added in v0.0.5

func (ecommerce EcommerceModel) PaymentCreate(pay TblEcomPayment, DB *gorm.DB) error

Create Payment

func (EcommerceModel) PaymentGet added in v0.0.5

func (ecommerce EcommerceModel) PaymentGet(id int, DB *gorm.DB) (payment TblEcomPayment, err error)

Edit Payment

func (EcommerceModel) PaymentIsActive added in v0.0.5

func (ecommerce EcommerceModel) PaymentIsActive(pay TblEcomPayment, DB *gorm.DB) (bool, error)

func (EcommerceModel) PaymentLists added in v0.0.5

func (ecommerce EcommerceModel) PaymentLists(offset, limit int, DB *gorm.DB) (pay []TblEcomPayment, err error)

Get payment list

func (EcommerceModel) PlaceOrder added in v0.0.3

func (ecommerce EcommerceModel) PlaceOrder(orderPlaced EcommerceOrder, DB *gorm.DB) (err error)

func (EcommerceModel) ProductCreate

func (ecommerceModel EcommerceModel) ProductCreate(product TblEcomProducts, DB *gorm.DB) (products TblEcomProducts, err error)

Create Product

func (EcommerceModel) ProductDetailsByProductId

func (ecommerceModel EcommerceModel) ProductDetailsByProductId(productid int, DB *gorm.DB) (product TblEcomProducts, err error)

Get Product details pass product id

func (EcommerceModel) ProductList

func (ecommerceModel EcommerceModel) ProductList(offset int, limit int, filter Filter, DB *gorm.DB) (tblproducts []TblEcomProducts, productcount int64, err error)

func (EcommerceModel) ProductPricingByProductId

func (ecommerceModel EcommerceModel) ProductPricingByProductId(productid int, DB *gorm.DB) (pricings []TblEcomProductPricings, err error)

Get product price pass product id

func (EcommerceModel) RemoveOffers

func (ecommerceModel EcommerceModel) RemoveOffers(price TblEcomProductPricings, deloffers []int, DB *gorm.DB) error

Delete offers

func (EcommerceModel) RemoveProductFromCartlist added in v0.0.2

func (ecommerce EcommerceModel) RemoveProductFromCartlist(productId int, memberId int, DB *gorm.DB) (err error)

func (EcommerceModel) SelectProductsChangeStatus

func (ecommerceModel EcommerceModel) SelectProductsChangeStatus(productIds []int, product TblEcomProducts, DB *gorm.DB) error

func (EcommerceModel) SkuNameCheck

func (ecommerceModel EcommerceModel) SkuNameCheck(product TblEcomProducts, skuname string, productid int, DB *gorm.DB) (bool, error)

func (EcommerceModel) StatusGet added in v0.0.5

func (ecommerce EcommerceModel) StatusGet(id int, DB *gorm.DB) (status TblEcomStatus, err error)

func (EcommerceModel) StatusLists added in v0.0.5

func (ecommerce EcommerceModel) StatusLists(offset, limit int, DB *gorm.DB) (status []TblEcomStatus, err error)

Get Status list

func (EcommerceModel) StoreLists added in v0.0.5

func (ecommerce EcommerceModel) StoreLists(DB *gorm.DB) (setting TblEcomSettings, err error)

Get Store list

func (EcommerceModel) UpdateCurrency added in v0.0.5

func (ecommerce EcommerceModel) UpdateCurrency(money TblEcomCurrency, DB *gorm.DB) error

func (EcommerceModel) UpdateCustomerDetails added in v0.0.7

func (ecommerce EcommerceModel) UpdateCustomerDetails(memberId int, customerDetails map[string]interface{}, DB *gorm.DB) (err error)

Update Customer Details

func (EcommerceModel) UpdateMemberDetails added in v0.0.7

func (ecommerce EcommerceModel) UpdateMemberDetails(memberId int, memberDetails map[string]interface{}, DB *gorm.DB) (err error)

Update Member details

func (EcommerceModel) UpdatePayment added in v0.0.5

func (ecommerce EcommerceModel) UpdatePayment(pay TblEcomPayment, DB *gorm.DB) error

func (EcommerceModel) UpdateProductPricing

func (ecommerceModel EcommerceModel) UpdateProductPricing(pricing TblEcomProductPricings, DB *gorm.DB) error

func (EcommerceModel) UpdateProductViewCount added in v0.0.3

func (ecommerce EcommerceModel) UpdateProductViewCount(productId int, productSlug string, DB *gorm.DB) (err error)

update product view

func (EcommerceModel) UpdateProducts

func (ecommerceModel EcommerceModel) UpdateProducts(product TblEcomProducts, DB *gorm.DB) error

Update Product

func (EcommerceModel) UpdateSetting added in v0.0.5

func (ecommerce EcommerceModel) UpdateSetting(setting TblEcomSettings, DB *gorm.DB) error

Update Setting

func (EcommerceModel) UpdateStatus added in v0.0.5

func (ecommerce EcommerceModel) UpdateStatus(status TblEcomStatus, DB *gorm.DB) error

func (EcommerceModel) UpdateStock added in v0.0.3

func (ecommerce EcommerceModel) UpdateStock(productId int, quantity int, DB *gorm.DB) (err error)

update stock

type EcommerceOrder added in v0.0.3

type EcommerceOrder struct {
	Id              int
	OrderId         string
	CustomerId      int
	Status          string
	ShippingAddress string
	IsDeleted       int
	CreatedOn       time.Time
	ModifiedOn      time.Time
	Price           int
	Tax             int
	TotalCost       int
}

type EcommerceProduct added in v0.0.2

type EcommerceProduct struct {
	ID                 int
	CategoriesID       int
	ProductName        string
	ProductSlug        string
	ProductDescription string
	ProductImagePath   string
	ProductYoutubePath string
	ProductVimeoPath   string
	Sku                string
	Tax                int
	Totalcost          int
	IsActive           int
	CreatedOn          time.Time
	CreatedBy          int
	ModifiedOn         time.Time
	ModifiedBy         int
	IsDeleted          int
	DeletedBy          int
	DeletedOn          time.Time
	ViewCount          int
	DefaultPrice       int
	DiscountPrice      int
	SpecialPrice       int
	ProductImageArray  []string
	EcommerceCart      EcommerceCart
	OrderID            int
	OrderUniqueID      string
	OrderQuantity      int
	OrderPrice         int
	OrderTax           int
	OrderStatus        string
	OrderCustomer      int
	OrderTime          time.Time
	PaymentMode        string
	ShippingDetails    string
}

type Filter

type Filter struct {
	Keyword      string
	Status       string
	Orderid      string
	Customername string
	IsActive     string
	FirstName    string
	MemberId     int
	ProductName  string
	CategoryId   int
	OrderStatus  int
	PriceRange   string
}

type OrderPayment added in v0.0.3

type OrderPayment struct {
	Id          int
	OrderId     int
	PaymentMode string
}

type OrderProduct added in v0.0.3

type OrderProduct struct {
	Id        int
	OrderId   int
	ProductId int
	Quantity  int
	Price     int
	Tax       int
}

type OrderShippingAddress added in v0.0.4

type OrderShippingAddress struct {
	Name    string `json:"name"`
	Area    string `json:"area"`
	Number  string `json:"number"`
	Email   string `json:"email"`
	HouseNo string `json:"houseno"`
	City    string `json:"city"`
	Country string `json:"country"`
	States  string `json:"states"`
}

type OrderStatus added in v0.0.3

type OrderStatus struct {
	Id          int
	OrderId     int
	OrderStatus int
	CreatedBy   int
	CreatedOn   time.Time
}

type OrderStatusNames added in v0.0.3

type OrderStatusNames struct {
	Id          int
	Status      string
	Priority    int
	ColorCode   string
	Description string
	IsActive    int
	CreatedBy   int
	CreatedOn   time.Time
	ModifiedBy  int
	ModifiedOn  time.Time
	IsDeleted   int
}

type ProductFilter added in v0.0.2

type ProductFilter struct {
	Status, SearchKeyword, OrderId, StartingDate, EndingDate string
	StartingPrice, EndingPrice, OrderHistory, UpcomingOrders int
}

type ProductSort added in v0.0.2

type ProductSort struct {
	Price int
	Date  int
}

type ShippingAddress added in v0.0.2

type ShippingAddress struct {
	Name    string `json:"name"`
	Area    string `json:"area"`
	Number  string `json:"number"`
	Email   string `json:"email"`
	HouseNo string `json:"houseno"`
	City    string `json:"city"`
	Country string `json:"country"`
	States  string `json:"states"`
}

type TblEcomCurrency added in v0.0.5

type TblEcomCurrency struct {
	Id              int    `gorm:"primaryKey;auto_increment;type:serial"`
	CurrencyName    string `gorm:"type:character varying"`
	CurrencyType    string `gorm:"type:character varying"`
	CurrencySymbol  string `gorm:"type:character varying"`
	IsActive        int    `gorm:"type:integer"`
	CurrencyDefault int    `gorm:"type:integer"`
	CreatedOn       time.Time
	CreatedBy       int
	ModifiedOn      time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedBy      int       `gorm:"DEFAULT:NULL"`
	IsDeleted       int       `gorm:"type:integer"`
	DeletedOn       time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	DeletedBy       int       `gorm:"type:integer"`
	DateString      string    `gorm:"-"`
}

type TblEcomCustomers

type TblEcomCustomers struct {
	Id               int       `gorm:"primaryKey;auto_increment;type:serial"`
	MemberId         int       `gorm:"type:integer"`
	FirstName        string    `gorm:"type:character varying"`
	LastName         string    `gorm:"type:character varying"`
	Email            string    `gorm:"type:character varying"`
	MobileNo         string    `gorm:"type:character varying"`
	Username         string    `gorm:"type:character varying"`
	Password         string    `gorm:"type:character varying"`
	StreetAddress    string    `gorm:"type:character varying"`
	City             string    `gorm:"type:character varying"`
	State            string    `gorm:"type:character varying"`
	Country          string    `gorm:"type:character varying"`
	ZipCode          string    `gorm:"type:character varying"`
	IsActive         int       `gorm:"type:integer"`
	CreatedOn        time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	CreatedBy        int       `gorm:"type:integer"`
	ModifiedOn       time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedBy       int       `gorm:"DEFAULT:NULL"`
	IsDeleted        int       `gorm:"type:integer"`
	DeletedOn        time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	DeletedBy        int       `gorm:"type:integer;DEFAULT:NULL"`
	Count            int       `gorm:"-:migration;<-:false"`
	ProfileImage     string    `gorm:"type:character varying"`
	ProfileImagePath string    `gorm:"type:character varying"`
	NameString       string    `gorm:"-:migration;<-:false"`
	ShippingAddress  string    `gorm:"-:migration;<-:false"`
}

type TblEcomOrderStatus added in v0.0.12

type TblEcomOrderStatus struct {
	Id          int       `gorm:"primaryKey;auto_increment;type:serial"`
	OrderId     int       `gorm:"type:integer"`
	OrderStatus int       `gorm:"type:integer"`
	CreatedBy   int       `gorm:"type:integer"`
	CreatedOn   time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	CreatedDate string    `gorm:"-:migration;<-:false"`
}

type TblEcomPayment added in v0.0.5

type TblEcomPayment struct {
	Id           int    `gorm:"primaryKey;auto_increment;type:serial"`
	PaymentName  string `gorm:"type:character varying"`
	Description  string `gorm:"type:character varying"`
	PaymentImage string `gorm:"type:character varying"`
	IsActive     int    `gorm:"type:integer"`
	CreatedOn    time.Time
	CreatedBy    int
	ModifiedOn   time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedBy   int       `gorm:"DEFAULT:NULL"`
	IsDeleted    int       `gorm:"type:integer"`
	DeletedOn    time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	DeletedBy    int       `gorm:"type:integer"`
}

type TblEcomProductOrderDetails

type TblEcomProductOrderDetails struct {
	Id         int `gorm:"primaryKey;auto_increment;type:serial"`
	Order_id   int `gorm:"type:integer"`
	Product_id int `gorm:"type:integer"`
	Quantity   int `gorm:"type:integer"`
	Price      int `gorm:"type:integer"`
}

type TblEcomProductOrders

type TblEcomProductOrders struct {
	Id              int                  `gorm:"primaryKey;auto_increment;type:serial"`
	Uuid            string               `gorm:"type:character varying"`
	CustomerId      int                  `gorm:"type:integer"`
	OrderStatus     int                  `gorm:"type:integer"`
	ShippingAddress string               `gorm:"type:character varying"`
	IsDeleted       int                  `gorm:"type:integer"`
	Username        string               `gorm:"-:migration;<-:false"`
	Email           string               `gorm:"-:migration;<-:false"`
	MobileNo        string               `gorm:"-:migration;<-:false"`
	StreetAddress   string               `gorm:"-:migration;<-:false"`
	City            string               `gorm:"-:migration;<-:false"`
	State           string               `gorm:"-:migration;<-:false"`
	Country         string               `gorm:"-:migration;<-:false"`
	ZipCode         string               `gorm:"-:migration;<-:false"`
	CreatedOn       time.Time            `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedOn      time.Time            `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedDate    string               `gorm:"-:migration"`
	CreatedDate     string               `gorm:"-:migration"`
	Price           int                  `gorm:"type:integer"`
	Tax             int                  `gorm:"type:integer"`
	TotalCost       int                  `gorm:"type:integer"`
	FirstName       string               `gorm:"-:migration;<-:false"`
	LastName        string               `gorm:"-:migration;<-:false"`
	NameString      string               `gorm:"-:migration;<-:false"`
	Orders          []TblEcomOrderStatus `gorm:"foreignKey:OrderId;references:Id"`
	StatusValue     string               `gorm:"-:migration;<-:false"`
	StatusPriority  int                  `gorm:"-:migration;<-:false"`
	StatusColor     string               `gorm:"-:migration;<-:false"`
	DeletedOn       time.Time            `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	DeletedBy       int                  `gorm:"type:integer;DEFAULT:NULL"`
}

type TblEcomProductPricings

type TblEcomProductPricings struct {
	Id        int `gorm:"primaryKey;auto_increment;type:serial"`
	ProductId int
	Priority  int
	Price     int
	StartDate time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	EndDate   time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	Type      string
	IsDeleted int       `gorm:"DEFAULT:0"`
	Startdate string    `gorm:"-:migration;<-:false"`
	Enddate   string    `gorm:"-:migration;<-:false"`
	DeletedOn time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	DeletedBy int       `gorm:"type:integer;DEFAULT:NULL"`
}

type TblEcomProducts

type TblEcomProducts struct {
	Id                 int `gorm:"primaryKey;auto_increment;type:serial"`
	CategoriesId       string
	ProductName        string
	ProductDescription string
	ProductImagePath   string
	ProductYoutubePath string
	ProductVimeoPath   string
	Sku                string
	ProductPrice       int
	Tax                int
	Totalcost          int
	Priority           int       `gorm:"-:migration;<-:false"`
	Price              int       `gorm:"-:migration;<-:false"`
	StartDate          time.Time `gorm:"-:migration;<-:false"`
	EndDate            time.Time `gorm:"-:migration;<-:false"`
	Type               string    `gorm:"-:migration;<-:false"`
	Quantity           int       `gorm:"-:migration;<-:false"`
	Order_id           int       `gorm:"-:migration;<-:false"`
	Product_id         int       `gorm:"-:migration;<-:false"`
	Quantityprice      int       `gorm:"-:migration;<-:false"`
	IsActive           int
	Stock              int
	CreatedOn          time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	CreatedBy          int       `gorm:"DEFAULT:NULL"`
	ModifiedOn         time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedBy         int       `gorm:"DEFAULT:NULL"`
	IsDeleted          int       `gorm:"DEFAULT:0"`
	DeletedOn          time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	DeletedBy          int       `gorm:"type:integer;DEFAULT:NULL"`
	Imgpath            []string  `gorm:"-"`
}

type TblEcomSettings added in v0.0.5

type TblEcomSettings struct {
	Id              int       `gorm:"primaryKey;auto_increment;type:serial"`
	StoreName       string    `gorm:"type:character varying"`
	DisplayStock    int       `gorm:"type:integer"`
	StockWarning    int       `gorm:"type:integer"`
	StockCheckout   int       `gorm:"type:integer"`
	CurrencyDefault int       `gorm:"type:integer"`
	PaymentDefault  int       `gorm:"type:integer"`
	StatusDefault   int       `gorm:"type:integer"`
	CreatedOn       time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	CreatedBy       int
	ModifiedOn      time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedBy      int       `gorm:"DEFAULT:NULL"`
}

type TblEcomStatus added in v0.0.5

type TblEcomStatus struct {
	Id          int    `gorm:"primaryKey;auto_increment;type:serial"`
	Status      string `gorm:"type:character varying"`
	Description string `gorm:"type:character varying"`
	IsActive    int    `gorm:"type:integer"`
	Priority    int    `gorm:"type:integer"`
	ColorCode   string `gorm:"type:character varying"`
	CreatedOn   time.Time
	CreatedBy   int
	ModifiedOn  time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	ModifiedBy  int       `gorm:"DEFAULT:NULL"`
	IsDeleted   int       `gorm:"type:integer"`
	DeletedOn   time.Time `gorm:"type:timestamp without time zone;DEFAULT:NULL"`
	DeletedBy   int       `gorm:"type:integer"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL