sulu / sulu-sales
Commerce Bundles of Sulu
Installs: 6 536
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 24
Forks: 6
Open Issues: 3
Type:sulu-bundle
Requires
- php: >=5.4
- doctrine/orm: ~2.5
- massive/pdf-bundle: ~0.1
- oro/doctrine-extensions: 1.0.*
- sulu/contact-extension-bundle: ~0.6
- sulu/pricing-bundle: ~0.5
- sulu/product-bundle: 0.17.*
- sulu/sulu: ~1.2
- symfony-cmf/routing-bundle: 1.2.*
- willdurand/hateoas-bundle: >=0.3 <2.0
Requires (Dev)
- evenement/evenement: 2.0.0 as 1.0.0
- phpunit/phpunit: ~4.0.0
- sensio/framework-extra-bundle: ~3.0
- symfony-cmf/testing: ~1.2
- symfony/monolog-bundle: 2.4.*
- symfony/symfony: ~2.8
- zendframework/zend-stdlib: ~2.3
- zendframework/zendsearch: @dev
Replaces
- sulu/sales-core-bundle: 0.10.6
- sulu/sales-order-bundle: 0.10.6
- sulu/sales-shipping-bundle: 0.10.6
- dev-develop
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.0
- 0.8.10
- 0.8.9
- 0.8.8
- 0.8.7
- 0.8.6
- 0.8.5
- 0.8.4
- 0.8.3
- 0.8.2
- 0.8.1
- 0.8.0
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.4
- 0.4.3
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.1
- 0.3.0
- 0.2.1
- 0.2.0
- 0.1.0
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-master
- dev-release/0.6.3
- dev-feature/unsubmitted-pdf
- dev-feature/pdf-naming-fallback
- dev-bugfix/editable-data-row
- dev-feature/item-table
- dev-feature/shppingcart-pdf-featurebranch
- dev-hotfix/datepicker
- dev-feature/transition-overlay
This package is auto-updated.
Last update: 2020-10-21 14:08:28 UTC
README
Configuration
The following description contains the default configuration for the different sales bundles.
SuluSalesCoreBundle
sulu_sales_core:
priceformatter_digits: 2
shop_location: ~ # Is used for calculating correct tax
email_from: ~ # Originator of sales emails like an order confirmation
email_templates: # Footer templates for email
footer_txt: ~
footer_html: ~
SuluSalesOrderBundle
Confirmation emails are only sent, when using CartManager for creating orders.
sulu_sales_order:
pdf_templates:
confirmation: SuluSalesOrderBundle:Pdf:order.confirmation.html.twig
base: SuluSalesCoreBundle:Pdf:pdf-base.html.twig
header: SuluSalesCoreBundle:Pdf:pdf-base-header.html.twig
footer: SuluSalesCoreBundle:Pdf:pdf-base-footer.html.twig
macros: SuluSalesCoreBundle:Pdf:pdf-macros.html.twig
dynamically: SuluSalesOrderBundle:Pdf:order.dynamically.html.twig
dynamically_base: SuluSalesOrderBundle:Pdf:order.confirmation.html.twig
pdf_response_type: 'inline'
pdf_order_confirmation_name_prefix: order_confirmation
pdf_order_dynamically_name_prefix: order_pdf
email_templates:
footer_txt: ~
footer_html: ~
shop_email_from: ~ # Originator of confirmation email
shop_email_confirmation_to: ~ # Defines an extra recipient for confirmation email
send_email_confirmation_to_customer: false # Defines if a confirmation mail should be sent to customer
objects:
sales_order:
model: Sulu\Bundle\Sales\OrderBundle\Entity\Order
repository: Sulu\Bundle\Sales\OrderBundle\Entity\OrderRepository
You also need to tell doctrine, how to resolve the target entities:
doctrine:
orm:
resolve_target_entities:
Sulu\Bundle\Sales\CoreBundle\Entity\ItemInterface: Sulu\Bundle\Sales\CoreBundle\Entity\Item
Sulu\Bundle\Sales\OrderBundle\Entity\OrderStatusInterface: Sulu\Bundle\Sales\OrderBundle\Entity\OrderStatus
Pdf templates dynamically
The dynamically
pdf template can be configured easily. That way it is possible to dynamically change the look of the
pdf generated from a given order object. To add even more flexibility it is possible to configure the
dynamically_base
template which is the template, that will be extended by dynamically
. Like: dynamically extends
dynamically_base.
Since there are defaults specified and default templates exist in the bundle, it is not strictly necessary to configure those parameters.
Pdf response type
The way the order bundle reacts on http requests that return a pdf. It is possible to configure the response so that, for example, it is returned as inline
so that the pdf file would be shown in a new tab, or as attachment
. As an attachment it would start a download without opening the file in the browser.
These configurations can be set in the parameters.yml
-file of your application under the key:
sulu_sales_orderbundle_pdf_responsetype: inline
The bundle-sided configuration for this key defaults to inline
.
Pdf naming prefixes
The naming prefixes, that can be configured are : pdf_order_confirmation_name_prefix
and
pdf_order_dynamically_name_prefix
. That way it is easily configurable how the returned file is named. So if a dynamic
template is rendered, the pdf_order_dynamically_name_prefix
will be used and suffixed with the order number. Applying
the same logic, the filename for the confirmation pdf is generated.
If not configured, the default values are applied. Those are like shown in the example config above.
Routing
The routing of the Bundle depends on the routing files that live in the respective Resources/config/routing
directories.
Those are, grouped by bundle:
- SuluSalesOrderBundle:
- routing.xml
- routing_api.xml
- routing_website.xml
- SuluSalesCoreBundle:
- routing.xml
- SuluSalesShippingBundle:
- routing.xml
- routing_api.xml
It is also important to know, that the routing for tests is configured separately. (Check the Tests/ directory)
How to run tests
The following command is going to run tests for all sales bundles:
composer install
tests/app/console doctrine:schema:update --force
phpunit
Documentation
Extend Sales Order
You can use sulu persistence to extend the Order entity and repository.
Events
The following events are triggered by the system:
Constant | Parameter | Triggered | Parameters |
---|---|---|---|
SalesOrderEvents:StatusChanged | sulu_sales_order.events.status_changed | Triggered when the status of an order changes. | SuluSalesOrderStatusChangeEvent |