Documentation ¶
Index ¶
- type CartAPIController
- func (cc *CartAPIController) AddAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) ApplyCombinedVoucherGift(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) ApplyGiftCardAndGetAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) ApplyVoucherAndGetAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) BillingAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) DeleteCartAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) DeleteDelivery(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) GetAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) Inject(responder *web.Responder, ApplicationCartService *application.CartService, ...)
- func (cc *CartAPIController) RemoveGiftCardAndGetAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) RemoveVoucherAndGetAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartAPIController) UpdateDeliveryInfoAction(ctx context.Context, r *web.Request) web.Result
- type CartAPIResult
- type CartViewActionData
- type CartViewController
- func (cc *CartViewController) AddAndViewAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartViewController) CleanAndViewAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartViewController) CleanDeliveryAndViewAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartViewController) DeleteAllAndViewAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartViewController) DeleteAndViewAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartViewController) Inject(responder *web.Responder, applicationCartService *application.CartService, ...)
- func (cc *CartViewController) UpdateQtyAndViewAction(ctx context.Context, r *web.Request) web.Result
- func (cc *CartViewController) ViewAction(ctx context.Context, r *web.Request) web.Result
- type CartViewData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CartAPIController ¶
type CartAPIController struct {
// contains filtered or unexported fields
}
CartAPIController for cart api
func (*CartAPIController) ApplyCombinedVoucherGift ¶
func (cc *CartAPIController) ApplyCombinedVoucherGift(ctx context.Context, r *web.Request) web.Result
ApplyCombinedVoucherGift applies a given code (which might be either a voucher or a giftcard code) to the cartService and returns the cart
func (*CartAPIController) ApplyGiftCardAndGetAction ¶
func (cc *CartAPIController) ApplyGiftCardAndGetAction(ctx context.Context, r *web.Request) web.Result
ApplyGiftCardAndGetAction applies the given giftcard and returns the cart the request needs a query string param "couponCode" which includes the corresponding giftcard code
func (*CartAPIController) ApplyVoucherAndGetAction ¶
func (cc *CartAPIController) ApplyVoucherAndGetAction(ctx context.Context, r *web.Request) web.Result
ApplyVoucherAndGetAction applies the given voucher and returns the cart
func (*CartAPIController) BillingAction ¶
BillingAction handles the checkout start action
func (*CartAPIController) DeleteCartAction ¶
DeleteCartAction cleans the cart and returns the cleaned cart
func (*CartAPIController) DeleteDelivery ¶
DeleteDelivery cleans the given delivery from the cart and returns the cleaned cart
func (*CartAPIController) Inject ¶
func (cc *CartAPIController) Inject( responder *web.Responder, ApplicationCartService *application.CartService, ApplicationCartReceiverService *application.CartReceiverService, billingAddressFormController *forms.BillingAddressFormController, deliveryFormController *forms.DeliveryFormController, Logger flamingo.Logger, )
Inject dependencies
func (*CartAPIController) RemoveGiftCardAndGetAction ¶
func (cc *CartAPIController) RemoveGiftCardAndGetAction(ctx context.Context, r *web.Request) web.Result
RemoveGiftCardAndGetAction removes the given giftcard and returns the cart the request needs a query string param "couponCode" which includes the corresponding giftcard code
func (*CartAPIController) RemoveVoucherAndGetAction ¶
func (cc *CartAPIController) RemoveVoucherAndGetAction(ctx context.Context, r *web.Request) web.Result
RemoveVoucherAndGetAction removes the given voucher and returns the cart
func (*CartAPIController) UpdateDeliveryInfoAction ¶
func (cc *CartAPIController) UpdateDeliveryInfoAction(ctx context.Context, r *web.Request) web.Result
UpdateDeliveryInfoAction updates the delivery info
type CartAPIResult ¶
type CartAPIResult struct { //Contains details if success is false Error *resultError Success bool Data interface{} DataValidationInfo *formDomain.ValidationInfo CartValidationResult *validation.Result }
CartAPIResult view data
func (*CartAPIResult) SetError ¶
func (r *CartAPIResult) SetError(err error, fallbackCode string) *CartAPIResult
SetError updates the cart error field
func (*CartAPIResult) SetErrorByCode ¶
func (r *CartAPIResult) SetErrorByCode(message string, code string) *CartAPIResult
SetErrorByCode - sets the error on the CartApiResult data and success to false
type CartViewActionData ¶
type CartViewActionData struct {
AddToCartProductsData []productDomain.BasicProductData
}
CartViewActionData for rendering results
type CartViewController ¶
type CartViewController struct {
// contains filtered or unexported fields
}
CartViewController for carts
func (*CartViewController) AddAndViewAction ¶
AddAndViewAction the DecoratedCart View ( / cart)
func (*CartViewController) CleanAndViewAction ¶
CleanAndViewAction empties the cart and shows it
func (*CartViewController) CleanDeliveryAndViewAction ¶
func (cc *CartViewController) CleanDeliveryAndViewAction(ctx context.Context, r *web.Request) web.Result
CleanDeliveryAndViewAction empties a single delivery and shows it
func (*CartViewController) DeleteAllAndViewAction ¶
func (cc *CartViewController) DeleteAllAndViewAction(ctx context.Context, r *web.Request) web.Result
DeleteAllAndViewAction empties the cart and shows it
func (*CartViewController) DeleteAndViewAction ¶
DeleteAndViewAction the DecoratedCart View ( / cart)
func (*CartViewController) Inject ¶
func (cc *CartViewController) Inject( responder *web.Responder, applicationCartService *application.CartService, applicationCartReceiverService *application.CartReceiverService, router *web.Router, logger flamingo.Logger, config *struct { ShowEmptyCartPageIfNoItems bool `inject:"config:commerce.cart.showEmptyCartPageIfNoItems,optional"` AdjustItemsToRestrictedQty bool `inject:"config:commerce.cart.adjustItemsToRestrictedQty,optional"` }, )
Inject dependencies
func (*CartViewController) UpdateQtyAndViewAction ¶
func (cc *CartViewController) UpdateQtyAndViewAction(ctx context.Context, r *web.Request) web.Result
UpdateQtyAndViewAction the DecoratedCart View ( / cart)
func (*CartViewController) ViewAction ¶
ViewAction the DecoratedCart View ( / cart)
type CartViewData ¶
type CartViewData struct { DecoratedCart decorator.DecoratedCart CartValidationResult validation.Result AddToCartProductsData []productDomain.BasicProductData CartRestrictionError application.RestrictionError }
CartViewData is used for cart views/templates