Beispiel #1
0
 /**
  * Add shipping totals information to address object
  *
  * @param \Magento\Quote\Model\Quote $quote
  * @param \Magento\Quote\Model\Quote\Address\Total $total
  * @return array
  */
 public function fetch(\Magento\Quote\Model\Quote $quote, \Magento\Quote\Model\Quote\Address\Total $total)
 {
     $amount = $total->getShippingAmount();
     $shippingDescription = $total->getShippingDescription();
     $title = $amount != 0 && $shippingDescription ? __('Shipping & Handling (%1)', $shippingDescription) : __('Shipping & Handling');
     return ['code' => $this->getCode(), 'title' => $title, 'value' => $amount];
 }