Finding products with and without custom options using SQL (Magento 1)

To find all products that have keine no custom options, run this query:

To find all products that do have custom options, simply remove “NOT” from the query above.

Adding a product image description programmatically (Magento 1)

There is no way to add a product image description using the addImageToMediaGallery function. The following code does the job though: foreach($product->getData(‘media_gallery’) as $each){ foreach($each as $image){ $attributes = $product->getTypeInstance(true)->getSetAttributes($product); $attributes['media_gallery']->getBackend()->updateImage($product, $image['file'], array(‘label’ => ‘whatever’)); } }

Adding a product image label programmatically (Magento 1)

If you want to add a label to a product image programmatically, you cannot do this with the addImageToMediaGallery method. The following code, however, does the job:

Getting the attribute set name of a product (Magento 1)

Use the following code to get a products attribute set name.