Skip to content

Commit bf9ea28

Browse files
committed
MAGETWO-69524: Value of updated_at Field is not Updated in "quote" Table
1 parent 4de831a commit bf9ea28

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

app/code/Magento/Quote/Model/Quote.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,10 @@ public function beforeSave()
836836
//mark quote if it has virtual products only
837837
$this->setIsVirtual($this->getIsVirtual());
838838

839+
if ($this->hasDataChanges()) {
840+
$this->setUpdatedAt(null);
841+
}
842+
839843
parent::beforeSave();
840844
}
841845

app/code/Magento/Quote/Setup/UpgradeSchema.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
8989
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
9090
'length' => 255,
9191
]
92+
)->modifyColumn(
93+
$setup->getTable('quote', self::$connectionName),
94+
'updated_at',
95+
[
96+
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TIMESTAMP,
97+
'nullable' => false,
98+
'default' => \Magento\Framework\DB\Ddl\Table::TIMESTAMP_INIT_UPDATE,
99+
]
92100
);
93101
}
94102
$setup->endSetup();

app/code/Magento/Quote/Test/Unit/Model/QuoteTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,7 @@ public function testBeforeSaveIsVirtualQuote(array $productTypes, $expected)
11881188

11891189
$this->quote->beforeSave();
11901190
$this->assertEquals($expected, $this->quote->getDataByKey(CartInterface::KEY_IS_VIRTUAL));
1191+
$this->assertNull($this->quote->getUpdatedAt());
11911192
}
11921193

11931194
/**

0 commit comments

Comments
 (0)