Woocommerce get variation product price php
I am using a plugin to display a widget that calculates the monthly installments of a product when buying on credit. The plugin uses $product->get_price()
and $variation->get_price()
to fill the data-amount=
parameter to auto calculate the installment based on the product price. However it only seems to work correctly on simple products with a static price, on variable products it only calculates the first variation and doesn’t change dynamically when selecting different variables. Is there a way to update this code so the plugin would calculate variable products correctly for each variation?