Skip to content
Snippets Groups Projects
Commit 87f929ed authored by Christel Loftus's avatar Christel Loftus
Browse files

Add company.php

parent 1ccb2a5a
No related branches found
Tags 1.0.25
1 merge request!6Rates at checkout
Checking pipeline status
......@@ -77,47 +77,4 @@ class AdditionalInfo
}
return $countryName;
}
// // Method to get the per-package price
// protected function _getPerpackagePrice($cost, $handlingType, $handlingFee)
// {
// if ($handlingType == AbstractCarrier::HANDLING_TYPE_PERCENT) {
// return $cost + $cost * $this->_numBoxes * $handlingFee / self::UNITS;
// }
// return $cost + $this->_numBoxes * $handlingFee;
// }
//
// // Method to get the per-order price
// protected function _getPerorderPrice($cost, $handlingType, $handlingFee)
// {
// if ($handlingType == self::HANDLING_TYPE_PERCENT) {
// return $cost + $cost * $handlingFee / self::UNITS;
// }
// return $cost + $handlingFee;
// }
//
// // Method to get configuration data of the carrier
// public function getCode($type, $code = '')
// {
// $codes = [
// 'method' => [
// 'bobGo' => __('BobGo'),
// ],
// 'unit_of_measure' => [
// 'KGS' => __('Kilograms'),
// 'LBS' => __('Pounds'),
// ],
// ];
// if (!isset($codes[$type])) {
// return false;
// } elseif ('' === $code) {
// return $codes[$type];
// }
// if (!isset($codes[$type][$code])) {
// return false;
// } else {
// return $codes[$type][$code];
// }
// }
}
<?php
namespace BobGroup\BobGo\Model\Carrier;
/**
* Get the Company information from the request body and return it
*/
class Company
{
/**
* @return mixed|string
*/
public function getDestComp(): mixed
{
$data = json_decode(file_get_contents('php://input'), true);
if (isset($data['address']['company'])) {
$destComp = $data['address']['company'];
} else {
$destComp = '';
}
return $destComp;
}
public function getSuburb(): mixed
{
$data = json_decode(file_get_contents('php://input'), true);
if (isset($data['address']['custom_attributes'][0]['value'])) {
$destSub = $data['address']['custom_attributes'][0]['value'];
//print_r($destSub);
} else {
$destSub = '';
}
return $destSub;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment