1 Reply Latest reply on Mar 31, 2013 6:23 PM by Sham HC

    How to create custom adapter for Products and CommerceService

    kostya.b

      Hi guys!

       

      First of all I wanted to say that I did search. Only relevant material I found was this http://dev.day.com/docs/en/cq/5-5/ecommerce/eCommerce-framework.html

       

      Unfortunately it doesn't go in details enough...

       

      I'm trying to follow geometrixx-outdoors example to create my shoppingCart. I have a list of of products in /etc/commerce/products.... referenced by productPage in content.

      But I don't know how to create custom CommerceProvider and Adapter to create proper Product objects - it always picks up geoProductImpl.

       

      As I understand I need to specify cq:commerceProvider to myProvider and then I need to somehow register MyProvider so it gets picked up.

      Also I guess I need to add MyProductAdapter somehow  so when shoppingCart executes following it returns my implementation instead of geoProductImpl.

      Product product = productResource.adaptTo(Product.class);

       

      I'd really appreciate if anyone could share an example or point me in the right direction for a guide.

       

      Cheers

      Kostya