Author Topic: Getting the last $product_id  (Read 5624 times)

Johnny Blatman

  • Beginner
  • *
  • Posts: 4
Getting the last $product_id
« on: June 26, 2008, 01:34:19 am »
I'm trying to modify browse_1.php to make the product image open as a lightbox link instead of just opening it in a new window, so I need to get it's product ID.
I tried using $product_id in browse_1.php but I only get the ID of the last product on the page (out of the 20 being displayed per page). I also tried going to shop.browse.php and create a new variable and assign the product ID to it from the database (i.e. $new_var = $db_browse->f("product_id");) and then to expose it to browse_1.php (i.e. $tpl->set('new_var', $new_var);) but I still get only the last product's ID every time.

What am I missing?

Thanks in advance...

Fost

  • Beginner
  • *
  • Posts: 7
Re: Getting the last $product_id
« Reply #1 on: December 28, 2008, 12:38:19 pm »
I have some problem....
Help please:)

rizu_csjm

  • Beginner
  • *
  • Posts: 2
Re: Getting the last $product_id
« Reply #2 on: August 06, 2012, 07:14:17 am »
I'm trying to modify browse_1.php to make the product image open as a lightbox link instead of just opening it in a new window, so I need to get it's product ID.
I tried using $product_id in browse_1.php but I only get the ID of the last product on the page (out of the 20 being displayed per page). I also tried going to shop.browse.php and create a new variable and assign the product ID to it from the database (i.e. $new_var = $db_browse->f("product_id");) and then to expose it to browse_1.php (i.e. $tpl->set('new_var', $new_var);) but I still get only the last product's ID every time.

What am I missing?

Thanks in advance...

------------------------------------------------------------------------

@Rizwan FROM websitedesigncity.com.au

$products[$i]['product_id'] = $db_browse->f("product_id");
You can add this code after to $products[$i]['product_sku'] = $db_browse->f("product_sku"); in administrator\components\com_virtuemart\html\shop.browse.php

and for print call  $product_id; in browse_1.php page

 :)