Close

Bugs

Support
5 years ago
#3914 Quote
Avatar
  • Moderator
  • 1002
zjerry wrote:
nopCommerce 3.2

If the "Terms of service (shopping cart page)" or "Terms of service (confirm order page)" option is in use, then if user clicks link to read terms the ugly new browser windows appears.

In 3.1 we have an elegant modal dialog displayed for that purpose.

Can you fix this?


Hi zjerry,

This is not a bug, but rather a change in nopCommerce. While in nop 3.1 a fancybox jquery plugin was used to show the TermsOfService topic, in nop 3.2 a new browser dialog is used for that purpose and as you know a browser dialog cannot be styled.

If you want to preserve the old fancybox dialog you will have to edit the Themes/NeoFashion/Views/ShoppingCart/OrderSummary.cshtml view as shown below:

Replace the


if (Model.TermsOfServiceOnShoppingCartPage)
                    {
                        <div id="terms-of-service-warning-box" title="@T("Checkout.TermsOfService")" style="display:none;">
                            <p>@T("Checkout.TermsOfService.PleaseAccept")</p>
                        </div>
                        <div class="terms-of-service">
                            <input id="termsofservice" type="checkbox" name="termsofservice" />
                            @T("Checkout.TermsOfService.IAccept")
                            <span class="read" onclick="javascript:OpenWindow('@Url.RouteUrl("TopicPopup", new { SystemName = "conditionsofUse" })', 450, 500, true)">@T("Checkout.TermsOfService.Read")</span>
                        </div>
                    }
                    <div class="checkout-buttons">
                        @if (String.IsNullOrEmpty(Model.MinOrderSubtotalWarning))
                        {
                            <script type="text/javascript">
                                $(document).ready(function () {
                                    $('#checkout').click(function () {
                                        //terms of service
                                        var termOfServiceOk = true;
                                        if ($('#termsofservice').length > 0) {
                                            //terms of service element exists
                                            if (!$('#termsofservice').is(':checked')) {
                                                $("#terms-of-service-warning-box").dialog();
                                                termOfServiceOk = false;
                                            } else {
                                                termOfServiceOk = true;
                                            }
                                        }
                                        return termOfServiceOk;
                                    });
                                });
                            </script>
                            <button type="submit" id="checkout" name="checkout" value="checkout" class="button-1 checkout-button">
                                <span>@T("Checkout.Button")</span>
                            </button>
                        }
                    </div>


with the following:
Support
5 years ago
#3916 Quote
Avatar
  • Moderator
  • 1002
 if (Model.TermsOfServiceOnShoppingCartPage)
                    {
                    <div id="terms-of-service-warning-box" title="@T("Checkout.TermsOfService")" style="display:none;">
                        <p>@T("Checkout.TermsOfService.PleaseAccept")</p>
                    </div>
                    <div class="terms-of-service">
                        <input id="termsofservice" type="checkbox" name="termsofservice" />
                        @T("Checkout.TermsOfService.IAccept")
                        @*uncomment below to how simple pop-up*@ @*<span class="read" onclick="javascript:OpenWindow('@Url.RouteUrl("TopicPopup", new { SystemName = "conditionsofUse" })', 450, 500, true)">@T("Checkout.TermsOfService.Read")</span>*@
                        @*use fancybox to how nice pop-up*@
                        @{
                        Html.AddScriptParts("~/Scripts/jquery.fancybox-1.3.4.pack.js");
                        Html.AddCssFileParts("~/Content/fancybox/jquery.fancybox-1.3.4.css");
                        }
                        <a class="read" href='@Url.RouteUrl("TopicPopup", new { SystemName = "conditionsofUse" })'>@T("Checkout.TermsOfService.Read")</a>
                        <script type="text/javascript">
                            $(".terms-of-service .read").fancybox({
                                'speedIn': 600,
                                'speedOut': 200,
                                'width': 450,
                                'height': 500,
                                'type': 'iframe',
                                'centerOnScroll': true
                            });
                        </script>
                    </div>
                    }
                    <div class="checkout-buttons">
                        @if (String.IsNullOrEmpty(Model.MinOrderSubtotalWarning))
                        {
                            <script type="text/javascript">
                                $(document).ready(function () {
                                    $('#checkout').click(function () {
                                        //terms of services
                                        var termOfServiceOk = true;
                                        @if (Model.TermsOfServiceEnabled)
                                        {
                                                <text>
                                        if (!$('#termsofservice').is(':checked')) {
                                            $("#terms-of-service-warning-box").dialog();
                                            termOfServiceOk = false;
                                        }
                                        else {
                                            termOfServiceOk = true;
                                        }
                                                </text>
                                        }
                                        return termOfServiceOk;
                                    });
                                });
                            </script>
                            <button type="submit" id="checkout" name="checkout" value="checkout" class="button-1 checkout-button">
                                <span>@T("Checkout.Button")</span>
                            </button>
                        }
                    </div>


A similar change should be done in the Checkout/Confirm.cshtml view.

Hope that helps!
zjerry
5 years ago
#3917 Quote
Avatar
  • 39
javascript:OpenWindow... effect is totally out of sync with this otherwise beautiful theme

I'm not a big fan of fancy box, for theme consistency sake it would be nicer to use same modal dialogs that you use elsewhere in the theme. (e.g. in the Quick View).

Do you plan to embed those changes in NeoFashion ?


Support
5 years ago
#3919 Quote
Avatar
  • Moderator
  • 1002
zjerry wrote:
javascript:OpenWindow... effect is totally out of sync with this otherwise beautiful theme

I'm not a big fan of fancy box, for theme consistency sake it would be nicer to use same modal dialogs that you use elsewhere in the theme. (e.g. in the Quick View).

Do you plan to embed those changes in NeoFashion ?




Hi zherry,

I agree that the fancy box looks much nicer. We have decided to embed it back so that the theme looks nice. We will let you know once is done!

Thanks for the feedback!
JonJJ
5 years ago
#4159 Quote
Avatar
  • 30
Love the Custom Head styles posibility in the theme.
Easy to define and adjust css without creating modifications or adding more files.

Problem is however that you have a limit of 2000 characters for the textfield.

If you add more than that the it will produce the following error:

[DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.]
   System.Data.Entity.Internal.InternalContext.SaveChanges() +169
   System.Data.Entity.Internal.LazyInternalContext.SaveChanges() +27
   System.Data.Entity.DbContext.SaveChanges() +20
   Nop.Data.EfRepository`1.Insert(T entity) +102

[Exception: Property: Value Error: The field Value must be a string or array type with a maximum length of '2000'.
]
   Nop.Data.EfRepository`1.Insert(T entity) +407
   Nop.Services.Logging.DefaultLogger.InsertLog(LogLevel logLevel, String shortMessage, String fullMessage, Customer customer) +153
   Nop.Services.Logging.LoggingExtensions.FilteredLog(ILogger logger, LogLevel level, String message, Exception exception, Customer customer) +95
   Nop.Services.Logging.LoggingExtensions.Error(ILogger logger, String message, Exception exception, Customer customer) +19
   Nop.Admin.Controllers.BaseNopController.LogException(Exception exc) +203
   Nop.Admin.Controllers.BaseNopController.OnException(ExceptionContext filterContext) +109
   System.Web.Mvc.Controller.System.Web.Mvc.IExceptionFilter.OnException(ExceptionContext filterContext) +10
   System.Web.Mvc.ControllerActionInvoker.InvokeExceptionFilters(ControllerContext controllerContext, IList`1 filters, Exception exception) +109
   System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +87
   System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +28
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
   System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(IAsyncResult asyncResult, ProcessRequestState innerState) +21
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
   System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31
   System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9514812
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155



2000 characters is not very much for any css and that is including empty spaces.
I just bumped into this and now will probably have to add my own stylesheet to overcome the problem.

I really hope that you will remove this limit for future versions, so it can be used again. Otherwise the custom stylesheet feature is not really usefull.

Thanks :-)



Support
5 years ago
#4162 Quote
Avatar
  • Moderator
  • 1002
Hi JonJJ,

Thank you for your feedback.

It has this limitation because it is implemented as a setting which have a limitation of 2000 chars. The idea of this was to add just some minor customizations that will be applied to the theme. But we will definitely consider removing this limitation in the future. You can use your own stylesheet for now so that you do not lose changes if you upgrade to a newer version in the future.

Thanks again for your feedback!

Best Regards!
JonJJ
5 years ago
#4165 Quote
Avatar
  • 30
Support wrote:
Hi JonJJ,

Thank you for your feedback.

It has this limitation because it is implemented as a setting which have a limitation of 2000 chars. The idea of this was to add just some minor customizations that will be applied to the theme. But we will definitely consider removing this limitation in the future. You can use your own stylesheet for now so that you do not lose changes if you upgrade to a newer version in the future.

Thanks again for your feedback!

Best Regards!


That's great news. Thanks.

The thing is I don't just use it to do customizations on the theme.
I use it for styling my custom Topic pages too in NopCommerce. So that's why I reach the limit.

Making the char limit of 2000 to "limitless" instead will add more value to your theme.
zjerry
5 years ago
#4181 Quote
Avatar
  • 39
Any news on that dialog...?



zjerry wrote:
javascript:OpenWindow... effect is totally out of sync with this otherwise beautiful theme

I'm not a big fan of fancy box, for theme consistency sake it would be nicer to use same modal dialogs that you use elsewhere in the theme. (e.g. in the Quick View).

Do you plan to embed those changes in NeoFashion




Hi zherry,

I agree that the fancy box looks much nicer. We have decided to embed it back so that the theme looks nice. We will let you know once is done!

Thanks for the feedback!
Support
5 years ago
#4266 Quote
Avatar
  • Moderator
  • 1002
Hi Jerry,

Sorry for the late reply!

We have decided to do this change for the next release which is going to be in the end of the next month. However you can follow the instructions on this forum post to change the dialog on the cart page to use the old fancy box dialog.

Thank you for your understanding!

zjerry wrote:
Any news on that dialog...?



zjerry wrote:
javascript:OpenWindow... effect is totally out of sync with this otherwise beautiful theme

I'm not a big fan of fancy box, for theme consistency sake it would be nicer to use same modal dialogs that you use elsewhere in the theme. (e.g. in the Quick View).

Do you plan to embed those changes in NeoFashion




Hi zherry,

I agree that the fancy box looks much nicer. We have decided to embed it back so that the theme looks nice. We will let you know once is done!

Thanks for the feedback!