Remove Gift Cards

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
Please can someone tell me how to remove the gift card facility so it just doesn't show during checkout. it would be nice to be able to switch it on or off so that it can be bought back in in the future if required.
Hace 13 años
Set Display.Checkout.GiftCardBox to false to turn this off in Configuration/All Settings in the admin section.
Hace 13 años
Hi
I'm running 1.7 and thats just not there!
Hace 13 años
I tried adding it but that didnt have any results
Hace 13 años
Ah... well different versions have different ways of doing things... you should always list the version you're using when you ask a question.

In OrderSummary.ascx find the code that looks like this:
<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>

and replace it with this:
                <%if (this.SettingManager.GetSettingValueBoolean("Display.Checkout.GiftCardBox"))
                  { %>
                <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>
                <%} %>

Since you already added the value, you should now be able to turn the gift card box on and off with it (true or false). This setting was added in a later version, not sure if it was 1.80 or 1.90.
Hace 13 años
Hi thanks, i really thought that was going to work, but when i F5'd after the change i got this in my browser (Chrome):-

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.modules_ordersummary_ascx' does not contain a definition for 'SettingManager' and no extension method 'SettingManager' accepting a first argument of type 'ASP.modules_ordersummary_ascx' could be found (are you missing a using directive or an assembly reference?)

Source Error:


Line 29:     <div class="clear">
Line 30:     </div>
Line 31:     <%if (this.SettingManager.GetSettingValueBoolean("Display.Checkout.GiftCardBox"))
Line 32:                   { %>
Line 33:                 <asp:Panel runat="server" ID="phGiftCards" CssClass="coupon-box">

Source File: c:\Users\Julian\Desktop\NopCommerce\NopCommerceStore\Modules\OrderSummary.ascx    Line: 31
Hace 13 años
Must be a different way to get the settings in the version you're using... I use 1.90. Give me a minute...
Hace 13 años
Try taking out the "this" in front of "SettingManager".

or like this:
 <%if (SettingManager.GetSettingValueBoolean("WhateverValue"))
                  {%>
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.