get_attributes() as $k => $v) {
if ($v === '') continue;
$tax = str_replace('attribute_', '', $k);
$term = taxonomy_exists($tax) ? get_term_by('slug', $v, $tax) : null;
$raw = $term ? $term->name : urldecode((string) $v);
$bits[] = html_entity_decode($raw, ENT_QUOTES | ENT_HTML5, 'UTF-8');
}
$variant_label = implode(' / ', $bits);
}
$unit_price = $qty > 0 ? (float) $item['line_subtotal'] / $qty : 0.0;
$line_total = (float) ($item['line_total'] ?? 0.0);
$base_price = $variation ? (float) get_post_meta($variation->get_id(), '_price', true) : 0.0;
$discount_pct = ($base_price > 0 && $unit_price < $base_price)
? (int) round((1 - ($unit_price / $base_price)) * 100)
: 0;
$remove_url = wp_nonce_url(
add_query_arg('studiou-fpp-remove-line', $key, get_permalink($product_id)),
'studiou-fpp-remove-line'
);
?>