VirtueMart Forum

VirtueMart 2 + 3 + 4 => Frontend Modules => Topic started by: ebogdan on August 09, 2015, 15:11:57 PM

Title: VM3: current product id in mod_virtuemart_product.php?
Post by: ebogdan on August 09, 2015, 15:11:57 PM
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.
Title: Re: VM3: current product id in mod_virtuemart_product.php?
Post by: PRO on August 09, 2015, 16:06:10 PM
of the product deatils?

or of the product thats showing in the product module?
Title: Re: VM3: current product id in mod_virtuemart_product.php?
Post by: ebogdan on August 09, 2015, 16:08:32 PM
Of the product details (the main product you are seeing in the page, not the ones displayed by the module).
Title: Re: VM3: current product id in mod_virtuemart_product.php?
Post by: ebogdan on August 09, 2015, 17:57:05 PM
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 */
}