OrderEventContainer
class OrderEventContainer
Class OrderEventContainer is injected as alligator.order.event.container. This container is connecting Order manager to other services
Methods
OrderEventContainer constructor.
Retrieve logged user. NULL if no user is logged in
Check if user have permission to add to cart
Retrieve router
Finds all users in the database.
Finds all users as a ARRAY
Find email for user that match provided id
Find user for provided id
Find user for provided criteria
Find all users that match provided ids
Check if coupon is valid for provided user(if provided user is NULL, check if coupon is valid for logged user)
Retrieve coupon from session
Remove coupon from session
Find coupon for provided id
Retrieve current tax
Send mail when order state is change
Retrieve search parameters from request
Send mail with provided parameters
Find address by id
Find all shipping providers
Find all group products in order
Retrieve product attribute values repository
Retrieve product manager
Retrieve current user settings
Get all Stores from database
Retrieve translator
Retrieve current front theme name
Retrieve reference for shipping provider
Generate route for provided route name
Find all orders that match provided criteria
Dispatch event after add to cart
Dispatch event to deal with buy x get y logic(if buy X get Y plugin is activated)
Dispatch event to deal with special offer logic(if special offer plugin is activated)
Dispatch provided event
Get relative ratio between default and provided currency
Retrieve cached checkout settings
Find all users with pagination
Find user by id
Retrieve reference for user that match provided id
Find payment type by id
Find all payment types
Dispatch event before any one step checkout logic
Retrieve current session from request
Force caching shop parameters
Find all users that match provided ids(if ids are NULL, retrieve all users)
Retrieve current order merge type
Retrieve current product settings
Retrieve current request
Dispatch event
Retrieve limits for payments(if payment is disabled for role)
Dispatch event to check if product can be added to cart
Retrieve single unit of measure pricing rule(if it exist)
Find payment type by name
If payment type is card payment, and have custom page for paying, redirect buyer to that page
Convert price from one currency to other
Retrieve default pricelist for shop
Get total group discount, as array, containing percent and fixed discount
Get total pricelist discount, represented as percent
Retrieve multiple group discount type
Retrieve calculated pricelist group discounts
Retrieve pricelist for user. NULL otherwise
Convert price from default currency to currency in order
Dispatch event after saving order on one step checkout
Retrieve current session
No description
Details
at line 52
__construct(ContainerInterface $container)
OrderEventContainer constructor.
at line 62
User|null
getLoggedUser()
Retrieve logged user. NULL if no user is logged in
at line 79
bool
checkProductAddToCartPermission(array|string $productPermissions)
Check if user have permission to add to cart
at line 89
Router
getRouter()
Retrieve router
at line 99
array
getAllUsers()
Finds all users in the database.
at line 109
array
findAllUserForCoupon()
Finds all users as a ARRAY
at line 121
array
getMailFromDb(int $id)
Find email for user that match provided id
at line 157
User|null
findUserForCoupon(int $id)
Find user for provided id
at line 169
mixed|null|object
findUserBy(array $array)
Find user for provided criteria
at line 181
array
getAllUsersInArray(array $arrayOfUsers)
Find all users that match provided ids
at line 196
Coupon|null
checkCoupon(string $code, User|null $user = null)
Check if coupon is valid for provided user(if provided user is NULL, check if coupon is valid for logged user)
at line 223
mixed
setCouponPKToSession(Coupon $coupon)
Set coupon to session
at line 236
int|null
getCouponPKFromSession()
Retrieve coupon from session
at line 244
removeCouponFromSession()
Remove coupon from session
at line 259
Coupon|null
getCouponById(int $couponId)
Find coupon for provided id
at line 271
mixed
updateCoupon(Coupon $coupon)
Update coupon
at line 283
Coupon|null
useCoupon(Coupon $coupon)
Increment coupon usage and set used to TRUE if number of uses reached usage limit
at line 305
Tax
getCurrentTax()
Retrieve current tax
at line 320
sendEditedStateOrderMail(Order $order, string $state = 'edit', array $additionalMails = array(), array|null $cardOrderInfo = null)
Send mail when order state is change
at line 355
mixed
getSearchParam()
Retrieve search parameters from request
at line 382
sendMails(string $template, string $from, array $to, array $context = array(), mixed $attachment = null, string $theme = null, mixed $entity = null)
Send mail with provided parameters
at line 394
mixed
getAddressFromDB(mixed $id)
Find address by id
at line 404
array
getAllShippingWithSelect()
Find all shipping providers
at line 416
array
getAllGroupProductsForOrder(int $orderId)
Find all group products in order
at line 426
ProductAttributeValuesRepository
getProductAttributeValuesRepository()
Retrieve product attribute values repository
at line 436
ProductManager
getProductManager()
Retrieve product manager
at line 461
UserSettings
getCurrentUserSettings()
Retrieve current user settings
at line 471
array
getAllStoresForPickUp()
Get all Stores from database
at line 483
bool
activateCoupon(Order $order)
Active coupon that is cached in session
at line 493
object|IdentityTranslator
getTranslator()
Retrieve translator
at line 503
string|null
getCurrentTheme()
Retrieve current front theme name
at line 527
ShippingProvider|Proxy|object|null
getShippingReference(int $id)
Retrieve reference for shipping provider
at line 539
string
generateNextRoute(string $routeName)
Generate route for provided route name
at line 560
mixed
doOrderItemsSearch(int $page, int $offset, int $productId, int $userId, int $reservationWarranty, int $maxQuantityPerOrderItem, array $searchParams, bool $count = false)
Find all orders that match provided criteria
at line 578
OrderEvent
dispatchAfterAddToCartLogicEvent(Order $order, OrderItem|null $orderItem = null, string|null $action = null, bool $isOrderMerging = false)
Dispatch event after add to cart
at line 602
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, int|null $oldQty = null)
Dispatch event to deal with buy x get y logic(if buy X get Y plugin is activated)
at line 622
SpecialOfferEvent
dispatchAfterAddToCartSpecialOfferEvent(Order $order)
Dispatch event to deal with special offer logic(if special offer plugin is activated)
at line 638
Event
dispatchEvent(string $name, Event $event)
Dispatch provided event
at line 650
float|int
getCurrencyRatio(string $current)
Get relative ratio between default and provided currency
at line 660
mixed
getCashCheckoutSettings()
Retrieve cached checkout settings
at line 674
array
getUsersByStringParam(int $page = 1, int $offset = 10, string|null $params = null)
Find all users with pagination
at line 686
array
getUserInfoForOrder(int $id)
Find user by id
at line 698
User|Proxy|null
getUserByPk(int $id)
Retrieve reference for user that match provided id
at line 710
string|null
getPaymentTypeByPk(int $id)
Find payment type by id
at line 720
array
getAllPaymentTypes()
Find all payment types
at line 733
array
dispatchOneStepCheckoutChanges(mixed $data, Order $order)
Dispatch event to apply gift card
at line 751
mixed
dispatchBeforeOneStepCheckoutEvent(Order $order, mixed $data)
Dispatch event before any one step checkout logic
at line 766
null|SessionInterface
getSession()
Retrieve current session from request
at line 774
forceInitialization()
Force caching shop parameters
at line 786
array
getAllEmailsForArrayOfIds(array|null $ids = null)
Find all users that match provided ids(if ids are NULL, retrieve all users)
at line 796
mixed
getOrderMergeType()
Retrieve current order merge type
at line 806
ProductSettings
getProductSettings()
Retrieve current product settings
at line 816
null|Request
getCurrentRequest()
Retrieve current request
at line 830
EventWithResult|Event
dispatchProductQuantityUnavailable(Order $order, OrderItem $orderItem, bool $removed = false)
Dispatch event
at line 849
array
getPaymentTypeLimits()
Retrieve limits for payments(if payment is disabled for role)
at line 861
EventWithResult|Event
dispatchProductAddToCartPermissionCheck(array|string $productPermissions)
Dispatch event to check if product can be added to cart
at line 874
UnitOfMeasureWeightPricing
findUnitOfMeasurePricingRules()
Retrieve single unit of measure pricing rule(if it exist)
at line 886
PaymentType
getPaymentTypeByName(string $paymentType)
Find payment type by name
at line 898
string
getRouteForPayment(string $payment)
If payment type is card payment, and have custom page for paying, redirect buyer to that page
at line 920
float|int
convertMoney(float $price, string $from, string $to)
Convert price from one currency to other
at line 930
mixed|null
getDefaultPricelist()
Retrieve default pricelist for shop
at line 943
float|int
getTotalGroupDiscount(int $productId, int $quantity)
Get total group discount, as array, containing percent and fixed discount
at line 956
float
getTotalPricelistDiscount(array $productPricelistItemsArray, int $quantity)
Get total pricelist discount, represented as percent
at line 966
string
getMultipleGroupsDiscountType()
Retrieve multiple group discount type
at line 976
string
getCalculatePricelistGroupDiscounts()
Retrieve calculated pricelist group discounts
at line 986
string|null
getUserPriceListCurrency()
Retrieve pricelist for user. NULL otherwise
at line 1006
float
convertOrderToPricelistCurrency(float $value, string $to)
Convert price from default currency to currency in order
at line 1016
mixed
dispatchCustomOneStepCheckoutRedirectEvent()
Dispatch event after saving order on one step checkout
at line 1029
object|Session
getCurrentSession()
Retrieve current session