almost 11 years ago
public function saveproductAction() { $categoryId = $_REQUEST['catId']; $productName = $_REQUEST['ProductName']; $productDesc = $_REQUEST['productDesc']; $productPrice = $_REQUEST['productPrice']; $productQty = $_REQUEST['productQty']; $newproduct = new Mage_Catalog_Model_Product(); $newproduct->setTypeId('simple'); $newproduct->setWeight(10); $newproduct->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH); $newproduct->setStatus(1); $newproduct->setSku($productName.time()); $newproduct->setTaxClassId(0); $newproduct->setCategoryIds($categoryId); $newproduct->setWebsiteIDs(array(1)); //$newproduct->setStoreIDs(array(1)); $newproduct->setStockData(array( 'is_in_stock' => 1, 'qty' =>$productQty, 'manage_stock' => 1 )); $newproduct->setAttributeSetId(4); $newproduct->setName($productName); $newproduct->setDescription($data['description']); $newproduct->setShortDescription($productDesc); $newproduct->setPrice($productPrice); try{ $newproduct->save(); //echo "Success"; $this->_redirect('manager/account/dashboardedit/'); } catch (Exception $e){ echo $e->getMessage(); }
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)