order creation
This commit is contained in:
@@ -1653,8 +1653,18 @@ abstract class Order implements ActiveRecordInterface
|
||||
$modifiedColumns[':p' . $index++] = 'UPDATED_AT';
|
||||
}
|
||||
|
||||
$db = Propel::getServiceContainer()->getAdapter(OrderTableMap::DATABASE_NAME);
|
||||
$dbMap = Propel::getServiceContainer()->getDatabaseMap(OrderTableMap::DATABASE_NAME);
|
||||
|
||||
$tableName = OrderTableMap::TABLE_NAME;
|
||||
|
||||
if ($db->useQuoteIdentifier()) {
|
||||
$tableName = $db->quoteIdentifierTable($tableName);
|
||||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO order (%s) VALUES (%s)',
|
||||
'INSERT INTO %s (%s) VALUES (%s)',
|
||||
$tableName,
|
||||
implode(', ', $modifiedColumns),
|
||||
implode(', ', array_keys($modifiedColumns))
|
||||
);
|
||||
|
||||
@@ -150,7 +150,7 @@ class OrderStatusTableMap extends TableMap
|
||||
$this->setUseIdGenerator(true);
|
||||
// columns
|
||||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
|
||||
$this->addColumn('CODE', 'Code', 'VARCHAR', false, 45, null);
|
||||
$this->addColumn('CODE', 'Code', 'VARCHAR', true, 45, null);
|
||||
$this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
|
||||
$this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
|
||||
} // initialize()
|
||||
|
||||
@@ -215,7 +215,7 @@ class OrderTableMap extends TableMap
|
||||
$this->addForeignKey('CUSTOMER_ID', 'CustomerId', 'INTEGER', 'customer', 'ID', true, null, null);
|
||||
$this->addForeignKey('INVOICE_ORDER_ADDRESS_ID', 'InvoiceOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null);
|
||||
$this->addForeignKey('DELIVERY_ORDER_ADDRESS_ID', 'DeliveryOrderAddressId', 'INTEGER', 'order_address', 'ID', true, null, null);
|
||||
$this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', true, null, null);
|
||||
$this->addColumn('INVOICE_DATE', 'InvoiceDate', 'DATE', false, null, null);
|
||||
$this->addForeignKey('CURRENCY_ID', 'CurrencyId', 'INTEGER', 'currency', 'ID', true, null, null);
|
||||
$this->addColumn('CURRENCY_RATE', 'CurrencyRate', 'FLOAT', true, null, null);
|
||||
$this->addColumn('TRANSACTION_REF', 'TransactionRef', 'VARCHAR', false, 100, null);
|
||||
|
||||
@@ -2,13 +2,26 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Thelia\Core\Event\OrderEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Model\Base\Order as BaseOrder;
|
||||
|
||||
class Order extends BaseOrder
|
||||
{
|
||||
use \Thelia\Model\Tools\ModelEventDispatcherTrait;
|
||||
|
||||
public $chosenDeliveryAddress = null;
|
||||
public $chosenInvoiceAddress = null;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
/*public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
$this->dispatchEvent(TheliaEvents::ORDER_SET_REFERENCE, new OrderEvent($this));
|
||||
}*/
|
||||
|
||||
/**
|
||||
* calculate the total amount
|
||||
*
|
||||
|
||||
@@ -4,6 +4,11 @@ namespace Thelia\Model;
|
||||
|
||||
use Thelia\Model\Base\OrderStatus as BaseOrderStatus;
|
||||
|
||||
class OrderStatus extends BaseOrderStatus {
|
||||
|
||||
class OrderStatus extends BaseOrderStatus
|
||||
{
|
||||
const CODE_NOT_PAID = "not_paid";
|
||||
const CODE_PAID = "paid";
|
||||
const CODE_PROCESSED = "processed";
|
||||
const CODE_SENT = "sent";
|
||||
const CODE_CANCELED = "canceled";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user