Back to PhocacartCart class

Method getShippingMethod

public
getShippingMethod
()

Method getShippingMethod - Source code

public function getShippingMethod()
{
    $shipping = array();
    $shipping['title'] = $this->shipping['title'];
    $shipping['method'] = $this->shipping['method'];
    $shipping['id'] = $this->shipping['id'];
    $shipping['image'] = $this->shipping['image'];
    $shipping['params_shipping'] = $this->shipping['params_shipping'];
    // E.g. guest checkout
    if (isset($shipping['id']) && (int) $shipping['id'] > 0 && $shipping['title'] == '' && $shipping['method'] == '') {
        $shippingObject = new PhocacartShipping();
        $shippingObject->setType($this->type);
        $sI = $shippingObject->getShippingMethod((int) $shipping['id']);
        if (isset($sI->title)) {
            $shipping['title'] = $sI->title;
        }
        if (isset($sI->method)) {
            $shipping['method'] = $sI->method;
        }
        if (isset($sI->image)) {
            $shipping['image'] = $sI->image;
        }
    }
    return $shipping;
}