Create configurable product in Magento programmatically

Following post includes the code that can be used to create a configurable product in Magento.

Brief introduction about configurable product

When adding new products to your Magento store you have the option to select the type of the product. The most basic option is simple product.
That’s just a single item with no specific attributes/options that can be changed by the buyer.
With the configurable product type you can offer an item with some options that can be configured by the customers themselves.
For example, you can sell the same model of shoes that are offered in different colors, sizes, etc. Instead of creating several simple
products for each size of the same shoe model that will be displayed individually on the frontend,
for instance, you can create a configurable product which will allow the customer to select the size before ordering the product.

To understand the code, one must have a basic understanding of how configurable product works in a Magento store.

Continue reading

Create Simple Product in Magento Store Programmatically


We are creating a simple product programmatically in Magento Store. There is nothing much to describe in this post.
I am using the basic required information to create the product. May be your store needs more attributes to create the product, but to keep the post simple I am using just 2 custom created attributes.




Following script contains a function that gives the option id of option label for any attribute code.
For example, Magento needs the 321(assume option id for label “Black”) to save the value of attribute color.

Continue reading