' . esc_html( sprintf( /* translators: 1: percent limit, 2: fixed amount limit. */ __( 'For safety, a coupon your AI prepared is approved here, by a site administrator, not in the AI chat, when it gives more than %1$d%% off, a fixed discount above %2$d, free shipping without a usage limit, or has neither a usage limit nor an expiry date. Check every value before you approve it.', 'addsynapse-store-assistant' ), CouponBrake::MAX_PERCENT, CouponBrake::MAX_FIXED ) ) . '
'; $notes = array( 'applied' => __( 'Approved: the coupon is saved. You can undo it here.', 'addsynapse-store-assistant' ), 'discarded' => __( 'Discarded. Nothing was changed.', 'addsynapse-store-assistant' ), 'undone' => __( 'Undone: the previous values are back.', 'addsynapse-store-assistant' ), 'conflict' => __( 'Not applied: the coupon changed since the draft (or the code is taken). Nothing was changed. Ask your AI for a new draft.', 'addsynapse-store-assistant' ), 'undo_refused' => __( 'Not undone: the coupon changed since, or an order already used it. Nothing was changed.', 'addsynapse-store-assistant' ), 'expired' => __( 'This draft has expired. Ask your AI for a new one.', 'addsynapse-store-assistant' ), ); if ( isset( $notes[ $done ] ) ) { $ok = in_array( $done, array( 'applied', 'discarded', 'undone' ), true ); echo '' . esc_html( $notes[ $done ] ) . '
' . esc_html__( 'Nothing is waiting for your approval.', 'addsynapse-store-assistant' ) . '
' . esc_html( $expired ? __( 'Expired', 'addsynapse-store-assistant' ) : ( $labels[ $entry['status'] ] ?? (string) $entry['status'] ) ) . '
'; foreach ( $entry['items'] as $item ) { $before = is_array( $item['expect'] ?? null ) ? $item['expect'] : array(); $after = is_array( $item['set'] ?? null ) ? $item['set'] : array(); echo '| ' . esc_html__( 'Field', 'addsynapse-store-assistant' ) . ' | ' . esc_html__( 'Now', 'addsynapse-store-assistant' ) . ' | ' . esc_html__( 'After approval', 'addsynapse-store-assistant' ) . ' |
|---|---|---|
| ' . esc_html( (string) $field ) . ' | ' . esc_html( self::show( $before[ $field ] ?? null, empty( $before ) ) ) . ' | ' . esc_html( self::show( $after[ $field ] ?? null, false ) ) . ' |