Closed juhanihaapala closed 4 years ago
Could you provide more information on what you are trying to do
if you take a look at the FedEx module
public function getAllowedMethods()
{
$allowed = explode(',', $this->getConfigData('allowed_methods'));
$arr = [];
foreach ($allowed as $k) {
$arr[$k] = $this->getCode('method', $k);
}
return $arr;
}
<field id="allowed_methods" translate="label" type="multiselect" sortOrder="190" showInDefault="1" showInWebsite="1" showInStore="0" canRestore="1">
<label>Allowed Methods</label>
<source_model>Magento\Fedex\Model\Source\Method</source_model>
<can_be_empty>1</can_be_empty>
</field>
But if you take a look at Flatrate
/**
* @return array
*/
public function getAllowedMethods()
{
return ['flatrate' => $this->getConfigData('name')];
}
So what allows methods are you trying to use
I made pr what I mean
@juhanihaapala ... thanks for the PR
Magento version #: any
Edition (EE, CE, OS, etc): Open Source
Expected behavior:
getAllowedMethods to return methods set in config
Actual behavior:
getAllowedMethods return one with the carrier name
Steps to reproduce:
Preconditions