/// <summary> /// Handle the visibility of the control. /// </summary> protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); bool ItemIsProductOption = (ShoppingCartItemInfoObject != null) && ShoppingCartItemInfoObject.IsProductOption; bool CartContentIsReadOnly = ValidationHelper.GetBoolean(ShoppingCartContent.GetValue("ReadOnlyMode"), false); // Remove is invisible for product option or in ReadOnly mode btnRemove.Visible = !(ItemIsProductOption || CartContentIsReadOnly); }
/// <summary> /// Handle the visibility of the control. /// </summary> protected override void OnPreRender(EventArgs e) { try { base.OnPreRender(e); cart = ShoppingCartInfoProvider.GetShoppingCartInfo(CartID); bool ItemIsProductOption = (ShoppingCartItemInfoObject != null) && ShoppingCartItemInfoObject.IsProductOption; bool CartContentIsReadOnly = ValidationHelper.GetBoolean(ShoppingCartContent.GetValue("ReadOnlyMode"), false); btnRemoveItem.Visible = !(ItemIsProductOption || CartContentIsReadOnly); } catch (Exception ex) { EventLogProvider.LogInformation("Kadena_CMSWebParts_Kadena_Cart_RemoveItemFromCart", "OnPreRender", ex.Message); } }