Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Puck Holshuijsen 184 posts 727 karma points
    Mar 08, 2022 @ 10:35
    Puck Holshuijsen
    0

    Extending the order overview in the backend

    Hi Matt,

    I was just wondering if it is able to extend the order overview in the backend? I basically want to show the company property next to the name, and i was wondering if this would be possible?

    I found the view of the list, and also the controller. But it appears that the company property is not available for this list. Maybe there is a way to get this value?

    Eg: enter image description here Thanks!

    Kind regards,

    Puck

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Mar 08, 2022 @ 11:48
    Matt Brailsford
    0

    Hi Puck,

    We don't currently have a way of displaying custom properties in the list view so it's just the customer name unfortunately.

    I was wondering if some angular interceptor could be used, but we don't return order properties for the list view so you wouldn't be able to grab the company name from the request body even if we can intercept the call.

    I think unfortunately then, right now the answer is going to have to be a no. But maybe I can look at firing some events or some config option for how the order name should be formatted. I'll have to give that some thought.

    Matt

  • Puck Holshuijsen 184 posts 727 karma points
    Mar 08, 2022 @ 13:34
    Puck Holshuijsen
    0

    Hi Matt,

    Thanks for the reply, was afraid of that :) It would be awesome if something like a config would be available in the future (just like the order editor config).

    Puck

  • Bo Jacobsen 605 posts 2403 karma points
    Mar 25, 2022 @ 13:29
    Bo Jacobsen
    0

    Hi Matt.

    I am just hijacking this thread :)

    Is it possible to add a custom filter or add a new custom row to be displayed in the list?

    Our customers is looking for a fast way to sort or see if the order is a delivery or a pickup by the store.

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Mar 25, 2022 @ 14:02
    Matt Brailsford
    0

    Hi Bo,

    You can add a custom advanced search filter yes (assuming you are on version 2.1 at least). Checkout our blog post on how to implement one https://vendr.net/blog/vendr-2-1-0-release/

    You can't currently inject your own row though (unless you want to get down and dirty with angular interceptors)

    Matt

  • Bo Jacobsen 605 posts 2403 karma points
    Mar 25, 2022 @ 14:42
    Bo Jacobsen
    0

    Hi Matt.

    Thanks for quick reply.

    We are currently on 1.8.6. But as far as i can see, we should be able to upgrade to 2.1.2 on .NET Framework 4.7.2?

    The only breaking change i can see we have to be aware of is the GetProductVariantAttributes and the productReference / productVariantReference parameters in IProductService and IVendrApi that now require a storeId parameter.

    I was actuelly playing around with the $httpProvider.interceptors for /App_Plugins/Vendr/backoffice/vendr/order-list.html and got some of it working.

    If only the order items returned for the view had their custom properties with them like those you get from vendrOrderResource.getOrder.

    vendrOrderResource.getOrder("80c61e40-92f1-4e40-a1bc-38bedddfe04b").then(function (order) {
        console.log(order.properties); // <= YaY!
    });
    
  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Mar 28, 2022 @ 08:12
    Matt Brailsford
    0

    Hi Bo,

    You can run v2.1.2 on Umbraco v8 yes, but you'll need to bare in mind that v2 was a bit of a big restructure (much should still be the same, but some things may have moved). Additionally, some of the NuGet packages have been dropped and others created which can affect upgrades. The best approach seems to be to uninstall v1 from everywhere and then install v2 (same goes for payment providers).

    It might be worth reviewing the v2 blog post for more on what changed https://vendr.net/blog/vendr-2-0-0-release/

    RE properties on the list view, yea, we may look at this later. We were just trying to keep the request size down and not loading what isn't needed by the list view, but yea, it does mean it's not available to you either to work around.

  • Bo Jacobsen 605 posts 2403 karma points
    Mar 28, 2022 @ 10:51
    Bo Jacobsen
    0

    Thanks Matt.

    Ill give it a go :)

    EDIT: I found out that the payment providers for Quickpay and NETS then need to be upgraded too.

  • Bo Jacobsen 605 posts 2403 karma points
    Mar 28, 2022 @ 21:46
    Bo Jacobsen
    0

    Matt.

    We almost hack it to work as we like, by interceptors, controller extenders and watchers.

    We want to be able to filter on Shipping Method selected.

    enter image description here

    The only thing that wont work is the actuel filtering when vendr angular code is calling vendrOrderResource.searchOrders(storeId, opts).

    When we filter on order status the opt got a property like orderStatusIds: ['641262bd-59b6-46eb-864d-916509aa1e9d'] and when we filter on Payment status it adds a property like paymentStatuses: [1, 2].

    Would it be possible to make a Vendr upgrade to 1.8.6, so we could be able to filter on a property like shippingMethodIds: ['cce5afd5-597f-4a68-a912-9c9b66fe2016'] ?

    opt = { 
        itemsPerPage: 30
        orderBy: "name"
        orderDirection: "asc"
        orderStatusIds: ['641262bd-59b6-46eb-864d-916509aa1e9d']
        pageNumber: 1
        pageSize: 30
        paymentStatuses: [1, 2]
        searchTerm: ""
        shippingMethodIds: ['cce5afd5-597f-4a68-a912-9c9b66fe2016'] 
    };
    
  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Mar 29, 2022 @ 08:35
    Matt Brailsford
    0

    Vendr fires a OrderSearchingNotification event that you can hook into to tweak the search criteria.

    Would that work?

  • Bo Jacobsen 605 posts 2403 karma points
    Mar 29, 2022 @ 08:57
    Bo Jacobsen
    0

    Maybe, ill give it a go and let you know :)

  • Bo Jacobsen 605 posts 2403 karma points
    Mar 29, 2022 @ 09:13
    Bo Jacobsen
    0

    I cant seem to find the OrderSearchingNotification. Should it be under Vendr.Core.Events.Notification?

    NotificationEventHandlerBase<OrderSearchingNotification>?

    EDIT: Found it at Vendr.Web.Events.Notification

  • Bo Jacobsen 605 posts 2403 karma points
    Mar 29, 2022 @ 11:16
    Bo Jacobsen
    0

    Matt, i need a little help.

    The OrderSearchingNotification evt for Filter and SearchTermFilter is always null.

    So i tried to play around with it:

    public class IncludeShippingMethodInOrderSearchingHandler : NotificationEventHandlerBase<OrderSearchingNotification>
    {
        public override void Handle(OrderSearchingNotification evt)
        {
            evt.Filter = (where) => where
            .SearchableFieldsMatch("shippingMethodIds", StringComparisonType.Contains);
    
            evt.SearchTermFilter = (where, shippingMethodIds) => where
            .HasShippingMethod(shippingMethodIds
            .Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
            .Select(x => Guid.Parse(x.Trim())));
        }
    }
    

    But it does not work. Like no orders is showin up now, haha :)

    Can you point me in the right direction?

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Mar 29, 2022 @ 12:45
    Matt Brailsford
    0

    So they are meant to be empty and it's a case of if one is populated, it should get merged into the existing query. To search shipping methods, you'll want to use the HasShippingMethod query specification.

    I recall you are on Umbraco v8, so something like this should probably work

    public class IncludeShippingMethodInOrderSearchingHandler : NotificationEventHandlerBase<OrderSearchingNotification>
    {
        public override void Handle(OrderSearchingNotification evt)
        {
            var ids = (HttpContext.Current?.Request.QueryString["shippingMethodIds"] ?? "")
                .Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(x => Guid.Parse(x.Trim()))
                .ToList();
    
            if (ids.Count > 0)
                evt.Filter = (where) => where.HasShippingMethod(ids);
        }
    }
    
  • Bo Jacobsen 605 posts 2403 karma points
    Mar 29, 2022 @ 13:59
    Bo Jacobsen
    1

    Yay, now its working!

    I only had to add [] to the shippingMethodIds, like (HttpContext.Current?.Request.QueryString["shippingMethodIds[]"] ?? "")

  • Matt Brailsford 4125 posts 22222 karma points MVP 9x c-trib
    Mar 29, 2022 @ 14:54
    Matt Brailsford
    0

    Nice 😎

  • Philip Hayton 98 posts 435 karma points
    Apr 05, 2022 @ 10:30
    Philip Hayton
    0

    Hi Bo,

    Would it be possible to share how you managed to hack this together? As we have a project for which this is a critical feature and the client is insisting on it.

    Any help is greatly appreciated!

Please Sign in or register to post replies

Write your reply to:

Draft