Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spicywebau/craft-reorder
Easy reordering of previous Craft Commerce user orders
https://github.com/spicywebau/craft-reorder
craft-commerce craft-plugin craft3 craft4 craftcms
Last synced: 1 day ago
JSON representation
Easy reordering of previous Craft Commerce user orders
- Host: GitHub
- URL: https://github.com/spicywebau/craft-reorder
- Owner: spicywebau
- License: other
- Created: 2018-09-25T04:42:14.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T08:31:00.000Z (6 months ago)
- Last Synced: 2024-10-12T14:38:38.394Z (27 days ago)
- Topics: craft-commerce, craft-plugin, craft3, craft4, craftcms
- Language: PHP
- Homepage:
- Size: 63.5 KB
- Stars: 3
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ReOrder
#### Easy reordering of previous Craft Commerce user orders.
ReOrder makes it easy to allow users to quickly replicate an old order's line items in their existing cart, including the items' quantities, product options and notes.
## Requirements
- ReOrder 3.x requires Craft CMS 5 and Craft Commerce 5.
## Installation
ReOrder can be installed through the Craft [Plugin Store](https://plugins.craftcms.com/). It can also be set up using Composer:
```
composer require spicyweb/craft-reorder
```Then browse to **Settings → Plugins** in the Craft control panel and choose to install ReOrder.
## Usage
ReOrder can be configured to either keep or discard the existing cart items when reordering an old order, and to allow or disallow reordering an order if not all of the associated purchasables are still available, whether they have been deleted, disabled or are just out of stock -- in which case, if reordering is allowed, ReOrder will just replicate the available items.
These options can be configured globally in the Craft control panel and can be overridden on a case-by-case basis in your template files.
ReOrder also makes it easy to allow a customer to select the items they want to reorder, if they don't want to reorder an entire order.
#### Example: retain cart but disallow partial reorders
```twig
{{ csrfInput() }}
{{ redirectInput('shop/checkout') }}
ReOrder!```
#### Example: allow customer to select which items to reorder
```twig
{{ csrfInput() }}
{{ redirectInput('shop/checkout') }}
{% for item in order.lineItems %}
{# other item info #}
{% endfor %}ReOrder!
```