Provide service name in getAllowedMethods function#23
Provide service name in getAllowedMethods function#23micwallace wants to merge 2 commits intofontis:masterfrom
Conversation
Carrier name is currently provided as the value for every service in the getAllowedMethods function. This patch corrects this so that the service name is returned instead.
|
Looks good @micwallace! Just had one request before I merge it in - could you have it fall back to the |
|
Hi @chnorton! I think it would be better to exclude the method if it doesn't exist in the config any more. Or possibly show the service code instead. Which one do you think? |
|
@micwallace it shouldn't be very common for a method to still be in the allowed list, but not have any config. So in this case just showing the service code probably makes sense. |
Fallback to method code when method name isn't found in the config.
|
Hi @chnorton, I've made the requested modification. I've also come across another problem which I think should be corrected. In AustraliaPost.php there is the following code: This is problematic since the transformations performed on the method code means that it no longer maps correctly to a valid Australia post service code. What was the logic behind this? Is there a dependency on this format? The Fontis Australia extension for Magento 1 does not make those transformations. It would be helpful to add an option to keep the standard service code when other service options aren't used. We use the official Aus. Post code to map Magento methods to shipping methods in our ERP system. I think other people would also require an exact method code to match which external systems. I am happy to create a pull request to create that option if you think other people would benefit. |
Carrier name is currently provided as the value for every service in the getAllowedMethods function. This patch corrects this so that the service name is returned instead.