"Cannot use object of type stdClass as array" when choosing a payment method

Started by lumares, April 09, 2020, 16:47:47 PM

Previous topic - Next topic

lumares

Since the last updates we get a "Cannot use object of type stdClass as array" error when I go to checkout and choose a payment method.

We are running:
Joomla 3.9.16
Virtuemart 3.6.10 10211
Payments via: VM modules and RO payments (v 5.2.0)

Problem:
In checkout when we choose a payment method, error "Cannot use object of type stdClass as array" appears.
Before the updates everything was working fine.

Troubleshooting:
We already contacted the ro payments and they did some checking.

Quote"The error basically says it fails in the function checkForCartQuantities on line 2030 in the file components/com_virtuemart/helpers/cart.php."

Also see attachement.

Any help would greatly be appreciated.
S.


pinochico

I think problem is mybe in paymet plugin RO == contact payment plugin developer
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

lumares

Yes, that is exaclty what I did. They said it has to be Virtuemart.

GJC Web Design

QuoteYes, that is exaclty what I did. They said it has to be Virtuemart.

well .. if they can't be bothered to update their plugin for new versions then it tells u a lot about their commitment to their clients and VM

switch on Joomla debug and u should get a stack trace to show u exactly where the error is being thrown
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

lumares

They did help, this is the exact statement I got from Ro payments, after his research (screenshot is the one above):

QuoteHello Steven,

I have taken a look and it is not an RO Payments problem as the error is generated in the VirtueMart code. Attached is the screenshot from the site. This doesn't happen when I click checkout but it happens for me when I click a payment method.

In that case it may be related to the OPC but that is for VirtueMart to tell you as I have no idea about that. The error basically says it fails in the function checkForCartQuantities on line 2030 in the file components/com_virtuemart/helpers/cart.php.

I just don't know what to do with this info; To be honest I don't know what OPC is?

I do have backups etc... but after updating the same happens. We are always strickt in updating our all Joomla sites and plugins.
I also disabled the whole RO payments plugin and only enabled VM COD and VM bank transfer. Same thing happens.

when selecting a payment method the error appears.

When I enable debug, I can't get any further then the homepage?

I can post the link to the site if you want or pm.

Any help is greatly appreciated.
Steven


GJC Web Design

OPC = One Page Checkout

r u using a 3rd party checkout?

so it happens on any payment method?

that line is

if($quantity!=$this->cartProductsData[$key]['quantity']){

so check what are the values of the vars  ... esp  $this->cartProductsData

should be an array

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

QuoteI also disabled the whole RO payments plugin

I think Virtuemart load any payments plugins even if disabled in the cart (initializes them). If this true, then RO plugin error in cart persists :(
We delete all payments plugin if we don't need.
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

lumares

Quote from: GJC Web Design on April 10, 2020, 23:03:29 PM
OPC = One Page Checkout

r u using a 3rd party checkout?

so it happens on any payment method?

that line is

if($quantity!=$this->cartProductsData[$key]['quantity']){

so check what are the values of the vars  ... esp  $this->cartProductsData

should be an array

Thank you for the tips, I have disabled OPC. -> Now the error happens when I click on "submit order".

So now I did a complete back-up restore and I am updating plugin per plugin to find the culprit.

1) Working & already updated site/shop with only VM and RO updates left open to be updated. > at this moment the shop is working as it should.
2) I Install the VM update and get an error: "Class 'vmPSPlugin' not found" -> now I get error "Cannot use object of type stdClass as array"

So the causing problem seems to do with Class 'vmPSPlugin' not found during the vm update.

PHP max execution is 60 and max men 128M , max file 512M

So at this point RO payments isn't even installed yet.

jenkinhill

Did you update both the VM component and the associated aio package?

Do you have any other third party VM plugins installed (apart from OPC)?
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

pinochico

Quote2) I Install the VM update and get an error: "Class 'vmPSPlugin' not found" -> now I get error "Cannot use object of type stdClass as array"

Virtuemart hase bug and not initialized vm model in payment or shipment plugins.
For this we must upgraded our gopay payment plugin and vm standard shipping plugin and add some code for loading some class.
I don't know what is with new version 3.6.10 and higher, but I think change wotking with loading models and class (we must upgraded VirtueMart Mailing Manager too).

So for this moment you must upgrade RO payment plugin.
Definitelly.

Yre you another question? :D
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products