postnl / postnl-magento2

This is the official Magento 2 extension for the logistics company PostNL. Add shipping options and parcelshops to your checkout. Create labels with track and trace functionality from the backend.
58 stars 60 forks source link

Mismatch Shipping method names #15

Closed gaurav-s closed 7 years ago

gaurav-s commented 7 years ago

Hi,

An order placed with PostNL as shipping method and shipping options, the method name in Order Table is "tig_postnl_regular".

I have a configuration page where I get the shipping methods by Magento\Shipping\Model\Config\Source\Allmethods

The shipping method name returned is "tig_postnl_tig_postnl". This mismatch is causing a problem in the functionality.

How do I get the exact same method name if order is placed with postNL shipping options.

tig-jaspersmits commented 7 years ago

Hi Gaurav-s,

My colleague Michiel mentioned that you can find the way we do it over here: https://github.com/tig-nl/postnl-magento2/blob/master/Helper/Data.php#L78..L88 Can you let me know if this gave the result you were expecting?

Kind regards,

Jasper

gaurav-s commented 7 years ago

Hi Jasper,

I can change it in the file you have mentioned, It would have been fine if I had to do it for a single shop. But It would not work for a generic plugin,

I wanted to understand are there any other shipping methods names this plugin returns apart from "tig_postnl_regular", if this is the only one why not make it more consistent and return the same when we call, Magento\Shipping\Model\Config\Source\Allmethods.

The plugin which we have builds asks admin to select Shipping methods during plugin configuration setup, then we have to run a process if that shipping method is found in the order. This is working fine with your Magento1 plugin. I hope it works in similar way with magento2 as well.

Regards, Gaurav

tig-michielgerritsen commented 7 years ago

Hello,

The tig_postnl_regular is the only name that is used, there are no other shipping methods right now. That tig_postnl_tig_postnl is returned seems to be a bug and should not happen. This seems a bug. I have added it to our backlog to further investigate. You can follow it, but it is in Dutch: https://jira.tig.nl/browse/POSTNLM2-327