Extending "Mage_Review_ProductController"
app/code/local/Primera/Review/etc/config.xml
app/code/local/Primera/Review/controllers/ProductController.php
app/code/local/Primera/Review/etc/config.xml
<config> <frontend> <routers> <review> <args> <modules> <primera_review before="Mage_Review">Primera_Review</primera_review> </modules> </args> </review> </routers> </frontend> </config>
app/code/local/Primera/Review/controllers/ProductController.php
<?php require_once 'Mage/Review/controllers/ProductController.php'; class Primera_Review_ProductController extends Mage_Review_ProductController { /** * Crops POST values * @param array $reviewData * @return array */
protected function _cropReviewData(array $reviewData) { $croppedValues = array(); $allowedKeys = array_fill_keys(array('detail', 'title', 'nickname','email'), true); foreach ($reviewData as $key => $value) { if (isset($allowedKeys[$key])) { $croppedValues[$key] = $value; } } return $croppedValues; } }
No comments:
Post a Comment