Revert "Merge branch 'cleanmaster' into modules"
This reverts commitd0ff5260f7, reversing changes made to67d0101dbe.
This commit is contained in:
@@ -523,7 +523,6 @@
|
||||
<column description="transaction reference - usually use to identify a transaction with banking modules" name="transaction_ref" size="100" type="VARCHAR" />
|
||||
<column description="delivery reference - usually use to identify a delivery progress on a distant delivery tracker website" name="delivery_ref" size="100" type="VARCHAR" />
|
||||
<column description="the invoice reference" name="invoice_ref" size="100" type="VARCHAR" />
|
||||
<column name="discount" type="FLOAT" />
|
||||
<column name="postage" required="true" type="FLOAT" />
|
||||
<column name="payment_module_id" required="true" type="INTEGER" />
|
||||
<column name="delivery_module_id" required="true" type="INTEGER" />
|
||||
@@ -901,6 +900,18 @@
|
||||
</behavior>
|
||||
<behavior name="versionable" />
|
||||
</table>
|
||||
<table name="coupon_order" namespace="Thelia\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="order_id" required="true" type="INTEGER" />
|
||||
<column name="value" required="true" type="FLOAT" />
|
||||
<foreign-key foreignTable="order" name="fk_coupon_order_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="order_id" />
|
||||
</foreign-key>
|
||||
<index name="idx_coupon_order_order_id">
|
||||
<index-column name="order_id" />
|
||||
</index>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
<table name="admin_log" namespace="Thelia\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="admin_login" size="255" type="VARCHAR" />
|
||||
@@ -979,6 +990,7 @@
|
||||
<column name="price" type="FLOAT" />
|
||||
<column name="promo_price" type="FLOAT" />
|
||||
<column name="price_end_of_life" type="TIMESTAMP" />
|
||||
<column defaultValue="0" name="discount" type="FLOAT" />
|
||||
<column name="promo" type="INTEGER" />
|
||||
<foreign-key foreignTable="cart" name="fk_cart_item_cart_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="cart_id" />
|
||||
@@ -1265,26 +1277,4 @@
|
||||
</unique>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
<table name="order_coupon" namespace="Thelia\Model">
|
||||
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="order_id" required="true" type="INTEGER" />
|
||||
<column name="code" required="true" size="45" type="VARCHAR" />
|
||||
<column name="type" required="true" size="255" type="VARCHAR" />
|
||||
<column name="amount" required="true" type="FLOAT" />
|
||||
<column name="title" required="true" size="255" type="VARCHAR" />
|
||||
<column name="short_description" required="true" type="LONGVARCHAR" />
|
||||
<column name="description" required="true" type="CLOB" />
|
||||
<column name="expiration_date" required="true" type="TIMESTAMP" />
|
||||
<column name="is_cumulative" required="true" type="BOOLEAN" />
|
||||
<column name="is_removing_postage" required="true" type="BOOLEAN" />
|
||||
<column name="is_available_on_special_offers" required="true" type="BOOLEAN" />
|
||||
<column name="serialized_conditions" required="true" type="LONGVARCHAR" />
|
||||
<foreign-key foreignTable="order" name="fk_order_coupon_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="order_id" />
|
||||
</foreign-key>
|
||||
<index name="idx_order_coupon_order_id">
|
||||
<index-column name="order_id" />
|
||||
</index>
|
||||
<behavior name="timestampable" />
|
||||
</table>
|
||||
</database>
|
||||
|
||||
@@ -24,13 +24,11 @@ namespace Front\Controller;
|
||||
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Controller\Front\BaseFrontController;
|
||||
use Thelia\Core\Event\Order\OrderEvent;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Core\Event\Cart\CartEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Thelia\Form\CartAdd;
|
||||
use Thelia\Model\AddressQuery;
|
||||
|
||||
class CartController extends BaseFrontController
|
||||
{
|
||||
@@ -55,8 +53,6 @@ class CartController extends BaseFrontController
|
||||
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::CART_ADDITEM, $cartEvent);
|
||||
|
||||
$this->afterModifyCart();
|
||||
|
||||
$this->redirectSuccess();
|
||||
|
||||
} catch (PropelException $e) {
|
||||
@@ -87,8 +83,6 @@ class CartController extends BaseFrontController
|
||||
try {
|
||||
$this->dispatch(TheliaEvents::CART_UPDATEITEM, $cartEvent);
|
||||
|
||||
$this->afterModifyCart();
|
||||
|
||||
$this->redirectSuccess();
|
||||
} catch (PropelException $e) {
|
||||
$this->getParserContext()->setGeneralError($e->getMessage());
|
||||
@@ -104,8 +98,6 @@ class CartController extends BaseFrontController
|
||||
try {
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::CART_DELETEITEM, $cartEvent);
|
||||
|
||||
$this->afterModifyCart();
|
||||
|
||||
$this->redirectSuccess();
|
||||
} catch (PropelException $e) {
|
||||
\Thelia\Log\Tlog::getInstance()->error(sprintf("error during deleting cartItem with message : %s", $e->getMessage()));
|
||||
@@ -150,25 +142,4 @@ class CartController extends BaseFrontController
|
||||
return $cartAdd;
|
||||
}
|
||||
|
||||
protected function afterModifyCart()
|
||||
{
|
||||
/* recalculate postage amount */
|
||||
$order = $this->getSession()->getOrder();
|
||||
if(null !== $order) {
|
||||
$deliveryModule = $order->getModuleRelatedByDeliveryModuleId();
|
||||
$deliveryAddress = AddressQuery::create()->findPk($order->chosenDeliveryAddress);
|
||||
|
||||
if(null !== $deliveryModule && null !== $deliveryAddress) {
|
||||
$moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode()));
|
||||
$postage = $moduleInstance->getPostage($deliveryAddress->getCountry());
|
||||
|
||||
$orderEvent = new OrderEvent($order);
|
||||
$orderEvent->setPostage($postage);
|
||||
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -25,12 +25,11 @@ namespace Front\Controller;
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Thelia\Controller\Front\BaseFrontController;
|
||||
use Thelia\Core\Event\Coupon\CouponConsumeEvent;
|
||||
use Thelia\Core\Event\Order\OrderEvent;
|
||||
use Thelia\Form\CouponCode;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Log\Tlog;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\Order;
|
||||
|
||||
/**
|
||||
* Class CouponController
|
||||
@@ -66,25 +65,6 @@ class CouponController extends BaseFrontController
|
||||
// Dispatch Event to the Action
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::COUPON_CONSUME, $couponConsumeEvent);
|
||||
|
||||
/* recalculate postage amount */
|
||||
$order = $this->getSession()->getOrder();
|
||||
if(null !== $order) {
|
||||
$deliveryModule = $order->getModuleRelatedByDeliveryModuleId();
|
||||
$deliveryAddress = AddressQuery::create()->findPk($order->chosenDeliveryAddress);
|
||||
|
||||
if(null !== $deliveryModule && null !== $deliveryAddress) {
|
||||
$moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode()));
|
||||
$postage = $moduleInstance->getPostage($deliveryAddress->getCountry());
|
||||
|
||||
$orderEvent = new OrderEvent($order);
|
||||
$orderEvent->setPostage($postage);
|
||||
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent);
|
||||
}
|
||||
}
|
||||
|
||||
$this->redirect($couponCodeForm->getSuccessUrl());
|
||||
|
||||
} catch (FormValidationException $e) {
|
||||
$message = sprintf('Please check your coupon code: %s', $e->getMessage());
|
||||
} catch (PropelException $e) {
|
||||
|
||||
@@ -95,7 +95,6 @@ class OrderController extends BaseFrontController
|
||||
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_ADDRESS, $orderEvent);
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_DELIVERY_MODULE, $orderEvent);
|
||||
$this->getDispatcher()->dispatch(TheliaEvents::ORDER_SET_POSTAGE, $orderEvent);
|
||||
|
||||
$this->redirectToRoute("order.invoice");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user