Monday, May 17, 2021

AEM Commerce As Cloud Service with CIF Add-On


 

In this post we will discuss how to setup the AEM commerce as a cloud service with CIF add-on.

 

Setup of AEM commerce as a cloud service :

 A local development environment is recommended to work with CIF projects and how to setup one is explained below:

 

Prerequisites:

Some of the prerequisites for the setup are :

1. AEM as a Cloud Service SDK

2. Java 11

3. Node.js

4. npm

5. Magento Instance URL

 

First of all , the latest CIF add-on should be downloaded from the Software Distribution portal. It is a zip file which contains the respective far file as add-ons for author and publish instance.

Now follow the steps below :

 

1. Make sure you have the latest AEM as a cloud service SDK.

2. Unpack the jar by running java -jar <jar_name> -unpack in the command line to create a quickstart folder.

3. Once the quickstart folder has been created , go inside it and create a folder named install.



4. Unzip the CIF add-on package file and copy the correct .far file in the install folder of the relative instance you are planning to run i.e. author .far file for author-4502 instance and publish .far for publish-4503 .


5. Create a local environment variable named COMMERCE_ENDPOINT holding the Magento GraphQL endpoint.

I have installed my Magento instance on my local machine and it is running on:

http://localhost/magento2/admin





In Windows : set COMMERCE_ENDPOINT=<magento_endpoint_url>/graphql

In MAC : export COMMERCE_ENDPOINT=<magento_endpoint_url>/graphql

Using echo, you can check your COMMERCE_ENDPOINT value



6. Now run the jar by running java -jar <jar_name> in the command line.

7. You will also need to setup the proxy server for Magento endpoint so that the endpoint is available locally for CIF add-on and the CIF core components and to get the products binded in the Commerce console. 

Run the following command to do that :

In Windows:

npx local-cors-proxy --proxyUrl http://localhost/magento2 --port 3000 --proxyPartial ""

Note: While setting up the proxy server , pass your Magento endpoint without /graphQL.

Your proxy server will be started stating Proxy Active and you can check the same by replacing proxied part with the http://localhost:3000/





Login to the AEM SDK and verify the CIF add-on related bundles at http://localhost:4502/system/console/osgi-installer

You will also be able to see the additional Commerce tab in http://localhost:4502/aem/start.html



Setup of the local AEM Commerce as a Cloud Service is completed now.

To deploy Viena project Follow Venia project with AEM

Happy Coding!!!


9 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This is a wonderful product, taking into account all the information about it, this type of product that prevents user interest in the site, and you will share more ... good luck.  small business consulting

    ReplyDelete
  3. Great info! I recently came across your blog and have been reading along. I thought I would leave my first comment. I don’t know what to say except that I have  代写

    ReplyDelete
  4. When your website or blog goes live for the first time, it is exciting. That is until you realize no one but you and your. accounting and bookkeeping services

    ReplyDelete
  5. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. brand names for sale

    ReplyDelete

ElasticSearch vs Apache SolrCloud

  Elasticsearch and Apache SolrCloud are both powerful, distributed search engines built on top of Apache Lucene. Both Elasticsearch and S...