Created
February 19, 2013 16:17
-
-
Save Schrank/4987320 to your computer and use it in GitHub Desktop.
Save a product from the frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// save the old id | |
$oldStoreId = Mage::app()->getStore()->getId(); | |
// set the store to be admin | |
Mage::app()->getStore()->setId(Mage_Core_Model_App::ADMIN_STORE_ID); | |
// set the orig data | |
$product->setOrigData(); | |
// save the product | |
$product->save(); | |
// reset the store id | |
Mage::app()->getStore()->setId($oldStoreId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment