dominic I tried the modified code you provided, but unfortunately, it does not work according to the settings from VirtueMart. The code works if we have one customer group for which discounts are set. However, if we have two or more customer groups, each with different discounts for product groups, then JA Megafilter displays the price with a discount from the customer group with the lowest ID to all customer groups, which is a significant issue.
The same thing happens even if we set different prices for different customer groups for each product.
I also noticed that JA Megafilter displays the product price to non-registered customers even though in VirtueMart settings, the price display is enabled only for registered customers (I solved this, but there is definitely an issue with JA Megafilter).