Ejemplo n.º 1
0
 /**
  * Render Checkout Summary
  *
  * @return HtmlTagBuilder
  */
 public function renderCheckoutSummary()
 {
     /** @var HtmlTagBuilder $result */
     $result = HtmlTagBuilder::div();
     $checkout = $this->checkout;
     // Customer and Payment
     $customer = $checkout['customer'];
     $result->append(HtmlTagBuilder::h2($customer->label()));
     $paymentMethod = $this->paymentMethods[$customer['paymentMethod']->val()];
     $result->append($this->buildKeyValueTable(array($customer['email']->label() => $customer['email']->val(), $customer['telephone']->label() => $customer['telephone']->val(), $customer['paymentMethod']->label() => HtmlTagBuilder::div(HtmlTagBuilder::h3($paymentMethod['name']))->appendText($paymentMethod['desc']))));
     // Addresses
     $billing = $checkout['billing'];
     $shipping = $checkout['shipping'];
     $result->append(HtmlTagBuilder::h2($billing->label()));
     $result->append($this->renderAddress($billing));
     $result->append(HtmlTagBuilder::h2($shipping->label()));
     if ($shipping['use_shipping_address']->val() === 'on') {
         $result->append($this->renderAddress($shipping));
     } else {
         $result->append($this->i18n->translate('checkoutSummary.shippingAdrSameAsBilling'));
     }
     // Comment
     $extra = $checkout['extra'];
     $result->append(HtmlTagBuilder::h2($extra->label()));
     $result->appendText($extra['comment']->val());
     return $result;
 }