silvershop-core
silvershop-core copied to clipboard
Error Message: LogOut or Session-Timeout during Checkout process
Hi I need a bit help with a problem which occurs in silvershop: If the session dies after timeout or the user logs out during the checkout-process the order-data is set to null and an 500 Error is thrown.
[Emergency] Uncaught TypeError: Argument 1 passed to SilverShop\Checkout\CheckoutComponentConfig::__construct() must be an instance of SilverShop\Model\Order, null given
POST /checkout/ShippingAddressForm/
Line 27 in /usr/www/users/shopyq/vendor/silvershop/core/src/Checkout/CheckoutComponentConfig.php
The user gets the default blank-page with 'The requested page is not found.' Is there anything I can do, to customize this message and render it with my template?
Thanks in advance.
Having a similar issue where the user session expires during payment, so the order is inaccessible when the user is directed back to the shop.
@Leapfrognz is your payment offsite or onsite?
In the short term - if it's onsite then apply a similar fix to user forms to prevent timeout (https://github.com/silverstripe/silverstripe-userforms/blob/5/client/src/bundles/UserForms.js#L759-L764) if it's offsite then you need to modify the PHP session timeout. By default, active sessions will expire after 24 minutes of inactivity so you may want to expand that to 60 minutes.
Long term I think we can look into long-lived checkout tokens for managing state rather than relying on sessions directly.
@wilr offsite. Ive added a short term fix by pushing order ID's into a cookie, and also adding a salted token to the return url and checking that.
@wilr we have a project which has this payment-config:
SilverStripe\Omnipay\Model\Payment:
allowed_gateways:
- 'Manual'
When a user without account tries to submit the order, the loading time is very long and ends in a 404 page - I guess the session expires here too. Users with account only experience the long loading time. Can this be fixed with php too?
Version: dev-master , silverstripe 4.9.0