Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7680885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:13:04+00:00 2026-05-31T18:13:04+00:00

I am looking for an API that can remove bundle items added in a

  • 0

I am looking for an API that can remove bundle items added in a main bundle product.

Can some one guide me to that API?

regards,
Irfan

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T18:13:05+00:00Added an answer on May 31, 2026 at 6:13 pm

    above does not work , Bundled items inside a bundle product are treated differently. There are inside Options and are called Selections.

        // get all the options of your bundle product assumed as $bundle
        $optionCollection = $bundle->getTypeInstance()->getOptionsCollection($bundle);
        $selectionIds = $optionIds = array();
        // and their Id into an array
        foreach($optionCollection as $opt) {
            $optionIds[] = $opt->getOptionId();
        }
        // fetch all the selections from all the previous Ids
        $selectionCollection = $bundle->getTypeInstance()->getSelectionsCollection($optionIds);
        foreach($selectionCollection as $sc) {
            if ($sc->getId()!=$itemToRemoveId) $selectionIds[] = $sc->getSelectionId();
        }
    
        // remove the Selection/Bundle association from database, we need to pass all the others except the one we need to drop
        Mage::getModel('bundle/mysql4_bundle')->dropAllUnneededSelections($bundle->getId(), $selectionIds);
    

    Another Easyier way is to Delete your Item from the bundle/Selection table :

    $sql = "DELETE FROM " . $this->getTable('bundle/selection') . " WHERE 'product_id' = " . $YOUR_ITEM_TO_REMOVE_ID ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking to add some data generated after payment (API key) that I can
I am looking for some simple API that I could send email to and
I'm looking to get my hands on an API (hopefully one that's platform agnostic)
Hope someone can advice but looking for an API service that can provide traveling
I'm looking for a totally free fingerprint reader API/SDK that I can use in
I am looking (I think) for the Windows API that I can use in
I'm looking for an API or Ruby Gem that can do two things. The
I'm looking for an API that can be accessed via C# implementation where I
I'm looking at building a simple web app that will expose an API that
I am looking for a managed code library/API or samples that let me write

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.