Hello Jerome,
thanks for the hint in the right direction. Now all is simple and is working like a charm!!
For the community and as a reference I share the php code of that little plugin. It is really easy to adapt it to any need.
<?php
/**
* @author CamModelTools
* @copyright (C) 2021-2021 CamModelTools. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
class plgHikaserial<nameofplugin> extends hikaserialPlugin {
protected $type = 'ext';
protected $multiple = false;
protected $name = '<nameofplugin>';
public function onBeforeSubscriptionCreate(&$subscription, &$do) {
/* echo '<pre>'; var_dump($subscription->orders[0]->cart->products[0]->name_of_extra_field); echo '</pre>'; */
$special_data = @$subscription->orders[0]->cart->products[0]->name_of_extra_field;
if(!empty($special_data))
{
if(empty($subscription->subscription_extradata))
$subscription->subscription_extradata = array();
$subscription->subscription_extradata['name_of_extra_field'] = $special_data;
}
}
}
Replace
<nameofplugin> with the name of the plugin; replace
name_of_extra_field with the name of your user defined field.
This boilerplate code works with user defined fields on item level.
I hope it will be of any help.
Thx
Sven