PrestaShop

Mastering PrestaShop Multistore: Dynamic Order Statuses for B2B & B2C Efficiency

Operating a PrestaShop multistore environment offers incredible flexibility, allowing merchants to cater to diverse customer segments with tailored product catalogs, pricing, and even branding. However, this flexibility often introduces unique challenges, especially when it comes to managing backend processes like order statuses. A common dilemma arises when a single PrestaShop installation serves both Business-to-Business (B2B) and Business-to-Consumer (B2C) clients, each requiring a distinct order processing workflow.

At Migrate My Shop, we frequently encounter merchants like Justine Plaud, who sought to differentiate order statuses across her B2B and B2C stores. Her B2B site required orders to initially sit in an "Awaiting Confirmation" status for manual sales team intervention, while her B2C store needed immediate "Payment Accepted" status upon successful online payment. This seemingly straightforward request highlights a critical aspect of PrestaShop's architecture and how to effectively leverage its features.

Configuring PrestaShop Payment Module for Automatic Order Status Update
Configuring PrestaShop Payment Module for Automatic Order Status Update

The Challenge: PrestaShop's Global Order Statuses

By default, PrestaShop's order statuses are designed to be global. This means that an order status like "Awaiting Confirmation" or "Payment Accepted" is generally available and behaves consistently across all stores within a multistore setup. While this simplifies management for single-purpose stores, it becomes a bottleneck for hybrid models like Justine's. Manually changing statuses for every B2C order defeats the purpose of e-commerce automation, while B2B orders often require a human touch before final processing.

The key insight, as highlighted by our expert wepresta in the forum, is that the initial order status is primarily determined by the payment module used and its configuration, rather than a global multistore setting for statuses themselves.

The Solution: Tailoring Order Statuses by Store Type

Achieving dynamic order statuses in a PrestaShop multistore environment hinges on intelligently configuring your payment methods and ensuring robust communication between your payment gateway and your PrestaShop instance.

1. B2C Store Automation: Leveraging Payment Gateways and Webhooks

For your B2C store, the goal is seamless automation. When a customer pays online, the order status should automatically transition to "Payment Accepted" or an equivalent status, eliminating manual intervention.

  • Payment Module Configuration: The first step is to dive into the settings of your chosen payment module (e.g., Payplug, Stripe, PayPal). Within the module's configuration panel in your PrestaShop back office, you will typically find an option to define the "Order status after successful payment" or "Status for accepted payments." It is crucial to set this to "Payment Accepted" (or a similar status like "Remote payment accepted"). Justine's initial issue with Payplug likely stemmed from this setting being incorrectly configured or defaulting to "Awaiting Confirmation."
  • The Power of Webhooks: Even with the correct module configuration, an order status might not update if the payment gateway cannot communicate back to PrestaShop. This communication is typically handled by a "webhook." A webhook is an automated message sent from the payment gateway to a specific URL on your PrestaShop site, notifying it that a payment has been successfully processed.
    • Verification: Ensure your payment gateway's webhook URL is correctly configured in its settings (usually found in your Payplug/Stripe/PayPal merchant account dashboard).
    • Troubleshooting: Common webhook issues include inaccessible URLs (e.g., due to incorrect domain, missing SSL), firewall restrictions blocking incoming requests, or Web Application Firewall (WAF) rules mistakenly flagging the webhook as malicious. If orders remain stuck, check your server logs and payment gateway logs for any failed webhook notifications.
  • Understanding Status Page Configuration: It's important to note that the "Configuration with the [Payment Module] module" section found on the individual order status page in PrestaShop (e.g., "Orders > Statuses") defines how that specific status is *interpreted* by the payment module, not how the payment module *assigns* the final status. The assignment happens within the payment module's own configuration.

2. B2B Store Workflow: Manual Processing and Specific Payment Methods

For your B2B store, where manual review and payment processing are integral, you'll want orders to land in an "Awaiting Confirmation" or "Awaiting Payment" status.

  • "No Immediate Payment" Modules: Utilize PrestaShop's built-in payment modules that do not require immediate online payment. Examples include:
    • Bank Wire: Orders are placed, and customers are provided with bank details for manual transfer. The initial status is typically "Awaiting bank wire payment."
    • Check: Similar to bank wire, but for physical checks. The initial status is "Awaiting check payment."
    • Payment on Delivery (COD): If applicable, orders can be placed with payment upon receipt.
  • Custom B2B Modules: For more sophisticated B2B operations, you might use or develop a custom module that allows for "Quote Request," "Proforma Invoice," or "Payment on Account" options. These modules are specifically designed to set an initial status that requires manual review by your sales or accounting team.
  • Manual Status Updates: Once the B2B order is reviewed, approved, and payment terms are settled (e.g., invoice sent, payment received), your sales team can manually update the order status in the PrestaShop back office to "Payment Accepted," "Preparation in progress," or "Shipped."

Beyond Default: Customization for Advanced Scenarios

While the above solutions cover most scenarios, there might be instances where you need even finer control – for example, if you use the same payment module for both B2B and B2C but need different initial statuses. In such cases, custom development might be necessary.

A skilled PrestaShop developer can create a small custom module or an override (e.g., on the PaymentModule class or the Order class) to intercept the order creation process. This custom logic could then check the current store context (Context::getContext()->shop->id) or the customer's group (e.g., B2B customer group vs. B2C customer group) and dynamically assign the appropriate initial order status before the order is saved to the database.

// Example of a conceptual override (simplified)
// In a custom module or override file like /override/classes/PaymentModule.php
class PaymentModule extends PaymentModuleCore
{
    public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = array(), $currency_special = null, $d $secure_key = false, Shop $shop = null)
    {
        // Check current shop context
        if (Context::getContext()->shop->id == YOUR_B2B_SHOP_ID) {
            // Force B2B initial status if needed, overriding module default
            $id_order_state = Configuration::get('PS_OS_AWAITING_PAYMENT'); // Or a custom B2B status
        }
        // Call parent method with potentially modified status
        return parent::validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method, $message, $extra_vars, $currency_special, $dont_touch_quantity, $secure_key, $shop);
    }
}

Best Practices for Multistore Order Management

  • Regular Review: Periodically review your payment module configurations and webhook settings, especially after module updates or PrestaShop migrations.
  • Monitor Logs: Keep an eye on your server error logs and payment gateway transaction logs to quickly identify and resolve any communication failures.
  • Staff Training: Ensure your sales, customer service, and accounting teams are fully aware of the distinct order processing workflows for each store.
  • Expert Assistance: For complex multistore setups or if you're planning a PrestaShop migration, don't hesitate to consult with e-commerce migration experts like those at Migrate My Shop. We can help you design and implement robust, efficient workflows.

Optimizing order statuses in your PrestaShop multistore is more than just a convenience; it's a strategic move that enhances operational efficiency, reduces manual errors, and improves the overall customer experience for both your B2B and B2C clients. By understanding the interplay between payment modules, webhooks, and PrestaShop's core architecture, you can unlock the full potential of your e-commerce platform.

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools