Ratings and Review Add-on

Installation of Spurtcommerce Ratings and Review Add-On

This document will help you to install Ratings and Review 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 Rating and Review Plugin helps to display the aggregate rating and review for products in the store. When this plugin is installed, the eCommerce site becomes ready for the Customers to post review about the product that they have purchased from the eCommerce store.

Features:

  • The Customer can provide a star rating.

  • The Customer can also add a comment along with the star rating.

  • Vendors and Admin can moderate the reviews.

  • Display of Reviews on the Storefront.

  • Display of number of 5 stars, 4 stars, 3 stars, 2 stars and 1s star ratings

  • Display of aggregate/overall rating.

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 "ratingandreview-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>/addon

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 "ratingand review-addOn.zip".

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

Path - admin/add-ons

Note:

Note:
In addon folder if already a cms folder exists.
Inside cms folder paste Rating and Review folder.
In cms routing file(cms.routing.ts) paste the below code.

export const ratingRoutes = [
 {
   path: 'rating_review',
   loadChildren: () => import('../cms/RatingAndReview/template/rating_review.module').then(m => m.RatingReviewModule),
   canActivate: [AuthGuard],
   data: { permissionForHeader: 'catalog-rating-review', root: 'catalog' }
 },
];
In addon folder if  cms folder doesn’t exists.
Paste the cms folder in addon.

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

1) Import below line into the add-ons/add-ons-reducer.ts

          import * as fromRatingReview from
'../add-ons/cms/RatingAndReview/core/ratingReview-reducer/ratingReview.reducer'

2) Add the reducer into the below object

ratingReview: fromRatingReview.reducer,

3) After adding its looks like below

export const AddOnReducers: ActionReducerMap<State> = {

ratingReview: fromRatingReview.reducer,

};

Update State Config

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

import { RatingReviewState } from
 '../add-ons/cms/RatingAndReview/core/ratingReview-reducer/ratingReview.state'

2) Add the state into the below object

ratingReview: RatingReviewState,

3) After adding its looks like below

export interface AddOnAppState {

ratingReview: RatingReviewState,

}

Step 3 : Change the routing file(cms.routing.ts)

Inside the src/theme/default/admin/cms/components/manage-content/manage.content.routing.ts

1)Import below line

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

Add these routes below the catalogRoutes array

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

2) For setting up the tab add this line in

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

Below line no:35

<li [appHideIfUnauthorized]="'catalog-rating-review'" >
                           <a href="javascript:void(0)" [routerLink]="['/cms/manage-content/rating_review']" [routerLinkActive]="'active'">
                           Ratings and Review
                           </a>
                           </li>

Step 4 : Run the application

After you have integrated the Rating and Review 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 "ratingand review-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

  1. Import below line into the add-ons/add-ons-reducer.ts

import * as fromRatingReview from 
'./RatingAndReview/core/reducer/ratingReview.reducer';

Add the reducer into the below object

ratingReview: fromRatingReview.reducer,

After adding its looks like below

export const AddOnReducers: ActionReducerMap<State> = {
                    	ratingReview: fromRatingReview.reducer
       	}

Update State Config

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

import { RatingReviewState } from 
            	  './RatingAndReview/core/reducer/ratingReview.state';

Add the state into the below object

ratingReview: RatingReviewState;

After adding its looks like below

export interface AddOnAppState {
ratingReview: RatingReviewState;
}

update effect config

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

	import {RatingReviewEffect} from 
	'./RatingAndReview/core/effects/ratingReview.effect';

Add the effect into the below object

RatingReviewEffect

After adding its looks like below

export const ADD_ON_EFFECT = [ RatingReviewEffect, ];

Update Component Config

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

import {RatingComponent} from './RatingAndReview/template/rating/rating.component';
import { ReviewControlsComponent } from './RatingAndReview/template/review-controls/review-controls.component';
import {ReviewComponent} from './RatingAndReview/template/review/review.component';

  1. Add the following components into the below object

RatingComponent
ReviewControlsComponent
ReviewComponent

After adding its looks like below

export const ADD_ON_COMPONENTS = [ RatingComponent, ReviewControlsComponent, ReviewComponent ];

Step 3 : Module Detail

The modules pertaining to ratings and reviews 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 Ratings and Reviews in Spurtcommerce pages.

In the rating and review addon having three components.

  1. RatingComponent

  2. ReviewControlsComponent

  3. ReviewComponent

RatingComponent

Directive

<app-spurt-star-rating [rating]=”<rating>” [productId]="productId" [isDetail]="true/false"></app-spurt-star-rating>

ReviewControlsComponent

Directive

  	<app-spurt-review-controls [productSlug]="id"></app-spurt-review-controls>

In the above directive have one input fields

Review component

This is a one page component. You can configure the route for this component.

This component only works with orderProductID.

Because after placing the order only the user can give the rating.

Whatever application module you can configure this route. For eg

src/default/pages/account/account.module.ts import line;

import { ReviewComponent } from '../../../../add-ons/RatingAndReview/template/review/review.component';

Config this route in src/default/pages/account/account.module.ts inside route array add this following object

	{
path: 'review/:id',
component: ReviewComponent,
data: {
breadcrumb: 'Review',
urls: [
{ title: 'Account' },
{ title: 'Order History' },
{ title: 'Order Details' },
{ title: 'Review this product' }
]
}
},
 

     

     
 
Param <:ID> is refer to the orderProductID

Step 4 : Run the application

After you have integrated the Rating and Review 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.

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

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

Extract the zip file and copy the content of api folder into the specified path

Path - <PROJECT_ROOT>/addon

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 vendor 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 "vendorratingandreview-addOn.zip".

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

Path - vendor/add-ons

Step 2 : Update the configuration add-ons/add-ons-reducer.ts

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 fromRatingReview from
    '../add-ons/RatingAndReview/core/reducer/RatingReview.reducer';

Add the reducer into the below object

ratingReview: fromRatingReview.reducer,

After adding its looks like below

export const AddOnReducers: ActionReducerMap<State> = {

ratingReview: fromRatingReview.reducer,

};

Update State Config add-ons/add-ons-reducer.ts

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


import { RatingReviewState } from 
'../add-ons/RatingAndReview/core/reducer/RatingReview.state'

Add the state into the below object

ratingReview: RatingReviewState,

After adding its looks like below

export interface AddOnAppState {

ratingReview: RatingReviewState,

}

Update Effect Config

1) Import below line into the add-ons/add-ons.effect.ts

  import { RatingReviewEffect } from  
  '../add-ons/RatingAndReview/core/effects/RatingReview.effect';

2) Add the effect into the below object

RatingReviewEffect

3) After adding its looks like below

export const ADD_ON_EFFECT = [

RatingReviewEffect,

];

Update Component Config

4) Import below line into the add-ons/add-ons.shared.component.ts

import { RatingreviewComponent } from "./RatingAndReview/template/ratingreview/ratingreview.component";

Add the following components into the below object

RatingreviewComponent

After adding its looks like below

export const ADD_ON_COMPONENTS = [

RatingreviewComponent

];

Step 3 : Module Detail

The modules pertaining to ratings and reviews 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 Ratings and Reviews in Spurtcommerce pages.

In the rating and review addon having one component.

1) RatingreviewComponent

Add the below steps to configure routing

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

  1. Import below line

import { RatingreviewComponent } from '../../../../../../../add-ons/RatingAndReview/template/ratingreview/ratingreview.component';

 

2) Add these routes below the Routes and childrens

array

        {
       path: 'rating-review',
       component: RatingreviewComponent,
       data: {
           title: 'Rating  and Review',
           urls: [{ title: 'Home' , url: '/dashboard'}, { title: 'CMS', url: '/cms/manage-content' },{ title: 'Manage content', url: 'cms/manage-content' }, { title: 'Rating and Review' }]
       }
   },

For setting up the tab add this line in

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

Below line no: 37

    <a href="javascript:void(0)" [routerLink]="['/cms/manage-content/rating-review']" class="">Rating and Review</a>
                                 

Step 4 : Run the application

After you have integrated the Rating and Review 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 "ratingand review-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

  1. Import below line into the add-ons/add-ons-reducer.ts


	import * as fromVendorRatingReview from 
	'./VendorRatingAndReview/core/reducer/vendorRatingReview.reducer';

Add the reducer into the below object

vendorRatingReview: fromVendorRatingReview.reducer,

After adding its looks like below

export const AddOnReducers: ActionReducerMap<State> = {
                    	ratingReview: fromRatingReview.reducer
       	}

Update State Config

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

     import { RatingReviewState as VendorRatingReviewState} from 
     './VendorRatingAndReview/core/reducer/vendorRatingReview.state';

Add the state into the below object

vendorRatingReview: VendorRatingReviewState,

After adding its looks like below

export interface AddOnAppState {
ratingReview: RatingReviewState;
}

update effect config

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

	  	import {VendorRatingReviewEffect} from 
	'./VendorRatingAndReview/core/effects/vendorRatingReview.effect';

Add the effect into the below object

VendorRatingReviewEffect,

After adding its looks like below

export const ADD_ON_EFFECT = [ RatingReviewEffect, ];

Update Component Config

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

   import {VendorReviewControlsComponent} from 
   './VendorRatingAndReview/template/vendor-review-controls/vendor-review-controls.component';


  1. Add the following components into the below object

VendorReviewControlsComponent,

After adding its looks like below

export const ADD_ON_COMPONENTS = [

VendorReviewControlsComponent,

];

Step 3 : Module Detail

The modules pertaining to vendor-rating and review 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 Vendor-rating and review in Spurtcommerce pages.

In the vendorRatingAndReviews addon having one components.

1) VendorReviewControlsComponent,

VendorReviewControlsComponent

Directive

<app-spurt-vendor-review-controls[vendorId]=”vendorId”></app-spurt-vendor-review-controls>

In the above directive have one input field

vendorId:numeric

Step 4 : Run the application

After you have integrated the Rating and Review 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