Free shipping for selected countries and/or shipping methods
This commit is contained in:
@@ -15,10 +15,10 @@ namespace Thelia\Controller\Front;
|
||||
use Symfony\Component\Routing\Router;
|
||||
use Thelia\Controller\BaseController;
|
||||
use Thelia\Core\HttpFoundation\Response;
|
||||
use Thelia\Core\Template\TemplateDefinition;
|
||||
use Thelia\Core\Template\TemplateHelper;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
|
||||
use Thelia\Tools\URL;
|
||||
|
||||
class BaseFrontController extends BaseController
|
||||
@@ -65,7 +65,15 @@ class BaseFrontController extends BaseController
|
||||
protected function checkValidDelivery()
|
||||
{
|
||||
$order = $this->getSession()->getOrder();
|
||||
if (null === $order || null === $order->chosenDeliveryAddress || null === $order->getDeliveryModuleId() || null === AddressQuery::create()->findPk($order->chosenDeliveryAddress) || null === ModuleQuery::create()->findPk($order->getDeliveryModuleId())) {
|
||||
if (null === $order
|
||||
||
|
||||
null === $order->getChoosenDeliveryAddress()
|
||||
||
|
||||
null === $order->getDeliveryModuleId()
|
||||
||
|
||||
null === AddressQuery::create()->findPk($order->getChoosenDeliveryAddress())
|
||||
||
|
||||
null === ModuleQuery::create()->findPk($order->getDeliveryModuleId())) {
|
||||
$this->redirectToRoute("order.delivery");
|
||||
}
|
||||
}
|
||||
@@ -73,13 +81,21 @@ class BaseFrontController extends BaseController
|
||||
protected function checkValidInvoice()
|
||||
{
|
||||
$order = $this->getSession()->getOrder();
|
||||
if (null === $order || null === $order->chosenInvoiceAddress || null === $order->getPaymentModuleId() || null === AddressQuery::create()->findPk($order->chosenInvoiceAddress) || null === ModuleQuery::create()->findPk($order->getPaymentModuleId())) {
|
||||
if (null === $order
|
||||
||
|
||||
null === $order->getChoosenInvoiceAddress()
|
||||
||
|
||||
null === $order->getPaymentModuleId()
|
||||
||
|
||||
null === AddressQuery::create()->findPk($order->getChoosenInvoiceAddress())
|
||||
||
|
||||
null === ModuleQuery::create()->findPk($order->getPaymentModuleId())) {
|
||||
$this->redirectToRoute("order.invoice");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParserInterface instance parser
|
||||
* @return TemplateDefinition the template
|
||||
*/
|
||||
protected function getParser($template = null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user