# Question and Answer Add-on old

**Installation of Spurtcommerce Question and Answer Add-On**

This document will help you to install Question and Answer add-on to your spurtcommerce server for single vendor as well as multi vendor

**you can install this Add-on through following steps**

step 1: [<mark style="color:blue;">Setup an API (Step By Step)</mark>](#setup-an-api-step-by-step) to add extension for admin

step 2: [<mark style="color:blue;">Admin setup</mark>](#admin-setup)

step 3: you can easily install admin storefront with [<mark style="color:blue;">store setup</mark><mark style="color:blue;">**.**</mark> ](#store-setup)spurtcommerce provides 3 admin storefronts, built with [<mark style="color:blue;">Angular,</mark> ](#store-setup)[<mark style="color:blue;">Flutter</mark>](#store-setup) and [<mark style="color:blue;">React.</mark>  ](#store-setup)

**Along with the above steps you need to  further follow these steps below to install this Add-on for Multi-vendor platform**

step 4:[ <mark style="color:blue;">Setup an API (Step By Step) t</mark>](#set-up-api-step-by-step-to-add-extension-for-multi-vendor)o add extension for multi vendor

step 5 :[ <mark style="color:blue;">Multi Vendor front end setup</mark>](#vendor-setup)

step 6: you can easily install vendor storefront with [<mark style="color:blue;">store setup</mark><mark style="color:blue;">**.**</mark> ](#store-setup-1)spurtcommerce provides 3 vendor storefronts, built with <mark style="color:blue;">Angular, Flutter</mark> and [<mark style="color:blue;">React.</mark>  ](#store-setup-1)

**About Addon :**

The Installation of Spurtcommerce Questions and Answers for Admin Products is for adding more information about product to let Customers know about what the product looks like, and what function it can perform. This feature also allows Customers to post questions for gathering information so that they can make an appropriate decision about purchase. When the plugin is installed, the Multi-Vendor eCommerce site becomes ready for Admin and Vendor to post questions and answers and also for Customers to ask questions about a product.

**Features:**

* The Admin and vendor can post questions and answers about products in order to give more details on the uses, specifications and attributes of the product.
* The Customers can view the questions and answers posted by the Admin on the product detail page.
* Customers can post questions about the products, to which the admin can answer.
* Customers can also answer questions about a product posted by another Customer, provided they have already purchased the particular product.
* A question on the product can have multiple answers (answered by purchased customers or admin). However, Admin can enable any one as the default answer to show the display. On clicking ‘see more’, other answers will appear.
* Admin and Vendor can enable any one answer from the multiple answers to a question on the product, from their control panel.

### [<mark style="color:blue;">Setup an API (Step By Step)</mark>](#setup-an-api-step-by-step)

For setting up the API, you need to execute the following steps:

* Installing an extension
* &#x20;Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurtcommerce comes packed in a zip, whose name ends in "<mark style="color:green;">**questionandanswer-addOn.zip"**</mark>. Extract the zip file, open api folder and open addon folder within that and copy the content of addon folder into the specified path

&#x20;                              **Path - \<PROJECT\_ROOT>/add-ons**

**Step 2 : Run the application**&#x20;

After you have completed the installation of the above mentioned steps, you can run the application and also view the changes.

```
$ npm start serve
```

Once you execute the above command, add-on file will get integrated into the backend API.

**Step 3 : Make the build**

These are the steps that need to be followed for generating the build.

To run the below command

```
$ npm run build
```

Then latest built files can be deployed into the server.

### [<mark style="color:blue;">Admin Setup</mark>](#front-end-admin-setup)

These are the steps that need to be followed to do the front end admin setup.

* &#x20;Installing an extension
* Update the configuration&#x20;
* Module Detail&#x20;
* &#x20;Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "qa-addOn.zip".

&#x20;        Extract the zip file and copy the content of  **admin/add-ons**  folder into the specified path

&#x20;                   **Path -  admin/add-ons**

{% hint style="info" %}
**Note:**

1\) In add-ons folder if already a cms folder exists.

Inside cms folder paste Question and answer folder.

In cms routing file(cms.routing.ts) paste the below code.

&#x20;

export const questionAnswerRoutes = \[

&#x20; {

path: 'question\_answer',

loadChildren: () => import('./QuestionAndAnswer/questionAnswer.module').then(m => m.questionAnswerModule),

canActivate: \[AuthGuard],

&#x20; },

];

\
2\) Inside the addon  if the cms folder doesn’t exist.

Paste the cms folder in add-ons.
{% endhint %}

**Step 2 : Update the configuration**&#x20;

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce config files. For this, you need to follow the steps below.

**Update Reducer Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-reducer.ts**</mark>

```

 import * as fromQuestionAnswer from '../add-ons/cms/QuestionAndAnswer/core/questionAnswer/questionAnswer-reducer/questionAnswer.reducer';

```

Add the reducer into the below object

&#x20;                     *questionAnswer: fromQuestionAnswer.reducer,*

After adding its looks like below

```
 
export const AddOnReducers: ActionReducerMap<State> = {
	questionAnswer: fromQuestionAnswer.reducer
};

```

**Update State Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-state.ts**</mark>

```
   
import { questionAnswerState } from
  './cms/QuestionAndAnswer/core/questionAnswer/questionAnswer-reducer/questionAnswer.state';

```

Add the state into the below object

```
questionAnswer: questionAnswerState;
```

After adding its looks like below

&#x20;                       **export interface AddOnAppState {**&#x20;

&#x20;                       **questionAnswer: questionAnswerState;**&#x20;

&#x20;                      }&#x20;

**Step 3 : Change the routing file(**<mark style="color:green;">**cms.routing.ts**</mark>**)** Inside the <mark style="color:green;">**src/theme/default/admin/cms/components/manage-content/manage-content.routing.ts**</mark>

Import below line

```
import * as cmsRouting from '../../../../../../../add-ons/cms/cms.routing';

```

Add these routes below the **manageContentRoutes** array

```
manageContentRoutes.forEach(data => {
if (data) {
manageContentRoutes.push(cmsRouting.questionAnswerRoutes[0]);
}
});

```

**Add Question And Answer Tab**

<mark style="color:green;">**In src/theme/admin/cms/components/header.component.html**</mark>

&#x20;          <mark style="color:green;">**Below line no:30**</mark>

```
<li [appHideIfUnauthorized]="'catalog-product'" >
    <a href="javascript:void(0)" [routerLink]="['/cms/manage-content/question_answer']" [routerLinkActive]="'active'">
Question and Answers
    </a>
</li>
 




```

**Step 4 : Run the application**

After you have integrated the *Question And Answer* Module into Spurtcommerce, you can use the following command to run the application.

```
 npm run large-serve
```

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

**Step 5 : Make the build**

To run the below command

```
  		 npm run large-build
```

Then the latest built files can be deployed into the server.

### [ <mark style="color:blue;">Store Setup</mark>](#store-setup)

{% tabs %}
{% tab title="Angular" %}

###

These are the steps that need to be followed to do the front end store setup.

* Installing an extension&#x20;
* Update the configuration&#x20;
* Module Detail
* &#x20;Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "qa-addOn.zip".&#x20;

&#x20;          Extract the zip file and copy the content of  store-angular/add-ons folder into the specified path

&#x20;                                  **Path -  store-angular/add-ons**

<br>

**Step 2 : Update the configuration**

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce config files. For this, you need to follow the steps below.

**Update Reducer Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-reducer.ts**</mark>

```
      import * as fromQuestionAndAnswer from  './QuestionAndAnswer/core/reducer/questionAnswer.reducer';

```

Add the reducer into the below object

&#x20;                   *questionAndAnswer: fromQuestionAndAnswer.reducer,*

After adding its looks like below

```
   export const AddOnReducers: ActionReducerMap<State> = {
                    questionAndAnswer: fromQuestionAndAnswer.reducer,
     
                                                         }


```

**Update Effect Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons.effect.ts**</mark>

```
 
    import { QuestionAnswerEffect } from 
    './QuestionAndAnswer/core/effects/questionAnswer.effect';

```

Add the effect into the below object

&#x20;                                 *QuestionAnswerEffect*

After adding its looks like below

&#x20;                      **export const ADD\_ON\_EFFECT = \[**

&#x20;                          **QuestionAnswerEffect**&#x20;

&#x20;                            **];**

**Update State Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-state.ts**</mark>

```
      import { questionAnswerState } from 
      './QuestionAndAnswer/core/reducer/questionAnswer.state';


```

Add the state into the below object

&#x20;                    *questionAndAnswer: questionAnswerState;*

After adding its looks like below

&#x20;                   **export interface AddOnAppState {**&#x20;

&#x20;                       **questionAndAnswer: questionAnswerState;**&#x20;

&#x20;                         **}**

**Update Component Config**

* Import below line into the **add-ons/add-ons.shared.component**

```
import { PostQuestionComponent } from './QuestionAndAnswer/template/model/post-question/post-question.component';
import { ReportAbuseComponent } from './QuestionAndAnswer/template/model/report-abuse/report-abuse.component';
import { PostAnswerComponent } from './QuestionAndAnswer/template/model/post-answer/post-answer.component';
import { ProductQuestionComponent } from './QuestionAndAnswer/template/product-question/product-question.component';
import { ControlsQuestionsComponent } from './QuestionAndAnswer/template/controls-questions/controls-questions.component';
import { AnswerListComponent } from './QuestionAndAnswer/template/model/answer-list/answer-list.component';

```

* Add the following components into the below object

&#x20;                            *PostQuestionComponent,*&#x20;

&#x20;                      *ReportAbuseComponent,*&#x20;

&#x20;                      *PostAnswerComponent,*&#x20;

&#x20;                      *ProductQuestionComponent,*    &#x20;

&#x20;                      *ControlsQuestionsComponent,*&#x20;

&#x20;                      *AnswerListComponent*

* &#x20;After adding its looks like below

**export const ADD\_ON\_COMPONENTS = \[ PostQuestionComponent, ReportAbuseComponent, PostAnswerComponent, ProductQuestionComponent, ControlsQuestionsComponent, AnswerListComponent ];**

**Step 3 : Module Detail**

The modules pertaining to controls-question and products-question are listed below. You may use these modules, in any page of Spurtcommerce.

Also, you can find the steps below to use the modules in WidgetList and WidgetProducts in Spurtcommerce pages.

In the rating and review addon having six components.

1. PostQuestionComponent,&#x20;
2. ReportAbuseComponent,&#x20;
3. PostAnswerComponent,&#x20;
4. ProductQuestionComponent,&#x20;
5. ControlsQuestionsComponent,&#x20;
6. AnswerListComponent

**ControlsQuestionsComponent**

**Directive**

```
<app-controls-questions [productDetails]="(productDetail.productDetails$ | async)" >
```

In the above directive have one input field

&#x20;                                                       productDetails:\[]

**Step 4 : Run the application**

After you have integrated the WidgetList and WidgetProduct Module into Spurtcommerce, you can use the following command to run the application.

```
 ng serve
```

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

**Step 5 : Make the build**

To run the below command

```
ng build --prod
```

Then the latest built files can be deployed into the server.
{% endtab %}

{% tab title="Flutter" %}
These are the steps that need to be followed to do the front end store setup.

* Installing an extension&#x20;
* Update the configuration
* &#x20;Module Detail
* &#x20;Run the Application
* &#x20;Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Extract the store-flutter folder  inside the folder go to (store-fluter → add-ons → QuestionAndAnswer folder) and copy the QuestionAndAnswer folder  and place the copied folder&#x20;

inside the project folder

**Add on location:**&#x20;

&#x20;                            &#x20;**&#x20; &#x20;**<mark style="color:green;">**projectFolder->lib->add-ons**</mark>

**After placing it it will look like this**

&#x20;                 <mark style="color:green;">**projectFolder->lib->add-ons->QuestionAndAnswer**</mark>

Once you finish these steps continue to the next step

**Step 2 : Update the configuration**

After extracting the add on zip file for changing the configurations in addons.dart, you have to follow the steps below:

**Go to**

&#x20;           <mark style="color:green;">**projectFolder->lib->add-ons->addonsshared.dart**</mark>

**Then inside addonsShared array paste the following content**

```
{"Questions": SpurtQuestions(), "data":""},
```

After placing the above files it will look like this

**List addonsShared = \[ {"Questions": SpurtQuestions(), "data":""}, ];**

Then give the following imports

```
import 
'package:spurtcommerce/add-ons/QuestionAndAnswer/questionanswer.dart';
```

Or&#x20;

There will be a popup for quick fix

**Step 3 : Module detail**

After executing the above mentioned steps, we have to place these below lines in the core folder to show the question and answer to the user.

**Detail Question and Answer**&#x20;

Once you finished updating the configuration then in the <mark style="color:green;">**projectFolder->lib->core->modules->detail->details.dart**</mark> file update this line where you seem comfortable with

```
findMyClass("Questions", {
    "id": details[“productId”],
                                    }),
```

**Step 4 : Run the application**

After integrating the Rating and Review Module into Spurt Commerce, you can use the following commands to run the application in terminal

```
$ flutter run
```

Or&#x20;

In **Run** menu select *run without debugging* In case if throws any exception

&#x20;                             **$ flutter run –no-sound-null-safety**

Once you execute the above command you can view the installed module in Spurt Commerce, within the page in which you have integrate&#x64;**.**

**Step 5 : Make the build**

&#x20;In order to build, you need to run the following commands. In order to check the application, run the following commands and build the application.

```
$flutter build
```

If you want to split the abi then

```
$flutter build –split-per-abi
```

For bundle build

```
$flutter build appbundle
```

{% endtab %}

{% tab title="React" %}
These are the steps that need to be followed to do the front end store setup.

* Installing an extension&#x20;
* Update the configuration&#x20;
* Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

<br>

Usually spurcommerce comes packed in a zip, whose name ends in "qa-addOns.zip". Extract the zip file and copy the content of store-react/addOns into the specified path as given below

&#x20;

**Path - addOns/QuestionAndAnswer**

**Add on location:**&#x20;

&#x20;                                          &#x20;**&#x20; &#x20;**<mark style="color:green;">**projectFolder-> addOns**</mark>&#x20;

**After placing it it will look like this**

&#x20;                        <mark style="color:green;">**projectFolder->addOns-> QuestionAndAnswer**</mark>

**Step 2 : Update the configuration**

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce <mark style="color:green;">**addonsconfig.js**</mark> files. For this, you need to follow the steps below.

Once you finish the first Step now declare the necessary plugins in the addonconfig.js file

Import below line into the <mark style="color:green;">**addonconfig.js**</mark>

```
import  SpurtQuestionAndAnswer from './QuestionAndAnswer/QuestionandAnswer'
```

Add the QuestionandAnswer plugin into the below object

**export const AddonsComponent={**&#x20;

**SpurtQuestionAndAnswer }**

**Step 3 : Module Detail**

The modules pertaining to Question and Answer plugin are listed below. You may use these modules, you must send the productId to use this module in any page of Spurtcommerce.

QuestionandAnswer Component:

<mark style="color:green;">**{ConnectPlugin.SpurtQuestionAndAnswer &&\<ConnectPlugin.SpurtQuestionAndAnswer productId={productId}/>}**</mark>

**Step 4 : Run the application**

After you have integrated the **SpurtQuestionAndAnswer** Module into Spurtcommerce, you can use the following command to run the application.

```
$ npm run dev
```

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

**Step 5 : Make the build**

To run the below command

```
$ npm run build or yarn nun build

```

Then the latest built files can be deployed into the server.
{% endtab %}
{% endtabs %}

#### [<mark style="color:blue;">Set up API (step by step) to add extension for Multi vendor</mark> ](#set-up-api-step-by-step-to-add-extension-for-multi-vendor)

For setting up the API, you need to execute the following steps:

* Installing an extension&#x20;
* Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in <mark style="color:green;">**"vendorquestionandanswer-addOn.zip".**</mark>&#x20;

Extract the zip file and copy the content of api folder into the specified path as given below.

&#x20;                                     **Path - \<PROJECT\_ROOT>/add-ons**

**Step 2 : Run the application**

After you have completed the installation of the above mentioned steps, you can run the application and also view the changes.

```
$ npm start serve
```

Once you execute the above command, add-on file will get integrated into the backend API.

**Step 3 : Make the build**

These are the steps that need to be followed for generating the build.

To run the below command

```
$ npm run build
```

Then latest built files can be deployed into the server.

### [<mark style="color:blue;">Multi Vendor front end Setu</mark>](#vendor-setup)<mark style="color:blue;">p</mark>

These are the steps that need to be followed to do the front end admin setup.

* &#x20;Installing an extension
* Update the configuration&#x20;
* Module Detail&#x20;
* &#x20;Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "vendorproductquestionandanswer-addOn.zip".&#x20;

Extract the zip file and copy the content of vendor/add-ons folder into the specified path

**Path - vendor/add-ons**

**Step 2 : Update the configuration**&#x20;

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce config files. For this, you need to follow the steps below.

**Update Reducer Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-reducer.ts**</mark>

```
import * as fromQuestionAnswer
 from'../add-ons/QuestionAndAnswer/core/reducer/questionAnswer.reducer'




```

**Add the reducer into the below object**

&#x20; questionAnswer: fromQuestionAnswer.reducer,

**After adding its looks like**&#x20;

&#x20; &#x20;

```
        export const AddOnReducers: ActionReducerMap<State> = {
                             questionAnswer: fromQuestionAnswer.reducer
                                            };


	                                      
                                        
```

**Update State Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-state.ts**</mark>

```
      import { ProductState } from './QuestionAndAnswer/core/reducer/questionAnswer.state'

```

Add the state into the below object

```
questionAnswer: ProductState;                   
```

After adding its looks like below

&#x20;                                       <br>

&#x20;                   export interface AddOnAppState {

&#x20;                                    questionAnswer: ProductState;

&#x20;                                }

**Update Effect Config add-ons/add-ons.effect.ts**

```
import { ProductEffect } from "./QuestionAndAnswer/core/effects/questionAnswer.effects";

```

&#x20;

Add the effect into the below object

&#x20;                   **ProductEffect,**

&#x20;

After adding its looks like below

&#x20;                      **export const ADD\_ON\_EFFECT = \[**

&#x20;                                    **ProductEffect**

**];**

&#x20;**Update Component Config  add-ons / add-ons.shared.component.ts**

<br>

```
import { addOnQuestionsDetailComponent } from 
'./QuestionAndAnswer/template/questions-detail/questions-detail.component';

```

```
import { addOnQuestionComponent } from 
"./QuestionAndAnswer/template/question/question.component";

```

```
import { addOnProductListComponent } 
from "./QuestionAndAnswer/template/product-list/product-list.component";

```

&#x20;

Add the following components into the below object

&#x20;                                          **addOnQuestionsDetailComponent,**

&#x20;                                          **addOnQuestionComponent,**

&#x20;                                           **addOnProductListComponent,**

&#x20;

&#x20;After adding its looks like below

&#x20;         **export const ADD\_ON\_COMPONENTS = \[**

&#x20;                       **addOnQuestionsDetailComponent,**

&#x20;                         **addOnQuestionComponent,**

&#x20;                         **addOnProductListComponent**

&#x20;                    **]**

**Step 3 : Module Detail**

The modules pertaining to productvariantlist and productvariantupdate are listed below. You may use these modules, in any page of Spurtcommerce.

&#x20;

Also, you can find the steps below to use the modules in Product Variant in Spurtcommerce pages.

&#x20;

In the ProductQuestionAndAnswer  addon having two component.

**VariantProductListComponent,**

**VariantProductAddComponent**

**Routing**

&#x20;     In <mark style="color:green;">**src/app/default/pages/component/cms/manage-content/manage-content.module**</mark>

&#x20;       Import below line

```
import { addOnProductListComponent } 
from '../../../../../../../add-ons/QuestionAndAnswer/template/product-list/product-list.component';

```

```
import { addOnQuestionComponent } from 
'../../../../../../../add-ons/QuestionAndAnswer/template/question/question.component';

```

&#x20;                &#x20;

&#x20;        2\)  Add these routes below the Routes array

```
   {
        path: 'product-question-answer',
        component: addOnProductListComponent,
        data: {
            title: 'Question Answer',
            urls: [{ title: 'Home', url: '/dashboard' },{ title: 'CMS', url: '/cms/manage-content' },{ title: 'Manage content', url: 'cms/manage-content' }, { title: 'Question & Answer' }]
        }
    },
    {
        path: 'question-answer/:id',
        component: addOnQuestionComponent,
    },
 
```

**For setting up the tab add this line in**

<mark style="color:green;">**src/app/default/pages/component/cms/layout/products.component.html**</mark>

<mark style="color:green;">**Below line no:37**</mark>

```
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton  
                               <a class="cursor" href="javascript:void(0)" [routerLink]="['/cms/manage-content/product-question-answer']">Question and Answer</a>
                           </div>
```

&#x20;**Step 4 : Run the application**

After you have integrated the *Question And Answer* Module into Spurtcommerce, you can use the following command to run the application.

```
 ng serve
```

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

**Step 5 : Make the build**

To run the below command

```
  	 ng build - -prod
```

Then the latest built files can be deployed into the server.

### [<mark style="color:blue;">Store Setup</mark>](#store-setup-1)

{% tabs %}
{% tab title="Angular" %}
These are the steps that need to be followed to do the front end store setup.

* Installing an extension&#x20;
* Update the configuration&#x20;
* Module Detail
* &#x20;Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "qa-addOn.zip".&#x20;

&#x20;          Extract the zip file and copy the content of  store-angular/add-ons folder into the specified path

**Path -  store-angular/add-ons**

<br>

**Step 2 : Update the configuration**

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce config files. For this, you need to follow the steps below.

**Update Reducer Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-reducer.ts**</mark>

```
      import * as fromQuestionAndAnswer from  './QuestionAndAnswer/core/reducer/questionAnswer.reducer';

```

Add the reducer into the below object

&#x20;                   *questionAndAnswer: fromQuestionAndAnswer.reducer,*

After adding its looks like below

```
   export const AddOnReducers: ActionReducerMap<State> = {
                          questionAndAnswer: fromQuestionAndAnswer.reducer,
     
                                                         }


```

**Update Effect Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons.effect.ts**</mark>

```
 
    import { QuestionAnswerEffect } from 
    './QuestionAndAnswer/core/effects/questionAnswer.effect';

```

Add the effect into the below object

&#x20;                                 *QuestionAnswerEffect*

After adding its looks like below

&#x20;                      **export const ADD\_ON\_EFFECT = \[**

&#x20;                          **QuestionAnswerEffect**&#x20;

&#x20;                            **];**

**Update State Config**

Import below line into the <mark style="color:green;">**add-ons/add-ons-state.ts**</mark>

```
      import { questionAnswerState } from 
      './QuestionAndAnswer/core/reducer/questionAnswer.state';


```

Add the state into the below object

&#x20;                    *questionAndAnswer: questionAnswerState;*

After adding its looks like below

&#x20;                   **export interface AddOnAppState {**&#x20;

&#x20;                       **questionAndAnswer: questionAnswerState;**&#x20;

&#x20;                         **}**

**Update Component Config**

* Import below line into the add-ons/add-ons.shared.component

```
import { PostQuestionComponent } from './QuestionAndAnswer/template/model/post-question/post-question.component';
import { ReportAbuseComponent } from './QuestionAndAnswer/template/model/report-abuse/report-abuse.component';
import { PostAnswerComponent } from './QuestionAndAnswer/template/model/post-answer/post-answer.component';
import { ProductQuestionComponent } from './QuestionAndAnswer/template/product-question/product-question.component';
import { ControlsQuestionsComponent } from './QuestionAndAnswer/template/controls-questions/controls-questions.component';
import { AnswerListComponent } from './QuestionAndAnswer/template/model/answer-list/answer-list.component';

```

* Add the following components into the below object

&#x20;                            *PostQuestionComponent,*&#x20;

&#x20;                      *ReportAbuseComponent,*&#x20;

&#x20;                      *PostAnswerComponent,*&#x20;

&#x20;                      *ProductQuestionComponent,*    &#x20;

&#x20;                      *ControlsQuestionsComponent,*&#x20;

&#x20;                      *AnswerListComponent*

* &#x20;After adding its looks like below

**export const ADD\_ON\_COMPONENTS = \[ PostQuestionComponent, ReportAbuseComponent, PostAnswerComponent, ProductQuestionComponent, ControlsQuestionsComponent, AnswerListComponent ];**

**Step 3 : Module Detail**

The modules pertaining to controls-question and products-question are listed below. You may use these modules, in any page of Spurtcommerce.

Also, you can find the steps below to use the modules in WidgetList and WidgetProducts in Spurtcommerce pages.

In the rating and review addon having six components.

1. PostQuestionComponent,&#x20;
2. ReportAbuseComponent,&#x20;
3. PostAnswerComponent,&#x20;
4. ProductQuestionComponent,&#x20;
5. ControlsQuestionsComponent,&#x20;
6. AnswerListComponent

**ControlsQuestionsComponent**

**Directive**

```
<app-controls-questions [productDetails]="(productDetail.productDetails$ | async)" >
```

In the above directive have one input field

productDetails:\[]

**Step 4 : Run the application**

After you have integrated the WidgetList and WidgetProduct Module into Spurtcommerce, you can use the following command to run the application.

```
 ng serve
```

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

**Step 5 : Make the build**

To run the below command

```
ng build --prod
```

Then the latest built files can be deployed into the server.

{% endtab %}

{% tab title="Flutter" %}

These are the steps that need to be followed to do the front end store setup.

* Installing an extension&#x20;
* Update the configuration&#x20;
* Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "qavendor-.addOn.zip". Extract the zip file and copy the content of store folder into the specified path as given below

Move QuestionAndAnswer folder from addOns/QuestionAndAnswer to Path - \<PROJECT\_ROOT>/addOns

Add on location:

&#x20;<mark style="color:green;">**projectFolder-> addOns**</mark>&#x20;

After placing it it will look like this

&#x20;<mark style="color:green;">**projectFolder->addOns-> QuestionAndAnswer**</mark>

**Step 2 : Update the configuration**

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce <mark style="color:green;">**addonsconfig.js**</mark> files. For this, you need to follow the steps below.

Once you finish the first Step now declare the necessary plugins in the <mark style="color:green;">**addonconfig.js**</mark> file

* Import below line into the <mark style="color:green;">**addonconfig.js**</mark>

```
import  SpurtQuestionAndAnswer from 
'./QuestionAndAnswer/QuestionandAnswer'

```

* Add the QuestionandAnswer plugin into the below object

```
export const AddonsComponent={
SpurtQuestionAndAnswer
}

```

#### Step 3 : Module Detail

The modules pertaining to Question and Answer plugin are listed below. You may use these modules, you must send the productId to use this module in any page of Spurtcommerce.

&#x20;                                *QuestionandAnswer Component:*

**{ConnectPlugin.SpurtQuestionAndAnswer &&\<ConnectPlugin.SpurtQuestionAndAnswer productId={productId}/>}**

**Step 4 : Run the application**

After you have integrated the SpurtQuestionAndAnswer Module into Spurtcommerce, you can use the following command to run the application.

```
$ npm run dev
```

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

**Step 5 : Make the build**

To run the below command

```
$ npm run build or yarn run build
```

Then the latest built files can be deployed into the server.
{% endtab %}

{% tab title="React" %}
These are the steps that need to be followed to do the front end store setup.

* Installing an extension&#x20;
* Update the configuration&#x20;
* Run the application&#x20;
* Make the build

**Step 1 : Installing an extension**

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "qa-addOns.zip". Extract the zip file and copy the content store-react/addOns into the specified path as given below

\
**Path - addOns/QuestionAndAnswer**

Add on location:&#x20;

&#x20;                                          &#x20;**&#x20; &#x20;**<mark style="color:green;">**projectFolder-> addOns**</mark>&#x20;

After placing it it will look like this

&#x20;                        <mark style="color:green;">**projectFolder->addOns-> QuestionAndAnswer**</mark>

**Step 2 : Update the configuration**

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce <mark style="color:green;">**addonsconfig.js**</mark> files. For this, you need to follow the steps below.

Once you finish the first Step now declare the necessary plugins in the addonconfig.js file

Import below line into the <mark style="color:green;">**addonconfig.js**</mark>

```
import  SpurtQuestionAndAnswer from './QuestionAndAnswer/QuestionandAnswer'
```

Add the QuestionandAnswer plugin into the below object

**export const AddonsComponent={**&#x20;

**SpurtQuestionAndAnswer }**

**Step 3 : Module Detail**

The modules pertaining to Question and Answer plugin are listed below. You may use these modules, you must send the productId to use this module in any page of Spurtcommerce.

QuestionandAnswer Component:

<mark style="color:green;">**{ConnectPlugin.SpurtQuestionAndAnswer &&\<ConnectPlugin.SpurtQuestionAndAnswer productId={productId}/>}**</mark>

**Step 4 : Run the application**

After you have integrated the **SpurtQuestionAndAnswer** Module into Spurtcommerce, you can use the following command to run the application.

```
$ npm run dev
```

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

**Step 5 : Make the build**

To run the below command

```
$ npm run build or yarn nun build

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spurtcommerce.com/addons/catalogue-related-addons/question-and-answer-add-on-old.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
