41 lines
780 B
PHP
41 lines
780 B
PHP
<?php
|
|
|
|
namespace Lts\Sales\Netsuite;
|
|
|
|
enum ShippingMethodMapping : int
|
|
{
|
|
//magento shipping method code => netsuite shipping method id
|
|
//In store pickup
|
|
case instore_pickup = 911;
|
|
|
|
//UPS Ground
|
|
case ups_03 = 1716;
|
|
|
|
//UPS Three-Day Select
|
|
case ups_12 = 7076;
|
|
|
|
//UPS Second Day Air
|
|
case ups_02 = 4622;
|
|
|
|
//UPS Next Day Air
|
|
case ups_01 = 7077;
|
|
|
|
//UPS Next Day Air Early A.M.
|
|
case ups_14 = 7074;
|
|
|
|
/**
|
|
* @param string $code
|
|
* @return int|null
|
|
*/
|
|
public static function getShippingMethodId(string $code)
|
|
{
|
|
foreach (self::cases() as $value) {
|
|
|
|
if (strtolower($value->name) === strtolower($code)) {
|
|
return $value->value;
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
} |