$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();
Ok.I have been faced for this cross domain request using ajax last week and i got real pain when i tried to use it. I tried with jquery ajax and read lots of articles from the Internet. Reading made me to do this post. First i tell you what was my scene. I had to do a validation regarding some value. I request this via Ajax.
Comments
Post a Comment