I'm trying to modify a magento oscommerce import script to work with attributes and configurable products. It's a challenge to say the least.
But I'm getting progress. Currently I'm trying to add attribute set name to magento, and after that, I'm writing to my tmp table where I need magento attribute set id, for the attribute set I've just created.
My problem is I don't know how to get that id.
My current code:
$sql = "select * from ezmage_variant_sets";
$results = $readConnection->fetchAll($sql);
foreach($results as $row) {
if ($row['variant_imported'] != 'y'){
$this->createAttributeSet($row['osc_variants_title'],-1);
// update tmp table
$sql = "update ezmage_variant_sets set variant_imported='y',mage_variant_id=".$variant->getId()." where osc_variants_id=".$row['osc_variants_id'];
$writeConnection->query($sql);
}
}
Problem is $variant->getId(). What would I need to get that id?