Copied to clipboard

Flag this post as spam?

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

  • Philip Hayton 93 posts 429 karma points
    6 days ago
    Philip Hayton

    How to filter a VirtualSubTree within Vendr by Store Id

    Hi Matt,

    Is it possible to perform contextual filtering on a collection based on the place it's being rendered?

    For example, I have one particular collection that is used in both a ContextApp AND as a Vendr VirtualSubTree at Commerce > Stores > {StoreName} > My Collection.

    The collection contains models like this:

    [PrimaryKeyColumn(AutoIncrement = false)]
    public Guid Id { get; set; } = Guid.NewGuid();
    public string? ContentUdi { get; set; }
    public Guid? StoreId { get; set; }
    public Guid? ProductId { get; set; }

    I am able to successfully filter the ContextApp using ContentUdi as a foreign key.

    However I'm having trouble filtering the VirtualSubTree in Vendr. I only want to show models where StoreId matches the current Store (which is a parent of the VirtualSubTree).

    Is there anyway of doing that?

    Any help is greatly appreciated! 🙏🏻

  • Matt Brailsford 4035 posts 21640 karma points MVP 9x c-trib
    5 days ago
    Matt Brailsford

    What does your virtual sub tree configuration look like?

  • Philip Hayton 93 posts 429 karma points
    3 days ago
    Philip Hayton

    Gah, don't worry, I think I've solved it.

    I had to store all IDs as a string instead of a Guid.

Please Sign in or register to post replies

Write your reply to: