controller

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: OSL-3.0 Imports: 12 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) 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

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) 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
	CartTeaser           *cart.Teaser
	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

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"`
		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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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