I need to make certain changes to the file order-details-item.php Product prices are formed in custom meta fields. So in my case the value is: $qty = $item->get_quantity(); is incorrect. It is always the same.
To solve the problem, I can use the simplest arephmetic operation. Divide the total order price by the product price. For example, if a customer ordered 10 kilograms of apples at a cost of 14.5 per kilogram the total cost will be 145. This means that in order to correctly display the quantity I need 145/10.
$price_weight_array = $product_attr['_mia_cup_price_weight'];
$price_unit_array = $product_attr['_mia_cup_price_unit'];
$sale_price_array = $product_attr['_mia_cup_sale_price_unit'];
$price_weight = $price_weight_array[0];
$price_unit = $price_unit_array[0];
$sale_price = $sale_price_array[0];
$prod_item_total = $order->get_formatted_line_subtotal();
custom_quantity = $prod_item_total / $price_weight
And here is the problem $order->get_formatted_line_subtotal(); returns me a number with currency symbol. And I cannot use it in arithmetic operation. How can I remove this symbol?