Example 2: Extending the mini cart
Another fun example of extending the Master template could be adding a custom block to the mini cart informing customers about free returns.
If you followed the previous example, you should be familiar with the basics:
- Open the MasterBlocks/Custom__blocks.cshtml template and define a Block and helper like below:
- Use @masterPage.GetBlockStructure() in the Master template to show the available extensibility points
- Locate the MiniCart section – you want to add the Block after the cart total as below:
Your mini cart will now include the custom Block in the MiniCartTotal block, below the total (which has a lower SortID) (Figure 2.1).