Magento get product variations/options with PHP - php

I am trying to get product variations for each child product on the view.phtml page.
Essentially, the drop-down of options for a configurable product are made of these values. For example - A t-shirt might have 3 sizes: small, medium, and large. The drop-down list that Magento has built-in, shows these 3 options (children products).
I am looking for the code to get these options.
I apologize if this is not very clear, the terminology for the Magento products is confusing. Just let me know if you need more details clarified.

I know its been a while. But I had similar problem while creating a script to export products a long with its children, options and prices.
This should get you started: http://fuckyeahcoding.wordpress.com/2011/10/13/easy-magento-csv-product-feeds/

Related

Show product options as a grid/matrix in product detail page

I have to develop a feature in product details page as shown in the screenshot.
https://www.dropbox.com/s/k7ntplkxf3qrvo8/details.png
The options in the grid are selectable and change according to paper or color selected.
What i don't understand is should they be configurable options or custom options.
And if anyone know a good magento extension to make a grid like (matrix) of options.
I don't believe that it's viable on Magento, BUT, you can create a custom JS function with an predesigned table programming for example:
1 day = price + 15%
3 day = price + 7%
6 day = price
Does that make cence, if this approach is not clear for you send me message and i'll try to help you in this case.
You should use Magento tire prices for this kind of stuff. Custom options are not helpful for this, because for every tireprice the additional costs are different.
Problem is, tire prices of simple products are not added to configurable products.
Maybe the simple configurable products extension will be helpful for this.
You can also try an approach with using grouped product to avoid this.

Programatically creating Configurable products in Magento 1.8.1

I have a Magento 1.8.1.0 website where I've imported around 3500 Simple Products using the SOAP API.
I need to be able to create Configurable Products which groups Simple Products based on an SKU pattern, but don't know how to do this programatically. Due to the number of products I can't do this manually because of how long it would take.
The website sells swimwear and the Simple Products are the Size and Colour options. I've added a lot of custom attributes to store details of colour and size, to the Default attribute group.
The Simple Products may look like this:
SKU: XX3736 (32)
SKU: XX3736 (34)
SKU: XX3736 (36)
SKU: XX3736 (38)
Numbers in brackets represent the Size. I've added an attribute which has common part of the SKU - in the above example XX3736 on all 4 Simple Products - so they can be identified as the same product.
Some questions:
How to programatically create the Configurable Products? I've read various posts such as http://blog.omnisubsole.com/2009/07/01/configurable-products-in-magento/ but this seems old (from 2009) and very complicated.
When creating the Simple Products, the product Name is the same in each instance, e.g. on the example above all 4 products are called "Speedo Fastskin 3". Is that correct or do the name need to differ so they can be identified with their Size? If it's wrong how could this be displayed on the front-end?
When I was importing the Simple Products I added things like the Description text to each one. But the products are set to "Not Visible Individually". Is it really necessary to import this data for each Simple Product? I know Magento requires certain fields but it seems strange to import data that's not actually shown anywhere.
Thanks in advance.
Also, it's disappointing that the API doesn't (seem to) support an easy method to do this? Does anyone know if there are plans to have this in later versions? Seems very odd that it's relatively easy to import the Simple Products but so hard to create Configurables from them!
Answered my own question but in the end this is what worked, with some modifications: http://www.codetweet.com/magento/create-configurable-product-magento-programmatically/

Magento Configure Products with 100's of permutations

I have an E-Commerce store (Build with Magento). I am stuck in a problem which you guys can help me to figure it out.
In my Magento Store each product has 40 color options and 10 different sizes. This add up to 400 permutations per product. I need to maintain inventory for each permutation and also make the products filterable.
The only solution for this in Magento is Configurable products but you need to add simple product for each permutation. The store has 6000 products meaning 6000*400=2400000 total products. I simply can't add these many products.
What are my other options? I am stuck here for quite some time.
Thanks in advance
One solution could be to create the 6000 simple products with color and size as attributes.
You would then observe on the add to cart event, or create a custom controller action, that would create a new product on the fly and populate the color and size attributes based on post values from the product view page. Then you would have to create a custom flat table to manage the inventory of each product-color-size combination. The custom inventory table can be referenced to set the stock item for the generated product and in the product grid/view to check the availability.
This would create a new product for each purchase, but you may be able to get away with deleting the product after the sale is made. Also you may have to customize the reordering process, if you need that feature as well.
This may not be the most straight forward solution, but it should work, in theory.

Hiding a custom option on a product in Magento

I have several hundred products in my Magento store, all of which have a very similar set of custom options. I used one product as a template, and copied its custom options to all of the other products so that all of the products currently have the same set of custom options.
I would like to disable or hide certain custom options for some products in my store without deleting the option completely. Right now, I only have the ability to delete an option for a product entirely. For example, some products cannot currently be ordered in different colors, but they might be later; I'd like to be able to disable the color option rather than delete it and re-add the entire list of colors later.
Does anyone have any similar experience who can provide me with some help with this problem? Thanks, I really appreciate the help!
Using custom options for attributes like "color" is not a correct approach for Magento. Magento has special product type - Configurable product for the catalog structure you're trying to achieve.
Here's benefits you'll get from using configurable product instead of custom options:
Automatic stock management. You won't need to enable-disable your custom options as soon as some physical item is out of stock - Magento will do it for you.
You won't have to copy all custom options to a new product you create. The attribute for the Attribute set this product belongs to will automatically be available for new entries.
You will have ability to filter your products by the color attribute on Category page using Layered Navigation.
Here's the guide how to create configurable product from the official Magento wiki.

Magento, add Clothing size attribute without Configurable Product

I want a simple way to let my user pick there clothing size before buy
but Configurable Product seems like to much overkill. you have to make a product of every size
and then you have to make a configurable product.
the shop is for my dad and if i have to explain him how he has to do this it would be weeks for him to know this, (it took several days to make him learn to create a simple product)
Is there any other possibility to create a product and in the front end let the user select the size attribute ..
there has to be a more simple way than this ?
The reason a configurable product relies on child simple products is to keep track of inventory--the simple product is the physical, shippable unit (Crew Neck Shirt-Red-Small) and the configurable product, as you know, is a "meta" product that groups all of the (Crew Neck Shirt-Some Color-Some Size) combinations together.
If you don't care about having your Magento store track inventory, then you can use a simple product with custom options. This is usually used for things that you make on the fly, like monogramming a t-shirt, or screen printing a t-shirt. Create the simple product and take a look at the Custom Options tab on the left side. There you can define a drop-down for your size and specify the options there. Unlike a product attribute, however, I'm pretty certain that you'll have to re-create the size options for each product that you decide to sell this way.
The Magento Web site has a video tutorial that shows how this works. You might show that to him.
I don't think you'll find too many arguments that the Magento admin interface is extremely confusing--even for computer savvy users--but it is what it is. Good luck!

Categories