Bonjour !
I try to edit some custom customer group fields in my Magento 2.3 but I don't know how to start.
I already have added some columns and displayed it in admin back-office with a module.
view/adminhtml/ui_component/customer_group_listing.xml
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<columns name="customer_group_columns">
<column name="siret">
<settings>
<filter>text</filter>
<label translate="true">SIRET</label>
</settings>
</column>
<column name="code_client">
<settings>
<filter>text</filter>
<label translate="true">Code client</label>
</settings>
</column>
<column name="zipcode">
<settings>
<filter>text</filter>
<label translate="true">Code postal</label>
</settings>
</column>
</columns>
</listing>
But now I want on the update form to have the capability to modify this fields (siret, code_client, zipcode)
For exemple, here I only have 2 fields but I want to add for example the zipcode in the form.
Thanks ;)
Thanks for the help.
I extend my module and now I try to display the field SIRET, and I modify the file Form.php.
The field is display but the field is not filled.
I try to modify the Save.php, Group.php
//Save.php
$siret = $this->getRequest()->getParam('SIRET');
$customerGroup->setSiret(!empty($siret) ? $siret : null);
//Group.php
public function getSiret()
{
return $this->_get(self::SIRET);
}
public function setSiret($siret)
{
return $this->setData(self::SIRET, $siret);
}
// GroupRepository.php
public function getById($id)
{
$groupModel = $this->groupRegistry->retrieve($id);
$groupDataObject = $this->groupDataFactory->create()
->setId($groupModel->getId())
->setCode($groupModel->getCode())
->setTaxClassId($groupModel->getTaxClassId())
->setSiret($groupModel->getSiret());
return $groupDataObject;
}
I add setSiret() everywhere in the file where we had setTaxClassId().
But it doesn't work, can someone help me ?
Thank you.