shoppingflux / shoppingfluxexport

7 stars 7 forks source link

Carrier matching system - Issues with uppercase #391

Closed ghost closed 6 years ago

ghost commented 6 years ago

Expected behaviour

Some marketplaces return the ShippingMethod name in uppercase, some other in lower case or camelcase style.

This should not create problem when matching the carrier from $actual_configuration (unserialize(Configuration::get('SHOPPING_FLUX_SHIPPING_MATCHING'))).

To do that we could force all carriers in lower case during matching to avoid mismatches.

Actual behaviour

If in the module configuration the carrier name is in lowercase and the one receive in the order in in uppercase then the matching will fail and the default carrier will be selected.

Steps to reproduce the behaviour

1 - In the carrier list, find an carrier in camel case, such as Mondial Relay 2 - Receive an order containing in ShippingMethod the carrier with another format (eg: MONDIAL RELAY) 3 - Once the order is created, check the carrier selected for the order. The carrier selected will not match. (The default carrier will be selected instead).

ghost commented 6 years ago

This shouldn't impact existing configurations. Therefore we will save the list of carriers again in lowercase when upgrading the module to 4.6.2