Prajapati Mahesh
Prajapati Mahesh

Reputation: 31

Get category same as admin category positions position

I'm trying to change the order of specific categories using a php script. The script below runs fine, and I'm seeing the position change values in catalog_category_entity, but order is unaffected in the admin, and in the front.

Upvotes: 3

Views: 40

Answers (2)

Muhammad Naseem
Muhammad Naseem

Reputation: 41

are you using your script like this ?

<?php
    $_categories = $this->getStoreCategories();
?>

<?php foreach ($_categories as $_category) : ?>
        <li class="<?php if($_category->getId() == $this->getCurrentCategoryId()) echo "active"; ?>">
            <a href="<?php echo $linkcot; ?>"><?php echo $_category->getName(); ?></a>
        </li>
<?php endforeach; ?>

if not use it like this.

Upvotes: 1

Muhammad Naseem
Muhammad Naseem

Reputation: 41

Please use drag and drop from admin And reindex than flush cache

Upvotes: 2

Related Questions