0
votes

I have created few simple products (sizes) in admin panel. My task is to create configurable product programmatically. When I create configurable product programmatically I use those simple products (loading by their IDs). But when I go to the page of that configurable product and choose size (simple product) and place order, in admin panel (Sales -> Orders) this configurable product has the SKU of simple product. How to avoid to setup simple product SKU for configurable product? The reason why I need this is I can have many products with same SKU in sales -> orders.

1
I edited your question but still its not clear what you are asking! Please be more specific. For example you could provide a screenshot to make it clearer for us.hatef

1 Answers

-1
votes
public function getSku()
{
/*if ($this->getItem()->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
    return $this->getItem()->getProductOptionByCode('simple_sku');
}*/
return $this->getItem()->getSku();
}

app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php

Replace the above code from below code in all files.

public function getSku() {
$product = Mage::getModel('catalog/product')->load($this->getItem()->getProductId());
return $product->getSku();
}