controller

package
v3.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: OSL-3.0 Imports: 10 Imported by: 1

Documentation

Index

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) AddAction

func (cc *CartAPIController) AddAction(ctx context.Context, r *web.Request) web.Result

AddAction Add Item to cart

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

func (cc *CartAPIController) BillingAction(ctx context.Context, r *web.Request) web.Result

BillingAction handles the checkout start action

func (*CartAPIController) DeleteCartAction

func (cc *CartAPIController) DeleteCartAction(ctx context.Context, r *web.Request) web.Result

DeleteCartAction cleans the cart and returns the cleaned cart

func (*CartAPIController) DeleteDelivery

func (cc *CartAPIController) DeleteDelivery(ctx context.Context, r *web.Request) web.Result

DeleteDelivery cleans the given delivery from the cart and returns the cleaned cart

func (*CartAPIController) GetAction

func (cc *CartAPIController) GetAction(ctx context.Context, r *web.Request) web.Result

GetAction Get JSON Format of API

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) 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
	CartTeaser           *cart.Teaser
	Data                 interface{}
	DataValidationInfo   *formDomain.ValidationInfo
	CartValidationResult *cart.ValidationResult
}

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

func (cc *CartViewController) AddAndViewAction(ctx context.Context, r *web.Request) web.Result

AddAndViewAction the DecoratedCart View ( / cart)

func (*CartViewController) CleanAndViewAction

func (cc *CartViewController) CleanAndViewAction(ctx context.Context, r *web.Request) web.Result

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

func (cc *CartViewController) DeleteAndViewAction(ctx context.Context, r *web.Request) web.Result

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"`
	},
)

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

func (cc *CartViewController) ViewAction(ctx context.Context, r *web.Request) web.Result

ViewAction the DecoratedCart View ( / cart)

type CartViewData

type CartViewData struct {
	DecoratedCart         cartDomain.DecoratedCart
	CartValidationResult  cartDomain.ValidationResult
	AddToCartProductsData []productDomain.BasicProductData
}

CartViewData is used for cart views/templates

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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