Post-Purchase Upsell & Cross-Sell

Review and allow an ERP import

This page is for you if you have set up ERP export. You learn where Shopware shows whether an order is ready for the ERP and how it alerts you to an order that needs review, by email and on the Health tab. You also learn how to allow the import of such an order and what to do if saving the configuration is rejected or Shopware stops you from deactivating the extension. In normal operation, every order becomes ready for the ERP by itself. You act only when an order shows Review needed.

The ERP Export tab

Under Marketing → Upsell & Cross-Sell → ERP Export, a table lists orders with the columns Order, Order status, ERP readiness and Waiting until.

The table lists the orders placed in the storefront while Enable post-purchase upsell offers and ERP export were on in the global settings, including orders for which no campaign qualified. Such an order shows Ready for the ERP immediately. Orders created in the Administration do not appear. When you turn on ERP export or select another integration or user account, older orders whose offer was neither accepted nor declined also appear, as Ready for the ERP.

The ERP readiness column shows one of these values:

  • Waiting, with the reason Customer decision or payment confirmation pending or Completing the accepted offer. You do not need to act.
  • Ready for the ERP, with the note Offer window ended when the offer expired unused. The ERP can import the order on its next run.
  • Review needed. The order waits until you allow its import.

Waiting until shows when the order is expected to become ready, or when it became ready. For an accepted offer, the column shows the expected end of processing. See How long an order waits.

In the order's … menu, View details opens ERP export details. The dialog also shows the integration or user account that waits for the order and, under Email notification, whether Shopware has sent an email about the order.

To open the tab, you need the extension's View permission. The Allow this import button appears only for an order that shows Review needed, and only with the additional permission Release ERP exports under Additional permissions. See Permissions.

The ERP Export tab in the Administration
The ERP Export tab with the columns Order, Order status, ERP readiness and Waiting until.

Email notifications

The scheduled task cwk_ppu.export_gate_overdue_notification runs every five minutes. Shopware sends an email when processing an accepted offer has still not finished at the later of these two times:

  • the time in the Waiting until column
  • the start of processing plus the minutes set in Overdue notification threshold (minutes)

The threshold is 15 minutes by default. The email goes to the addresses set for the order's sales channel in Email if an order with an accepted offer does not become ready for the ERP, or to the addresses the sales channel inherits from All Sales Channels. If the field is empty and the sales channel does not inherit the setting, Shopware sends no email. Shopware records a successful send and retries a failed send on the next run. See ERP export settings.

Shopware runs this task through its admin worker while someone has the Administration open in a browser, or through dedicated workers for scheduled tasks and the message queue. So that the task also runs overnight and at weekends, set up dedicated workers, or ask your hosting provider or agency to set them up.

Health checks

Under Marketing → Upsell & Cross-Sell → Health, two checks warn about:

  • a sales channel in which Wait until the order is ready before the ERP can import it is on, but no existing integration or user account is selected
  • the number of orders that show Review needed

Each warning names the next step. See Health check.

List of checks on the Health tab, all ticked except a warning about one order awaiting review
The Health tab with a passed check for the ERP's integration or user account and a warning about one order that needs review before its import.

Allow an import after review

If processing an accepted offer has not finished by the time in Waiting until, the order shows Review needed. It does not become ready by itself, so the ERP cannot import it before you have checked it.

If you allow it too early, the ERP can import the order before its order items, transactions, captures and refunds are complete.

To allow the import, you need the additional permission Release ERP exports under Additional permissions. To check the order, you also need the View permission for Orders and access to the log files in var/log/ on the server. If you do not have access to the log files, ask your hosting provider or agency. See Permissions.

To allow the import, follow these steps:

  1. Open the order under Orders → Overview. The email notification contains the order number. If you have not received an email, find the order on the ERP Export tab by selecting Waiting in the ERP readiness field. This filter also shows orders with Review needed.
  2. Check the order's items, grand total, transactions, captures and refunds. For a PayPal payment, the order's PayPal tab shows the captures and refunds.
  3. Search the extension's log files for the order's 32-character ID. The files are in var/log/, and their names start with cwk_post_purchase_upsell_. The ID is in the browser's address bar while the order is open.
  4. Make sure that the order items and grand total match the final payment or refund outcome. If they do not match, do not allow the import and contact support@commercewerk.de.
  5. Open Marketing → Upsell & Cross-Sell → ERP Export.
  6. In the … menu of the order, select View details. You can narrow the list to this order in the Order number field.
  7. In ERP export details, click Allow this import. A dialog appears with the question Allow the ERP to import this order on its next run?
  8. Click Allow this import. The message "The ERP can import this order on its next run." appears.

Run the following commands on the server, in the Shopware installation directory. If you do not have access to the server, ask your hosting provider or agency to run them.

The command cwk:ppu:export-gate lists the orders that need review and shows a single order, without changing anything:

bin/console cwk:ppu:export-gate --stale
bin/console cwk:ppu:export-gate ORDER_ID

Replace ORDER_ID with the order's 32-character ID from the Order id column of the --stale output. The order number does not work here.

With --stale, the command shows a table with the columns Order id, Order number, ERP credential and Expected mutation deadline, or reports that there is no such order. Expected mutation deadline is the time in Waiting until, given in UTC. Use --stale on its own. With an order ID, the command shows that order's ERP details and changes nothing.

After the checks in steps 1 to 4, you can allow the import on the server instead:

bin/console cwk:ppu:export-gate ORDER_ID --release

The command works only for an order that shows Review needed. It shows the order's details and asks you to confirm. Nothing changes unless you answer yes. There is deliberately no bulk command.

Save a rejected configuration change

While an order in the affected sales channel shows Completing the accepted offer or Review needed, Shopware rejects a change to these settings with an error message:

  • Wait until the order is ready before the ERP can import it
  • Integration the ERP uses to import orders
  • User account the ERP uses to import orders

The affected sales channel is the one you save for. A save under All Sales Channels affects every sales channel. See Configuration changes.

If you leave the configuration, Shopware discards your unsaved change. To save the change, follow these steps:

  1. Open Marketing → Upsell & Cross-Sell → ERP Export in a new browser tab. The configuration with your change stays open in the first browser tab.
  2. If an order shows Completing the accepted offer, reload the page until the order shows Ready for the ERP or Review needed.
  3. If an order shows Review needed, follow the steps in Allow an import after review.
  4. Switch back to the browser tab with the configuration.
  5. Click Save again. The message "Configuration saved." appears.

If Shopware stops you from deactivating the extension, open Marketing → Upsell & Cross-Sell → ERP Export, follow steps 2 and 3, then deactivate the extension again. To learn when Shopware stops the deactivation, see Configuration changes.