I’m uploading products via the Magento API and they are not showing up in the frontend. I have to go into the backend, open them up, change nothing, save the product and then it will appear.
Any idea why? I assume the act of saving it in the back end, is saving some extra flags in the DB, I just don’t know what.
@Steve Madsen. here is the code, I don't think I'm missing anything crucial, as the backend interface would prompt me of it, then I open of the product.
public void Import(Product product)
{
var mageProduct = new catalogProductCreateEntity();
mageProduct.name = product.Name;
mageProduct.description = product.Description;
mageProduct.price = product.Price.ToString();
mageProduct.short_description = product.ShortDescription;
mageProduct.description = product.Description;
mageProduct.status = "1";
mageProduct.weight = "0";
mageProduct.tax_class_id = "2";
mageProduct.gift_message_available = "0";
var additionalattributes = new associativeEntity[4];
var entity = new associativeEntity();
entity.key = "ship_price";
entity.value = product.PostageCost;
additionalattributes[0] = entity;
entity = new associativeEntity();
entity.key = "depth_cm";
entity.value = product.Depth;
additionalattributes[1] = entity;
entity = new associativeEntity();
entity.key = "height_cm";
entity.value = product.Height;
additionalattributes[2] = entity;
entity = new associativeEntity();
entity.key = "width_cm";
entity.value = product.Width;
additionalattributes[3] = entity;
mageProduct.additional_attributes = additionalattributes;
_m.catalogProductCreate(MageSessionProvider.GetSession(), "simple", "26", product.SKU, mageProduct);
var stock = new catalogInventoryStockItemUpdateEntity();
stock.manage_stock = 0;
stock.qty = "0";
_m.catalogInventoryStockItemUpdate(MageSessionProvider.GetSession(), product.SKU, stock);
Console.WriteLine(product.Name + " imported");
}