-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from david-fiaty-cko/master
Checkout.com Magento 2 Module - v1.0.8
- Loading branch information
Showing
11 changed files
with
262 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace CheckoutCom\Magento2\Block\Order; | ||
|
||
use Magento\Sales\Model\Order\Address; | ||
use Magento\Framework\View\Element\Template\Context as TemplateContext; | ||
use Magento\Framework\Registry; | ||
use Magento\Payment\Helper\Data as PaymentHelper; | ||
use Magento\Sales\Model\Order\Address\Renderer as AddressRenderer; | ||
|
||
/** | ||
* Invoice view comments form | ||
* | ||
* @author Magento Core Team <[email protected]> | ||
*/ | ||
class Info extends \Magento\Framework\View\Element\Template | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $_template = 'order/info.phtml'; | ||
|
||
/** | ||
* Core registry | ||
* | ||
* @var \Magento\Framework\Registry | ||
*/ | ||
protected $coreRegistry = null; | ||
|
||
/** | ||
* @var \Magento\Payment\Helper\Data | ||
*/ | ||
protected $paymentHelper; | ||
|
||
/** | ||
* @var AddressRenderer | ||
*/ | ||
protected $addressRenderer; | ||
|
||
/** | ||
* @param TemplateContext $context | ||
* @param Registry $registry | ||
* @param PaymentHelper $paymentHelper | ||
* @param AddressRenderer $addressRenderer | ||
* @param array $data | ||
*/ | ||
public function __construct( | ||
TemplateContext $context, | ||
Registry $registry, | ||
PaymentHelper $paymentHelper, | ||
AddressRenderer $addressRenderer, | ||
array $data = [] | ||
) { | ||
$this->addressRenderer = $addressRenderer; | ||
$this->paymentHelper = $paymentHelper; | ||
$this->coreRegistry = $registry; | ||
$this->_isScopePrivate = true; | ||
parent::__construct($context, $data); | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
protected function _prepareLayout() | ||
{ | ||
$this->pageConfig->getTitle()->set(__('Order # %1', $this->getOrder()->getRealOrderId())); | ||
$infoBlock = $this->paymentHelper->getInfoBlock($this->getOrder()->getPayment(), $this->getLayout()); | ||
$this->setChild('payment_info', $infoBlock); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getPaymentInfoHtml() | ||
{ | ||
$order = $this->coreRegistry->registry('current_order'); | ||
$payment = $order->getPayment(); | ||
$method = $payment->getMethodInstance(); | ||
|
||
return $method->getTitle(); | ||
|
||
} | ||
|
||
/** | ||
* Retrieve current order model instance | ||
* | ||
* @return \Magento\Sales\Model\Order | ||
*/ | ||
public function getOrder() | ||
{ | ||
return $this->coreRegistry->registry('current_order'); | ||
} | ||
|
||
/** | ||
* Returns string with formatted address | ||
* | ||
* @param Address $address | ||
* @return null|string | ||
*/ | ||
public function getFormattedAddress(Address $address) | ||
{ | ||
return $this->addressRenderer->format($address, 'html'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0"?> | ||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> | ||
<update handle="customer_account"/> | ||
<update handle="sales_order_item_renderers"/> | ||
<update handle="sales_order_item_price"/> | ||
<update handle="sales_order_info_links"/> | ||
<body> | ||
<referenceContainer name="page.main.title"> | ||
<block class="Magento\Sales\Block\Order\Info" name="order.status" template="order/order_status.phtml"/> | ||
<block class="Magento\Sales\Block\Order\Info" name="order.date" template="order/order_date.phtml"/> | ||
<container name="order.actions.container" htmlTag="div" htmlClass="actions-toolbar order-actions-toolbar"> | ||
<block class="Magento\Sales\Block\Order\Info\Buttons" as="buttons" name="sales.order.info.buttons" cacheable="false"/> | ||
</container> | ||
</referenceContainer> | ||
<referenceContainer name="sales.order.info.buttons"> | ||
<block class="Magento\Sales\Block\Order\Info\Buttons\Rss" as="buttons.rss" name="sales.order.info.buttons.rss" cacheable="false"/> | ||
</referenceContainer> | ||
<referenceContainer name="content"> | ||
<block class="Magento\Sales\Block\Order\View" name="order.comments" template="order/order_comments.phtml" before="sales.order.info.links"/> | ||
<block class="Magento\Sales\Block\Order\View" name="sales.order.view" cacheable="false" after="sales.order.info.links"> | ||
<block class="Magento\Sales\Block\Order\Items" name="order_items" template="order/items.phtml"> | ||
<block class="Magento\Framework\View\Element\RendererList" name="sales.order.items.renderers" as="renderer.list"/> | ||
<block class="Magento\Sales\Block\Order\Totals" name="order_totals" template="order/totals.phtml"> | ||
<arguments> | ||
<argument name="label_properties" xsi:type="string">colspan="4" class="mark"</argument> | ||
<argument name="value_properties" xsi:type="string">class="amount"</argument> | ||
</arguments> | ||
<block class="Magento\Tax\Block\Sales\Order\Tax" name="tax" template="order/tax.phtml"/> | ||
</block> | ||
</block> | ||
</block> | ||
<block class="CheckoutCom\Magento2\Block\Order\Info" as="info" name="sales.order.info" after="sales.order.view"/> | ||
</referenceContainer> | ||
<block class="Magento\Framework\View\Element\Template" name="additional.product.info" template="Magento_Theme::template.phtml"/> | ||
</body> | ||
</page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
/** | ||
* Copyright © 2013-2017 Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
// @codingStandardsIgnoreFile | ||
|
||
?> | ||
<?php /** @var $block \Magento\Sales\Block\Order\Info */ ?> | ||
<?php $_order = $block->getOrder() ?> | ||
<div class="block block-order-details-view"> | ||
<div class="block-title"> | ||
<strong><?php /* @escapeNotVerified */ echo __('Order Information') ?></strong> | ||
</div> | ||
<div class="block-content"> | ||
<?php if (!$_order->getIsVirtual()): ?> | ||
<div class="box box-order-shipping-address"> | ||
<strong class="box-title"><span><?php /* @escapeNotVerified */ echo __('Shipping Address') ?></span></strong> | ||
<div class="box-content"> | ||
<address><?php /* @escapeNotVerified */ echo $block->getFormattedAddress($_order->getShippingAddress()); ?></address> | ||
</div> | ||
</div> | ||
|
||
<div class="box box-order-shipping-method"> | ||
<strong class="box-title"> | ||
<span><?php /* @escapeNotVerified */ echo __('Shipping Method') ?></span> | ||
</strong> | ||
<div class="box-content"> | ||
<?php if ($_order->getShippingDescription()): ?> | ||
<?php echo $block->escapeHtml($_order->getShippingDescription()) ?> | ||
<?php else: ?> | ||
<?php /* @escapeNotVerified */ echo __('No shipping information available'); ?> | ||
<?php endif; ?> | ||
</div> | ||
</div> | ||
<?php endif; ?> | ||
|
||
<div class="box box-order-billing-address"> | ||
<strong class="box-title"> | ||
<span><?php /* @escapeNotVerified */ echo __('Billing Address') ?></span> | ||
</strong> | ||
<div class="box-content"> | ||
<address><?php /* @escapeNotVerified */ echo $block->getFormattedAddress($_order->getBillingAddress()); ?></address> | ||
</div> | ||
</div> | ||
<div class="box box-order-billing-method"> | ||
<strong class="box-title"> | ||
<span><?php /* @escapeNotVerified */ echo __('Payment Method') ?></span> | ||
</strong> | ||
<div class="box-content"> | ||
<?php echo $block->getPaymentInfoHtml() ?> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.