SEO

Installation of Spurtcommerce Product Variant Add-On

This document will help you to install Product Variant 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: Store setup

About addon

This document will help you to install SEO addon to your spurtcommerce Community Edition. This addon is a default integration in Multi-Vendor. When this plugin is installed, your eCommerce portal can be optimized for search engine with meta tags.

Features:

  • In Admin, under 'Manage SEO' admin can either select Product, Category, Pages or Blogs.

  • On selecting a particular option, the list page appears, with an option adjacent to each of the items as 'Update Meta'.

  • On clicking on 'Update Meta' a pop-up opens, where the admin can update the title, description and keywords.

  • On saving the same, the Meta tags for a particular option - either product, category, blogs or pages gets updated.

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

Admin Setup

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

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

Path - admin/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 fromBlogSeo from './cms/seo/blog-seo/core/reducer/blog-seo.reducer';
import * as fromCategorySeo from './cms/seo/category-seo/core/reducer/category-seo.reducer';
import * as fromPageSeo from './cms/seo/page-seo/core/reducer/page-seo.reducer';

import * as fromProductSeo from './cms/seo/product-seo/core/reducer/product-seo.reducer';

import * as fromGenerateSiteMap from './cms/site-map/core/generatesitemap-reducer/generatesitemap.reducer';

Add the reducer into the below object

blogSeo: fromBlogSeo.reducer,

categorySeo: fromCategorySeo.reducer,

pageSeo: fromPageSeo.reducer,

productSeo: fromProductSeo.reducer,

Generatesitemap: fromGenerateSiteMap.reducer

  1. After adding its looks like below


export const AddOnReducers: ActionReducerMap<State> = {
            blogSeo: fromBlogSeo.reducer,
                                               categorySeo: fromCategorySeo.reducer,
                                               pageSeo: fromPageSeo.reducer,
                                              productSeo: fromProductSeo.reducer,
                                       Generatesitemap: fromGenerateSiteMap.reducer


};



Update State Config

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

 import { BlogSeoState } from './cms/seo/blog-seo/core/reducer/blog-seo.state';

import { CategorySeoState } from 
           './cms/seo/category-seo/core/reducer/category-seo.state';

import { PageSeoState } from './cms/seo/page-seo/core/reducer/page-seo.state';

import { ProductSeoState } from './cms/seo/product-seo/core/reducer/product-seo.state';
import { GeneratesitemapState } from './cms/site-map/core/generatesitemap-reducer/generatesitmap.state';
  1. Add the state into the below object

blogSeo: BlogSeoState,

categorySeo: CategorySeoState,

pageSeo: PageSeoState,

productSeo: ProductSeoState,

Generatesitemap: GeneratesitemapState

  1. After adding its looks like below

export interface AddOnAppState {

blogSeo: BlogSeoState,

categorySeo: CategorySeoState,

pageSeo: PageSeoState,

productSeo: ProductSeoState,

Generatesitemap: GeneratesitemapState

}

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

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

  1. Import below line

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

2. Add these routes below the manageSeoRoutes array

manageSeoRoutes.push(cmsRouting.productSeoRoutes[0]);

manageSeoRoutes.push(cmsRouting.categorySeoRoutes[0]);

manageSeoRoutes.push(cmsRouting.blogSeoRoutes[0]);

manageSeoRoutes.push(cmsRouting.pageSeoRoutes[0]);

manageSeoRoutes.push(cmsRouting.siteMapRoutes[0]);

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

Below line no:82

 <li [appHideIfUnauthorized]="'cms-blogs'" >
                           <a href="javascript:void(0)" [routerLink]="['/cms/manage-seo/product_seo']" [routerLinkActive]="'active'">
                               Product
                           </a>
                       </li>

                       <li [appHideIfUnauthorized]="'cms-blogs'" >
                           <a href="javascript:void(0)" [routerLink]="['/cms/manage-seo/category_seo']" [routerLinkActive]="'active'">
                               Category
                           </a>
                       </li>


                       <li [appHideIfUnauthorized]="'cms-blogs'" >
                           <a href="javascript:void(0)" [routerLink]="['/cms/manage-seo/page_seo']" [routerLinkActive]="'active'">
                               Pages
                           </a>
                       </li>


                       <li [appHideIfUnauthorized]="'cms-blogs'" >
                           <a href="javascript:void(0)" [routerLink]="['/cms/manage-seo/blog_seo']" [routerLinkActive]="'active'">
                               Blog
                           </a>
                       </li>

 <li [appHideIfUnauthorized]="'cms-blogs'" >
                           <a href="javascript:void(0)" [routerLink]="['/cms/manage-seo/sitemap']" [routerLinkActive]="'active'">
                               Sitemap
                           </a>
                       </li>

Step 4 : Run the application

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

 npm run large-serve

Store Setup

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

Update Component Config

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.

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

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

import { ProductSeoComponent } from './seo/Product-seo/template/product-seo/product-seo.component';
import { CategorySeoComponent } from './seo/category-seo/template/category-seo/category-seo.component';
import { PageSeoComponent } from './seo/page-seo/template/page-seo/page-seo.component';
import { BlogSeoComponent } from './seo/blog-seo/template/page-seo/blog-seo.component';
  1. Add the following components into the below object

1) ProductSeoComponent,

2) CategorySeoComponent,

3) PageSeoComponent,

4) BlogSeoComponent,

3. After adding its looks like below

export const ADD_ON_COMPONENTS = [

1) ProductSeoComponent,

2) CategorySeoComponent,

3) PageSeoComponent,

4) BlogSeoComponent,

]

Step 3 : Module Detail

The modules pertaining to seo 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 seo in Spurtcommerce pages.

In the seo addon having four components.

ProductSeoComponent,

CategorySeoComponent,

PageSeoComponent,

BlogSeoComponent,

ProductsSeoComponent

Directive

   <app-product-seo [productSlug]="id"></app-product-seo>in

CategorySeocomponent

Directive

 <app-category-seo [categorySlug]="categorySlug"></app-category-seo>                 

pageSeocomponent

Directive

   <app-page-seo [pageSlug]="pageId"></app-page-seo>

BlogSeocomponent

Directive

    <app-blog-seo [blogSlug]="blogId"></app-blog-seo>

Step 4 : Run the application

After you have integrated the Blogs 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