Magento 2 delete specific product categoriesGet specific categories Name and URL to itShow Specific Categories On Magento Home PageHow to get product ids of specific category and not in other categories in Magento?How to Delete All Products Within a CategoryMagento get product current subcategory of specific parent categoryExcluding products from multiple categories in collectionI can not delete or modify a product categoryMagento 2: Display list of specific categories on Home PageHow to load only the children categories that belong to the current product (magento)Specific view for specific category in Magento 2
My employer faked my resume to acquire projects
Is "cool" appropriate or offensive to use in IMs?
Best material to absorb as much light as possible
Why did the person in charge of a principality not just declare themself king?
Defining the standard model of PA so that a space alien could understand
How can I tell if I'm being too picky as a referee?
How did NASA Langley end up with the first 737?
What is a fully qualified name?
How to deal with a colleague who is being aggressive?
Can a person survive on blood in place of water?
Website returning plaintext password
What could a self-sustaining lunar colony slowly lose that would ultimately prove fatal?
Sankey diagram: not getting the hang of it
I know that there is a preselected candidate for a position to be filled at my department. What should I do?
Is it legal to meet with potential future employers in the UK, whilst visiting from the USA
When the Torah was almost lost and one (or several) Rabbis saved it?
Access to the path 'c:somepath' is denied for MSSQL CLR
Ethical issue - how can I better document what is happening?
How to politely tell someone they did not hit "reply to all" in an email?
Count Even Digits In Number
Efficient Algorithm for the boundary of a set of tiles
Question in discrete mathematics about group permutations
Pirate democracy at its finest
What does $!# mean in Shell scripting?
Magento 2 delete specific product categories
Get specific categories Name and URL to itShow Specific Categories On Magento Home PageHow to get product ids of specific category and not in other categories in Magento?How to Delete All Products Within a CategoryMagento get product current subcategory of specific parent categoryExcluding products from multiple categories in collectionI can not delete or modify a product categoryMagento 2: Display list of specific categories on Home PageHow to load only the children categories that belong to the current product (magento)Specific view for specific category in Magento 2
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
how can I delete specific categories for a product in Magento 2.Forex: I have a product with a,b,c categories, I have some conditions if the conditions meet my categories remains same but if those conditions fail I need to remove b, the category only not a,c categories. How can I achieve that?
magento2 product category delete
add a comment |
how can I delete specific categories for a product in Magento 2.Forex: I have a product with a,b,c categories, I have some conditions if the conditions meet my categories remains same but if those conditions fail I need to remove b, the category only not a,c categories. How can I achieve that?
magento2 product category delete
Let me know whether you would like to remove programmatically? or manually
– Nagaraju Kasa
May 19 at 4:14
programmatically @NagarajuKasa
– Prasanth
May 19 at 4:31
add a comment |
how can I delete specific categories for a product in Magento 2.Forex: I have a product with a,b,c categories, I have some conditions if the conditions meet my categories remains same but if those conditions fail I need to remove b, the category only not a,c categories. How can I achieve that?
magento2 product category delete
how can I delete specific categories for a product in Magento 2.Forex: I have a product with a,b,c categories, I have some conditions if the conditions meet my categories remains same but if those conditions fail I need to remove b, the category only not a,c categories. How can I achieve that?
magento2 product category delete
magento2 product category delete
edited May 20 at 8:31
Muhammad Anas
1,0663525
1,0663525
asked May 19 at 3:46
PrasanthPrasanth
278
278
Let me know whether you would like to remove programmatically? or manually
– Nagaraju Kasa
May 19 at 4:14
programmatically @NagarajuKasa
– Prasanth
May 19 at 4:31
add a comment |
Let me know whether you would like to remove programmatically? or manually
– Nagaraju Kasa
May 19 at 4:14
programmatically @NagarajuKasa
– Prasanth
May 19 at 4:31
Let me know whether you would like to remove programmatically? or manually
– Nagaraju Kasa
May 19 at 4:14
Let me know whether you would like to remove programmatically? or manually
– Nagaraju Kasa
May 19 at 4:14
programmatically @NagarajuKasa
– Prasanth
May 19 at 4:31
programmatically @NagarajuKasa
– Prasanth
May 19 at 4:31
add a comment |
1 Answer
1
active
oldest
votes
You need to build a category collection of the categories you want to delete.
Then it's just the case of something like this:
try
$category->delete();
echo 'Category Removed';
catch (Exception $e)
echo 'Failed to remove category ' . $category->getId();
echo $e->getMessage();
I cant be more specific without knowing more about the conditions which means delete.
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%2f275146%2fmagento-2-delete-specific-product-categories%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to build a category collection of the categories you want to delete.
Then it's just the case of something like this:
try
$category->delete();
echo 'Category Removed';
catch (Exception $e)
echo 'Failed to remove category ' . $category->getId();
echo $e->getMessage();
I cant be more specific without knowing more about the conditions which means delete.
add a comment |
You need to build a category collection of the categories you want to delete.
Then it's just the case of something like this:
try
$category->delete();
echo 'Category Removed';
catch (Exception $e)
echo 'Failed to remove category ' . $category->getId();
echo $e->getMessage();
I cant be more specific without knowing more about the conditions which means delete.
add a comment |
You need to build a category collection of the categories you want to delete.
Then it's just the case of something like this:
try
$category->delete();
echo 'Category Removed';
catch (Exception $e)
echo 'Failed to remove category ' . $category->getId();
echo $e->getMessage();
I cant be more specific without knowing more about the conditions which means delete.
You need to build a category collection of the categories you want to delete.
Then it's just the case of something like this:
try
$category->delete();
echo 'Category Removed';
catch (Exception $e)
echo 'Failed to remove category ' . $category->getId();
echo $e->getMessage();
I cant be more specific without knowing more about the conditions which means delete.
answered May 19 at 18:09
Dominic XigenDominic Xigen
54811
54811
add a comment |
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%2f275146%2fmagento-2-delete-specific-product-categories%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
Let me know whether you would like to remove programmatically? or manually
– Nagaraju Kasa
May 19 at 4:14
programmatically @NagarajuKasa
– Prasanth
May 19 at 4:31