Skip to content
Snippets Groups Projects

Resolve "Magento extension :: Rates at checkout"

Merged Christel Loftus requested to merge 4-magento-extension-rates-at-checkout into dev
3 files
+ 170
45
Compare changes
  • Side-by-side
  • Inline

Files

  • c7a51e97
    #4 - additions to rates at checkout magento · c7a51e97
    Christel Loftus authored
@@ -3,9 +3,9 @@
@@ -3,9 +3,9 @@
namespace BobGroup\BobGo\Model\Carrier;
namespace BobGroup\BobGo\Model\Carrier;
/**
/**
* Get the Company information from the request body and return it
* Get the AdditionalInfo information from the request body and return it
*/
*/
class Company
class AdditionalInfo
{
{
/**
/**
@@ -36,4 +36,45 @@ class Company
@@ -36,4 +36,45 @@ class Company
}
}
return $destSub;
return $destSub;
}
}
 
 
/**
 
* @return mixed|string
 
*/
 
public function getDestTelephone(): mixed
 
{
 
$data = json_decode(file_get_contents('php://input'), true);
 
 
if (isset($data['address']['telephone'])) {
 
$destTelephone = $data['address']['telephone'];
 
} else {
 
$destTelephone = '';
 
}
 
return $destTelephone;
 
}
 
 
 
/**
 
* @var \BobGroup\BobGo\Model\Carrier\AdditionalInfo
 
*/
 
public $countryFactory;
 
 
public function __construct($countryFactory)
 
{
 
$this->countryFactory = $countryFactory;
 
}
 
 
/**
 
* country full name
 
*
 
* @return string
 
*/
 
public function getCountryName($countryId): string
 
{
 
$countryName = '';
 
$country = $this->countryFactory->create()->loadByCode($countryId);
 
if ($country) {
 
$countryName = $country->getName();
 
}
 
return $countryName;
 
}
}
}
Loading