Managing Order Statuses Differently in a PrestaShop Multistore Setup
Differentiating Order Statuses in a PrestaShop Multistore Environment
This insight addresses a common challenge faced by PrestaShop merchants operating a multistore setup: how to manage order statuses differently for B2B and B2C stores. The original poster, Justine Plaud, sought a solution to streamline order processing based on the customer type.
The Problem: Global Order Statuses
In PrestaShop, order statuses are typically global, meaning they apply to all stores within a multistore setup. Justine needed a way to automatically set the order status to "Payment Accepted" for B2C orders processed through Payplug, while B2B orders, which are manually processed, should remain in the "Awaiting Confirmation" status until manually updated by the sales team.
The Solution: Payment Module Configuration and Webhooks
The expert, wepresta, provided a detailed explanation of how to achieve the desired outcome. The core concept involves leveraging the payment module's configuration and ensuring proper webhook functionality.
B2C Store Configuration:
- Payment Module Settings: The key is to configure the Payplug module to automatically transition the order status to "Payment Accepted" (or an equivalent status) upon successful payment. This setting is usually found within the module's configuration panel.
- Webhook Verification: Ensure that the Payplug webhook is correctly configured and functioning. The webhook is responsible for notifying PrestaShop when a payment is successfully processed. If the webhook fails (due to URL accessibility issues, firewall restrictions, or WAF rules), the order status will not update automatically.
The expert pointed out that the "Configuration with the Payplug module" section on the order status page is for defining how Payplug interprets a specific PrestaShop order status, not for setting the final order status for B2C orders.
B2B Store Configuration:
- Payment Method Selection: For the B2B store, a payment method that doesn't involve immediate online payment (e.g., bank transfer, invoice, or payment on receipt) should be used. These methods typically create orders with an "Awaiting Confirmation" status, allowing the sales team to manually manage the payment and update the order status accordingly.
Specific Module/Override Considerations
The expert also mentioned that if a different initial order status is desired for each store while using the same payment module, a custom module or override on the order validation process would be necessary. This custom solution would need to determine the order status based on the store or customer group (B2B/B2C).
PayPlug Configuration Details
Justine clarified that Payplug was being used, but the automatic status update wasn't working. The expert suggested checking the Payplug module settings for a parameter like "status after payment accepted/captured" and ensuring it's set to "Payment Accepted" or a similar status, not "Awaiting Confirmation".
Key Takeaways
- PrestaShop's default order statuses are global, but payment module configuration and webhooks provide the means to differentiate order processing for B2B and B2C stores.
- Properly configuring the payment module to automatically update the order status upon successful payment is crucial for B2C orders.
- Verifying the functionality of the payment module's webhook is essential to ensure that payment notifications are correctly received by PrestaShop.
- For more complex scenarios requiring different initial order statuses with the same payment module, a custom module or override may be needed.