Question and Answer Add-on

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: Setup an API (Step By Step) to add extension for admin

step 2: Admin setup

step 3: you can easily install admin storefront with store setup. spurtcommerce provides 3 admin storefronts, built with Angular, Flutter and React.

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

step 4: Setup an API (Step By Step) to add extension for multi vendor

step 5 : Multi Vendor front end setup

step 6: you can easily install vendor storefront with store setup. spurtcommerce provides 3 vendor storefronts, built with Angular, Flutter and React.

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.

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

  • Installing an extension

  • Run the application

  • 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 "questionandanswer-addOn.zip". Extract the zip file, open api folder and open addon folder within that and copy the content of addon folder into the specified path

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.

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

  • Installing an extension

  • Update the configuration

  • Module Detail

  • Run the application

  • 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".

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

Path - admin/add-ons

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.

export const questionAnswerRoutes = [

{

path: 'question_answer',

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

canActivate: [AuthGuard],

},

];

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

Paste the cms folder in add-ons.

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 add-ons/add-ons-reducer.ts


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

Add the reducer into the below object

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 add-ons/add-ons-state.ts

   
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

export interface AddOnAppState {

questionAnswer: questionAnswerState;

}

Step 3 : Change the routing file(cms.routing.ts) Inside the src/theme/default/admin/cms/components/manage-content/manage-content.routing.ts

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

In src/theme/admin/cms/components/header.component.html

Below line no:30

<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.

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

  • Installing an extension

  • Update the configuration

  • Module Detail

  • Run the application

  • 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".

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

Path - store-angular/add-ons

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 add-ons/add-ons-reducer.ts

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

Add the reducer into the below object

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 add-ons/add-ons.effect.ts

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

Add the effect into the below object

QuestionAnswerEffect

After adding its looks like below

export const ADD_ON_EFFECT = [

QuestionAnswerEffect

];

Update State Config

Import below line into the add-ons/add-ons-state.ts

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

Add the state into the below object

questionAndAnswer: questionAnswerState;

After adding its looks like below

export interface AddOnAppState {

questionAndAnswer: questionAnswerState;

}

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

PostQuestionComponent,

ReportAbuseComponent,

PostAnswerComponent,

ProductQuestionComponent,

ControlsQuestionsComponent,

AnswerListComponent

  • 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,

  2. ReportAbuseComponent,

  3. PostAnswerComponent,

  4. ProductQuestionComponent,

  5. ControlsQuestionsComponent,

  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.

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

  • Installing an extension

  • Run the application

  • 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 "vendorquestionandanswer-addOn.zip".

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

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.

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

  • Installing an extension

  • Update the configuration

  • Module Detail

  • Run the application

  • 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".

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

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 add-ons/add-ons-reducer.ts

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



Add the reducer into the below object

questionAnswer: fromQuestionAnswer.reducer,

After adding its looks like

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


	                                      
                                        

Update State Config

Import below line into the add-ons/add-ons-state.ts

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

Add the state into the below object

questionAnswer: ProductState;                   

After adding its looks like below

export interface AddOnAppState {

questionAnswer: ProductState;

}

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

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

Add the effect into the below object

ProductEffect,

After adding its looks like below

export const ADD_ON_EFFECT = [

ProductEffect

];

Update Component Config add-ons / add-ons.shared.component.ts

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";

Add the following components into the below object

addOnQuestionsDetailComponent,

addOnQuestionComponent,

addOnProductListComponent,

After adding its looks like below

export const ADD_ON_COMPONENTS = [

addOnQuestionsDetailComponent,

addOnQuestionComponent,

addOnProductListComponent

]

Step 3 : Module Detail

The modules pertaining to productvariantlist and productvariantupdate 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 Product Variant in Spurtcommerce pages.

In the ProductQuestionAndAnswer addon having two component.

VariantProductListComponent,

VariantProductAddComponent

Routing

In src/app/default/pages/component/cms/manage-content/manage-content.module

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';

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

src/app/default/pages/component/cms/layout/products.component.html

Below line no:37

<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>

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.

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

  • Installing an extension

  • Update the configuration

  • Module Detail

  • Run the application

  • 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".

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

Path - store-angular/add-ons

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 add-ons/add-ons-reducer.ts

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

Add the reducer into the below object

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 add-ons/add-ons.effect.ts

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

Add the effect into the below object

QuestionAnswerEffect

After adding its looks like below

export const ADD_ON_EFFECT = [

QuestionAnswerEffect

];

Update State Config

Import below line into the add-ons/add-ons-state.ts

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

Add the state into the below object

questionAndAnswer: questionAnswerState;

After adding its looks like below

export interface AddOnAppState {

questionAndAnswer: questionAnswerState;

}

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

PostQuestionComponent,

ReportAbuseComponent,

PostAnswerComponent,

ProductQuestionComponent,

ControlsQuestionsComponent,

AnswerListComponent

  • 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,

  2. ReportAbuseComponent,

  3. PostAnswerComponent,

  4. ProductQuestionComponent,

  5. ControlsQuestionsComponent,

  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.

Last updated