Hi, hope it's the right forum section for this question,
We developed a plugin that inserts VirtueMart products in a newsletter, but we have troubles getting the correct prices based on a specific shoppergroup

We're currently using this code:
$productId = 524;
$shoppergroup = array(2);
$vmProductModel = new VirtueMartModelProduct();
$product = $vmProductModel->getProduct($productId, false, true, false, 1, false, $shoppergroup);
$vmProductModel->addImages($product);
$price = $product->product_price;
if($includeTax == 1 && !empty($product->prices['basePriceWithTax'])) $price = $product->prices['basePriceWithTax'];
But it does not seem to take the discount and rules into account for VM2 and VM3

Do you have any API to load the product with the right prices? Ideally we would like to be able to get the price either with or without the tax.
Our script can be executed from the Front-end and the Back-end, and when it's executed there could be no user logged-in (executed with a cron task).
Thanks for any hint you could give us

Jeremy