dynamic delivery modules on delivery front template

This commit is contained in:
Etienne Roudeix
2013-12-20 12:14:20 +01:00
parent b3ac365b45
commit 22efc21bfe
4 changed files with 64 additions and 22 deletions

View File

@@ -131,6 +131,10 @@
<default key="_view">order-delivery</default>
</route>
<route id="admin.delivery.ajax-module-list" path="/order/deliveryModuleList">
<default key="_controller">Front\Controller\OrderController::getDeliveryModuleListAjaxAction</default>
</route>
<route id="order.invoice.process" path="/order/invoice" methods="post">
<default key="_controller">Front\Controller\OrderController::invoice</default>
<default key="_view">order-invoice</default>

View File

@@ -41,6 +41,7 @@ use Thelia\Model\Base\OrderQuery;
use Thelia\Model\ConfigQuery;
use Thelia\Model\ModuleQuery;
use Thelia\Model\Order;
use Thelia\TaxEngine\TaxEngine;
use Thelia\Tools\URL;
/**
@@ -260,5 +261,18 @@ class OrderController extends BaseFrontController
return $this->generateOrderPdf($order_id, ConfigQuery::read('pdf_delivery_file', 'delivery'));
}
public function getDeliveryModuleListAjaxAction()
{
$country = $this->getRequest()->get(
'country_id',
TaxEngine::getInstance($this->getRequest()->getSession())->getDeliveryCountry()->getId()
);
$this->checkXmlHttpRequest();
$args = array('country' => $country);
return $this->render('ajax/order-delivery-module-list', $args);
}
}