PS PrestaShop Beginner

Edit a PrestaShop order with DataFirefly Order Editor

Install the module, set the editable order states and invoice handling, then edit products, addresses, carrier and discounts of a validated order.

Updated Module version 1.0.0

Overview

DataFirefly Order Editor adds an editor to every order page of the back office, right under the Products block. It lets you edit a validated order like a cart: add or remove products, swap a combination, fix a quantity or a price, change the address or the carrier, remove or add a discount. Every change is recalculated by the PrestaShop cart engine, and the invoice is cancelled by a credit slip and reissued, or updated, as you choose.

The module runs on PrestaShop 8.0 to 9.x. It is translated into English, French, Spanish, German, Italian, Dutch, Polish and Portuguese.

Installation

  1. In Modules > Module Manager, click Upload a module and drop the file dforderedit-1.0.0.zip.
  2. On installation, the module grants its permissions to the profiles already allowed to edit orders (for example SuperAdmin, Salesman, Logistician).
  3. Open an order: the Order editor block appears under the Products block.

A profile without the right to edit orders does not see the editor. To open it to a new profile, give it the edit right on orders, then tick the module permissions in Advanced Parameters > Team > Permissions.

Configuration

The module configuration page has five settings:

  • Order states where editing is allowed: the editor is only offered for orders in these states. Canceled, Refunded and Payment error are excluded by default.
  • Default invoice handling: credit slip and new invoice (recommended, required in France and many EU countries), or update of the existing invoice with the same number. This can be changed for each edit.
  • Restock removed quantities by default.
  • Notify the customer by email by default.
  • Add a private note to the order after each edit.

Editing an order

Opening the editor

On the order page, click Edit this order. As long as nothing is confirmed, the order is not touched: the Reset button cancels all pending changes, and the browser warns you if you leave the page with changes not applied.

Products

  • Add a product: type a name, reference, EAN or ID in the search (several words, in any order). Arrow keys and Enter let you pick with the keyboard. For a product with combinations, choose the combination in the list that appears.
  • Swap the combination: the list shows the stock of each combination. The price of the new combination is filled in and stays editable.
  • Fix the quantity or the price: the price paid by the customer is kept by default. The Apply catalog price link takes the current price for this customer (group, specific prices, quantity discounts).
  • Tax excl. or tax incl. entry: the switch above the table chooses the entry mode. By default it follows the price display of the customer’s group. A price typed tax incl. is converted to tax excl., which remains the reference of the order.
  • Remove a line: the bin icon strikes the line out, the arrow icon restores it.

Addresses

Pick another address of the customer in the list, or click Edit the fields of this address to fix a street or a zip code. An edited address is saved as a new address linked to this order only: past orders and the customer’s address book are not changed. If the country changes, the VAT of the products and of the shipping is recalculated.

Discounts

Untick a discount to remove it from the order. The search adds an existing cart rule by name or code. The Add a free discount link creates a discount as an amount tax incl. or a percentage with the label of your choice, without going through the cart rules catalog. This discount is stored as a disabled cart rule reserved to the customer and already used: it cannot be reused at checkout.

Shipping

The carrier list only offers the carriers able to deliver the edited cart to the chosen address, with their price and delay. Three modes apply to the shipping cost:

  • Keep the shipping cost of the order: the amount tax excl. is kept, the tax follows the address if it changes country.
  • Recalculate with the selected carrier: required when you change carrier.
  • Set a shipping cost (tax incl.).

Options

  • Order state after the edit: the state changes through the native PrestaShop history, with its usual emails.
  • Put removed quantities back in stock.
  • Send the updated order summary to the customer, in their language.
  • Invoice: credit slip and new invoice, or update of the existing invoice.
  • Internal note, saved in the edit history.

New totals and confirmation

Moments after each change, the bar pinned to the bottom of the screen shows the total tax incl. before and after, the difference, and the amount still due by the customer or the overpayment to refund. The Details link opens the line-by-line comparison (quantities, prices, tax rates), the discounts, the addresses and all totals. Warnings appear above: insufficient stock, a cart rule whose minimum is no longer reached, a carrier that no longer delivers.

Click Apply the changes: the confirmation lists the lines affected, the discounts, the carrier change, the documents that will be created and the new state. Click Confirm and apply, the page reloads on the updated order.

Invoice and credit slip

Credit slip and new invoice mode (default)

  1. The invoice PDF is archived as it was, before any write.
  2. A credit slip cancels the invoice for its full amount. Its PDF is archived too.
  3. A new invoice is issued with the next number. Lines, discounts, carrier and payments are linked to it.

The download link of the cancelled invoice, in the back office and in the customer account, always returns its original PDF. The cancelled invoice is no longer offered in the add payment form.

Update mode

The amounts of the existing invoice are updated and it keeps its number, as PrestaShop does natively. The PDF from before the edit is still archived. An order with several invoices always goes through the credit slip and new invoice mode.

If no invoice has been issued yet, there is nothing to regenerate: only the order is updated.

Payments and refunds

The payment already received stays on the order. When the new total is higher, PrestaShop shows the remaining amount as for any partial payment. When it is lower, the overpayment is shown in the editor and the refund is made through your payment provider.

When an order later moves to a paid state, PrestaShop normally adds a payment for every invoice not fully paid. The module prevents this fake payment on invoices cancelled by a credit slip.

Stock

Stock is adjusted by difference. A quantity raised from 2 to 3 uses one unit, a removed line puts its quantity back in stock if the option is ticked, a swapped combination returns the old one and uses the new one. Reserved quantities are recalculated at the end.

Locked lines

  • Refunded or returned line: it can be neither edited nor removed, so existing credit slips stay correct. The other lines of the order remain editable.
  • Customized line (text, file sent by the customer): it can be removed but not changed. The customization text is shown under the line and the customer’s files are never touched.
  • Product deleted from the catalog: the line can only be removed.

History and traceability

The history, under the editor, lists every edit: date, employee, lines, discounts, addresses, carrier and state changed, total before and after, internal note, and links to the archived PDFs. A private note also summarizes the edit in the order messages.

On uninstall, the history and the archived PDFs are kept so cancelled invoices stay identified if the module is installed again.

For developers

  • actionOrderEdited: native PrestaShop hook, called with order after each edit.
  • actionDfOrderEditAfter: called with order, id_dforderedit_log, changes (lines, discounts, addresses, carrier, totals) and id_order_slips.

The recalculation uses a temporary cart that is never linked to an order and is deleted at the end. The preview runs in a transaction that is rolled back.

Troubleshooting

The editor does not appear on the order

Check that the order state is one of the editable states in the configuration, and that the employee’s profile is allowed to edit orders and to view the module.

The carrier cannot deliver the new cart

The weight, amount or zone is outside the carrier’s ranges. Choose another carrier in the list or set the shipping cost manually.

The price of a line could not be set exactly

A catalog rule (a group reduction, for example) applies on top of the price entered. Check the price in the details before confirming.

Order from a multi-carrier cart

When a cart was split into several orders, cart rules are recalculated on the edited order only. A warning reminds you of this in the preview.

Was this page helpful?

Still stuck? Contact support