Hi Nicolas,
I've got an idea that maybe simplifies the process. I should create an extra field for order, which is read-only and fill it with the selected data choosen from the dropdown lsit.
I've restarted the plugin as you adviced, tried to re-use some other plugin's part.
I've created the Checkout step. In onCheckoutStepDisplay function as I had no idea how to remove a step if not the specified shipping plugin is choosen, I take the new checkout step under the Address in configuration. I loaded the shipping class to examine if that shipping plugin is choosen (if not then the dropdown do not shows). After that I added the dropdown filled with the XML data.
1.) But whatever I choose from dropdown, there's no "selected" parameter in the code in front of the choosen item. Maybe that's why I'm unable take the data to next step. If dropdown name is "PPPlehetosegek" then I should use
shouldn't I?
2.) Also I don't know how to take the selected data to the custom field to fill in. Maybe I should also use the session as you adviced
$_SESSION['valasztott_PPP'] = $_POST['PPPlehetosegek'];
But then how to load it to the field?
3.) I tried to set in onAfterCheckoutStep to force the user to choose an item mandatory, and don't let him to move to next step until nothing is choosen. But maybe I copied no the correct code.
if(empty($_SESSION['valasztott_PPP']) || is_null($_SESSION['valasztott_PPP'])) {
$go_back = true;
$app->setUserState('No PPP choosen!');
}
Thanks in advance for your long patience!