Jump to content

Stripe Payment Module Error Cannot get ProductLazyArray from ID: Argument 1


Stephenray

Recommended Posts

I am getting errors on the Prestashop error logs of the following:

Some stripe payments are still being processed.

I can't see any corresponding activity on the Stripe developer logs and no customer shopping carts logged around the same time.

 

Is anyone else getting similar errors?

Prestashop V8.1.6

PHP version 8.1

Stripe Module version 3.6.8

 

stripe_official - mLpeIec1PCac0fNsoff - /classes/services/StripeDisplayHeaderService.php:61 - Cannot get ProductLazyArray from ID: Argument 1 passed to StripeOfficial\Classes\factories\StripeProductLazyArrayFactory::createProductLazyArrayFromProductId() must be of the type integer, null given, called in /home/automate/public_html/modules/stripe_official/classes/services/StripeDisplayHeaderService.php on line 59 - #0 /home/automate/public_html/modules/stripe_official/classes/services/StripeDisplayHeaderService.php(59): StripeOfficial\Classes\factories\StripeProductLazyArrayFactory::createProductLazyArrayFromProductId(NULL, Object(Context)) #1 /home/automate/public_html/modules/stripe_official/stripe_official.php(1235): StripeOfficial\Classes\services\StripeDisplayHeaderService->setHeaders() #2 /home/automate/public_html/classes/Hook.php(1043): Stripe_official->hookDisplayHeader(Array) #3 /home/automate/public_html/classes/Hook.php(418): HookCore::coreCallHook(Object(Stripe_official), 'hookDisplayHead...', Array) #4 /home/automate/public_html/classes/Hook.php(981): HookCore::callHookOn(Object(Stripe_official), 'displayHeader', Array) #5 /home/automate/public_html/classes/controller/FrontController.php(622): HookCore::exec('displayHeader') #6 /home/automate/public_html/controllers/front/ProductController.php(465): FrontControllerCore->initContent() #7 /home/automate/public_html/classes/controller/Controller.php(319): ProductControllerCore->initContent() #8 /home/automate/public_html/classes/Dispatcher.php(510): ControllerCore->run() #9 /home/automate/public_html/index.php(28): DispatcherCore->dispatch() #10 {main}

Link to comment
Share on other sites

 

Can you confirm your product URL structure under Shop Parameters → SEO & URLs → Schema of URLs?
(Does it include {id}-{rewrite} or have you removed {id}?)

Are you using any module or customization that removes numeric IDs from product URLs?

Link to comment
Share on other sites

Hi - thanks for your reply,

Here are the details from the schema page: I haven't modified anything here (that I am aware of). I do also use a theme and I it seems that it is not modifying the numeric ids from the url. Here is an example:

https://www.automatemyplace.com.au/accessories/91-12v-10ah-lithium-lifepo4-batteries-to-suit-gate-opener-ups-alarms-etc.html

 

image.thumb.png.0127b5094625b18ac6468f2f983538b7.png

image.png

Link to comment
Share on other sites

It’s not entirely clear what the root cause is from the logs alone. You could try matching one of the error timestamps to an abandoned cart or order attempt to see if a real customer was involved — if so, you could even reach out to that customer to ask whether they had any checkout issues around that time.

If the visitor actually reached Stripe, they would have already been logged in or registered, so you’d likely see a trace (cart, order, or payment intent). The fact that there’s none suggests these are bots or malformed direct requests hitting product or checkout URLs without valid parameters.

These aren’t real payment attempts, so nothing appears in your Stripe dashboard. A CAPTCHA or Turnstile won’t help here because those only protect form submissions, and these are GET requests from automated traffic.

As you can imagine, solving something like this properly requires hands-on review (logs, Stripe module, theme, etc.), which is difficult to do through the forum. PrestaShop offers paid support that’s generally quite good, and there’s also a Job offers section here if you want someone to take a closer look.

Link to comment
Share on other sites

Many thanks for your advice. That makes sense to me that these may not be genuine requests as there are no corresponding customer carts at the time. That was my main concern that I was missing orders. I will check with some customers that do process orders successfully and see if they had any issues. If not, I will just ignore these errors for now.

Link to comment
Share on other sites

Your very welcome @Stephenray

This may help:  Both methods stop the request before PHP loads, so it never reaches PrestaShop or the Stripe module.

Note there are other methods but this you can do without 3rd party.

Web server rules (Apache / Nginx)

Apache (.htaccess)

# Block product controller without id_product
RewriteCond %{QUERY_STRING} (^|&)controller=product(&|$) [NC]
RewriteCond %{QUERY_STRING} !(^|&)id_product=[0-9]+(&|$) [NC]
RewriteRule ^ - [F]

Nginx

if ($arg_controller = "product") {
    if ($arg_id_product = "") { return 403; }
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...