I need to add additional fields in the order. These are the steps:
* create order.php with addColumn() calls
* extend Aimeos\MShop\Order\Item\Base with my own class B2bItem with __construct(), getters and setters for my fields, toArray() and fromArray().
* extend Aimeos\MShop\Order\Manager\Base with my own class B2bManager with createItemBase() returning B2bItem(...)
* extend Aimeos\Client\Html\Common\Decorator with my own class B2bCheckout
* add the new fields in the SELECT/INSERT/UPDATE queries in mshop.php, set manager->base->name to B2bManager
* configure the decorator B2bCheckout for checkout.
* extend jqadm template so that the new fields are accessed with their getters.
* add input fields for my new order fields in the frontend
I got parts of it to work:
* The fields in the database are created. I filled them manually for the first test.
* When I access the order in the backend, then the values of the new fields are displayed (via the getters).
* The input fields in the frontend are displayed.
* B2bCheckout is called.
But: Saving the basket results in an error thrown in the process method of B2bCheckout: "Call to undefined method Aimeos\MShop\Order\Item\Base\Standard::getOrdername()"
$controller = \Aimeos\Controller\Frontend::create( $this->getContext(), 'basket' );
if (($orderName = $view->param('cs_ordername')) !== null) {
$controller->get()->setOrderername($orderName);
$controller->save();
}
Something must be missing. I checked my code with the example here:
https://gist.github.com/boettner-it/081 ... 24907fe91b
In difference to the documentation (
https://aimeos.org/docs/Developers/Libr ... gers_items), the GIST is extending the Base classes.
Could you please throw some light on this?