JComments

Integration of JComments to VirtueMart

Integration with VirtueMart 1.1.4

  1. Open file /administrator/components/com_virtuemart/html/shop.product_details.php
  2. Find the lines:
      /*** Show all reviews available ***/
      $product_reviews = ps_reviews::product_reviews( $product_id );
      /*** Show a form for writing a review ***/
     
      if( $auth['user_id'] > 0 ) {
        $product_reviewform = ps_reviews::reviewform( $product_id );
    and replace them with:
      global $mainframe;
      $comments = $mainframe->getCfg('absolute_path') . '/components/com_jcomments/jcomments.php';
      if (file_exists($comments)) {
        require_once($comments);
        $product_reviews = JComments::showComments($product_id, 'com_virtuemart', $product_name);
        $product_reviewform = "";
  3. Open file /administrator/components/com_virtuemart/html/shop.browse.php
  4. Find and delete (comment) the following lines:
        if (PSHOP_ALLOW_REVIEWS == '1' && @$_REQUEST['output'] != "pdf") {
          // Average customer rating: xxxxx
              // Total votes: x
          $product_rating = ps_reviews::allvotes( $db_browse->f("product_id") );
        }
        else {
          $product_rating = "";
        }
  5. Go to VirtueMart component configuration page and select by checkmark the «Enable Customer Review/Rating System» option to «Yes»

Integration with VirtueMart 1.0

  1. Open file /administrator/components/com_virtuemart/html/shop.product_details.php
  2. Find the lines:
      /*** Show all reviews available ***/
      $product_reviews = ps_reviews::product_reviews( $product_id );
      /*** Show a form for writing a review ***/
      $product_reviewform = ps_reviews::reviewform( $product_id );
    and replace them with:
      $comments = $mosConfig_absolute_path . '/components/com_jcomments/jcomments.php';
      if (file_exists($comments)) {
        require_once($comments);
        $product_reviews = JComments::showComments($product_id, 'com_virtuemart', $product_name);
        $product_reviewform = "";
      }
  3. Open file /administrator/components/com_virtuemart/html/shop.browse.php
  4. Find and delete (comment) the following lines:
      $product_rating = $VM_LANG->_PHPSHOP_CUSTOMER_RATING .": <br />";
      $product_rating .= ps_reviews::allvotes( $db_browse->f("product_id") );
  5. Go to VirtueMart component configuration page and select by checkmark the «Enable Customer Review/Rating System» option to «Yes»

After all above changes were done the visitors of internet shop based on VirtueMart component will be able to leave comments to all goods using all possibilities of JComments.

See also:

 
JoomlaTune