How to set the date of a review programatically
-
30-10-2019 - |
Question
I am trying to import some reviews programatically. I am using the following code:
$review = Mage::getModel('review/review');
$review->setEntityPkValue($product->getId());
$review->setStatusId(1);
$review->setTitle("title");
$review->setDetail("detail");
$review->setEntityId(1);
$review->setStoreId(Mage::app()->getStore()->getId());
$review->setStatusId(1);
$review->setCustomerId(NULL);
$review->setNickname("nickname");
$review->setReviewId($review->getId());
$review->setStores(array(Mage::app()->getStore()->getId()));
$review->setCreatedAt(Mage::getModel('core/date')->gmtTimestamp($date));
$review->save();
$review->aggregate();
$date is a timestamp of the date of the review. The problem is that my reviews are being imported at the current date. How can I set the created_at parameter?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange