From bce348f04b30874b5e80db3daf47a8cf6f27ff87 Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Sun, 6 Oct 2019 15:47:31 +0200 Subject: [PATCH] Added ID and ORDER_PRODUCT_ID to loop results --- .../Loop/OrderProductAttributeCombination.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php index dc2275b1ca..940dc2ebc3 100644 --- a/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php +++ b/core/lib/Thelia/Core/Template/Loop/OrderProductAttributeCombination.php @@ -70,10 +70,10 @@ public function buildModelCriteria() foreach ($orders as $order) { switch ($order) { - case "alpha": + case 'alpha': $search->orderByAttributeTitle(Criteria::ASC); break; - case "alpha_reverse": + case 'alpha_reverse': $search->orderByAttributeTitle(Criteria::DESC); break; } @@ -89,14 +89,16 @@ public function parseResults(LoopResult $loopResult) $loopResultRow = new LoopResultRow($orderAttributeCombination); $loopResultRow - ->set("ATTRIBUTE_TITLE", $orderAttributeCombination->getAttributeTitle()) - ->set("ATTRIBUTE_CHAPO", $orderAttributeCombination->getAttributeChapo()) - ->set("ATTRIBUTE_DESCRIPTION", $orderAttributeCombination->getAttributeDescription()) - ->set("ATTRIBUTE_POSTSCRIPTUM", $orderAttributeCombination->getAttributePostscriptum()) - ->set("ATTRIBUTE_AVAILABILITY_TITLE", $orderAttributeCombination->getAttributeAvTitle()) - ->set("ATTRIBUTE_AVAILABILITY_CHAPO", $orderAttributeCombination->getAttributeAvChapo()) - ->set("ATTRIBUTE_AVAILABILITY_DESCRIPTION", $orderAttributeCombination->getAttributeAvDescription()) - ->set("ATTRIBUTE_AVAILABILITY_POSTSCRIPTUM", $orderAttributeCombination->getAttributeAvPostscriptum()) + ->set('ID', $orderAttributeCombination->getId()) + ->set('ORDER_PRODUCT_ID', $orderAttributeCombination->getOrderProductId()) + ->set('ATTRIBUTE_TITLE', $orderAttributeCombination->getAttributeTitle()) + ->set('ATTRIBUTE_CHAPO', $orderAttributeCombination->getAttributeChapo()) + ->set('ATTRIBUTE_DESCRIPTION', $orderAttributeCombination->getAttributeDescription()) + ->set('ATTRIBUTE_POSTSCRIPTUM', $orderAttributeCombination->getAttributePostscriptum()) + ->set('ATTRIBUTE_AVAILABILITY_TITLE', $orderAttributeCombination->getAttributeAvTitle()) + ->set('ATTRIBUTE_AVAILABILITY_CHAPO', $orderAttributeCombination->getAttributeAvChapo()) + ->set('ATTRIBUTE_AVAILABILITY_DESCRIPTION', $orderAttributeCombination->getAttributeAvDescription()) + ->set('ATTRIBUTE_AVAILABILITY_POSTSCRIPTUM', $orderAttributeCombination->getAttributeAvPostscriptum()) ; $this->addOutputFields($loopResultRow, $orderAttributeCombination);