#StackBounty: #magento-1.9 #soap Set all selected media gallery types to default store value using SOAP Api

Bounty: 50

I want all images of a product to use the default small_image, thumbnail and image again for every storeview using the SOAP api.

So far I’ve tried to set the ‘types’ using catalog_product_attribute_media.update to null but with no success.

            foreach($storeviews as $storeviewId) {
                $result = $client->call(
                    $session,
                    'catalog_product_attribute_media.list',
                    $productId,
                    $storeviewId
                );

                foreach($result as $image) {
                    $client->call(
                        $session,
                        'catalog_product_attribute_media.update',
                        [ 
                            $productId,
                            $image['file'],
                            [
                                'types' => null,
                            ]
                        ],
                        $storeviewId
                    );
                }
            }


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.