delivery process
This commit is contained in:
@@ -22,9 +22,12 @@
|
||||
/*************************************************************************************/
|
||||
|
||||
namespace Thelia\Core\Template\Loop;
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Thelia\Core\Template\Element\LoopResult;
|
||||
use Thelia\Core\Template\Element\LoopResultRow;
|
||||
use Thelia\Core\Template\Loop\Argument\Argument;
|
||||
use Thelia\Model\CountryQuery;
|
||||
use Thelia\Module\BaseModule;
|
||||
|
||||
/**
|
||||
* Class Delivery
|
||||
@@ -39,7 +42,7 @@ class Delivery extends BaseSpecificModule
|
||||
$collection = parent::getArgDefinitions();
|
||||
|
||||
$collection->addArgument(
|
||||
Argument::createIntTypeArgument("country")
|
||||
Argument::createIntTypeArgument("country", null, true)
|
||||
);
|
||||
|
||||
return $collection;
|
||||
@@ -50,6 +53,14 @@ class Delivery extends BaseSpecificModule
|
||||
$search = parent::exec($pagination);
|
||||
/* manage translations */
|
||||
$locale = $this->configureI18nProcessing($search);
|
||||
|
||||
$search->filterByType(BaseModule::DELIVERY_MODULE_TYPE, Criteria::EQUAL);
|
||||
|
||||
$country = $this->getCountry();
|
||||
if(null !== $country) {
|
||||
//@todo
|
||||
}
|
||||
|
||||
/* perform search */
|
||||
$deliveryModules = $this->search($search, $pagination);
|
||||
|
||||
@@ -73,7 +84,7 @@ class Delivery extends BaseSpecificModule
|
||||
->set('CHAPO', $deliveryModule->getVirtualColumn('i18n_CHAPO'))
|
||||
->set('DESCRIPTION', $deliveryModule->getVirtualColumn('i18n_DESCRIPTION'))
|
||||
->set('POSTSCRIPTUM', $deliveryModule->getVirtualColumn('i18n_POSTSCRIPTUM'))
|
||||
->set('PRICE', $moduleInstance->calculate($this->getCountry()))
|
||||
->set('PRICE', $moduleInstance->calculate(CountryQuery::create()->findPk($country)))
|
||||
;
|
||||
|
||||
$loopResult->addRow($loopResultRow);
|
||||
|
||||
@@ -28,6 +28,9 @@ use Symfony\Component\DependencyInjection\ContainerAware;
|
||||
|
||||
abstract class BaseModule extends ContainerAware
|
||||
{
|
||||
const CLASSIC_MODULE_TYPE = 1;
|
||||
const DELIVERY_MODULE_TYPE = 2;
|
||||
const PAYMENT_MODULE_TYPE = 3;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user