Deprecated: Creation of dynamic property VirtueMartControllerCart::$address_type

Started by lostmail, July 22, 2024, 19:34:30 PM

Previous topic - Next topic

lostmail

I have this error message above my cart side:

Deprecated: Creation of dynamic property VirtueMartControllerCart::$address_type is deprecated in /www/htdocs/w014c4cc/J4V4/components/com_virtuemart/controllers/cart.php on line 87

The message is coming but i have disabled error messages in joomla...(debugging not active).


In line 87 this is in cart.php:

$cart = VirtueMartCart::getCart(false, array(), NULL, $vendorId);

Something deprecated in PHP 8.2/8.3 ?
VirtueMart VirtueMart 4.2.16 11030 | Joomla 4.x | PHP 8.3 | Vp_neoteric 1.6

Jumbo!

Open - components/com_virtuemart/controllers/cart.php

Find the following codes between lines 32 to 33:

var $useSSL = null;
var $useXHTML = false;

Replace the above by:

var $useSSL = null;
var $useXHTML = false;
var $address_type = null;

lostmail

No the error is in line 87:

Deprecated: Creation of dynamic property VirtueMartControllerCart::$address_type is deprecated in /www/htdocs/w014c4cc/_J4V4/components/com_virtuemart/controllers/cart.php on line 87

$cart->order_language = vRequest::getString('order_language', $cart->order_language);

What is wrong here now ?
VirtueMart VirtueMart 4.2.16 11030 | Joomla 4.x | PHP 8.3 | Vp_neoteric 1.6

Jumbo!

It is not an error but a harmless deprecation warning. The solution is the same as that I posted earlier.

A quick fix will be to set the "Error Reporting" option to "None" in Joomla Global Configuration.

lostmail

Sorry - my mistake.

It seems VM has overwritten the modified cart.php with an update and the fix was gone....
I re-fixed it - but in a wrong path of my folders....so it did  not work.

Now it`s working and the message is gone.

THANK YOU !
VirtueMart VirtueMart 4.2.16 11030 | Joomla 4.x | PHP 8.3 | Vp_neoteric 1.6