Developer forum

Forum » Swift » OrderLineItem.cshtml Template - Image is not rendered for a product without image.

OrderLineItem.cshtml Template - Image is not rendered for a product without image.

Pedro Meias
Pedro Meias
Reply

Hi,

DW 9.17.2

Swift v1.26.0

Reporting a possible bug on Cart Page.

After adding a product with no image to cart, on the cart page the "missing-image" is not rendered properly

 

On the template Templates/Designs/Swift/eCom7/CartV2/Step/Helpers/OrderLineItem.cshtml considering the following lines of code

12 string image = orderline.GetString("Ecom:Product.PrimaryImage");
13 image = "/Admin/Public/GetImage.ashx?width=" + 180 + "&height=" + 180 + "&image=" + image + "&format=webp";
14 image = !orderline.GetString("Ecom:Product.PrimaryImage").StartsWith("/Files/", StringComparison.OrdinalIgnoreCase) ? orderline.GetString("Ecom:Product.PrimaryImage") : image;

When we print the value on line #12 it returns the following

/Images/missing_image.jpg

Even if line #13 alters the value, line #14 it setting it back to the same value on line #12 because the value does not start with "/Files"

How HTML markup looks

 

Thank you.

 


Replies

 
Merethe Vrå Andersen Dynamicweb Employee
Merethe Vrå Andersen
Reply

Hi,

Thank you for bringing this up. We had the issue earlier that was fixed, but it has been introduced again.
Bug 19490 is created.

Kind regards,
Merethe Vrå Andersen

 
Pedro Meias
Pedro Meias
Reply

Hi Merethe,

Thank you!

 

You must be logged in to post in the forum