Copied to clipboard

Flag this post as spam?

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


  • Anders Brännmark 228 posts 280 karma points
    Sep 29, 2020 @ 07:34
    Anders Brännmark
    0

    Custom product adapter

    Would like to create a custom product adapter that uses the default behavior of the Vendr Umbraco ProductAdapter but override the prices collection where I want to hook in external data.

    The prices on the default product snapshot is set to only get via a private prices property.

    Any reason why this isn't a get and set property so one inherit the UmbracoProductAdapter and fire the base GetProductSnapshot. Overwrite the prices property before returning a product snapshot?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Sep 29, 2020 @ 08:32
    Matt Brailsford
    100

    Hey Anders,

    A snapshot by it's nature is a read only entity and so when overriding the ProductAdapter you generally have to override the ProductSnapshot too.

    We have a good example of overriding the defaults in the demo store which you can find here https://github.com/vendrhub/vendr-demo-store/tree/main/src/Vendr.DemoStore/Web/Adapters as we override the adapter / snapshot in order to override the product name so it should be pretty similar to your setup, just that you want to change the prices returned rather than the name.

    Hope this helps

    Matt

  • Anders Brännmark 228 posts 280 karma points
    Sep 29, 2020 @ 09:58
    Anders Brännmark
    0

    Did something similar for my solution. Just wanted to check that this is the correct way of doing it..

    /Thanks Anders

Please Sign in or register to post replies

Write your reply to:

Draft