I have a custom product (configurables) importer from XML made by me. Things are not working fine. The products are created, but attributes and categories are not set properly. Maybe I'm missing some part, or not doing it right.
Categories tab of simple and configurable product are looking like this, though I have
$o['categoryids'] = Array (  => 190 ). 190 leads to Shop → Events → Homecoming.
Asociated products are correct, but if you pay attention at the color you see nothing there but it should be 'Print'.
The tab with custom options for simple product (
style should not be there, and
color must be
size - one of [00, 0, 2]):
The tab with custom options for configurable product:
Full code of MainFormController.php (file with importing code) is on pastebin (Alert: Messy code where logic may not be found). First is called
Contents of XML: http://pastebin.com/B7JaG1y9 (simplified: 1 product, 3 sizes and 1 color as trying to do in the code).
Create configurable product is called with the following args: enter link description here
Args for create simple product: http://pastebin.com/AVV2AE9Q
Information about attributes (attributes and values): http://pastebin.com/ibB33Mku
The problem with attributes was at:
When setting simple product attributes, you must pass the value id not the value itself.
Now remains the problem with the categories. A stange thing is that I created a simple product following the tutorial from http://www.danneh.org/2012/05/creating-products-programmatically-magento, and the same problem is there.
Well, I added manually a product to Magento (tests for categories). And I saw that, even for that product the problem is. So I need to make a new question, because it's not related to configurable products.