cancel
Showing results for 
Search instead for 
Did you mean: 

Shift/Add existing simple products to configurable product

Shift/Add existing simple products to configurable product

We want to shift existing simple products to configurable products as our site is live we do not want to create new products. Is there any script or extension using which we can achieve the same or any other method to do the same?

1 REPLY 1

Re: Shift/Add existing simple products to configurable product

Yes, there are a few ways to add existing simple products to configurable products without creating new products. Here are some methods:

  1. Use an extension: There are extensions available on the Magento Marketplace that allow you to add simple products to configurable products. One such extension is "Simple Configurable Products" by Organic Internet. This extension provides an easy-to-use interface for adding simple products to configurable products.

    1. Use scripts: You can write custom scripts to add existing simple products to configurable products. Here's an example script:

      <?php
      require_once 'app/Mage.php';
      umask(0);
      Mage::app('default');
      
      //Load configurable product by SKU
      $configurableProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', 'configurable_sku_here');
      if (!$configurableProduct) {
          echo "Configurable product not found";
          exit;
      }
      
      //Load simple product(s) by SKU
      $simpleProduct1 = Mage::getModel('catalog/product')->loadByAttribute('sku', 'simple_sku_1_here');
      $simpleProduct2 = Mage::getModel('catalog/product')->loadByAttribute('sku', 'simple_sku_2_here');
      if (!$simpleProduct1 || !$simpleProduct2) {
          echo "Simple product(s) not found";
          exit;
      }
      
      //Add simple products to configurable product
      $configurableProduct->getTypeInstance()->saveProducts($configurableProduct->getId(), array($simpleProduct1->getId(), $simpleProduct2->getId()));
      
      echo "Products added to configurable product";