Jump to content
  • 0

Order error: Object could not be converted to string


Maciej Sza

Question

Hi,

I Develops a new module. The module allows you to create new products. 
When I make an order in client area and click "Checkout & Pay" I get an error: 
"Uncaught Error, code 0 in ../vendors/minphp/language/src/Language.php on line 124 Message: Object of class stdClass could not be converted to string"

I add test empty product with "None" module and no errors appeared (item_string.png).
When dump the orders
I noticed that objects are being passed in "Item Ordered" (item_object.png).
Do you have any idea how to resolve this issue ?

 

 

 

item_string.png

item_object.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

There is likely an erroneous call to Language::_() in your module.  Argument 1 take a language key (e.g. 'AdminClients.add.name'), Argument 2 is boolean true to return the language and store it in a variable or false to output it to the webpage, argument 3+ are values submitted to sprintf (e.g. language is 'My name is %1$s' and the call is Language::_('AdminMain.myinfo.myname', true, $name)).  Likely you've accidentally submitted an object in argument 3+

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...