feat(main): Get it running

Still need to fix back office display
This commit is contained in:
2026-07-10 10:06:00 +02:00
parent d1d10cebba
commit 71a0efe445
8 changed files with 26 additions and 12 deletions
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ws_customerspecialty</name>
<displayName><![CDATA[Customer Specialty]]></displayName>
<version><![CDATA[1.0.0]]></version>
<description><![CDATA[Adds a manageable specialty/profession field to customer accounts, shown in the back office and exposed to order confirmation emails.]]></description>
<author><![CDATA[Isabelle Oving-Anno | De Websmid BV]]></author>
<tab><![CDATA[]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
</module>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

@@ -150,7 +150,7 @@ class CustomerSpecialtyController extends FrameworkBundleAdminController
]; ];
} }
private function getCommandBus() protected function getCommandBus()
{ {
return $this->get('prestashop.core.command_bus'); return $this->get('prestashop.core.command_bus');
} }
@@ -2,7 +2,7 @@
namespace Websmid\CustomerSpecialty\Form\DataHandler; namespace Websmid\CustomerSpecialty\Form\DataHandler;
use PrestaShop\PrestaShop\Core\Form\FormDataHandlerInterface; use PrestaShop\PrestaShop\Core\Form\IdentifiableObject\DataHandler\FormDataHandlerInterface;
use Websmid\CustomerSpecialty\Command\SaveCustomerSpecialtyCommand; use Websmid\CustomerSpecialty\Command\SaveCustomerSpecialtyCommand;
use PrestaShop\PrestaShop\Core\CommandBus\CommandBusInterface; use PrestaShop\PrestaShop\Core\CommandBus\CommandBusInterface;
@@ -2,7 +2,7 @@
namespace Websmid\CustomerSpecialty\Form\DataProvider; namespace Websmid\CustomerSpecialty\Form\DataProvider;
use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface; use PrestaShop\PrestaShop\Core\Form\IdentifiableObject\DataProvider\FormDataProviderInterface;
use Websmid\CustomerSpecialty\Entity\CustomerSpecialty; use Websmid\CustomerSpecialty\Entity\CustomerSpecialty;
use Websmid\CustomerSpecialty\Entity\CustomerSpecialtyLang; use Websmid\CustomerSpecialty\Entity\CustomerSpecialtyLang;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
@@ -10,7 +10,7 @@ use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
final class CustomerSpecialtyDataProvider implements FormDataProviderInterface final class CustomerSpecialtyDataProvider implements FormDataProviderInterface
{ {
public function getDefaultData(): array public function getDefaultData()
{ {
return [ return [
'title' => [], 'title' => [],
@@ -18,7 +18,7 @@ final class CustomerSpecialtyDataProvider implements FormDataProviderInterface
]; ];
} }
public function getData($id): array public function getData($id)
{ {
$entityManager = SymfonyContainer::getInstance()->get('doctrine.orm.entity_manager'); $entityManager = SymfonyContainer::getInstance()->get('doctrine.orm.entity_manager');
@@ -68,8 +68,9 @@ class CustomerSpecialtyGridDefinitionFactory extends AbstractGridDefinitionFacto
->setName($this->trans('Edit', [], 'Admin.Actions')) ->setName($this->trans('Edit', [], 'Admin.Actions'))
->setIcon('edit') ->setIcon('edit')
->setOptions([ ->setOptions([
'route' => 'customerspecialty_edit', 'route' => 'customerspecialty_edit',
'route_param_name' => 'idCustomerSpecialty', 'route_param_name' => 'idCustomerSpecialty',
'route_param_field' => 'id_ws_customerspecialty',
]) ])
) )
->add( ->add(
@@ -77,8 +78,9 @@ class CustomerSpecialtyGridDefinitionFactory extends AbstractGridDefinitionFacto
->setName($this->trans('Move up', [], 'Modules.Wscustomerspecialty.Admin')) ->setName($this->trans('Move up', [], 'Modules.Wscustomerspecialty.Admin'))
->setIcon('arrow_upward') ->setIcon('arrow_upward')
->setOptions([ ->setOptions([
'route' => 'customerspecialty_move_up', 'route' => 'customerspecialty_move_up',
'route_param_name' => 'idCustomerSpecialty', 'route_param_name' => 'idCustomerSpecialty',
'route_param_field' => 'id_ws_customerspecialty',
]) ])
) )
->add( ->add(
@@ -86,8 +88,9 @@ class CustomerSpecialtyGridDefinitionFactory extends AbstractGridDefinitionFacto
->setName($this->trans('Move down', [], 'Modules.Wscustomerspecialty.Admin')) ->setName($this->trans('Move down', [], 'Modules.Wscustomerspecialty.Admin'))
->setIcon('arrow_downward') ->setIcon('arrow_downward')
->setOptions([ ->setOptions([
'route' => 'customerspecialty_move_down', 'route' => 'customerspecialty_move_down',
'route_param_name' => 'idCustomerSpecialty', 'route_param_name' => 'idCustomerSpecialty',
'route_param_field' => 'id_ws_customerspecialty',
]) ])
), ),
]) ])
@@ -2,7 +2,7 @@
namespace Websmid\CustomerSpecialty\Grid\Filters; namespace Websmid\CustomerSpecialty\Grid\Filters;
use PrestaShop\PrestaShop\Core\Grid\Filter\Filters; use PrestaShop\PrestaShop\Core\Search\Filters;
use Websmid\CustomerSpecialty\Grid\Definition\Factory\CustomerSpecialtyGridDefinitionFactory; use Websmid\CustomerSpecialty\Grid\Definition\Factory\CustomerSpecialtyGridDefinitionFactory;
class CustomerSpecialtyFilters extends Filters class CustomerSpecialtyFilters extends Filters