CheckoutManager
class CheckoutManager implements CheckoutManagerInterface, BasicEntityManagerInterface, JQGridInterface
Class CheckoutManager is injected as alligator.checkout_manager service. CheckoutManager handles the logic for managed entity.
Properties
| protected OrderManager | $orderManager | ||
| protected ProductManager | $productManager | ||
| protected ShippingManagerInterface | $shippingManager | ||
| protected OrderEventContainer | $eventContainer | ||
| protected string | $doCartActionMessage | Message that indicates that item is already in cart | |
| protected bool | $isOrderMerging |
Methods
No description
Check if user has permission to add provided product to cart
Check if anonymous user is allowed to finish order
Retrieve current user settings
No description
Find payment type by name
If payment type is card payment, and have custom page for paying, redirect buyer to that page
Create response message depending on action(for do cart action)
No description
No description
{@inheritdoc}
Dispatch event
No description
No description
Send mail to logged user
No description
No description
{@inheritdoc}
No description
No description
Finds all users as a ARRAY
No description
No description
Check if coupon exist
If $code is 'NULL', coupon will be removed from session and from couponCode field in order
Format error message for response
Retrieve current tax
Retrieve logged user's username. Empty string if no user is logged in
Retrieve logged user. NULL if no user is logged in
Check if user has admin role
No description
No description
Retrieve last order for live sale
JQgrid function
JQGrid function
JQGrid function
Find provided number of finished orders for dashboard
Remove provided order
Find all shipping providers
Remove order item - called from edit order in backend
Find product attribute value that match provided selected attributes
Edit order item, and update quantities
Get all Stores from database
Dispatch event after add to cart
Dispatch event to deal with special offer logic(if special offer plugin is activated)
Dispatch event to deal with buy x get y logic(if buy X get Y plugin is activated)
Dispatch provided event
Find order with relationships by id
Retrieve orders in abandoned cart state with pagination
JQGrid function
JQGrid function
JQGrid function
Retrieve reference for shipping provider
Generate route for provided route name
Send mail when order state is change
Get relative ratio between default and provided currency
No description
No description
Find all users with pagination
Find user by id
Find all payment types
No description
Find all group products in order
Force caching shop parameters
Find all users that match provided ids(if ids are NULL, retrieve all users)
Check prices for all items in order If price is changed for order item add to array
Replace current order depending on order merge type settings
No description
No description
No description
No description
Find last unfinished order for provided user
Dispatch event after saving order on one step checkout
Dispatch event before any one step checkout logic
Update currency and currency ratio for provided order
Details
at line 117
__construct(OrderManagerInterface $orderManager, ProductManager $productManager, ShippingManagerInterface $shippingManager, Factory $stateMachine, OrderEventContainer $eventContainer)
at line 129
mixed
getProductFromDB(Product $product)
at line 140
bool
checkProductAddToCartPermission(Product $product)
Check if user has permission to add provided product to cart
at line 150
bool
checkAnonymousAllowed()
Check if anonymous user is allowed to finish order
at line 167
UserSettings
getCurrentUserSettings()
Retrieve current user settings
at line 175
string
getDoCartActionMessage()
at line 187
PaymentType
getPaymentTypeByName(string $paymentType)
Find payment type by name
at line 198
string
getRouteForPayment(string $payment)
If payment type is card payment, and have custom page for paying, redirect buyer to that page
at line 209
string
createResponseMessage(string $action)
Create response message depending on action(for do cart action)
at line 228
array|int|bool|Order
doCartAction(Order $order, Product $product, string $action, int $qty, array $selectedAttributes, bool $useQtyStep = true, $changeProductQty = true, $additionalParams = [])
at line 525
float|null
getProductPrice(Product $productDB, Order $order)
Retrieve price for provided product and order
at line 572
mixed
checkOrderItemAdjustments(OrderItem $orderItem)
Calculate item adjustments for order
at line 721
changeAdjustmentValues(OrderItem $orderItem, string $key, float $value, boolean $neutral = true, boolean $isFixed = false)
at line 741
doAddShipping(Order $order, ShippingProvider $shipping)
at line 749
doAddPayment(Order $order, string $payment)
at line 757
doApplyPaymentType($step, $order = null)
{@inheritdoc}
at line 779
EventWithResult|Event
dispatchProductQuantityUnavailable(Order $order, OrderItem $orderItem, bool $removed = false)
Dispatch event
at line 798
RedirectResponse
doTransition(mixed $order, string $routeName, string $lastRoute)
at line 812
QueryBuilder
getAllShippings()
at line 820
saveOrder(Order $order)
at line 830
editOrder(Order $order)
{@inheritdoc}
at line 844
int
duplicateOrderSendMail(int $id, int $userId)
Send mail to logged user
at line 861
array
findAllOrders()
at line 875
sendSwiftMessage(string $templateName, string|array $fromEmail, string|array $toEmail, array $context = array(), array|null $attachment = null, string|null $theme = null, null $entity = null)
at line 883
findAbandonedCarts()
{@inheritdoc}
at line 891
array
generateDataForReport(array $invoiceSearchParams)
at line 899
mixed
getDBOrder(Order $order)
at line 907
array
getAllUsers()
at line 917
array
findAllUserForCoupon()
Finds all users as a ARRAY
at line 925
mixed
savePromotion(mixed $content)
at line 988
null|object
saveTax(mixed $content)
at line 1011
null|object
checkCoupon(mixed $code)
Check if coupon exist
at line 1037
setCurrentPricelistForOrder(Order $order, User|null $user)
Set user's/default pricelist to order
at line 1056
mixed
updateCouponCode(int $orderId, string $code)
If $code is 'NULL', coupon will be removed from session and from couponCode field in order
at line 1069
bool
activateCoupon(Order $order)
Activate coupon stored in session
at line 1092
array
rejectCoupon(array $applyResponse)
Format error message for response
at line 1125
bool
isGrantedOrderAccess(Order $order)
at line 1151
Tax
getCurrentTax()
Retrieve current tax
at line 1161
mixed
getLoggedUsername()
Retrieve logged user's username. Empty string if no user is logged in
at line 1173
mixed
getLoggedUser()
Retrieve logged user. NULL if no user is logged in
at line 1183
bool
hasRoleAdmin()
Check if user has admin role
at line 1211
OrderEventContainer
getEventContainer()
at line 1219
OrderManager
getOrderManager()
at line 1231
Order|mixed
editOrderAddresses(Order $order, Address $address, Address|null $shippingAddress)
at line 1289
array|bool
changeOrderItem(stdClass $data)
Change order item state
at line 1304
array
findLastOrderForLiveSale(mixed $number)
Retrieve last order for live sale
at line 1319
array
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $JQGridWrapper = null)
JQgrid function
at line 1335
array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $JQGridWrapper = null)
JQGrid function
at line 1350
array
getCountForJQGRID(null $searchParams = null, null $sortParams = null, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
JQGrid function
at line 1362
array
getOrdersForDashboard(int $number)
Find provided number of finished orders for dashboard
at line 1374
bool
deleteOrders(array $ordersArray)
Remove provided order
at line 1396
array
getAllShippingWithSelect()
Find all shipping providers
at line 1410
Order
editOrderRemoveItem(int $itemId, int $orderId)
Remove order item - called from edit order in backend
at line 1422
mixed
getProductAttValue(array $pavArray, array $selectedAttributes)
Find product attribute value that match provided selected attributes
at line 1455
bool
activateCouponForOrderEdit(string $couponCode, Order $order)
Activate coupon for order
at line 1487
Order
editOrderAddItem(Order $order, Product $product, array $additionalData)
Edit order item, and update quantities
at line 1497
array
doProductSearch(ProductSearchWrapper $searchWrapper)
at line 1507
array
getAllStoresForPickUp()
Get all Stores from database
at line 1521
OrderEvent
dispatchAfterAddToCartLogicEvent(Order $order, OrderItem|null $orderItem = null, string|null $action = null, bool $isOrderMerging = false)
Dispatch event after add to cart
at line 1532
SpecialOfferEvent
dispatchAfterAddToCartSpecialOfferEvent(Order $order)
Dispatch event to deal with special offer logic(if special offer plugin is activated)
at line 1548
BuyXGetYProductEvent
dispatchBuyXGetYOfferEvent(Order|null $order, OrderItem|null $orderItem, string|null $action, string|null $eventName = BuyXGetYProductEvent::PRODUCT_BUY_X_GET_Y_CHECK_ACTION_EVENT, boolean $hasItem = true, null $oldQty = null)
Dispatch event to deal with buy x get y logic(if buy X get Y plugin is activated)
at line 1560
Event
dispatchEvent(string $name, Event $event)
Dispatch provided event
at line 1574
mixed
getDBOrderForDetails(int $id)
Find order with relationships by id
at line 1587
mixed
getAbandonedCartsForPagination(int $userId, int $page, int $offset)
Retrieve orders in abandoned cart state with pagination
at line 1600
mixed
getOrdersForPagination(int $userId, int $page, int $offset)
JQGrid function
at line 1613
mixed
countAbandonedCartsByUserForPagination(int $userId)
JQGrid function
at line 1624
array
countOrdersByUserForPagination(int $userId)
JQGrid function
at line 1635
User
createNewUser(User $user)
Find user with provided mail(create new if user doesn't exist)
at line 1653
ShippingProvider|Proxy|null|object
getShippingReference(int $id)
Retrieve reference for shipping provider
at line 1664
string
generateNextRoute(string $routeName)
Generate route for provided route name
at line 1680
mixed
sendEditedStateOrderMail(Order $order, string $type, array $additionalMails = array(), null $cardOrderInfo = null)
Send mail when order state is change
at line 1691
float
getCurrencyRatio(string $current)
Get relative ratio between default and provided currency
at line 1699
Router
getRouter()
at line 1707
mixed
getCashCheckoutSettings()
at line 1720
array
getUsersByStringParam(int $page, int $offset, array $searchParam)
Find all users with pagination
at line 1731
mixed
getUserInfoForOrder(int $id)
Find user by id
at line 1741
array
getAllPaymentTypes()
Find all payment types
at line 1749
array
getAllShippingMethods()
at line 1760
array
getAllGroupProductsForOrder(int $orderId)
Find all group products in order
at line 1781
mixed
dispatchOneStepCheckoutChanges(mixed $data, Order $order)
Dispatch event to apply gift card
at line 1789
forceInitialization()
Force caching shop parameters
at line 1800
array
getAllEmailsForArrayOfIds(array|null $ids = null)
Find all users that match provided ids(if ids are NULL, retrieve all users)
at line 1815
Order
recalculateItemsInOrder(Order $order, array $arrayOfChangedOrderItemPrice = [], array $unavailableProducts = [])
Check prices for all items in order If price is changed for order item add to array
at line 1856
replaceCurrentOrder(UserInterface $user, Order|null $lastOrderParam = null)
Replace current order depending on order merge type settings
at line 1957
ProductSettings
getProductSettings()
at line 1965
null|Request
getCurrentRequest()
at line 1983
array
getPaymentTypeLimits()
at line 1991
setIsOrderMerging(bool $isOrderMerging)
at line 2006
mixed
getLastUnfinishedOrderForUser(bool $nullable = true, bool $excludeUser = false, bool $shouldConvertMoney = true)
Find last unfinished order for provided user
at line 2019
setLastOrder(Order|null $lastOrder)
at line 2029
mixed
dispatchCustomOneStepCheckoutRedirectEvent()
Dispatch event after saving order on one step checkout
at line 2040
Order
convertOrderToPricelistCurrency(Order $order)
Convert order to pricelist currency
at line 2052
mixed
dispatchBeforeOneStepCheckoutEvent(Order $order, mixed $data)
Dispatch event before any one step checkout logic
at line 2066
Order|null
changeCurrentOrderCurrency(string $toCurrency)
Update currency and currency ratio for provided order