Get loaded shipping method given its id.

@param CartInterface $cart             Cart
@param string        $shippingMethodId Shipping method id

@return ShippingMethod|null Required shipping method
9131
public function getOneById(CartInterface $cart, $shippingMethodId)
    {
        $shippingMethods = $this->get($cart);

        return array_reduce(
            $shippingMethods,
            function (
                $foundShippingMethod,
                ShippingMethod $shippingMethod
            ) use ($shippingMethodId) {

                return ($shippingMethodId === $shippingMethod->getId())
                    ? $shippingMethod
                    : $foundShippingMethod;
            },
            null
        );
    }
51197
public function getShippingId()
    {
        if (!$this->_sShippingSetId) {
            $this->_sShippingSetId = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable('sShipSet');
        }

        $sActPaymentId = $this->getPaymentId();
        // setting default if none is set
        if (!$this->_sShippingSetId && $sActPaymentId != 'oxempty') {
            $oUser = $this->getUser();

            // choosing first preferred delivery set
            list(, $sActShipSet) = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Application\Model\DeliverySetList::class)->getDeliverySetData(null, $oUser, $this);
            // in case nothing was found and no user set - choosing default
            $this->_sShippingSetId = $sActShipSet ? $sActShipSet : ($oUser ? null : 'oxidstandard');
        } elseif (!$this->isAdmin() && $sActPaymentId == 'oxempty') {
            // in case 'oxempty' is payment id - delivery set must be reset
            $this->_sShippingSetId = null;
        }

        return $this->_sShippingSetId;
    }
70935
public function toWishlist($cart_id)
    {
        $result = null;
        $this->hook->attach('cart.move.wishlist.before', $cart_id, $result, $this);

        if (isset($result)) {
            return (array) $result;
        }

        $cart = $this->cart->get($cart_id);

        if (empty($cart) || !$this->cart->delete($cart_id)) {
            return $this->getResultError();
        }

        $result = $this->addToWishlist($cart);

        gplcart_static_clear();

        $this->hook->attach('cart.move.wishlist.after', $data, $result, $this);
        return (array) $result;
    }
1208382
public function findByOrderId($id, $locale = null)
    {
        try {
            $qb = $this->getShippingQuery($locale);
            $qb->andWhere('shipping.order = :id');
            $qb->setParameter('id', $id);

            return $qb->getQuery()->getResult();
        } catch (NoResultException $exc) {
            return null;
        }
    }
56304
protected function getListShipping()
    {
        $id = $this->getParam(0);

        if (!isset($id)) {
            $list = $this->shipping->getList();
            $this->limitArray($list);
            return $list;
        }

        $method = $this->shipping->get($id);

        if (empty($method)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        return array($method);
    }
1316772
public function loadOrderShippingMethod(
        CartInterface $cart,
        OrderInterface $order
    ) {
        $shippingMethodId = $cart->getShippingMethod();

        if (empty($shippingMethodId)) {
            return $this;
        }

        $shippingMethod = $this
            ->shippingWrapper
            ->getOneById($cart, $shippingMethodId);

        if ($shippingMethod instanceof ShippingMethod) {
            $order->setShippingAmount($shippingMethod->getPrice());
            $order->setShippingMethod($shippingMethod);
        }
    }
200145
public function dispatchCartLineOnAddEvent(
        CartInterface $cart,
        CartLineInterface $cartLine
    ) {
        $this->eventDispatcher->dispatch(
            ElcodiCartEvents::CARTLINE_ONADD,
            new CartLineOnAddEvent(
                $cart,
                $cartLine
            )
        );

        return $this;
    }
750507
protected function fetchAvailableShippingMethods()
    {
        if (!$this->methods) {
            $activeCarriers = $this->getShippingConfig()->getActiveCarriers();
            foreach ($activeCarriers as $carrierCode => $carrierModel) {
                $this->addShippingMethodsFromCarrier($carrierCode, $carrierModel);
            }
        }
        return $this->methods;
    }
366534
@Override
	public List<CommerceTaxFixedRateAddressRel> findByCommerceTaxMethodId(
		long commerceTaxMethodId) {
		return findByCommerceTaxMethodId(commerceTaxMethodId,
			QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
662538
public function getPaymentMethod()
    {
        /** @var \Order $order */
        $order = $this->getOrder()->source;
        if (isset($order->module)) {
            return $order->module;
        }
        return parent::getPaymentMethod();
    }
594788
function setShippingMethod() {
    global $total_count, $total_weight;
    // ensure that cart contents is calculated properly for weight and value
    if (!isset($total_weight)) $total_weight = $_SESSION['cart']->show_weight();
    if (!isset($total_count)) $total_count = $_SESSION['cart']->count_contents();
    // set the shipping method if one is not already set
    // defaults to the cheapest shipping method
    if ( !$_SESSION['shipping'] || ( $_SESSION['shipping'] && ($_SESSION['shipping'] == false) && (zen_count_shipping_modules() > 1) ) ) {
      require_once(DIR_WS_CLASSES . 'http_client.php');
      require_once(DIR_WS_CLASSES . 'shipping.php');
      $shipping_Obj = new shipping;

      // generate the quotes
      $shipping_Obj->quote();

      // set the cheapest one
      $_SESSION['shipping'] = $shipping_Obj->cheapest();
    }
  }
661858
public static com.liferay.commerce.tax.model.CommerceTaxMethod createCommerceTaxMethod(
		long commerceTaxMethodId) {
		return getService().createCommerceTaxMethod(commerceTaxMethodId);
	}
1219979
def cart_get(self, CartId=None, HMAC=None, **kwargs):
        
        if not CartId or not HMAC:
            raise CartException('CartId required for CartGet call')
        response = self.api.CartGet(CartId=CartId, HMAC=HMAC, **kwargs)
        root = objectify.fromstring(response)

        cart = AmazonCart(root)
        self._check_for_cart_error(cart)

        return cart
1283307
public function getShippingMethodTemplate($template, array $order, $shipping_model)
    {
        if (empty($order['shipping'])) {
            return '';
        }

        $method = $shipping_model->get($order['shipping']);
        return $this->getMethodTemplate($template, $order, $method);
    }
1015513
public static com.liferay.commerce.model.CommerceShippingMethod updateCommerceShippingMethod(
		com.liferay.commerce.model.CommerceShippingMethod commerceShippingMethod) {
		return getService().updateCommerceShippingMethod(commerceShippingMethod);
	}
532470
public function setShipping(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Shipping\Shipping $shipping = null)
    {
        $this->shipping = $shipping;

        return $this;
    }
691133
protected function getShippingMethodsCheckout()
    {
        $list = $this->shipping->getList(array('status' => true));
        $this->prepareMethodsCheckout($list);
        return $list;
    }