Order::getTotalPriceWithDelivery PHP Method

getTotalPriceWithDelivery() public method

public getTotalPriceWithDelivery ( ) : float
return float
    public function getTotalPriceWithDelivery()
    {
        $price = $this->getTotalPrice();
        if (!$this->separate_delivery) {
            $price += $this->getDeliveryPrice();
        }
        return $price;
    }

Usage Example

Example #1
0
 /**
  * Starts a payment session and returns its ID
  *
  * @param Order $order
  * @return string|bool
  */
 public function getSessionId(Order $order)
 {
     $data = ['key' => $this->key, 'type' => $this->type, 'order_id' => $order->url . '_' . time(), 'amount' => $order->getTotalPriceWithDelivery() * 100, 'product' => Yii::t('PaylerModule.payler', 'Order #{n}', $order->id)];
     $sessionData = $this->sendRequest($data, 'StartSession');
     if (!isset($sessionData['session_id'])) {
         Yii::log(Yii::t('PaylerModule.payler', 'Session ID is not defined.'), CLogger::LEVEL_ERROR);
         return false;
     }
     return $sessionData['session_id'];
 }
All Usage Examples Of Order::getTotalPriceWithDelivery