The following code works great in a template.
{% set priceProduct = currentUser.priceTable.relatedTo({
targetElement: product.id,
field: 'product'
}).one() %}
{{ priceProduct.price }}
Where priceTable is a Super Table, product.id is from an entry element (we're in loop).
'product' is an entry field in the Super Table row and 'price' is a plaintext field in the Super Table row.
How might we go about replicating this functionality in a plugin?
Craft Pro 3.0.29
Super Table 2.0.11