简体   繁体   中英

magento products suddenly disappear from admin and frontend

These few days I have been adding new products. Today when adding products, they are suddenly gone from Admin and frontend. Could someone give me some idea how to get them back? In the media folder, I can see the pictures and in the MySQL database, I can see the descriptions. But how to get them show up in the admin and frontend? I am using Magento 1.702.

how are you adding the products using magento ui or backent coding? if you are adding products in coding you should set the admin session enabled.

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
Mage::getSingleton('core/session', array('name'=>'adminhtml'));
$userModel = Mage::getModel('admin/user');
$userModel->setUserId(1);
$session = Mage::getSingleton('admin/session');
$session->setUser($userModel);
$session->setAcl(Mage::getResourceModel('admin/acl')->loadAcl());

It should work!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM