Quelques nouveaux fichiers et modules en conf
This commit is contained in:
36
local/modules/OrderComment/Loop/SessionOrderCommentLoop.php
Normal file
36
local/modules/OrderComment/Loop/SessionOrderCommentLoop.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace OrderComment\Loop;
|
||||
|
||||
use Thelia\Core\Template\Element\ArraySearchLoopInterface;
|
||||
use Thelia\Core\Template\Element\BaseLoop;
|
||||
use Thelia\Core\Template\Element\LoopResult;
|
||||
use Thelia\Core\Template\Element\LoopResultRow;
|
||||
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
|
||||
|
||||
class SessionOrderCommentLoop extends BaseLoop implements ArraySearchLoopInterface
|
||||
{
|
||||
public function buildArray()
|
||||
{
|
||||
$item = ['comment' => $this->request->getSession()->get('order-comment')];
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
public function parseResults(LoopResult $loopResult)
|
||||
{
|
||||
$item = $loopResult->getResultDataCollection();
|
||||
|
||||
$loopResultRow = new LoopResultRow();
|
||||
$loopResultRow->set('ORDER_COMMENT', $item['comment']);
|
||||
|
||||
$loopResult->addRow($loopResultRow);
|
||||
|
||||
return $loopResult;
|
||||
}
|
||||
|
||||
public function getArgDefinitions()
|
||||
{
|
||||
return new ArgumentCollection();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user