To Add a new field to order ,below the invoice number

Help for integrating the Laravel package
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!
User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: To Add a new field to order ,below the invoice number

Post by aimeos » 09 Aug 2024, 13:49

Seems like after your change it fails to send the "refid" to the server correctly.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

hyalcin
Posts: 11
Joined: 09 Aug 2024, 13:22

Re: To Add a new field to order ,below the invoice number

Post by hyalcin » 28 Aug 2024, 11:47

I applied the above steps for the additions I made to the mshop_order_address table.

default/shema/order.php

Code: Select all

<?php

return [
    'table' => [
        'mshop_order_address' => function (\Aimeos\Upscheme\Schema\Table $table) {

            $table->string('care_fund');
            $table->string('insurance_number');
            $table->integer('care_level');
        }
        ]
     ]
     
I don't have a problem displaying these fields in the address form. However, I couldn't understand how to edit the order/item.php in the last section.

Code: Select all

$context = app('aimeos.context')->get(true);
        $controller = new \Aimeos\Controller\Frontend\Basket\Standard($context);
        $include = ['basket/address', 'basket/product'];

        $basket = $controller->get()->setCustomerId($context->user());

        $basketData = json_decode(json_encode($basket), true);
        Log::debug('created basket: ' . json_encode($basketData));
How can I access the fields I have newly added in the address?

User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: To Add a new field to order ,below the invoice number

Post by aimeos » 29 Aug 2024, 10:27

You need to add a decorator to the customer address manager for the new fields in the customer address table:
https://aimeos.org/docs/latest/models/e ... /#easy-way
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply