Customizing the Shopping Cart Lines rendering
The Shopping Cart Lines rendering includes a rendering variant in the form of a Scriban template. The Shopping Cart Lines rendering has its own default rendering variant root and default rendering variant (/sitecore/Content/<tenant>/<site>/Presentation/Rendering Variants/Shopping Cart Lines), which uses a Scriban template for generating the markup. Although you can modify the Scriban template, it is best to create a new custom rendering variant in this case so that the customization does not get overridden during software upgrades. You can also change the labels for the rendering on the associated data source item.
The Shopping Cart Lines - deprecated rendering is only available for existing sites and uses a standard view and code-behind instead of a Scriban template.
The following code shows the Scriban template for the Shopping Cart Lines rendering defined within the default rendering variant. The view content (like the label text) is passed into the MVC Model and is available as the embedded object o_model in the Scriban context while the product information (including product details, unit price, and inventory) is populated using Knockout bindings and AJAX calls on the frontend.
Shopping Cart Lines rendering model
Shopping Cart Lines rendering model
In the Shopping Cart Lines Scriban template, you access the properties and objects contained in the ShoppingCartLinesRenderingModel model through the embedded item o_model. The class diagram for the Shopping Cart Lines rendering model is shown in the following figure.

Shopping Cart Lines call sequence
Shopping Cart Lines call sequence
The following sequence diagram shows a high-level view of the calls made when the shopper interacts with the Shopping Cart Lines in the context of free gift selection.
This sequence diagram applies to manual free gift selection and does not reflect the actions taken when the free gift is automatically added to the cart.
