$fixed_rules, 'percentage' => $percentage_rules, ); /** * Helper function to render a single rule row. */ if ( ! function_exists( 'tpt_render_pricing_row' ) ) { function tpt_render_pricing_row( $amount, $value, $type, $role, $loop, $custom_prefix, $fieldsWidth, $entity_id ) { $is_fixed = ( 'fixed' === $type ); // Map field keys based on type $qty_key = $is_fixed ? 'fixed_quantities' : 'percentage_quantities'; $val_key = $is_fixed ? 'fixed_prices' : 'percentage_discounts'; $qty_name = Form::getFieldName( $qty_key, $role, $loop, $custom_prefix ) . '[]'; $val_name = Form::getFieldName( $val_key, $role, $loop, $custom_prefix ) . '[]'; // Format value and attributes $val_display = $is_fixed ? wc_format_localized_price( $value ) : $value; $placeholder = $is_fixed ? __( 'Price', 'tier-pricing-table' ) : __( 'Percentage discount', 'tier-pricing-table' ); ?>