cancel
Showing results for 
Search instead for 
Did you mean: 

Change error message on checkout "An error occurred on the server. Please try again"

Change error message on checkout "An error occurred on the server. Please try again"

Hi,

 

I'm trying to customize the error message that appears on the checkout page. I've changed the 

 public function savePaymentInformationAndPlaceOrder(
        $cartId,
        \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
        \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
    ) {
        $this->savePaymentInformation($cartId, $paymentMethod, $billingAddress);
        try {
            $orderId = $this->cartManagement->placeOrder($cartId);
        } catch (\Exception $e) {
            throw new CouldNotSaveException(
                __('Your order could not be placed. Please call to order.'),
                $e
            );
        }
        return $orderId;
    }

in the files below:

vendor/magento/module-checkout/Model/PaymentInformationManagement.php 

vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php

But the same message "An error occurred on the server..." appears.

 

I'm in production mode so I've redeployed static content, recompiled the code and cleaned and flushed my cache. I'm not sure if I'm missing another place to change or if this message is still stuck in the cache somewhere.

 

Thanks