- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2019
10:12 AM
05-27-2019
10:12 AM
Re: How to Bulk import Product Reviews in Magento 1.9?
HI @Aveeva
You need to customise review/rating code in your existing review code.
You can call a new function as addRating($reviewId) and can call in the function after
$review->aggregate();
line. In this function you can add rating based on Review Id.
I hope it will help you.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-31-2019
11:39 PM
05-31-2019
11:39 PM
Re: How to Bulk import Product Reviews in Magento 1.9?
- <?php
- require_once 'app/Mage.php'; // Load Mage
- Mage::app(); // Init Mage
- ini_set('memory_limit', '128M');
- $fp = fopen('Reviews.csv', 'r');
- Mage::app()->setCurrentStore(1); //desired store id
- while($line = fgetcsv($fp)) {
- // $review = Mage::getModel('review/review');
- $review = Mage::getModel('review/rating');
- $review->setEntityPkValue($line[0]);//product id //a
- $review->setStatusId($line[1]); //b
- $review->setTitle($line[2]); //c
- $review->setDetail($line[3]); //d
- $review->setEntityId($line[4]); //e
- $review->setStoreId(Mage::app()->getStore()->getId());
- $review->setStatusId($line[5]); //approved //f
- $review->setCustomerId($line[6]);//null is for administrator //g
- $review->setNickname($line[7]); //h
- $review->setReviewId($review->getId());
- $review->setStores(array(Mage::app()->getStore()->getId()));
- $review->save();
- $review->aggregate();
- $review->addRating($reviewId);
- }
- ?>
Pls check the line 9 & 23, is my code right, if wong how can i do correct and how to import ratings values using csv.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2019
04:05 AM
11-19-2019
04:05 AM
Re: How to Bulk import Product Reviews in Magento 1.9?
@Vimal Kumar Could you pls help me with how can i add Date and how to change date already imported reviews?
- « Previous
-
- 1
- 2
- Next »