Nop.Plugin.Feed.Froogle - FIX: use product variant picture if available instead of parent product picture

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 năm cách đây
I thought it might help someone if I posted a fix for the Froogle Feed Plugin to use product variant pictures instead of the parent pictures if available in the xml feed it generates.

nopCommerce version: 2.20
Plugin Name: Nop.Plugin.Feed.Froogle
Plugin Version: 1.01

File: FroogleService.cs
Line: 224

                        var pictures = _pictureService.GetPicturesByProductId(product.Id, 1);

REPLACE WITH:

                        /// LFW 07/01/12 START BUG FIX: Use product variant picture if available
                        IList<Picture> pictures = new List<Picture>();
                        if (productVariant.PictureId != 0)
                        {
                            //Get single product variant picture & add to list
                            pictures.Add(_pictureService.GetPictureById(productVariant.PictureId));
                        }
                        else
                        {
                            //Get 1st product picture
                            pictures = _pictureService.GetPicturesByProductId(product.Id, 1);
                        }
                        /// LFW 07/01/12 END BUG FIX: Use product variant picture if available
12 năm cách đây
Thanks!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.