Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shipping method identifiers not matching #54

Open
lkreher opened this issue Aug 22, 2016 · 2 comments
Open

Shipping method identifiers not matching #54

lkreher opened this issue Aug 22, 2016 · 2 comments

Comments

@lkreher
Copy link

lkreher commented Aug 22, 2016

When listing available shipping modules in the backend via toOptionsArray, the shipping method "DPD Home Delivery" is identified as 'dpdclassic_classic', but when placing an order the same shipping method is identified as 'dpdclassic_dpdclassic'. This breaks compatibility with other modules that provide further options for specific shipping methods.

A quick fix would be:
Replace

    public function getAllowedMethods()
    {
        return array('classic' => $this->getConfigData('name'));
    }

with

    public function getAllowedMethods()
    {
        return array($this->_code => $this->getConfigData('name'));
    }

in Model/Carrier/Dpdclassic.php, but I'm not 100% certain this works without causing other issues.

@mvgucht
Copy link
Contributor

mvgucht commented Aug 29, 2016

Hey lkreher,

thanks for your feedback. that looks like a typo. I can not find any reference to classic_dpdclassic.

how are your preliminary tests going?

@lkreher
Copy link
Author

lkreher commented Aug 29, 2016

I'm talking about the backend function "toOptionsArray" of the full set of shipping methods, which creates a list of all available shipping methods and allows the user to select multiple shipping methods, similar to payment methods, shipping countries etc. This is not specific to this module, but a base function of magento.

But in the list created by that function the shipping methods receive an identification name apparently constructed by the carrier code ('dpdclassic' in this case) and the allowed methods provided by "getAllowedMethods()". So for each method in the return array of that function it will create a list item with 'dpdclassic_'.$arraykey as identifier, and right now the key is simply 'classic'.

My proposed fix changes the array key to 'dpdclassic', and this way the identifiers match up. We are still in the process of setting up everything, so I am still not sure this fix does not break some other functionality, but we have not found any problems yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants