Hide Gift Card and/or Discount entry on Checkout

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 лет назад
Is their an option to remove of hide the Gift card / Discount options (that ask for a code to be entered on the check out page) in the admin area? I can't seem to find it.

If I'm not using these features I'm surprised that they are on by default.

I can 'hide' it using CSS but this seems incorrect.
13 лет назад
Hi there,

I am also looking for a way to do this. Have you found the solution yet?

Many Thanks,

Ella
13 лет назад
You can add settings to hide either or both options.

1. Add two new settings in Administration > Configuration > All Settings > "Add New"
    Name: Display.ShowOrderSummaryCouponBox
    Value: false
    ---
    Name: Display.ShowOrderSummaryGiftCard
    Value: false

2. Edit file: Modules\OrderSummary.ascx  (or download the modified file, works for version 1.60 and 1.70, but not 1.50 -backup your current file before replacing)

Change lines 10-50 from the following:
<%if (this.IsShoppingCart)
  { %>
<asp:Panel runat="server" ID="phCoupon" CssClass="coupon-box">
    <b>
        <%=GetLocaleResourceString("ShoppingCart.DiscountCouponCode")%></b>
    <br />
    <%=GetLocaleResourceString("ShoppingCart.DiscountCouponCode.Tooltip")%>
    <br />
    <asp:TextBox ID="txtDiscountCouponCode" runat="server" Width="125px" />&nbsp;
    <asp:Button runat="server" ID="btnApplyDiscountCouponCode" OnClick="btnApplyDiscountCouponCode_Click"
        Text="<% $NopResources:ShoppingCart.ApplyDiscountCouponCodeButton %>" CssClass="applycouponcodebutton"
        CausesValidation="false" />
    <asp:Panel runat="server" ID="pnlDiscountWarnings" CssClass="warning-box" EnableViewState="false"
        Visible="false">
        <br />
        <asp:Label runat="server" ID="lblDiscountWarning" CssClass="warning-text" EnableViewState="false"
            Visible="false"></asp:Label>
    </asp:Panel>
</asp:Panel>
<div class="clear">
</div>
<asp:Panel runat="server" ID="phGiftCards" CssClass="coupon-box">
    <b>
        <%=GetLocaleResourceString("ShoppingCart.GiftCards")%></b>
    <br />
    <%=GetLocaleResourceString("ShoppingCart.GiftCards.Tooltip")%>
    <br />
    <asp:TextBox ID="txtGiftCardCouponCode" runat="server" Width="125px" />&nbsp;
    <asp:Button runat="server" ID="btnApplyGiftCardsCouponCode" OnClick="btnApplyGiftCardCouponCode_Click"
        Text="<% $NopResources:ShoppingCart.ApplyGiftCardCouponCodeButton %>" CssClass="applycouponcodebutton"
        CausesValidation="false" />
    <asp:Panel runat="server" ID="pnlGiftCardWarnings" CssClass="warning-box" EnableViewState="false"
        Visible="false">
        <br />
        <asp:Label runat="server" ID="lblGiftCardWarning" CssClass="warning-text" EnableViewState="false"
            Visible="false"></asp:Label>
    </asp:Panel>
</asp:Panel>
<div class="clear">
</div>
<%} %>

to the following (new code underlined):
<%if (this.IsShoppingCart)
  { %>
<% if (SettingManager.GetSettingValueBoolean("Display.ShowOrderSummaryCouponBox", true))
   { %>
<asp:Panel runat="server" ID="phCoupon" CssClass="coupon-box">
    <b>
        <%=GetLocaleResourceString("ShoppingCart.DiscountCouponCode")%></b>
    <br />
    <%=GetLocaleResourceString("ShoppingCart.DiscountCouponCode.Tooltip")%>
    <br />
    <asp:TextBox ID="txtDiscountCouponCode" runat="server" Width="125px" />&nbsp;
    <asp:Button runat="server" ID="btnApplyDiscountCouponCode" OnClick="btnApplyDiscountCouponCode_Click"
        Text="<% $NopResources:ShoppingCart.ApplyDiscountCouponCodeButton %>" CssClass="applycouponcodebutton"
        CausesValidation="false" />
    <asp:Panel runat="server" ID="pnlDiscountWarnings" CssClass="warning-box" EnableViewState="false"
        Visible="false">
        <br />
        <asp:Label runat="server" ID="lblDiscountWarning" CssClass="warning-text" EnableViewState="false"
            Visible="false"></asp:Label>
    </asp:Panel>
</asp:Panel>
<div class="clear">
</div>
<% } %>
<% if (SettingManager.GetSettingValueBoolean("Display.ShowOrderSummaryGiftCard", true))
   { %>
<asp:Panel runat="server" ID="phGiftCards" CssClass="coupon-box">
    <b>
        <%=GetLocaleResourceString("ShoppingCart.GiftCards")%></b>
    <br />
    <%=GetLocaleResourceString("ShoppingCart.GiftCards.Tooltip")%>
    <br />
    <asp:TextBox ID="txtGiftCardCouponCode" runat="server" Width="125px" />&nbsp;
    <asp:Button runat="server" ID="btnApplyGiftCardsCouponCode" OnClick="btnApplyGiftCardCouponCode_Click"
        Text="<% $NopResources:ShoppingCart.ApplyGiftCardCouponCodeButton %>" CssClass="applycouponcodebutton"
        CausesValidation="false" />
    <asp:Panel runat="server" ID="pnlGiftCardWarnings" CssClass="warning-box" EnableViewState="false"
        Visible="false">
        <br />
        <asp:Label runat="server" ID="lblGiftCardWarning" CssClass="warning-text" EnableViewState="false"
            Visible="false"></asp:Label>
    </asp:Panel>
</asp:Panel>
<div class="clear">
</div>
<%} %>
<%} %>

3. Save the file and refresh the shopping cart page. If the settings are set to true or if they haven't been added then the options will be displayed (default value is true if the settings aren't found).

To enable the Coupon Code Box or Gift Card Box on the shopping cart summary page, set to true their respective settings value Display.ShowOrderSummaryCouponBox or Display.ShowOrderSummaryGiftCard.

.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.