This is the continuation of the previous article which is http://keysandstrokes.info/integrate-aem-magento-3/. After deploying your CIF project into AEM, you need to configure your AEM instance to connect with Magento. In this article, we are going to see how to connect to Magento and load products information on the AEM page.
Open http://localhost:4502/system/console/configMgr and edit CIF GraphQL Client Configuration Factory
- By default the GraphQL Service Identifier points to “default”, you can change this to anything which you feel you can remember, here I changed this to “custom”
- Enter your Magento server hostname by appending with “/graphql” in the GraphQL Service URL ex: https://localhost:4502/graphql.
- If you are setting up development environment then you must enable “Accept self singed SSL certificate” and install a self-signed certificate for your domain otherwise it won’t work.
- Keep remaining things as it is.
Now, edit CIF Catalog Magento GraphQL Configuration Factory and provide Magento GraphQL Service Identifier to “custom” and keep remaining things as it is.
Step 3 :
Now, go to the products console ( http://localhost:4502/aem/products.html/var/commerce/products ) and bind products
- Click on create button
- Select Bind Products
- You should see the below screen.
- Enter title, Name and select Commerce provider as “magento-graphql”
- Enter Magento Store view as “default” or check with your Magento developer
- Enter Root Category Id is 2 or check with your Magento developer for category id
- Select Project as a “custom” which you configured in step 1
Now, click on the Bind button, after that you should see below screen, The difference between Hybris and Magento is, in Hybris we import products and categories into AEM, but In Magento we don’t import products instead of that we get products information on demand from Magento.
For example, the “Bottoms” and “Tops” will appear only when you click on the “Women” category
Now, open this URL ( http://localhost:4502/editor.html/content/jara-magento/us/en.html ) and if you see below screen then the integration is successful.
In my next article, I will explain how to create a custom component which consumes data from Magento using GraphQL and display on the AEM page.