Undefined property: $prefix
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Undefined property: $prefix
I made a little of progress trying to add custom fields to address part in checkout.
Now I am getting the following error:
Undefined property: Aimeos\MShop\Order\Item\Base\Address\MyExt::$prefix
(even if I use the Standard manager):
Undefined property: Aimeos\MShop\Order\Item\Base\Address\Standard::$prefix
It starts here:
https://github.com/aimeos/ai-controller ... d.php#L303
And breaks here:
https://github.com/aimeos/aimeos-core/b ... se.php#L66
And here is the var_dump of $address object:
Any hints on what I am missing?
Now I am getting the following error:
Undefined property: Aimeos\MShop\Order\Item\Base\Address\MyExt::$prefix
(even if I use the Standard manager):
Undefined property: Aimeos\MShop\Order\Item\Base\Address\Standard::$prefix
It starts here:
https://github.com/aimeos/ai-controller ... d.php#L303
And breaks here:
https://github.com/aimeos/aimeos-core/b ... se.php#L66
And here is the var_dump of $address object:
Code: Select all
/var/www/e-commerce/2marchio/vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Order/Item/Base/Base.php:282:
object(Aimeos\MShop\Order\Item\Base\Address\Standard)[335]
private 'values' =>
array (size=2)
'order.base.address.siteid' => int 1
'order.base.address.type' => string 'payment' (length=7)
private 'prefix' (Aimeos\MShop\Common\Item\Address\Base) => string 'order.base.address.' (length=19)
private 'modified' (Aimeos\MShop\Common\Item\Base) => boolean true
private 'values' (Aimeos\MShop\Common\Item\Address\Base) =>
array (size=12)
'order.base.address.siteid' => int 1
'order.base.address.firstname' => string 'xxxxx' (length=5)
'order.base.address.lastname' => string 'xxxxx' (length=9)
'order.base.address.vatid' => string 'xxxxx' (length=11)
'order.base.address.address1' => string 'xxxxxx' (length=18)
'order.base.address.address2' => string 'uhehe' (length=5)
'order.base.address.address3' => string '931' (length=3)
'order.base.address.city' => string 'xxxx' (length=5)
'order.base.address.state' => string 'xx' (length=2)
'order.base.address.postal' => string '53444-222' (length=9)
'order.base.address.email' => string 'xxxxxx' (length=32)
'order.base.address.telephone' => string '3242312312' (length=10)
private 'prefix' (Aimeos\MShop\Common\Item\Base) => string 'order.base.address.' (length=19)
private 'values' (Aimeos\MShop\Common\Item\Base) =>
array (size=1)
'order.base.address.siteid' => int 1
Re: Undefined property: $prefix
I guess, you have overwritten the constructor but didn't call the parent constructor, so no prefix is set:
https://github.com/aimeos/aimeos-core/b ... rd.php#L34
https://github.com/aimeos/aimeos-core/b ... rd.php#L34
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Undefined property: $prefix
I haven't overwritten the constructor...
I tried to overwrite it (calling the parent constructor but the error is the same).
I have debugged and the code goes all way up to `Common/Item/Base.php` setting the value for $prefix value correctly.
https://github.com/aimeos/aimeos-core/b ... se.php#L37
But the error keeps popping up in the same line as described in the first item of this thread
I tried to overwrite it (calling the parent constructor but the error is the same).
I have debugged and the code goes all way up to `Common/Item/Base.php` setting the value for $prefix value correctly.
https://github.com/aimeos/aimeos-core/b ... se.php#L37
But the error keeps popping up in the same line as described in the first item of this thread
Re: Undefined property: $prefix
If you post the code of your item class, we can maybe tell you what's wrong
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Undefined property: $prefix
Hi!
Here it is...
Manager: http://pastebin.com/r6vPsQ8P
Item: http://pastebin.com/hZPQRXXT
I was able to bypass the error commenting the line 282 here:
https://github.com/aimeos/aimeos-core/b ... e.php#L282
The id was null anyways... But we need to uncomment this line and make it work as it should!
Here it is...
Manager: http://pastebin.com/r6vPsQ8P
Item: http://pastebin.com/hZPQRXXT
I was able to bypass the error commenting the line 282 here:
https://github.com/aimeos/aimeos-core/b ... e.php#L282
The id was null anyways... But we need to uncomment this line and make it work as it should!
Re: Undefined property: $prefix
Your manager seems to be OK, please show us your new item too.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Undefined property: $prefix
Just edited my last post
Re: Undefined property: $prefix
Seems to be OK too. Which PHP version do you use? If PHP 7 is it at least PHP 7.0.4?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Undefined property: $prefix
Code: Select all
vagrant@vagrant-ubuntu-trusty-64:~$ php -v
PHP 5.5.36-1+donate.sury.org~trusty+1 (cli) (built: May 26 2016 13:10:45)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
Re: Undefined property: $prefix
Hm, PHP 5.5 is usually not problematic (early versions of PHP 7 are) and I hope you didn't find a PHP bug.
to your own class and see if this works? If not you can try to initialize it with "order.base.address."
The strange thing is that Aimeos\MShop\Common\Item\Base contains the "prefix" property including the right value in your var_dump() output. Can you try to addbrunojti wrote: And here is the var_dump of $address object:Code: Select all
/var/www/e-commerce/2marchio/vendor/aimeos/aimeos-core/lib/mshoplib/src/MShop/Order/Item/Base/Base.php:282: private 'prefix' (Aimeos\MShop\Common\Item\Base) => string 'order.base.address.' (length=19) private 'values' (Aimeos\MShop\Common\Item\Base) =>
Code: Select all
private $prefix
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star