×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: SOLVED: Virtuemart browse

SOLVED: Virtuemart browse 6 years 9 months ago #11228

  • Jaume
  • Jaume's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 24
It would be great to get some (X comments + POST) in the browse so the user could choose a product that has reviews (comments) BEFORE entering flypage.

I'm thinking of a simple query to get the numnber of comments and link to an anchor to comments. Could you help me with the query?? I can't get to the DB semantic. thanks!!

Thanks...

SOLVED: Virtuemart browse 6 years 9 months ago #11230

  • Jaume
  • Jaume's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 24
Ok... done

on Shop.browse $tpl->set( 'product_id', $db_browse->f("product_id") );

on browse_1.php

$query_cat = 'SELECT count(*) from jos_comment where component="com_virtuemart" and contentid='.$product_id;
$result_cat = mysql_query($query_cat);
if (mysql_errno()) echo "errNO()=".mysql_errno()."--error()=".mysql_error()."--query=".$query."--result=".$result;
if ($row = mysql_fetch_array($result_cat))
echo "COMENTARIOS: ".$row[0];
echo $query_cat;

Now that's working, I'm going to put it more polite and stylish.

Was easy... sorry for the post

SOLVED: Virtuemart browse 6 years 9 months ago #11243

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
Hey Jaume,
I think that there is even an easier way to do this. You have to call our plugin at the above place. Is $this->vars available in all virtuemart template? If so, then when you call the plugin Shop.browse, the plugin will automatically recognize that this is not single view, it will show the write comment text and also will count the comments for the specific item.

Daniel

SOLVED: Virtuemart browse 6 years 9 months ago #11246

  • Jaume
  • Jaume's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 24
Hi Daniel,

Thanks for the response. I tried but it displayed an error in josc_com_virtuemart (surely due to what you're saying: that array not available).
$productArray = array_merge($category, $vars, $this->vars); says that 3rd parameter is not an Array.

Anyone knows how to get $this->vars available in shop.browse or directly to browse_1.php ??

I WOULD BE GREAT!!!

Thanks !!

SOLVED: Virtuemart browse 6 years 9 months ago #11248

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 154
  • Thank you received: 1081
It was so long ago, I even cannot remember why I needed this->vars['productArray'):

You can try something else - create a new josc_com_virtuemart_list.php - copy the content of the josc_com_virtuemart and remove the unnecessary parts such as the productArray.
  • Page:
  • 1
Time to create page: 0.107 seconds