In Magento 2, Set base image as small image
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty{ margin-bottom:0;
}
up vote
1
down vote
favorite
I have nearly 40k products and all images have been set to small only. If I go into the backend and then set each image one by one to the base, it will take me forever. Is there any way to do it via the database?
magento2 product-images
add a comment |
up vote
1
down vote
favorite
I have nearly 40k products and all images have been set to small only. If I go into the backend and then set each image one by one to the base, it will take me forever. Is there any way to do it via the database?
magento2 product-images
You want to set small image which is already set in base image?
– Rohan Hapani
Nov 23 at 12:23
I want to set a base image which is already set in the small image.
– Akash Patel
Nov 23 at 12:52
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have nearly 40k products and all images have been set to small only. If I go into the backend and then set each image one by one to the base, it will take me forever. Is there any way to do it via the database?
magento2 product-images
I have nearly 40k products and all images have been set to small only. If I go into the backend and then set each image one by one to the base, it will take me forever. Is there any way to do it via the database?
magento2 product-images
magento2 product-images
asked Nov 23 at 11:52
Akash Patel
50416
50416
You want to set small image which is already set in base image?
– Rohan Hapani
Nov 23 at 12:23
I want to set a base image which is already set in the small image.
– Akash Patel
Nov 23 at 12:52
add a comment |
You want to set small image which is already set in base image?
– Rohan Hapani
Nov 23 at 12:23
I want to set a base image which is already set in the small image.
– Akash Patel
Nov 23 at 12:52
You want to set small image which is already set in base image?
– Rohan Hapani
Nov 23 at 12:23
You want to set small image which is already set in base image?
– Rohan Hapani
Nov 23 at 12:23
I want to set a base image which is already set in the small image.
– Akash Patel
Nov 23 at 12:52
I want to set a base image which is already set in the small image.
– Akash Patel
Nov 23 at 12:52
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
If you want to do by MySQL way follow below way
First, run below query to know the query is actually working and you will get a list of images
select ev.value, mg.value from catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
After that run below query to update small image path with a thumbnail image
UPDATE catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
SET ev.value = mg.value
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
You should run first in test ENV, after making sure you can run on other ENV.
Hope It will solve your issue
It's working. Thanks
– Akash Patel
Nov 23 at 12:35
add a comment |
up vote
0
down vote
You can use the CSV.
Please add two more column 'base_image' and 'thumbnail_image' in the csv file and re import all the products.Then after reindex the process.
Image Url does not generate When I import via CSV file.I have done this
– Akash Patel
Nov 23 at 12:13
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
If you want to do by MySQL way follow below way
First, run below query to know the query is actually working and you will get a list of images
select ev.value, mg.value from catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
After that run below query to update small image path with a thumbnail image
UPDATE catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
SET ev.value = mg.value
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
You should run first in test ENV, after making sure you can run on other ENV.
Hope It will solve your issue
It's working. Thanks
– Akash Patel
Nov 23 at 12:35
add a comment |
up vote
2
down vote
accepted
If you want to do by MySQL way follow below way
First, run below query to know the query is actually working and you will get a list of images
select ev.value, mg.value from catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
After that run below query to update small image path with a thumbnail image
UPDATE catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
SET ev.value = mg.value
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
You should run first in test ENV, after making sure you can run on other ENV.
Hope It will solve your issue
It's working. Thanks
– Akash Patel
Nov 23 at 12:35
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
If you want to do by MySQL way follow below way
First, run below query to know the query is actually working and you will get a list of images
select ev.value, mg.value from catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
After that run below query to update small image path with a thumbnail image
UPDATE catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
SET ev.value = mg.value
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
You should run first in test ENV, after making sure you can run on other ENV.
Hope It will solve your issue
If you want to do by MySQL way follow below way
First, run below query to know the query is actually working and you will get a list of images
select ev.value, mg.value from catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
After that run below query to update small image path with a thumbnail image
UPDATE catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
SET ev.value = mg.value
WHERE mg.value_id = mgv.value_id
AND mgv.entity_id = ev.entity_id
AND ev.attribute_id IN (87, 88, 89)
AND mgv.position = 1;
You should run first in test ENV, after making sure you can run on other ENV.
Hope It will solve your issue
answered Nov 23 at 12:15
Hitesh
1,122323
1,122323
It's working. Thanks
– Akash Patel
Nov 23 at 12:35
add a comment |
It's working. Thanks
– Akash Patel
Nov 23 at 12:35
It's working. Thanks
– Akash Patel
Nov 23 at 12:35
It's working. Thanks
– Akash Patel
Nov 23 at 12:35
add a comment |
up vote
0
down vote
You can use the CSV.
Please add two more column 'base_image' and 'thumbnail_image' in the csv file and re import all the products.Then after reindex the process.
Image Url does not generate When I import via CSV file.I have done this
– Akash Patel
Nov 23 at 12:13
add a comment |
up vote
0
down vote
You can use the CSV.
Please add two more column 'base_image' and 'thumbnail_image' in the csv file and re import all the products.Then after reindex the process.
Image Url does not generate When I import via CSV file.I have done this
– Akash Patel
Nov 23 at 12:13
add a comment |
up vote
0
down vote
up vote
0
down vote
You can use the CSV.
Please add two more column 'base_image' and 'thumbnail_image' in the csv file and re import all the products.Then after reindex the process.
You can use the CSV.
Please add two more column 'base_image' and 'thumbnail_image' in the csv file and re import all the products.Then after reindex the process.
answered Nov 23 at 12:10
Sunny Rahevar
812112
812112
Image Url does not generate When I import via CSV file.I have done this
– Akash Patel
Nov 23 at 12:13
add a comment |
Image Url does not generate When I import via CSV file.I have done this
– Akash Patel
Nov 23 at 12:13
Image Url does not generate When I import via CSV file.I have done this
– Akash Patel
Nov 23 at 12:13
Image Url does not generate When I import via CSV file.I have done this
– Akash Patel
Nov 23 at 12:13
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f251081%2fin-magento-2-set-base-image-as-small-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You want to set small image which is already set in base image?
– Rohan Hapani
Nov 23 at 12:23
I want to set a base image which is already set in the small image.
– Akash Patel
Nov 23 at 12:52