Free Magento extension Simple Products Generator automatically creates simple products, representing the possible combinations of attributes.

  • Open the file / app / code / community / WP / GenerateSimpleProducts / controllers / IndexController.php
  • Find the function _getSimpleProductPrefixes in this code

Examples of the SKU changing

SKU would be [MainProductSKU] + [The first letter of the attribute value]

Configurable Magento product SKU value is "ring". Configurable attribute is "material". Attribute has values:

  • gold
  • silver
  • platinum

By default 3 Magento simple products would be created with sku values:

  • ring-material-gold
  • ring-material-silver
  • ring-material-platinum

Let us change sku generation rule so that sku would be [MainProductSKU] + [The first letter of the attribute value]:

  • ring-g
  • ring-s
  • ring-p

How to do that?

Open the file / app / code / community / WP / GenerateSimpleProducts / controllers / IndexController.php

Find the function _getSimpleProductPrefixes in this code

Replace the code

with this code

How can add the number of the stock i have for each sizes

For example
Size stock
25 1
26 5
27 6
28 8

Open to edit:
/app/code/community/WP/GenerateSimpleProducts/controllers/IndexController.php

Find the function:
_createSimpleProduct

Comment this string:
$stockData['qty'] = '1000';

After the code:
$stockData = $product->getStockData();

Add the code:


Premium Magento extensions can help transform your Magento Shopping Cart into an online selling machine.

Back

Go to contentsBack to previous page