Skip to content
Alexandre Bacco edited this page Jan 30, 2014 · 7 revisions

Cart Initialize

  • OrderCurrencyListener::processOrderCurrency
    • Order::setCurrency(CurrencyContext::getCurrency()) : set the Currency (from the context) to the Order (from the event)
  • OrderUserListener::setOrderUser
    • Order::setUser(User) : set the current user (from the context) to the current Order (from the event)

Cart Change

  • RefreshCartListener::refreshCart (priority 255)
    • Order:calculateTotal : refreshes the order
  • OrderTaxationListener::applyTaxes
    • TaxationProcessor::applyTaxes : matches the tax zone with shipping address if any, and handle TaxAdjustments
    • Order::calculateTotal : refreshes the order
  • OrderPromotionListener::processOrderPromotion (priority -50)
    • PromotionProcessor::process(Order) : reverts all already applied promotions, and then apply eligible promotions
    • Order::calculateTotal : refreshes the order
  • OrderInventoryListener::createInventoryUnits (priority -100)
    • InventoryHandler::processInventoryUnits : creates inventory units according to order items, with state in_cart

Security Step

Security Pre Complete

  • OrderUserListener::setOrderUser
    • Order::setUser(User) : set the current user (from the context) to the current Order (from the event)

Coupon

Coupon Invalid

Addressing Step

Addressing Initialize

Addressing Pre Complete

  • OrderTaxation::applyTaxes (idem as for event Cart Change)
    • TaxationProcessor::applyTaxes : matches the tax zone with shipping address if any, and handle TaxAdjustments
  • OrderPromotionListener::processOrderPromotion (idem as for event Cart Change)
    • PromotionProcessor::process(Order) : reverts all already applied promotions, and then apply eligible promotions
    • Order::calculateTotal : refreshes the order

Addressing Complete

  • RestrictedZoneListener::handleRestrictedZone : remove products restricted regarding the current address *

Shipping Step

Shipping Initialize

  • OrderShippingListener::processOrderShipments
    • ShipmentFactory::createShipment(Order) : Create a shipment based on inventory units if it doesn't already exist

Shipping Pre Complete

  • OrderShippingListener::processOrderShippingCharges
    • ShippingProcessor::applyShippingCharges(Order) : Delete and add all shipping adjustments

Finalize Step

Finalize Initialize

Finalize Pre Complete

  • OrderInventory::updateInventoryUnits
    • InventoryHandler::updateInventory(Order) : change inventory units state to sold and decrease stock (via InventoryOperator::decrease)
  • OrderStateListener::resolveOrderStates
    • StateResolver::resolvePaymentState(Order) : define order PaymentState according to payment state
    • StateResolver::resolveShippingState(Order) : define order ShippingState according to shipment states

Finalize Complete

  • OrderConfirmationEmailListener::processOrderConfirmation
    • Mailer::sendOrderConfirmation(Order) : send order confirmation email to user

Payment Step

Payment Initialize

  • OrderPaymentListener::processOrderPayment
    • PaymentProcessor::createPayment(Order) : create the Payment and attach to Order

Payment Pre Complete

Order Pre Create

  • CouponUsageListener::handleCouponUsage
    • Order::getPromotionCoupon()::incrementUsed() : increment the usage number of the attached coupon
  • OrderNumberListener::generateOrderNumber (priority 10)
    • OrderNumberGenerator::generate(Order) : generate and assign a unique number to the Order
  • CompleteOrderListener::completeOrder
    • Order::complete() : completes Order

Payment state pre change

  • OrderPaymentListener::updateOrderOnPayment
    • Dispatch event sylius.order.pre_pay is payment if completed

Order Pre Pay (when an order receive payment)

  • OrderShippingListener::processShipmentStates
    • ShipmentFactory::updateShipmentStates(Order) : update shipment states from checkout to ready