4

Magento 1.9.0.1

In the admin panel, you have the ability to sort categories by attributes as seen here: http://inchoo.net/magento/changing-default-category-sort-order-in-magento/

Now I have sorted products in categories by:

  • price (default)
  • name
  • position

I need to remove position from the menu leaving only price and name

I don't want to edit every single category view from catalago-->manage categories because I have too many categories in the store.

I need to act in configurations

4 Answers 4

2

I've modified the toolbar template file:

/<your_theme>/template/catalog/product/list/toolbar.phtml

replacing this:

<ul>
  <?php foreach($this->getAvailableOrders() as $_key => $_order): ?>
    ...

with this:

<ul>
  <?php foreach($this->getAvailableOrders() as $_key => $_order): ?>
    <?php if ($_key === 'position') { continue; } ?>
    ...
2

add this to css

.sorter-options > option[value=position] {
    display: none;
}
0

Did it this simple way, maybe somebody needs smthing like this

<div class="form-item-select">
        <select id="sorter" data-role="sorter" class="sorter-options">
            <?php foreach ($block->getAvailableOrders() as $_key => $_order): ?>
                <option value="<?= /* @escapeNotVerified */ $_key ?>"
                    <?php if ($block->isOrderCurrent($_key)): ?>
                        selected="selected"
                    <?php endif; ?>
                    >
                    <?php if ($block->isOrderCurrent($_order === "Price")): ?>
                        Final Price
                    <?php else: ?>
                        <?= $block->escapeHtml(__('Sort by %1', $_order)) ?>
                    <?php endif; ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
-5

follow the steps below.

  1. Go to Catalog > Attributes > Manage Attributes
  2. Select position from the attribute list
  3. Under Properties > Frontend Properties, set the display to "No" for the following options;
    • Used in Product Listing
    • Used for Sorting in Product Listing

Remember to flush the cache if you had cache enabled.

1
  • There's no position attribute in the attribute list in my Magento 1.9.1. I have unsuccessful tried to search position and its translation in the site language, even place. Nothing
    – bobrock4
    Commented Jun 24, 2016 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.