Developer forum

Forum » Ecommerce - Standard features » OrderLineService.Create method not available

OrderLineService.Create method not available

Oscar Romin
Oscar Romin
Reply

Hey!

I'm trying to create new orderlines based on existing orderlines using the orderline service (essentialy copying orderlines but with new Id's).

The OrderLineService.Create() method seems ideal for this, but it seems that I'm not able to use it. And in the docs for the method it says that it requires version 1.7.0 of the Dynamicweb.Ecommerce.dll (link: https://doc.dynamicweb.com/api/html/d3d2bb33-e2fe-44c3-4a1a-3f64d22c7ab4.htm). However, this version of the dll doesn't seem to exist. The highest version I can locate is 1.6.0.

Another weird thing is that the method seems to be defined in 1.6.0 and everything builds without error when I use it but when I go to the page that implements it I get the following error:

'Dynamicweb.Ecommerce.Orders.OrderLineService' does not contain a definition for 'Create' and no extension method 'Create' accepting a first argument of type 'Dynamicweb.Ecommerce.Orders.OrderLineService' could be found (are you missing a using directive or an assembly reference?)

Is this method available and if so, what am I doing wrong?

Thanks!


Replies

 
Nicolai Pedersen
Reply

Create exists in 2 versions and have since 9.5.

Looking at the exception you have, it indicates that your code is a bit off - it says you pass it Dynamicweb.Ecommerce.Orders.OrderLineService as the first parameter. Could you share your code - and what version are you running?

BR Nicolai

 
Oscar Romin
Oscar Romin
Reply

I'm running Dynamicweb v9.6.0

​
        OrderService oService = new OrderService();
        OrderLineService olService = new OrderLineService();

        Order template = OrderRepository.GetTemplate(templateId);
        List<OrderLine> templateOrderLines = OrderRepository.GetTemplateOrderLinesByOrderId(templateId);

        oService.DowngradeToCart(template);

        foreach(var ol in templateOrderLines)
        {
            var stockunit = StockUnit.GetProductStockUnits(ol.Product)[0];
            olService.Create(template, ol.Product, ol.Quantity, stockunit, ol.UnitPrice);
        }

        Context.SetCart(template);
 
Nicolai Pedersen
Reply

So what does OrderRepository.GetTemplate(templateId); return? DW also has a OrderRepository, but does not containt such method.

BR Nicolai

 
Oscar Romin
Oscar Romin
Reply

It's a custom method that simply returns an Order object using the OrderService. I'm using the GetOrder method even though it's marked as obsolete, becuase I get the same error as with OrderLineService.Create; that the new GetById method doesn't exist.

 

public static Order GetTemplate(string orderAutoId)
{
      return orderService.GetOrder(orderAutoId);
}
 
Nicolai Pedersen
Reply

ok, you must have a problem with your runtime assemblies in your /bin.

If you look at your original exception, it is indicating you pass an orderlineservice object to create as first parameter.

Is this a template? or all in an assembly? And why do you not have a full call stack - that is also really really weird...

BR Nicolai

 
Oscar Romin
Oscar Romin
Reply

I tried to delete all my bin folders and rebuild everything. It still doesn't work but the error message is slightly different.

 

Exception in template (Designs/------/_parsed/OrderFlow.parsed.cshtml): System.MissingMethodException: Method not found: Dynamicweb.Ecommerce.Orders.OrderLine Dynamicweb.Ecommerce.Orders.OrderLineService.Create(Dynamicweb.Ecommerce.Orders.Order, Dynamicweb.Ecommerce.Products.Product, Double, Dynamicweb.Ecommerce.Stocks.StockUnit, Dynamicweb.Ecommerce.Prices.PriceInfo).
 
Nicolai Pedersen
Reply

And then ALL of your source code. You pass something wrong to that method...

 
Oscar Romin
Oscar Romin
Reply

Here's the full error message:
 

Exception in template (Designs/-----/_parsed/OrderFlow.parsed.cshtml): System.MissingMethodException: Method not found: Dynamicweb.Ecommerce.Orders.OrderLine Dynamicweb.Ecommerce.Orders.OrderLineService.Create(Dynamicweb.Ecommerce.Orders.Order, Dynamicweb.Ecommerce.Products.Product, Double, Dynamicweb.Ecommerce.Stocks.StockUnit, Dynamicweb.Ecommerce.Prices.PriceInfo).
   vid -----.DW.Data.Repositories.OrderRepository.CopyOrderLinesToOrder(Order order, List`1 orderlines)
   vid CompiledRazorTemplates.Dynamic.acabeccbbcd.Execute()
   vid RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   vid RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   vid RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   vid RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   vid Dynamicweb.Rendering.Template.RenderRazorTemplate()
@inherits RazorTemplateBase<RazorTemplateModel<Template>>
@using System.Diagnostics
@using System.Linq
@using System.Web
@using System.Xml
@using ------.DW.Helpers
@using Dynamicweb.Content
@using Dynamicweb.Core
@using Dynamicweb.Ecommerce.Integration
@using Dynamicweb.Ecommerce.LiveIntegration
@using Dynamicweb.Ecommerce.Notifications
@using Dynamicweb.Ecommerce.Orders
@using Dynamicweb.Rendering
@using Dynamicweb.Security
@using Dynamicweb.Security.UserManagement
@using Extensions = -----.DW.Helpers.Extensions

<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="author" content="">

    @*<link rel="shortcut icon" href="/Files/Templates/Designs/------/favicon.ico">*@
    <link rel="icon" href="/Files/Templates/Designs/------/Images/favicon.ico">

    <title>@GetValue("Title")</title>
@GetValue("MetaTags")
@GetValue("CopyRightNotice")


    <!-- jQuery -->
    <script src="/Files/Templates/Designs/------/libs/jquery.js"></script>
    <script src="/Files/Templates/Designs/------/libs/jquery-ui-1.12.1/jquery-ui.min.js"></script>
    <link href="/Files/Templates/Designs/------/libs/jquery-ui-1.12.1/jquery-ui.css" rel="stylesheet">
    <link href="/Files/Templates/Designs/------/libs/jquery-ui-1.12.1/jquery-ui.theme.min.css" rel="stylesheet">
    <!-- Custom Fonts -->
    <link type="text/css" rel="stylesheet" href="//fast.fonts.net/cssapi/b5236ebc-c9d4-4f42-8aac-fc69d65315ac.css">

    <!-- Bootstrap Core -->
    <script src="/Files/Templates/Designs/-------/libs/bootstrap/bootstrap.min.js"></script>
    <link href="/Files/Templates/Designs/-------/libs/bootstrap/bootstrap.min.css" rel="stylesheet">


    <!-- Bootstrap Table -->
    <script src="/Files/Templates/Designs/------/libs/bootstrap-table/bootstrap-table.js"></script>
    <script src="/Files/Templates/Designs/------/libs/bootstrap-table/bootstrap-table-filter-control.js"></script>
    <link href="/Files/Templates/Designs/------/libs/bootstrap-table/bootstrap-table.css" rel="stylesheet">

    <!-- Chosen -->
    <script src="/Files/Templates/Designs/------/libs/chosen_v1.8.7/chosen.jquery.js"></script>

    <!-- Font awesome -->
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

    <!-- Validator JS -->
    <script src="/Files/Templates/Designs/------/libs/validator.js"></script>

    <!-- Custom JS -->
    <script src="/Files/Templates/Designs/------/js/xml2obj.js"></script>
    <script src="/Files/Templates/Designs/-----/js/products.js"></script>
    <script src="/Files/Templates/Designs/-----/js/inputfields.js"></script>
    <script src="/Files/Templates/Designs/-----/js/mypage.js"></script>
    <script src="/Files/Templates/Designs/-----/js/show-hide-alarm-receivers.js"></script>
    <script src="/Files/Templates/Designs/-----/js/redirecter.js"></script>
    <script src="/Files/Templates/Designs/-----/js/platform-checker.js"></script>
    <script src="/Files/Templates/Designs/-----/js/orderTemplates.js"></script>

    <!-- Latest compiled and minified CSS -->
    @*<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.css">
        <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/bootstrap-table.min.js"></script>
        <script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-table/1.11.1/locale/bootstrap-table-zh-CN.min.js"></script>*@

    <!-- Custom CSS -->
    <link href="/Files/Templates/Designs/-----/css/main.css" rel="stylesheet">
    <link href="/Files/Templates/Designs/-----/fonts/Icomoon/style.css" rel="stylesheet">
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
@GetValue("Stylesheets")
@GetValue("Javascripts")
</head>
@{
    string baseUrl = GetValue("DwAreaName").ToString().ToLower().Replace(" ", "");
    string currentCulture = "";
    string languageNr = "";
    foreach (var language in GetLoop("Languages"))
    {

        string culture = language.GetString("Culture");
        if (language.GetBoolean("IsCurrent"))
        {
            currentCulture = culture;
            languageNr = (culture.Substring(0, 2) == "en") ? "-1" : "";


        }
    }
    string homeUrl = baseUrl + "/home" + languageNr;
    string fullName = GetString("DW_extranet_AccessUserName");
    var names = fullName.Split(' ');
    var user = User.get_Current(PagePermissionLevels.Frontend);

    string logoutId = "";
    var c = GetGlobalValue("Global:Area.LongLang");
    logoutId = Extensions.GetResultBasedOffLang(c, "9", "46", "36", "56");

    string loginUrl = baseUrl + "/login" + languageNr;
    string accessDeniedUrl = baseUrl + "/accessdenied" + languageNr;

    if (string.IsNullOrWhiteSpace(GetString("DW_extranet_AccessUserName")))
    {
        Dynamicweb.Context.Current.Response.Redirect("~/" + loginUrl);
    }

    //if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Page.IsProtected")))
    //{
    //    Dynamicweb.Context.Current.Response.Redirect("~/" + accessDeniedUrl);
    //}

    if (c == "sv-SE" || c == "en-GB")
    {
        if (user.Country.ToLower() == "norway" || user.Country.ToLower() == "no")
        {
            if (string.IsNullOrEmpty(GetString("Item.Area.Norwegian_Url")))
            {
                <text>Set the norwegian URL in adminsite</text>
            }
            else
            {
                Dynamicweb.Context.Current.Response.Redirect("/" + (string.IsNullOrEmpty(GetString("Item.Area.Norwegian_Url")) ? "-----norge" : GetString("Item.Area.Norwegian_Url")));
            }
        }
    }
    else if (c == "nb-NO" || c == "en-US")
    {
        if (user.Country.ToLower() == "sweden" || user.Country.ToLower() == "se")
        {
            if (string.IsNullOrEmpty(GetString("Item.Area.Swedish_Url")))
            {
                <text>Set the swedish URL in adminsite</text>
            }
            else
            {
                Dynamicweb.Context.Current.Response.Redirect("/" + (string.IsNullOrEmpty(GetString("Item.Area.Swedish_Url")) ? "-------norge" : GetString("Item.Area.Swedish_Url")));
            }
        }
    }
    if (user.Country.ToLower() != "sweden" && user.Country.ToLower() != "norway" && user.Country.ToLower() != "se" && user.Country.ToLower() != "no")
    {
        Dynamicweb.Context.Current.Response.Redirect("/Admin/Public/ExtranetLogoff.aspx");
    }
}

<!-- Top Header Menu -->
@{
    @*if (User.get_Current(PagePermissionLevels.Frontend).)
            {
        //work in progress
            }
        <div class="container2" style="
            margin-left: auto;
            display: block;
            background: darkred;">

            Du har redan en korg
            <div><a href="/removecart?id=CART">remove cart</a></div>

        </div>*@
    /*impersonate*/
    if (GetGlobalValue("Global:Extranet.SecondaryUser.ID").IsNullOrEmpty() == false)
    {
        <div class="impersonate-container">
            <div class="impersonating-line"></div>
            <div class="impersonating">
                <b>@Translate("Impersonating", "Imiterar"):</b>
                @user.Email, @user.Name, @user.Company
                <form method="get">
                    <input type="hidden" name="DwExtranetRemoveSecondaryUser" id="DwExtranetRemoveSecondaryUser" value="1">
                    <input type="submit" value='@Translate("Stop impersonating", "Sluta imitera")' class="btn btn--yellow big-mini">
                </form>
            </div>
        </div>
        <div style="padding: 5px;"></div>
    }
}
<div class="top-header-menu">
    <div class="container">
        @* this button is for testing purposes *@
        @*<button id="removeCart" onclick="removeCart();">Ta bort cart</button>*@
        @*<script>console.log("@User.get_Current(PagePermissionLevels.Frontend).ID")</script>*@
        @{@*
                var hej = new OrderContext().Id;
                @hej*@

        //var os = new OrderService();
        //os.Delete("CART506");
        //os.Delete("CART388");

       // ErpResponseCache.ClearAllCaches();

        @*@User.GetCurrentExtranetUser().GetSuperAdmin().Name
 <br>       @User.GetCurrentExtranetUser().GetSuperAdmin().ID*@



        }
        <ul class="nav navbar-nav">
            @foreach (var language in GetLoop("Languages"))
            {
                string culture = language.GetString("Culture");
                //string linkText = (culture.Substring(3).ToLower() == "se") ? "svenska" : (culture.Substring(3).ToLower() == "us") ? "english" : "norsk";
                string linkText = "";
                linkText = Extensions.GetResultBasedOffLang(culture, "svenska", "english", "norsk", "english");

                var queryParams = HttpContext.Current.Request.Url.Query;

                if (!language.GetBoolean("IsCurrent"))
                {
                    string languagePage = language.GetString("PageID");
                    <li class="flags @culture.Substring(3).ToLower() "><a class="language" href="/Default.aspx?ID=@languagePage@queryParams" hreflang="@culture.Substring(0, 2)">@linkText</a></li>
                }
                else
                {
                    <li class="flags active @culture.Substring(3).ToLower() "><a class="language">@linkText</a></li>
                }
            }
        </ul>
        <ul class="nav navbar-nav pull-right">
            @if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_AccessUserName")))
            {
                string linkUrl = baseUrl + "/my-profile" + languageNr;
                @*<li>
                        <a class="" href="@linkUrl" hreflang="@currentCulture.Substring(0, 2)">@Translate("My Page")</a>
                    </li>*@
                <li>
                    <a class="log-out" href="/Admin/Public/ExtranetLogoff.aspx?ID=@logoutId">@Translate("Logout")</a>
                </li>
                <li>
                    @*<a class="name-tag" href="@linkUrl" hreflang="@currentCulture.Substring(0, 2)">@GetValue("DW_extranet_AccessUserName")</a>*@
                    <a href="" class="name-tag">
                        @GetValue("DW_extranet_AccessUserName")
                    </a>
                </li>
                <li>
                    @if (names.Length > 1)
                    {

                        string initials = names[0].Substring(0, 1) + names[1].Substring(0, 1);
                        <span class="initials-badge">@initials.ToUpper()</span>
                    }
                    else
                    {
                        string initials = names[0].Substring(0, 1);
                        <span class="initials-badge">@initials.ToUpper()</span>
                    }
                </li>
            }
            else
            {
                string linkUrl = baseUrl + "/login" + languageNr;
                <li>
                    <a class="" href="@linkUrl" hreflang="@currentCulture.Substring(0, 2)">@Translate("Login")</a>
                </li>
            }
        </ul>
    </div>
</div>
<!-- Top Navigation Menu -->
<nav class="navbar top-navigation-menu" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="glyphicon glyphicon-remove"></span>
            </button>
            <a class="navbar-brand" href="@homeUrl">
                <img class="img-responsive" src="/Files/Templates/Designs/-----/Images/-----Logo.png">
            </a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <div class="visible-xs row mobile-nav-top">
                <div class="col-xs-12 mobile-menu-name">
                    @{
                        if (!string.IsNullOrWhiteSpace(GetString("DW_extranet_AccessUserName")))
                        {
                            if (names.Length > 1)
                            {

                                string initials = names[0].Substring(0, 1) + names[1].Substring(0, 1);
                                <span class="initials-tag">@initials</span>
                            }
                            else
                            {
                                string initials = names[0].Substring(0, 1);
                                <span class="initials-tag">@initials</span>
                            }
                            <span class="name-tag">@GetValue("DW_extranet_AccessUserName")</span>
                            <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@logoutId">@Translate("Logout")</a>
                        }
                    }
                </div>
            </div>
            <div class="hidden-mobile">
                @GetValue("DwNavigation(navbar)")
            </div>
            <div class="visible-mobile">
                @GetValue("DwNavigation(navbar2)")
            </div>
            <div class="row">
                <div class="col-xs-12 visible-xs mobile-menu-languages">
                    @foreach (var language in GetLoop("Languages"))
                    {
                        string culture = language.GetString("Culture");
                        string linkText = (culture.Substring(3).ToLower() == "se") ? "svenska" : (culture.Substring(3).ToLower() == "us") ? "english" : "norsk";

                        if (!language.GetBoolean("IsCurrent"))
                        {
                            string languagePage = language.GetString("PageID");
                            <div class="flags @culture.Substring(3).ToLower() "><a class="language" href="/Default.aspx?ID=@languagePage" hreflang="@culture.Substring(0, 2)">@linkText</a></div>
                        }
                        else
                        {
                            <div class="flags active @culture.Substring(3).ToLower() "><a class="language">@linkText</a></div>
                        }
                    }
                </div>
            </div>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>


<!-- Page Content -->
<div class="container-fluid">
    <section class="center-container content-container dw-mod" id="content">
        @inherits RazorTemplateBase<RazorTemplateModel<Template>>
@using System.Collections.Generic
@using System.Net.Http
@using System.Web
@using Dynamicweb.Rendering
@using ------.DW.Data.Repositories;
@using Dynamicweb.Ecommerce;
@using Dynamicweb.Ecommerce.Orders;
@using Dynamicweb.Ecommerce.Stocks;
@using ------.DW.Data.ViewModels;
@using Dynamicweb.Ecommerce.Notifications
@using Dynamicweb.Ecommerce.Orders
@using Context = Dynamicweb.Ecommerce.Common.Context



@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
@{
    //TODO: Hämta orderflowtype från URLen, dvs avkommentera raden nedan när funktionen är färdig.
    //var orderflowtype = "materials";
    var orderflowtype = HttpContext.Current.Request.Url.ParseQueryString()["orderflowtype"] ?? "";
    <div>@*@orderflowtype*@</div>

    var templateId = HttpContext.Current.Request.Url.ParseQueryString()["templateId"] ?? "";
    Order template = null;
    List<OrderLine> templateOrderLines = new List<OrderLine>();

    if (!string.IsNullOrEmpty(templateId))
    {
        OrderService oService = new OrderService();
        OrderLineService olService = new OrderLineService();

        template = OrderRepository.GetTemplate(templateId);
        templateOrderLines = OrderRepository.GetTemplateOrderLinesByOrderId(templateId);

        oService.DowngradeToCart(template);

        OrderRepository.CopyOrderLinesToOrder(template, templateOrderLines);

        Context.SetCart(template);
    }
}

<pre>
TemplateId: @templateId
TemplateOrderLineCount: @templateOrderLines.Count
-----------------------
@if (Context.Cart != null)
{
<text>Cart.Id: @Context.Cart.Id</text>
    if(Context.Cart.OrderLines != null)
    {
<text>OrderlineCount: @Context.Cart.OrderLines.Count</text>
<text>-----------------------</text>

        foreach(var orderline in Context.Cart.OrderLines)
        {
<text>@orderline.ProductName</text>
        }
    }
}
</pre>

<div class="order-flow-nav row">
    <div class="order-step" id="material-step">
        <div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">&#10004;</span></div>
        <p class="step-name">Hårdvara och tillbehör</p>
        <hr class="order-step-line">
    </div>

    @if (System.Web.HttpContext.Current.Session["OrderflowSession"] == "LinkGo")
    {
        <div class="order-step" id="router-step">
            <div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">&#10004;</span></div>
            <p class="step-name">Routerkonfiguration</p>
            <hr class="order-step-line">
        </div>
    }
    else if (System.Web.HttpContext.Current.Session["OrderflowSession"] == "Alarms")
    {
        <div class="order-step" id="alarmreciever-step">
            <div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">&#10004;</span></div>
            <p class="step-name">@Translate("Alarm reciever")</p>
            <hr class="order-step-line">
        </div>
    }

    @if (System.Web.HttpContext.Current.Session["OrderflowSession"] == "LinkGo")
    {
        <div class="order-step" id="service-step">
            <div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">&#10004;</span></div>
            <p class="step-name">Tjänstekonfiguration</p>
            <hr class="order-step-line">
        </div>
    }

    <div class="order-step" id="information-step">
        <div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">&#10004;</span></div>
        <p class="step-name">Uppgifter</p>
        <hr class="order-step-line">
    </div>

    <div class="order-step" id="confirm-step">
        <div class="step-nr-container"><span class="step-nr"></span><span class="step-checked">&#10004;</span></div>
        <p class="step-name">Bekräfta order</p>
    </div>
</div>

<div id="content">@GetValue("DwContent(content)")</div>

<div class="order-flow-footer row">
    <h2>
        Behöver du hjälp med din beställning? <br>
        Kontakta kundtjänst: 08-1234567
    </h2>
</div>

<script>
    var counter = 1;
    var readMore= '@Translate("Read more")';
    var readLess = '@Translate("Read less")';

    $('.order-step').each(function (i, obj) {
        $(this).find('.step-nr').text(counter);
        counter++;
    });

    $('.readmore-link').click(function () {
         if ($(this).html().trim().indexOf(readMore) >= 0) {
             $(this).html(readLess + " &#9650;");
         } else {
             $(this).html(readMore + " &#9660;");
         }
    });
</script>
    </section>
</div>




<!-- Footer -->
<div id="footer-full">
    <footer>
        <div class="container">
            <div class="row">
                <div class="col-xs-12 col-sm-3">
                    <h2 class="footer-header">@Translate("Customer service")</h2>
                    <div class="footer-sub-header">
                        <span class="icon-telephone"></span>
                        <span class="">@GetValue("Item.Area.Phone_Support")</span>
                    </div>
                </div>
                <div class="col-xs-12 col-sm-3">
                    <h2 class="footer-header">@Translate("Phone operator")</h2>
                    <div class="footer-sub-header">
                        <span class="icon-telephone"></span>
                        <span>
                            @GetValue("Item.Area.Phone_Other")
                        </span>
                    </div>

                </div>
                <div class="col-xs-12 col-sm-6">
                    <img src="/Files/Templates/Designs/------/Images/WhiteLogo/-------white-logo@2x.png" class="white-logo">
                </div>
            </div>
            <hr>
            <div class="row">
                <div class="col-xs-12 col-sm-3">
                    @if (!string.IsNullOrEmpty(GetString("Item.Area.Parent_Page_1")))
                    {
                        var parent1_idString = GetString("Item.Area.Parent_Page_1").Split('=')[1];
                        int parent1_id = 0;
                        int.TryParse(parent1_idString, out parent1_id);

                        string parent1_pageName = Dynamicweb.Services.Pages.GetPage(parent1_id).MenuText;
                        var parent1_pageList = Dynamicweb.Services.Pages.GetPagesByParentID(parent1_id).ToList();

                        <h2 class="footer-header"> @parent1_pageName</h2>

                        for (int i = 0; i < parent1_pageList.Count; i++)
                        {
                            if (i < 5)
                            {
                                <a class="footer-link" href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(parent1_pageList[i].ID)">
                                    @parent1_pageList[i].MenuText
                                </a>
                            }
                            else
                            {
                                break;
                            }
                        }
                    }
                </div>
                <div class="col-xs-12 col-sm-3">
                    @if (!string.IsNullOrEmpty(GetString("Item.Area.Parent_Page_2")))
                    {
                        var parent2_idString = GetString("Item.Area.Parent_Page_2").Split('=')[1];
                        int parent2_id = 0;
                        int.TryParse(parent2_idString, out parent2_id);

                        string parent2_pageName = Dynamicweb.Services.Pages.GetPage(parent2_id).MenuText;
                        var parent2_pageList = Dynamicweb.Services.Pages.GetPagesByParentID(parent2_id).ToList();

                        <h2 class="footer-header"> @parent2_pageName</h2>

                        for (int i = 0; i < parent2_pageList.Count; i++)
                        {
                            if (i < 5)
                            {
                                <a class="footer-link" href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(parent2_pageList[i].ID)">
                                    @parent2_pageList[i].MenuText
                                </a>
                            }
                            else { break; }
                        }
                    }
                </div>
                <div class="col-xs-12 col-sm-6">
                    <h2 class="footer-header">@Translate("About -----")</h2>
                    <p class="about-text">@GetValue("Item.Area.About_Text")</p>
                    <h2 class="footer-header">@Translate("Privacy Policy")</h2>
                    <p class="about-text">@GetValue("Item.Area.Privacy_Policy")</p>
                </div>
            </div>
        </div>
    </footer>
    <div class="footer-bottom">
        <div class="container">

            <div class="row">
                <div class="col-xs-12 col-sm-3">
                    <h2 class="footer-city">@GetValue("Item.Area.Office_1_Name")</h2>
                    <p>@GetValue("Item.Area.Office_1_Address_1")</p>
                    <p>@GetValue("Item.Area.Office_1_Address_2")</p>
                </div>
                <div class="col-xs-12 col-sm-3">
                    <h2 class="footer-city">@GetValue("Item.Area.Office_2_Name")</h2>
                    <p>@GetValue("Item.Area.Office_2_Address_1")</p>
                    <p>@GetValue("Item.Area.Office_2_Address_2")</p>
                </div>
                <div class="col-xs-12 col-sm-3">
                    <h2 class="footer-city">@GetValue("Item.Area.Office_3_Name")</h2>
                    <p>@GetValue("Item.Area.Office_3_Address_1")</p>
                    <p>@GetValue("Item.Area.Office_3_Address_2")</p>
                </div>
                <div class="col-xs-12 col-sm-3">
                    <h2 class="footer-city">@GetValue("Item.Area.Office_4_Name")</h2>
                    <p>@GetValue("Item.Area.Office_4_Address_1")</p>
                    <p>@GetValue("Item.Area.Office_4_Address_2")</p>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /.container -->
    
</html>
 
Oscar Romin
Oscar Romin
Reply

I used the deprecated OrderService.CreateOrderLine() (I just discovered that it exists) method with the exact same parameters now as a workaround and everything works as intended.

 

You must be logged in to post in the forum