Copied to clipboard

Flag this post as spam?

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


  • Tony 76 posts 112 karma points
    May 27, 2016 @ 14:25
    Tony
    0

    Dynamic Collection

    I want to create a dynamic collection which I can populate based of values in a product. At the moment Im just looking to create a collection which shows 'Available' products, as thats a 'standard' product value.

    Im looking a the example one from the online documents, but the example is for invoices (using teh invoice service) and the one Im building is for products.

    The Methods in the product service do not marry up very well with the ones int the invoice service, so I cant seem to get what I need. Is there any examples of a Dynamic Product Collection out there?

  • Tony 76 posts 112 karma points
    May 30, 2016 @ 15:40
    Tony
    0

    Anyone? Do I need to extend the products service? I dont really want to tinker to much in there, especially if Im just doing something simple wrong?

    I just want to create a dynamic collection base on whether a product is 'Available' or not? Surely it cant be that hard as I would expect people to want dynamic collections based on size or cost etc..

  • Tony 76 posts 112 karma points
    Jul 07, 2016 @ 23:33
    Tony
    0

    Can nobody help? I just want to create a simple Dynamic product collection, for example if I wanted all products that were blue.

    Ive looked through all the git code and the only product providers to follow are static ones, when I try and use the Product service it complains that none of teh methods are available! for example if says the method 'GetKeysFromCollection isnt available, but your using it in the git solution??

    Ive tried building the core dll and using that but still nothing?

    ((ProductService)this.MerchelloContext.Services.ProductService).GetKeysFromCollection( this.CollectionKey, page, itemsPerPage, sortBy, sortDirection);

  • Sam Gooch 15 posts 107 karma points
    Oct 18, 2017 @ 12:19
    Sam Gooch
    0

    Hi Tony

    Did you ever get this sorted?

    Thanks, Sam

  • Ronald Barendse 4 posts 75 karma points c-trib
    4 days ago
    Ronald Barendse
    0

    I am too trying to create dynamic collections in the back-end, so editors can see products attached to a specific content type. The documentation on the sales collections (https://merchello.readme.io/docs/sales-collections) isn't very helpfull for creating product collections indeed!

    I'm using Umbraco 7.6 and Merchello 2.6, so far I've added the following in merchello.config:

    <tree id="products" title="Products" icon="icon-barcode" routePath="merchello/merchello/productlist/manage" visible="true" sortOrder="1">
        <selfManagedEntityCollectionProviders>
            <entityCollectionProvider key="FC26B245-7CDD-411E-84BE-B3CE2911E22B" icon="icon-barcode" visible="true" ref="Machines and materials" />
        </selfManagedEntityCollectionProviders>
    </tree>
    

    And created the provider DynamicProductContentTypeProductCollectionProvider:

    [EntityCollectionProvider("FC26B245-7CDD-411E-84BE-B3CE2911E22B", "9F923716-A022-4089-A110-1E9B4E1F2AD1", "Machines & materials", "A dynamic collection queries for products associated with a specified product content type.", true)]
    public class DynamicProductContentTypeProductCollectionProvider : CachedQueryableEntityCollectionProviderBase<IProduct>
    {
        // Using default implementation (NotImplementedException)
    }
    

    A new tree node Machines & materials is added below Products, but none of the provider methods are invoked, the URL of the node has a different key /umbraco/#/merchello/merchello/productlist/2610eec0-c28f-4257-957b-9ff32f7ccd0c and the XHR request just returns an empty JSON response ({"currentPage":1,"itemsPerPage":10,"totalPages":0,"totalItems":0,"items":[]})!

    Maybe @rustyswayne could pitch in here!

  • Ronald Barendse 4 posts 75 karma points c-trib
    3 days ago
    Ronald Barendse
    0

    The provider Tony wants and the one I've tried to create both filter on a single (static) value, but would it also be possible to create a provider that shows filters for multiple values (e.g. all product content types)?

    This should work like the built-in collections, but populate filters based on dynamic data (not directly managed by the user). Any ideas?

Please Sign in or register to post replies

Write your reply to:

Draft