Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Removing "Step 1 of 1 - " heading on a custom shopping cart control View modes: 
User avatar
Member
Member
matt-awg - 1/4/2013 6:47:05 AM
   
Removing "Step 1 of 1 - " heading on a custom shopping cart control
I am building a custom single page check out process for an e-commerce site. I have taken advice from support and the forums on how to copy code from the existing controls for each cart step and combine them into one custom control. So far it is working except I cannot figure out how to remove "Step 1 of 1 - Step Description Here" from the top of the page. I have the class defined like this:
public partial class CMSModules_Ecommerce_Controls_ShoppingCart_CustomCheckOut : ShoppingCartStep
{

I was able to remove the step images with a property on the control. I was able to remove part of the "Step 1 of 1 - Step Description Here" caption using this:
ShoppingCartControl.CheckoutProcessSteps[ShoppingCartControl.CurrentStepIndex].Caption = "";

But it still says:
Step 1 of 1 -

It removed the part of that heading that described the step but how do I remove the "Step 1 of 1 -" part?

This seems like a simple thing so I apologize in advance if I am missing something stupid! Any help will be greatly appreciated.

Thanks,
Matt

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 1/9/2013 5:01:30 AM
   
RE:Removing "Step 1 of 1 - " heading on a custom shopping cart control
Hi,

The step indexes in header are rendered by ShoppingCart control ~\CMSModules\Ecommerce\Controls\ShoppingCart\ShoppingCart.ascx, in lblStepTitle label in the code behind (method Page_PreRender).

Whether the indexes are displayed is controlled by the property DisplayStepIndexes, so you could completely turn them off by setting this property to false. This should pick up the else branch in the code and render the caption only.

Hope this will help.

Regards,
Zdenek

User avatar
Member
Member
matt-awg - 1/9/2013 7:11:38 AM
   
RE:Removing "Step 1 of 1 - " heading on a custom shopping cart control
FYI, after more conversations off line with support, here is what worked:

Create a new layout for the web part from the default one - in the web part properties dialog - tab "Layout" - and set the property, e.g. like:
<%@ Control Language="C#" AutoEventWireup="true"
Inherits="CMSWebParts_Ecommerce_ShoppingCart_ShoppingCartWebPart" CodeFile="~/CMSWebParts/Ecommerce/ShoppingCart/ShoppingCartWebPart.ascx.cs" %>
<%@ Register Src="~/CMSModules/Ecommerce/Controls/ShoppingCart/ShoppingCart.ascx" TagName="ShoppingCart" TagPrefix="cms" %>
<cms:ShoppingCart ID="cartElem" runat="server" DisplayStepIndexes="false" />