Wednesday, July 13, 2011

JReview - How to unpublish the listing according to the end date

I am working on one of the site 2Lush Cru, a Joomla based site from last month. JReviews componet is used to show the liting of wines & there is a field 'offer end date'. Depend on the 'offer end date', listing should be closed automatically. Its not JReviews's built in functionality. The problem is Jreview store some data of listing as an article(content table). There is field for article end date(publish_down) in Joomla, so i wanted to store offer end date of JReviews in a article(content) table so that it closes according to the close date.
Initially i thought, view is already overidden, after written some query's it will work. Invested 3-4 hrs. but it didn't worked. Finally got a solution, oerride a JReviews listings controller(listings_controllers.php) where it stores data. I was not aware how to override JReviews controller, This page came to help me.
In listings_controller.php on line no 1343 pasted this code
$this->data['Listing']['publish_up'] = $this->data['Field']['Listing']['jr_opstartdate'];
$this->data['Listing']['publish_down'] = $this->data['Field']['Listing']['jr_openddate'];
Remember jr_opstartdate & jr_openddate parameters will be changed acccordingly the names you have set for the field(joomla admin site, field manager).

1 comment:

  1. Hey Amol I'm hoping you'll find this video comparing different JReviews biz models helpful! Also a NINJA text marketing tactic strategy at 27:35 http://youtu.be/7AkY7E7x_00

    ReplyDelete