After i import the products into magento which appears to go smoothly no errors; the products aren't visible in the store. however if i go to any product and save(even without changing anything) it it is instantly available. Why are these products not visible right away...
Running the latest stable build.
Thanks
The best way to solve this problem programmatically is to
Import the product
Examine all the product's attributes via some custom code
Save the product
Examine all the product's attributes via some custom code
Compare the results of #2 and #4
Ensure your import process explicitly sets whatever attributes were missing in #2 but present in #4
Here's the snipping I'd use to examine the product attributes. Run this or something like it in a phtml template, custom controller, etc.
var_dump(
Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addAttributeToFilter('sku','SKUGOESHERE')
->getFirstItem()
->getData()
);
For anyone else who is having this problem: I solved it by making sure you set the websiteid
for the product. If you are using a custom script, remember to add the following:
$product->setWebsiteIds(array(Mage::app()->getStore(true)->getWebsite()->getId()));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With