This commit is contained in:
Jitendra Singh 2020-02-11 15:02:04 +05:30
parent 66f29937e9
commit 002a977e22
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;
}
}