mothership-ec / cog-mothership-returns
Cog module for order returns in Mothership
Requires
- php: >=5.4.0
- mothership-ec/cog: ~4.10
- mothership-ec/cog-mothership-commerce: ~5.0
- mothership-ec/cog-mothership-ecommerce: ~3.7
- mothership-ec/cog-mothership-reports: ~2.1
- dev-develop
- 5.4.0
- 5.3.0
- 5.2.0
- 5.1.1
- 5.1.0
- 5.0.2
- 5.0.1
- 5.0.0
- 4.3.0
- 4.2.0
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.1
- 3.0.0
- 2.0.0
- 1.1.0
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-master
- dev-completed-returns
- dev-returns-slip-format
- dev-returns-slip
- dev-feature/reports-ignore-voids
- dev-feature/exchange-listing
- dev-feature/standalone-returns
- dev-feature/return-create-bugfix
- dev-issue/returns-slip-missing-data
- dev-feature/returns-frontend
- dev-feature/multiple-payment-issue
- dev-feature/out-of-stock-return-fix
- dev-feature/loader-day
- dev-feature/returns-transactions
- dev-issue/82-returns-completed
This package is not auto-updated.
Last update: 2021-03-22 11:07:11 UTC
README
description
Installation
Add "message/cog-mothership-returns": "1.1.*"
to your composer.json
.
Assembling a new return
The assembler helps you build a new return ready for passing to the create decorator.
This service is available via:
$assembler = $this->get('return.assembler');
If you have an existing return you can pass this into the assembler with:
$assembler->setReturn($return);
And retrieve the assembled return once you are finished building it:
$return = $assembler->getReturn();
If your return has no associated order, i.e. is standalone, you should set the currency. This defaults to 'GBP'
:
$assembler->setCurrency('EUR');
You can set the return item from either a instance of Commerce\Order\Entity\Item\Item
or Commerce\Product\Unit\Unit
.
// Standard $orderItem = $this->get('order.item.loader')->getByID(1); $assembler->setReturnItem($orderItem); // Standalone $productUnit = $this->get('product.unit.loader')->getByID(1); $assembler->setReturnItem($productUnit);
Notes
Namespaces and classes are called OrderReturn
due to PHP having return
as a reserved word.