Attribute size should not change the image
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Attribute size should not change the image
I have a select article with 6 different colors and 4 different sizes. These are 24 articles. When selecting the color I want to show the image of the article in this color. When selecting the size it should not have any effect on the image.
1) I put the image with the color in all 4 of the variant articles: This has the effect that I have 4 identical images that are shown in the slider.
2) I put the image with the color in only one of the variant article. Lets say just in the one of the size small. Then I have each color only once in the slider, but when I select first the color and then the size then the image changes to the wrong color when selecting size.
So it would be necessary to be able to define if an attribute can change the image. Is this somehow possible? Or to be able to define that 4 identical images are not shown in the slider.
1) I put the image with the color in all 4 of the variant articles: This has the effect that I have 4 identical images that are shown in the slider.
2) I put the image with the color in only one of the variant article. Lets say just in the one of the size small. Then I have each color only once in the slider, but when I select first the color and then the size then the image changes to the wrong color when selecting size.
So it would be necessary to be able to define if an attribute can change the image. Is this somehow possible? Or to be able to define that 4 identical images are not shown in the slider.
Re: Attribute size should not change the image
I modified aimeos.js line 453... to:
/**
* Shows the images associated to the variant attributes
*/
onImageVariant() {
$(document).on("change", ".product .selection .select-list", ev => {
const elem = $(ev.currentTarget);
const type = elem.data("type");
const value = elem.find(".select-option:checked").val();
// Check if type is the Attribut 'size'
if (type !== 'size') {
elem.closest(".product").find(".image-single .item").each((idx, el) => {
if($(el).data("variant-" + type) == value) {
swiffyslider.slideTo($(el).closest(".swiffy-slider")[0], idx)
}
});
}
});
},
/**
* Shows the images associated to the variant attributes
*/
onImageVariant() {
$(document).on("change", ".product .selection .select-list", ev => {
const elem = $(ev.currentTarget);
const type = elem.data("type");
const value = elem.find(".select-option:checked").val();
// Check if type is the Attribut 'size'
if (type !== 'size') {
elem.closest(".product").find(".image-single .item").each((idx, el) => {
if($(el).data("variant-" + type) == value) {
swiffyslider.slideTo($(el).closest(".swiffy-slider")[0], idx)
}
});
}
});
},
Re: Attribute size should not change the image
Thanks for investigating and finding a solution!
Can you please create a pull request here so we can merge your changes into the core?
https://github.com/aimeos/ai-client-html
Can you please create a pull request here so we can merge your changes into the core?
https://github.com/aimeos/ai-client-html
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star