Skip to content

How to change (text) after sorting option on category page

I need help changing the text in () when selecting the sort option. With translation I change to Low to high and High to low but I have to change Product name to (A-Z). I don’t know how to change only one option (Only Product Name)

enter image description here

$directions = ['asc', 'desc'];
$currentDirection = $block->getCurrentDirection();

?>
<div class="toolbar-sorter sorter">
    <label class="sorter-label" for="sorter"><?= $block->escapeHtml(__('Sort By')) ?></label>
    <select id="sorter" data-role="sorter" class="sorter-options">
        <?php foreach ($block->getAvailableOrders() as $_key => $_order) :?>
            <?php foreach ($directions as $_sort): ?>
                <option value="<?= $block->escapeHtmlAttr($_key) ?>.<?= $_sort ?>"
                    <?php if ($block->isOrderCurrent($_key) && $currentDirection === $_sort) :?>
                        selected="selected"
                    <?php endif; ?>
                    >
                    <?= $block->escapeHtml(__($_order)) ?>
                    (<?= $block->escapeHtml($_sort === "asc" ? __("Ascending") : __("Descending")) ?>)
                </option>
            <?php endforeach; ?>
        <?php endforeach; ?>
    </select>
?>