News:

Looking for documentation? Take a look on our wiki

Main Menu

VM3: current product id in mod_virtuemart_product.php?

Started by ebogdan, August 09, 2015, 15:11:57 PM

Previous topic - Next topic

ebogdan

Hi.

When using the Virtuemart Products module ("mod_virtuemart_product.php") in VM3, how can I find out the current product id, if there is one?

Obviously, I need to find out that while the user is on a product's details page.

Thanks,

L.E.: To explain better: I want to modify the module to show some extra info while the user is seeing a product's details page, related to that certain product, so I need the product id.

PRO

of the product deatils?

or of the product thats showing in the product module?

ebogdan

Of the product details (the main product you are seeing in the page, not the ones displayed by the module).

ebogdan

Found it:


$jinput = JFactory::getApplication()->input;
$bproduct_id = $jinput->get('virtuemart_product_id');
$bcategory_id = $jinput->get('virtuemart_category_id');
$bview = $jinput->get('view');

if($bview === 'productdetails') {
/* Logic here */
}