Merge pull request #2421 from jitendra-webkul/1.0

Issue #2417 fixed
This commit is contained in:
Jitendra Singh 2020-02-11 15:05:48 +05:30 committed by GitHub
commit c58eba14f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 1 deletions

View File

@ -54,7 +54,7 @@ abstract class AbstractShipping
*
* @return array
*/
public function getDecription()
public function getDescription()
{
return $this->getConfigData('decription');
}

View File

@ -107,4 +107,29 @@ class Shipping
return $rates;
}
/**
* Returns active shipping methods
*
* @return array
*/
public function getShippingMethods()
{
$methods = [];
foreach (Config::get('carriers') as $shippingMethod) {
$object = new $shippingMethod['class'];
if (! $object->isAvailable())
continue;
$methods[] = [
'method' => $object->getCode(),
'method_title' => $object->getTitle(),
'description' => $object->getDescription()
];
}
return $methods;
}
}