I am working on importing a csv of product reviews to my magento.
The csv is in my magento shell folder. I created a product_review.php script inside my shell directory
<?php
require '../app/Mage.php';
umask(0);
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
ini_set('max_execution_time', 84000);
ini_set('memory_limit', '5120M');
$fp = fopen('final_available_dup.csv', 'r');
//Mage::app()->setCurrentStore(4); //desired store id
while($line = fgetcsv($fp)) {
$review = Mage::getModel('review/review');
$review->setEntityPkValue($line[0]);//previews1.csv
$review->setCreatedAt($line[1]);//previews1.csv
$review->setStatusId($line[2]); //approved
$review->setTitle($line[3]);
$review->setNickname($line[4]);
$review->setDetail($line[5]);
$review->setEntityId($line[6]);
$review->setStoreId(Mage::app()->getStore()->getId());
//$review->setStatusId($line[5]);
$review->setCustomerId($line[7]);//null is for administrator
$review->setReviewsCount($line[8]);//null is for administrator
$review->setReviewId($review->getId());
$review->setStores(array(Mage::app()->getStore()->getId()));
$review->save();
$review->aggregate();
}
?>
and when i run the shell folder and run product_review.php a blank page came which i guess is the correct way.
But when i go into my back end and check i cannot see any reviews.I am not able to which product the review is getting updated.
I don't know is there anything more I should do?