我希望有人能够解决一个需要我们大量体力劳动的问题,解决方案似乎很简单:-)
摘要:是否可以更改代码,当您编辑订单(已开票或尚未开票)时,该代码不使用您编辑订单时的订单日期和时间,而是使用订单的日期和时间。原订单?
例子:
但是,我们希望订单1000-1收到订单日期15/05/2015 12:00,与原始订单1000相同。
说明:我们使用使用产品预订的Magento扩展程序(嵌入式ERP)。如果客户订购产品,则不会从库存中删除该项目,而是保留库存。如果物料有缺货,则将客户放在队列中。
该系统使用先进先出系统。它使用订单日期来检查哪个客户在队列中比其他客户高。
因为我们使用缺货订单,所以客户有时喜欢添加或删除要订购的商品,因为他们无论如何都要等待商品。但是,当更改订单以添加或删除项目时,新订单将获得新的订单日期和时间。我们希望客户保留与其原始订单相同的产品。因此,现在我们手动更改每个商品的产品预定,使其与原始订单相同。
我希望当新订单的订单日期和时间与原始订单相同时,我们可以对新订单自动进行正确的产品预订。
将文件app / code / core / Mage / Adminhtml / Model / Sales / Order / Create.php复制到app / code / local / Mage / Adminhtml / Model / Sales / Order /中。保持文件夹结构不变!
找到选项createOrder()并更改它
if ($this->getSession()->getOrder()->getId()) {
$oldOrder = $this->getSession()->getOrder();
$this->getSession()->getOrder()->setRelationChildId($order->getId());
$this->getSession()->getOrder()->setRelationChildRealId($order->getIncrementId());
$this->getSession()->getOrder()->cancel()
->save();
$order->save();
}
有了这个:
if ($this->getSession()->getOrder()->getId()) {
$oldOrder = $this->getSession()->getOrder();
$this->getSession()->getOrder()->setRelationChildId($order->getId());
$this->getSession()->getOrder()->setRelationChildRealId($order->getIncrementId());
$this->getSession()->getOrder()->cancel()
->save();
$order->setCreatedAt($oldOrder->getCreatedAt());
$order->save();
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句