Magento – CSV imported product is not showing in Magento front end

csvmagento-1.9product

I have uploaded product in CSV format. I set the product as enabled, stock as in_stock and quantity as 100 in CSV file, But the product is not showing in front end pages, But when I just open and save the product from admin panel the product is listing in front pages.
Any help is appreciable.
Thank you in advance

    $product = Mage::getModel ( 'catalog/product' );
    $product = Mage::getModel ( 'marketplace/product' )->setProductInfo(   $product, $set, $type, $categoryIds, $sellerId, $groupId, $imagesPath );
$product->setAttributeSetId($attributeSetID);
        $product->setTypeId('simple'); 
        $product->setSellerId($sellerId); 
        $product->setGroupId($groupId); 
        $product->setCreatedAt(strtotime('now'));
        $product->setName($productName);                            
        $product->setManufacturer($barndOptionValue); 
        $product->setModel($ModelOptionValue);
        $product->setProductcode($productCode); 
        $product->setRoomBudget($room_budget); 
        $product->setShortDescription($shortDescription); 
        $product->setDescription($Description); 
        $product->setSku($sku);
        $product->setDimensionUnits($diamensionUnitValue); 
        $product->setLenghtWithoutPacking($diamensionLengthWithoutPacking);
        $product->setWidthWithoutPacking($diamensionBreadthWithoutPacking);
        $product->setHeightWithoutPacking($diamensionHeightWithoutPacking);
        $product->setWeightUnit($weightUnitValue);
        $product->setWeight($weightWithoutPacking);
        $product->setWeightWithPacking($weightWithPacking);
        $product->setRoom($roomIds);
        $product->setMinimumOrderQuantity($minimumOrderQuantity);
        $product->setOrderDispatchLeadTime($leadDispatchTime); 
        $product->setLengthWithPacking($dimensionWithPackingLenght);
        $product->setWidthWithPacking($dimensionWithPackingBreadth); 
        $product->setHeightWithPacking($dimensionWithPackingHeight);
        $product->setMsrp($msrp);
        $product->setPrice($price);
        $product->setShippingcostIncluded($shippingcostIncluded);
        $product->setSellerProductcode($sellerProductcode);
        $product->setVisibility(4); // catalog, search
       $product->setStatus(1); // enbled
       $product->setTaxClassId(0);
        $product->setSellerShippingOption(17);
        $product->setWebsiteIds(array(1));
    $product->setData('group_price',$groupPrice);
    $stockData = $product->getStockData();
    $stockData['qty'] = $stock; 
    $stockData['is_in_stock'] = 1; //
    $stockData['manage_stock'] = 1;
    $stockData['use_config_manage_stock'] = 0;
    $product->setStockData($stockData);
    $product->save ();

Best Answer

  1. Make sure the product Status is Enabled (CSV file: status set to 1).
  2. Make sure the product Visibility is set to Catalog, Search (CSV file: visibility set to 4).
  3. Make sure the product is In Stock (CSV file: is_in_stock set to 1).
  4. Make sure the product has a quantity available (CSV file: qty is greater than 0).
  5. Make sure the product is in a category.
  6. Flush and update your cache in System > Cache Management.
  7. Reindex your data in System > Index Management.

Use below code :

 <?
    $product = Mage::getModel ( 'catalog/product' );
       // $product = Mage::getModel ( 'marketplace/product' )->setProductInfo(   $product, $set, $type, $categoryIds, $sellerId, $groupId, $imagesPath );
            $product->setStoreId(1); // put store id 
            $product->setAttributeSetId($attributeSetID);
            $product->setTypeId('simple'); 
            $product->setSellerId($sellerId); 
            $product->setGroupId($groupId); 
            $product->setCreatedAt(strtotime('now'));
            $product->setName($productName);                            
            $product->setManufacturer($barndOptionValue); 
            $product->setModel($ModelOptionValue);
            $product->setProductcode($productCode); 
            $product->setRoomBudget($room_budget); 
            $product->setShortDescription($shortDescription); 
            $product->setDescription($Description); 
            $product->setSku($sku);
            $product->setDimensionUnits($diamensionUnitValue); 
            $product->setLenghtWithoutPacking($diamensionLengthWithoutPacking);
            $product->setWidthWithoutPacking($diamensionBreadthWithoutPacking);
            $product->setHeightWithoutPacking($diamensionHeightWithoutPacking);
            $product->setWeightUnit($weightUnitValue);
            $product->setWeight($weightWithoutPacking);
            $product->setWeightWithPacking($weightWithPacking);
            $product->setRoom($roomIds);
            $product->setMinimumOrderQuantity($minimumOrderQuantity);
            $product->setOrderDispatchLeadTime($leadDispatchTime); 
            $product->setLengthWithPacking($dimensionWithPackingLenght);
            $product->setWidthWithPacking($dimensionWithPackingBreadth); 
            $product->setHeightWithPacking($dimensionWithPackingHeight);
            $product->setMsrp($msrp);
            $product->setPrice($price);
            $product->setShippingcostIncluded($shippingcostIncluded);
            $product->setSellerProductcode($sellerProductcode);
            $product->setVisibility(4); // catalog, search
           $product->setStatus(1); // enbled
           $product->setTaxClassId(0);
            $product->setSellerShippingOption(17);
            $product->setWebsiteIds(array(1));      
            $product->setData('group_price',$groupPrice);
             $product->setStockData(array(
                       'use_config_manage_stock' => 0, //'Use config settings' checkbox
                       'manage_stock'=>1, //manage stock
                       'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart
                       'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart
                       'is_in_stock' => 1, //Stock Availability
                       'qty' => 999 //qty
                   )
                    );
            $product->save ();
?>