How to extend a mshop_order_base table
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
- IvanIgniter
- Posts: 58
- Joined: 01 Dec 2021, 07:41
Re: How to extend a mshop_order_base table
Yes.. I have done it many times just the exact new field name as what I did in orders table decorator with no problem inserting new added field. But only in order_base table, any added extra fields in my decorator are the only fields that are not stored after saving?
Re: How to extend a mshop_order_base table
You can check here what happens during saving:
https://github.com/aimeos/aimeos-core/b ... d.php#L676
https://github.com/aimeos/aimeos-core/b ... d.php#L676
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
- IvanIgniter
- Posts: 58
- Joined: 01 Dec 2021, 07:41
Re: How to extend a mshop_order_base table
Thank you for that information.. I was able to trace the flow or data up to the last part in the core. I noticed that my added array has no chance to be stored and part of the added fields to be inserted just as what happen in order saving process.
I traced in this part fromArray() of order base part. The add() function has no way to be stored in the object to save "order_base" returning itself without saving the added array compared to "order" add() function which returns the added array and saved the added new field.
I have found a work around the only way I can save the added array in line 387 to store it in the object but this is in the aimeos core code part which is not the best solution. Kindly provide us the best solution without touching the aimeos core code.
I traced in this part fromArray() of order base part. The add() function has no way to be stored in the object to save "order_base" returning itself without saving the added array compared to "order" add() function which returns the added array and saved the added new field.
I have found a work around the only way I can save the added array in line 387 to store it in the object but this is in the aimeos core code part which is not the best solution. Kindly provide us the best solution without touching the aimeos core code.
Re: How to extend a mshop_order_base table
Thanks for tracking this down!
This is a left-over from the past where order base item doesn't extend from the common item class and where the code was duplicated in the order base item - but not for the custom properties. This has been fixed now in 2021.10.x-dev. Can you please test?
In dev-master, the order base item extends from common item class so this won't be a problem any more
This is a left-over from the past where order base item doesn't extend from the common item class and where the code was duplicated in the order base item - but not for the custom properties. This has been fixed now in 2021.10.x-dev. Can you please test?
In dev-master, the order base item extends from common item class so this won't be a problem any more
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
- IvanIgniter
- Posts: 58
- Joined: 01 Dec 2021, 07:41
Re: How to extend a mshop_order_base table
Your welcome..
I switch now from aimeos/aimeos-core from 2021.10.19 to 2021.10.x-dev and it work. My added new fields are successfully saved to order_base table. Thank you so much.
I switch now from aimeos/aimeos-core from 2021.10.19 to 2021.10.x-dev and it work. My added new fields are successfully saved to order_base table. Thank you so much.