Categories are not in order same as in Admin panel Magento 2 Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Admin Panel order grid: Multiple sort conditions?Programmatically assign a product's categories _AND_ sort order/positionCategory Sorting: Add custom “Available Product Listing Sort by” option in admin panelCategory Sorting Product list: How to take off position from attributes?Magento 2 - Admin Layout XML - Update Template and change block type for specific categoryChanging the layout of the product category page by editing an XML fileM2: After updating products from code, thumbnails are not showing in catalog and on backendMagento 2: Sort multilevel category collection by both level and positionMagento 2: How to change the position/order of a sub-category?Magento 2 : How to show sub categories on Static block?
Is it a good idea to use CNN to classify 1D signal?
How come Sam didn't become Lord of Horn Hill?
If my PI received research grants from a company to be able to pay my postdoc salary, did I have a potential conflict interest too?
Is CEO the profession with the most psychopaths?
Did MS DOS itself ever use blinking text?
Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source
Where are Serre’s lectures at Collège de France to be found?
Is it fair for a professor to grade us on the possession of past papers?
How would a mousetrap for use in space work?
What does できなさすぎる means?
If a contract sometimes uses the wrong name, is it still valid?
Dating a Former Employee
Has negative voting ever been officially implemented in elections, or seriously proposed, or even studied?
Maximum summed powersets with non-adjacent items
Circuit to "zoom in" on mV fluctuations of a DC signal?
What's the meaning of "fortified infraction restraint"?
Why do we bend a book to keep it straight?
Why aren't air breathing engines used as small first stages
What does this Jacques Hadamard quote mean?
Do I really need to have a message in a novel to appeal to readers?
Is "Reachable Object" really an NP-complete problem?
How do I find out the mythology and history of my Fortress?
Fundamental Solution of the Pell Equation
What causes the direction of lightning flashes?
Categories are not in order same as in Admin panel Magento 2
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Admin Panel order grid: Multiple sort conditions?Programmatically assign a product's categories _AND_ sort order/positionCategory Sorting: Add custom “Available Product Listing Sort by” option in admin panelCategory Sorting Product list: How to take off position from attributes?Magento 2 - Admin Layout XML - Update Template and change block type for specific categoryChanging the layout of the product category page by editing an XML fileM2: After updating products from code, thumbnails are not showing in catalog and on backendMagento 2: Sort multilevel category collection by both level and positionMagento 2: How to change the position/order of a sub-category?Magento 2 : How to show sub categories on Static block?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am listing children categories of specific category using below code:
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->loadByAttribute('url_key', 'shop');
$childrenCategories = $category->getAllChildren(true);
This methods does not return categories in same order as in Admin panel.
I have changed position of categories in Admin panel by drag and drop then i cleared cache and reindexed too.
Any idea what is wrong here?
magento2 sorting sub-categories
add a comment |
I am listing children categories of specific category using below code:
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->loadByAttribute('url_key', 'shop');
$childrenCategories = $category->getAllChildren(true);
This methods does not return categories in same order as in Admin panel.
I have changed position of categories in Admin panel by drag and drop then i cleared cache and reindexed too.
Any idea what is wrong here?
magento2 sorting sub-categories
add a comment |
I am listing children categories of specific category using below code:
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->loadByAttribute('url_key', 'shop');
$childrenCategories = $category->getAllChildren(true);
This methods does not return categories in same order as in Admin panel.
I have changed position of categories in Admin panel by drag and drop then i cleared cache and reindexed too.
Any idea what is wrong here?
magento2 sorting sub-categories
I am listing children categories of specific category using below code:
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->loadByAttribute('url_key', 'shop');
$childrenCategories = $category->getAllChildren(true);
This methods does not return categories in same order as in Admin panel.
I have changed position of categories in Admin panel by drag and drop then i cleared cache and reindexed too.
Any idea what is wrong here?
magento2 sorting sub-categories
magento2 sorting sub-categories
asked 13 mins ago
KhushbuKhushbu
9010
9010
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I suggest to check with your database category tabel, so you can easily debug where is the issue.
add a comment |
Try This :-
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->->addAttributeToFilter('url_key','shop');
$childrenCategories = $category->getAllChildren(true);
It's giving error:Invalid method MagentoCatalogModelCategoryInterceptor::addAttributeToFilter
– Khushbu
2 mins ago
which model call for get category collection ???
– Rk Rathod
1 min ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270563%2fcategories-are-not-in-order-same-as-in-admin-panel-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I suggest to check with your database category tabel, so you can easily debug where is the issue.
add a comment |
I suggest to check with your database category tabel, so you can easily debug where is the issue.
add a comment |
I suggest to check with your database category tabel, so you can easily debug where is the issue.
I suggest to check with your database category tabel, so you can easily debug where is the issue.
answered 11 mins ago
Anas MansuriAnas Mansuri
187
187
add a comment |
add a comment |
Try This :-
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->->addAttributeToFilter('url_key','shop');
$childrenCategories = $category->getAllChildren(true);
It's giving error:Invalid method MagentoCatalogModelCategoryInterceptor::addAttributeToFilter
– Khushbu
2 mins ago
which model call for get category collection ???
– Rk Rathod
1 min ago
add a comment |
Try This :-
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->->addAttributeToFilter('url_key','shop');
$childrenCategories = $category->getAllChildren(true);
It's giving error:Invalid method MagentoCatalogModelCategoryInterceptor::addAttributeToFilter
– Khushbu
2 mins ago
which model call for get category collection ???
– Rk Rathod
1 min ago
add a comment |
Try This :-
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->->addAttributeToFilter('url_key','shop');
$childrenCategories = $category->getAllChildren(true);
Try This :-
$categoryFactory = $this->_categoryFactory->create();
$category = $categoryFactory->->addAttributeToFilter('url_key','shop');
$childrenCategories = $category->getAllChildren(true);
answered 7 mins ago
Rk RathodRk Rathod
1,429214
1,429214
It's giving error:Invalid method MagentoCatalogModelCategoryInterceptor::addAttributeToFilter
– Khushbu
2 mins ago
which model call for get category collection ???
– Rk Rathod
1 min ago
add a comment |
It's giving error:Invalid method MagentoCatalogModelCategoryInterceptor::addAttributeToFilter
– Khushbu
2 mins ago
which model call for get category collection ???
– Rk Rathod
1 min ago
It's giving error:
Invalid method MagentoCatalogModelCategoryInterceptor::addAttributeToFilter
– Khushbu
2 mins ago
It's giving error:
Invalid method MagentoCatalogModelCategoryInterceptor::addAttributeToFilter
– Khushbu
2 mins ago
which model call for get category collection ???
– Rk Rathod
1 min ago
which model call for get category collection ???
– Rk Rathod
1 min ago
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270563%2fcategories-are-not-in-order-same-as-in-admin-panel-magento-2%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown