$productId =1; $loadpro=Mage::getModel('catalog/product')->load($product->getId()); $mediaApi = Mage::getModel("catalog/product_attribute_media_api"); $mediaApiItems = $mediaApi->items($product->getId()); foreach($mediaApiItems as $item) { $mediaApi->remove($loadpro->getId(), $item['file']); } $loadpro->save();
Through the application configaration file You can easily save values to later usage. you can create a application configuration file from project > Add New Item (Ctrl + Shift + A) example You want to add get string from config file Create a Config file using above step. after that insert following code to the config file. its a XML file. appsettings add key="DatabasePath" value="c:\\projects\data\spider.mdb" add key="SupportEmail" value="webmaster-1@dotnetspider.com" appsettings configuration in the coding add following Dim app As New System.Configuration.AppSettingsReader Dim s As String s = app.GetValue("DatabasePath", Type.GetType("System.String")) MessageBox.Show(s) its very easy when you are handling databases. you can store database connection string in that config for later reusabilty. Please post your comments
Comments
Post a Comment