myparcelnl / prestashop

PrestaShop module to integrate with MyParcel NL and BE
https://developer.myparcel.nl/nl/documentatie/11.prestashop.html
10 stars 5 forks source link

MyParcelNL PrestaShop v4.0.0 #226

Open EdieLemoine opened 9 months ago

EdieLemoine commented 9 months ago

This is a general thread about the upcoming v4.0.0 release. Feel free to ask questions or discuss here. Please post issues via the beta v4.0.0 issue form

We've rewritten the plugin from scratch using our Plugin Development Kit, which allows us to have one shared codebase for all functionality that's common across the plugins we have for several e-commerce platforms. The shared codebase is going to make it a lot easier for us to fix bugs and add features in the future as everything we change affects each of our e-commerce platform plugins/modules.

Some of the biggest features and improvements:

You can track our progress on the beta branch of this repository if you like. We intend on being able to close all existing bug reports with this update. See the linked Projects for more information on what we're working on.

We would be very grateful if you or your clients are willing to help us test the beta releases.

EdieLemoine commented 7 months ago

The first beta version was just released, we'd love to hear what you think!

crillaerts commented 6 months ago

The first beta version was just released, we'd love to hear what you think!

Question: what Prestashop version is supported ? I'm using the latest 8.1.2 version, is this already compatible ? (If so, see the issues I logged) - https://github.com/myparcelnl/prestashop/issues/236 - https://github.com/myparcelnl/prestashop/issues/237

If not, what is the latest supported version ? Thank you !

EdieLemoine commented 6 months ago

Hi @crillaerts, the latest 8.x version is fully supported so everything should work. Of course there can be bugs, but they shouldn't be very significant.

tajriba commented 6 months ago

Hi @EdieLemoine when is this version stable or RC planned? And also with PS 1.7 support?

EdieLemoine commented 6 months ago

Hi @tajriba,

It's hard to say because we want as many customers as possible to test the module before marking it as stable. We just haven't had enough users so far to be sure enough everything is working correctly.

We are going to send an e-mail to our PrestaShop customers soon to invite them to test this version. I do think 1.7 support should be done before marking it as stable, that's the highest priority issue we have open right now.

tajriba commented 5 months ago

@EdieLemoine Yes, please let us know when version (beta) 2.0 is ready for 1.7 support so we can test.

pipo1000 commented 4 months ago

Hello, what is your timeline on the latest plugin supporting Prestashop 8.1.x?

Currently I am running the myparcel plugin on an old version of prestashop on an old php version and we want to move to the latest version 8.1.4. Currently the only plugin you have is a plugin running Prestashop 1.7 which is out of support running a php version which is also out of support. As such the maneuverability to newer versions which are within the support matrix is very limited. I tried to run your 1.10 version of the plugin (Deze plugin werkt met PrestaShop 1.7+.) on the latest version of php and prestashop but I hit some compatibility issues (compile and runtime errors).

EdieLemoine commented 4 months ago

@pipo1000 the 2.x (beta) version of the module now supports PrestaShop 1.7.8+ as well as PrestaShop 8.0+. The 1.x version does not support PHP 8 nor PrestaShop 8.

We still want to see it in use by a few more customers before we release it as stable, so if you want to try it out that would be great.

pipo1000 commented 4 months ago

I tried to install 2.x beta 2 however I fall at the first hurdle. I installed a fresh empty docker container with image prestashop/prestashop:8.1.4 . Within this container I tried to install the myparcelnl-prestashop-2.0.0-beta.2.zip and it failed with an error about a hook. When I installed it again it succeeded but when saving the API key I get an error about a missing table. No single ps_myparcelnl* table has been created by the modules. Uninstalling and re-install does not help.

I also tried the plugin with 8.1.3, which also failed installing. As a last test I tried the plugin on 1.7.8.11, although I could install the plugin, it would not accept my API key, I get a SQL error as an response while saving the API key. All my testing has not been a success, did you test this plugin yourself and on what versions of PS?

See the errors below.

Any tips?

docker run -dti  --name ps81empty -p 8010:80 --link mariadb \
-e DB_SERVER=mariadb \
-e DB_NAME=ps81empty \
-e DB_PASSWD=password \
-e PS_INSTALL_AUTO=1 \
-e PS_COUNTRY=nl \
-e PS_ERASE_DB=1 \
-e PS_INSTALL_DB=1 \
-e PS_DOMAIN=192.168.2.45:8010 \
-e ADMIN_MAIL=some@domain.nl \
-e ADMIN_PASSWD=password \
prestashop/prestashop:8.1.4

First error ;

Installation of module myparcelnl failed. Error: Hook actionObjectCustomerMessageAddAfter could not be registered

Stack trace: 8.1.4
#0 /var/www/html/modules/myparcelnl/vendor/myparcelnl/pdk/src/Base/Facade.php(25): MyParcelNL\PrestaShop\Service\ModuleService->registerHooks()
#1 /var/www/html/modules/myparcelnl/src/Pdk/Installer/Service/PsInstallerService.php(90): MyParcelNL\Pdk\Base\Facade::__callStatic('registerHooks', Array)
#2 /var/www/html/modules/myparcelnl/vendor/myparcelnl/pdk/src/App/Installer/Service/InstallerService.php(52): MyParcelNL\PrestaShop\Pdk\Installer\Service\PsInstallerService->executeInstallation(Array)
#3 /var/www/html/modules/myparcelnl/src/Pdk/Installer/Service/PsInstallerService.php(57): MyParcelNL\Pdk\App\Installer\Service\InstallerService->install(Array)
#4 /var/www/html/modules/myparcelnl/vendor/myparcelnl/pdk/src/Base/Facade.php(25): MyParcelNL\PrestaShop\Pdk\Installer\Service\PsInstallerService->install(Object(MyParcelNL))
#5 /var/www/html/modules/myparcelnl/myparcelnl.php(101): MyParcelNL\Pdk\Base\Facade::__callStatic('install', Array)
#6 /var/www/html/modules/myparcelnl/myparcelnl.php(162): MyParcelNL->{closure}()
#7 /var/www/html/modules/myparcelnl/myparcelnl.php(102): MyParcelNL->withErrorHandling(Object(Closure))
#8 /var/www/html/src/Adapter/Module/Module.php(271): MyParcelNL->install()
#9 /var/www/html/src/Core/Module/ModuleManager.php(109): PrestaShop\PrestaShop\Adapter\Module\Module->onInstall()
#10 /var/www/html/src/PrestaShopBundle/Controller/Admin/Improve/ModuleController.php(384): PrestaShop\PrestaShop\Core\Module\ModuleManager->install('myparcelnl', '/tmp/php5P7xs4')
#11 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(169): PrestaShopBundle\Controller\Admin\Improve\ModuleController->importModuleAction(Object(Symfony\Component\HttpFoundation\Request))
#12 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php(81): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#13 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php(201): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, false)
#14 /var/www/html/admin123/index.php(84): Symfony\Component\HttpKernel\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, false)
#15 {main}

Stacktrace 8.1.3

Installation of module myparcelnl failed. Error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '68-949-1' for key 'PRIMARY'

Stack trace:
#0 /var/www/html/classes/db/Db.php(377): DbPDOCore->_query('INSERT INTO `ps...')
#1 /var/www/html/classes/db/Db.php(744): DbCore->query('INSERT INTO `ps...')
#2 /var/www/html/classes/db/Db.php(477): DbCore->q('INSERT INTO `ps...', true)
#3 /var/www/html/classes/Hook.php(619): DbCore->insert('ps_hook_module', Array)

Second error in http response when trying to install the plugin and saving the api key;

message `An exception occurred while executing 'SELECT t0.carrier_id AS carrier_id_1, t0.myparcel_carrier AS myparcel_carrier_2, t0.date_upd AS date_upd_3, 
t0.date_add AS date_add_4 FROM ps_myparcelnl_carrier_mapping t0 WHERE t0.myparcel_carrier = ? LIMIT 1' 
with params ["postnl"]:\n\nSQLSTATE[42S02]: Base table or view not found: 1146 Table 'ps81empty.ps_myparcelnl_carrier_mapping' doesn't exist`

HTTP Response on PS 1.7.8.11 saving API Key;

{
    "message": "An exception occurred while executing 'INSERT INTO ps_myparcelnl_carrier_mapping (carrier_id, myparcel_carrier, date_upd, date_add) VALUES (?, ?, ?, ?)' with params [13, \"postnl\", \"2024-03-24 12:33:12\", \"2024-03-24 12:33:12\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'postnl' for key 'myparcel_carrier'",
    "errors": [
        {
            "status": 400,
            "code": 0,
            "message": "An exception occurred while executing 'INSERT INTO ps_myparcelnl_carrier_mapping (carrier_id, myparcel_carrier, date_upd, date_add) VALUES (?, ?, ?, ?)' with params [13, \"postnl\", \"2024-03-24 12:33:12\", \"2024-03-24 12:33:12\"]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'postnl' for key 'myparcel_carrier'",
            "trace": "Enable development mode to see stack trace."
        }
    ]
}
pipo1000 commented 3 months ago

Could please verify my findings about issues I hit when trying out your new Myparcel Prestashop module and let me know? Many thanks in advance!