Copied to clipboard

Flag this post as spam?

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


  • Michael Nielsen 154 posts 811 karma points
    Mar 11, 2022 @ 09:58
    Michael Nielsen
    0

    Advanced Search property not showing up in backend

    I'm trying to add phone number to the new advanced search, but I must be doing something wrong or forgetting something, as it does not show up.

    Can anyone point me in the right direction?

    This is my filter

    [AdvancedFilter("billingTelephone", "Phone Number", "A full or partial cart number to search on", Group = "Customer")]
        public class OrderPhoneNumberFilter : OrderAdvancedFilterBase
        {
            public override bool CanApply(string value) => !string.IsNullOrWhiteSpace(value);
    
            public override IQuerySpecification<OrderReadOnly> Apply(IQuerySpecification<OrderReadOnly> query, IOrderQuerySpecificationFactory @where, string value)
            {
                return query.And(where.HasProperty(new KeyValuePair<string, string>("billingTelephone", value), StringComparisonType.Contains));
            }
        }
    

    And this is the composer

    [ComposeAfter(typeof(VendrComposer))]
        public class VendrSearchFilterComposer : IUserComposer
        {
            public void Compose(Composition composition)
            {
                composition.WithCartAdvancedFilters().Append<OrderPhoneNumberFilter>();
    
            }
    
            public class VendrSearchFilterComponent : IComponent
            {
                public void Initialize()
                {
    
                }
    
                public void Terminate()
                {
                }
            }
        }
    

    Umbraco 8.18.0

    Vendr 2.1.1

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Mar 11, 2022 @ 10:34
    Matt Brailsford
    100

    Stilly question, but you are looking in the cart editor UI and not the order editor UI (sorry, gotta ask the simple questions first).

    Matt

  • Michael Nielsen 154 posts 811 karma points
    Mar 11, 2022 @ 12:32
    Michael Nielsen
    0

    Well... yes that would be a totally silly question, normally 😅🤦‍♂️

    If I look at the new carts UI, that I've totally forgot was there, it's there...

    And changing

    composition.WithCartAdvancedFilters().Append<OrderPhoneNumberFilter>();
    

    to

    composition.WithOrderAdvancedFilters().Append<OrderPhoneNumberFilter>();
    

    Makes it appears in the orders section, where I want it.

    Sorry for the brain fart, and thanks 👍

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Mar 11, 2022 @ 12:42
    Matt Brailsford
    0

    Hehe, no judgment here. I have many brain farts most days 😂😂

    I do love a simple support request now and again 😁

Please Sign in or register to post replies

Write your reply to:

Draft