E-Commerce Framework: Class mapping


#1

Hi,
I’m new to the EcommerceFrameworkBundle and currently trying to install it and creating a product index with one attribute productName. I added a config for the bundle like in the demo-ecommerce project and tried to adapt it to my installation/needs.
My Product class does not have the id Product but MyCompanyProduct and I would like to map it so the EcommerceFrameworkBundle can work with it.
In the class editor in pimcore backend I set parent class of MyCompanyProduct to \Pimcore\Bundle\EcommerceFrameworkBundle\Model\AbstractProduct.

When I try to create the product index via command line the IndexUpdater throws an exception (line 47) Attempted to load class “Listing” from namespace “\Pimcore\Model\DataObject\Product”. Did you forget a use statement …

So my question is: How do I configure the EcommerceFrameworkBundle to work with my own product class? Did I miss something?

Thank you in advance

Kind regards,
Sonja


#2

Not in front of computer right now, but I believe you can specify the class as an argument to the command. Check the help for the command.


#3

Hi,
Thank you for your hint, I tried it like this:
php bin/console ecommerce:indexservice:bootstrap --update-index --object-list-class \Pimcore\Model\DataObject\MyCompanyProduct\Listing

This works until the next error, but nothing to do with this topic.

Then: Is this enough to use own Product classes, no other config needed to use MyCompanyProduct instead of Product?

Thank you and kind regards,
Sonja