Page 1 of 2

How to extend a mshop_order_base table

Posted: 13 Jun 2022, 09:59
by IvanIgniter
I am using laravel 6.x, PHP 7.4, Docker desktop/Ubuntu and the Aimeos 2021 (aimeos-laravel: 2021.10.4 / aimeos-core: 2021.10.13)

I have implemented different decorators like customers, product, orders but this time I want to create a decorator for sub-item for mshop_order_base table. From the documentation I can't find any examples. Kindly help me how to implement it or give me a link.

Thank you

Re: How to extend a mshop_order_base table

Posted: 14 Jun 2022, 19:23
by aimeos
It's the same like for the domain managers, only the configuration contains the type of the sub-manager:
https://github.com/aimeos/aimeos-core/b ... p#L78-L105

Re: How to extend a mshop_order_base table

Posted: 15 Jun 2022, 07:29
by IvanIgniter
I am not sure what you mean only the configuration contains the type of the sub-manager and based on the link.
This how I understand and did it but after php artisan aimeos:setup. No additional field was added in mshop_order_base table.
Please guide how it is done to make it right.
1.jpg
1.jpg (79.28 KiB) Viewed 1606 times
2.jpg
2.jpg (149.49 KiB) Viewed 1606 times
3.jpg
3.jpg (73.91 KiB) Viewed 1606 times
I also tried this way
1a.jpg
1a.jpg (37.79 KiB) Viewed 1605 times
And this
1b.jpg
1b.jpg (33.7 KiB) Viewed 1603 times
and moved the Myproject.php file to
ext\ai-admin-jqadm\lib\custom\src\MShop\Order\Manager\Base\Decorator\Myproject.php

Re: How to extend a mshop_order_base table

Posted: 17 Jun 2022, 05:21
by IvanIgniter
Waiting for a respond.. Please help what is the solution?

Re: How to extend a mshop_order_base table

Posted: 21 Jun 2022, 03:02
by IvanIgniter
Could anybody help or suggest what to do if they encounter the same issue?

Re: How to extend a mshop_order_base table

Posted: 21 Jun 2022, 04:06
by IvanIgniter
I have figured it out how to add the new columns to mshop_order_base but I couldn't display those added new fields.
Please advise what is the correct configuration to show it in aimeos admin order list page.
3a.jpg
3a.jpg (115.3 KiB) Viewed 1539 times

Re: How to extend a mshop_order_base table

Posted: 21 Jun 2022, 06:38
by aimeos
Your schema file is now correct (order.php) but your decorator configuration must be:

Code: Select all

'mshop' => [
	'order' => [
		'manager' => [
			'base' => [
				'decorators' => [
					'local' => [
						'MyProject'
					]
				]
			]
		]
	]
]
See: https://aimeos.org/docs/2022.x/config/m ... atorslocal

Re: How to extend a mshop_order_base table

Posted: 21 Jun 2022, 11:16
by IvanIgniter
Thank you..

'order' => [
'manager' => [
'base' => [
'decorators' => [
'local' => [
'Myproject'
]
]
],
'decorators' => [
'local' => ['Myproject']
]
]
]

Works for me.
The second mistake was the Decorator/Myproject should be mordba.fieldname not mordbase.fieldname

Re: How to extend a mshop_order_base table

Posted: 24 Jun 2022, 05:51
by IvanIgniter
Can I have a last one more question using a decorator.
I was able to display now what records are stored in the db but storing into that extra fields along with existing fields is not working.

Why is the comment field was the only one stored in the db and the new field last_name did not?
I was tracing the whole codes as will as the aimeos core to make it right but I can't figure it out.

Re: How to extend a mshop_order_base table

Posted: 26 Jun 2022, 07:46
by aimeos
You must hand over "last_name", not "order.base.last_name". The key is exactly the same as you use in your decorator.