Order

Architecture

For more information about our position regarding the order architecture, you can read: Order.

Presentation

The SonataOrderBundle basically manages the Order-related entities & managers, offers AdminBundle integration and provides a basic controller and basic views to display the orders.

Moreover, the RecentOrders admin & front dashboard block is present in this bundle as well.

Tools

Status Renderer

The SonataOrderBundle provides a status renderer for the order and orderelement objects, which handles the object’s status as well as payment and delivery statuses.

The Status Renderer twig helper is documented in SonataCoreBundle.

Block Services

A Recent Orders block service is available, that can be contextualised to a user or the admin (you’ve got implementation samples in the demo). You can customize the number of orders displayed.

You also have a Breadcrumb block service, see SonataSeoBundle documentation.

Configuration

The bundle allows you to configure the entity classes; you’ll also need to register the Doctrine mapping.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
sonata_order:
    class:
        order:                App\Sonata\OrderBundle\Entity\Order
        order_element:        App\Sonata\OrderBundle\Entity\OrderElement
        customer:             App\Sonata\CustomerBundle\Entity\Customer

# Enable Doctrine to map the provided entities
doctrine:
    orm:
        entity_managers:
            default:
                mappings:
                    ApplicationSonataOrderBundle: ~
                    SonataOrderBundle: ~