Skip to content

Commit

Permalink
Merge branch 'master' into Oauth_implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
jm-extend authored Sep 4, 2024
2 parents a11238c + 3dfbf33 commit 2f523e0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
20 changes: 20 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ Opening the admin settings Store / Configuration / Extend / Store View will show



**2.3.12**

Merge pull request #415 from helloextend/PUE_order_details_frontend

Patch Release: Add warranty item details





**2.3.11**

Patch Release: Add warranty item details

in the frontend, the Warranty Item was lacking details. this patch brings the warranty details and the parent order ID if present for PUE orders





**2.3.10**

Patch Release : Merge pull request #414 from helloextend/Bundle_product_Sync_price
Expand Down
5 changes: 5 additions & 0 deletions view/frontend/layout/sales_order_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<action method="setTemplate" ifconfig="warranty/enableExtend/enable">
<argument name="template" xsi:type="string">Extend_Warranty::order/item/additional-info.phtml</argument>
</action>
<arguments>
<argument name="viewModel" xsi:type="object">Extend\Warranty\ViewModel\Warranty</argument>
</arguments>



<block class="Extend\Warranty\Block\Order\Item\Renderer\LeadOfferRenderer"
name="order.item.warranty"
Expand Down
43 changes: 40 additions & 3 deletions view/frontend/templates/order/item/additional-info.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,48 @@
*/

/** @var $block \Magento\Framework\View\Element\Template */

/** @var \Extend\Warranty\ViewModel\Warranty $viewModel */
$viewModel = $block->getData('viewModel');
?>

<?php
$_item = $block->getItem();
$block->getChildBlock('order.item.warranty')->setItem($_item);

$_item = $block->getItem();
$block->getChildBlock('order.item.warranty')->setItem($_item);

if ($_item->getProductType()=='warranty'){

$_productOptions = $_item->getProductOptions();
$_planId = isset($_productOptions["warranty_id"]) ? $_productOptions["warranty_id"] : '';
$_parentSku= isset($_productOptions["associated_product"]) ? $_productOptions["associated_product"] : '';
$_contractID = $viewModel->unserialize($_item->getContractId()) ?? [];
$_contractID = is_array($_contractID) ? $_contractID : [$_contractID];

$_refunded = (isset($_productOptions["refund"]) && true == $_productOptions["refund"])
? "-- All refunded --" : '';

//retrieve Parent Order ID if present
$currentOrderId = $_item->getOrderId();
$parentOrderId = isset($_productOptions["parent_order_id"]) ? $_productOptions["parent_order_id"] : null;
$incrementId = $parentOrderId ? $viewModel->getOrderIncrementId($parentOrderId) : null;
?>
<div class="product-warranty-block">

<?php if (empty($_refunded) && $_contractID): ?>
<span><?= $block->escapeHtml(__('Contract ID'))?>: </span>
<?= /* @noEscape */ implode(", ", $_contractID); ?>
<?php else: ?>
<?= $block->escapeHtml($_refunded); ?>
<?php endif; ?>
<br /><span><?= /* @noEscape */ $block->escapeHtml(__('Plan ID'))?>: </span><?= /* @noEscape */ $_planId ?>
<br /><span><?= /* @noEscape */ $block->escapeHtml(__('Associated SKU'))?>: </span><?= /* @noEscape */ $_parentSku ?>

<?= $block->getChildHtml('', false);
</div>
<?php
if ($parentOrderId && ($parentOrderId <> $currentOrderId) && $incrementId) {
echo " Parent Order: <a href='". $block->getUrl('sales/order/view', ['order_id' => $parentOrderId])."'>".$incrementId."</a>";
}
}
?>
<?= $block->getChildHtml('', false);

0 comments on commit 2f523e0

Please sign in to comment.