You are here

public function USPSRateRequestBase::cleanServiceName in Commerce USPS 8

Utility function to clean the USPS service name.

Parameters

string $service: The service id.

Return value

string The cleaned up service id.

2 calls to USPSRateRequestBase::cleanServiceName()
USPSRateRequest::resolveRates in src/USPSRateRequest.php
Resolve the rates from the RateRequest response.
USPSRateRequestInternational::resolveRates in src/USPSRateRequestInternational.php
Resolve the rates from the RateRequest response.

File

src/USPSRateRequestBase.php, line 207

Class

USPSRateRequestBase
Class USPSRateRequest.

Namespace

Drupal\commerce_usps

Code

public function cleanServiceName($service) {

  // Remove the html encoded trademark markup since it's
  // not supported in radio labels.
  $service = str_replace('<sup>™</sup>', '', $service);
  $service = str_replace('<sup>®</sup>', '', $service);
  return $service;
}