So I have one issue with Wordpress and Woocommerce products, where on single product page in the loop I created custom variables like this:
// Quantity
$quantity = get_post_meta( $post->ID, "wccaf_quantity", true );
// Regular Price
$regular_price = get_post_meta( get_the_ID(), '_regular_price', true);
// Subtotal
$subtotal = $quantity * $regular_price;
Calculations are based on custom fields that user inputs through Wordpress admin panel. It all works on front-end, but I have faced an issue where I want to sort the products on product page with eg. $subtotal variable. Is there any possibility that I can achieve this somehow, to call this variable like post meta or something. I'm ok with PHP, but don't know how this works in Wordpress
You can see the site here, description tab in Investment details: http://aldinmujkic.website/yehuda1/product/amazonbasics-apple-certified-lightning-to-usb-cable/