Magento 1.7 – How to Get Store and Store View Code from Product Review

magento-1.7PHPreview

I'm using magento 1.7. I want export product reviews from magento. For that, I want to find the store and store view codes of the product review. I tried the below, But It does not work.

$review_store = Mage::getModel('review/review')->getStoreId();
$review_storviews = Mage::getModel('review/review')->getStores();

How to get the store and store view from product review object?

Best Answer

You need load a review before call getStoreId method, like this:

$storeId = Mage::getModel('review/review')->load(6)->getStoreId(); //6 is a Review ID.

If you have a review object already, you can do this:

$storeId = $review->getStoreId();