Permalink
Browse files

Added 3 new outputs to order loop

  • Loading branch information...
roadster31 committed Jan 8, 2019
1 parent fd18c00 commit d2fe4730f84921d8830e1ff43940ec0fcd7a4c04
Showing with 13 additions and 1 deletion.
  1. +13 −1 core/lib/Thelia/Core/Template/Loop/Order.php
@@ -119,6 +119,7 @@ public function getSearchIn()
* @param $searchTerm
* @param $searchIn
* @param $searchCriteria
* @throws \Propel\Runtime\Exception\PropelException
*/
public function doSearch(&$search, $searchTerm, $searchIn, $searchCriteria)
{
@@ -281,12 +282,20 @@ public function buildModelCriteria()
return $search;
}
/**
* @param LoopResult $loopResult
* @return LoopResult
* @throws \Propel\Runtime\Exception\PropelException
*/
public function parseResults(LoopResult $loopResult)
{
/** @var \Thelia\Model\Order $order */
foreach ($loopResult->getResultDataCollection() as $order) {
$tax = 0;
$tax = $itemsTax = 0;
$amount = $order->getTotalAmount($tax);
$itemsAmount = $order->getTotalAmount($itemsTax, false, false);
$hasVirtualDownload = $order->hasVirtualProduct();
$loopResultRow = new LoopResultRow($order);
@@ -313,6 +322,9 @@ public function parseResults(LoopResult $loopResult)
->set('STATUS_CODE', $order->getOrderStatus()->getCode())
->set('LANG', $order->getLangId())
->set('DISCOUNT', $order->getDiscount())
->set('TOTAL_ITEMS_TAX', $itemsTax)
->set('TOTAL_ITEMS_AMOUNT', $itemsAmount - $itemsTax)
->set('TOTAL_TAXED_ITEMS_AMOUNT', $itemsAmount)
->set('TOTAL_TAX', $tax)
->set('TOTAL_AMOUNT', $amount - $tax)
->set('TOTAL_TAXED_AMOUNT', $amount)

0 comments on commit d2fe473

Please sign in to comment.