Links

Product Attribute Add-on

Installation of Spurtcommerce Product Attribute Add-On
This document will help you to install Product Attribute 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 6: you can easily install vendor storefront with store setup. spurtcommerce provides 3 vendor storefronts, built with Angular, Flutter and React.

Installation of Spurtcommerce Product Attribute Add-On

About Addon :
The Installation of Spurtcommerce Product Attributes add-on will enable the feature of creation of attribute masters for the admin. When the plugin is installed, the multi-Vendor eCommerce portal becomes ready for the admin to create attribute masters that can be used for providing product specifications to the Customers.
Features
  • Create an attribute group, to list various attribute under that attribute group. For example, Laptop can be an attribute group.
  • Add various attributes under the attribute group. E.g., Under Laptop as the attribute group, various attributes can be operating system, memory disk space, etc.
  • Map attributes to the product. While mapping the attribute, they can provide the specification in the free text box available. E.g., if the attribute selected is operating system, in the free text box, you can enter Windows 11.
  • Once the attributes are added, it will display as product specifications in the product detail page.
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 "productattribute-addOn.zip". Extract the zip file and copy the content of api 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 executed for installation of the extension.
  • 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 "productattribute.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 catalog folder exists.
Inside cms folder paste productVarient folder.
In catalog routing file(catalog.routing.ts) paste the below code.
export const productAttributeRoutes = [
{
path: 'product_attribute',
loadChildren: () => import('./ProductAttributes/template/product_attribute.module').then(m => m.ProductAttributeModule),
canActivate: [AuthGuard],
},
];
2) Inside the addon if the catalog folder doesn’t exist.
Paste
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 fromProductAttribute
from'./catalog/ProductAttributes/core/reducer/productAttributes.reducer';
import * as fromProductAttributes from
'./catalog/ProductAttributes/core/attributes/attributes-reducer/attributes.reducer';
import * as fromProductAttributeGroup from
'./catalog/ProductAttributes/core/attributes-group/attributes-group-reducer/attributes-group.reducer';
Add the reducer into the below object
productAttribute: fromProductAttribute.reducer,
masterAttribute:fromProductAttributes.reducer,
masterAttributeGroup:fromProductAttributeGroup.reducer,
After adding its looks like below
export const AddOnReducers: ActionReducerMap<State> = {
productAttribute: fromProductAttribute.reducer,
masterAttribute:fromProductAttributes.reducer,
masterAttributeGroup:fromProductAttributeGroup.reducer,
};
Update State Config
Import below line into the add-ons/add-ons-state.ts
import { ProductAttributeState } from
'./catalog/ProductAttributes/core/reducer/productAttributes.state';
import { AttributeState } from
'./catalog/ProductAttributes/core/attributes/attributes-reducer/attributes.state';
import { AttributeGroupState } from
'./catalog/ProductAttributes/core/attributes-group/attributes-group-reducer/attributes-group.state';
Add the state into the below object
productAttribute: ProductAttributeState,
masterAttribute:AttributeState,
masterAttributeGroup:AttributeGroupState,
After adding its looks like below
export interface AddOnAppState {
productAttribute: ProductAttributeState,
masterAttribute:AttributeState,
masterAttributeGroup:AttributeGroupState,
}
Step 3 : Change the routing file(manageproduct.routing.ts)
Inside the src/theme/default/admin/catalog/components/manage-products/manage-products.routing.ts
If the point one already exists in your file, skip point one
Import below line
import * as catalogRouting from'../../../../../../../add-ons/catalog/catalog.routing';
Add these routes below the manageProductsRoute array
manageProductsRoute.forEach(data => {
if (data) {
manageProductsRoute.push(catalogRouting.
productAttributeRoutes[0]);
}
});
For setting up the tab add this line in
src/theme/default/admin/catalog/components/header/header.component.html/
Below line no:36
<li [appHideIfUnauthorized]="'product-attribute'" >
<a href="javascript:void(0)" [routerLink]="['/catalog/manage-products/product_attribute/product-list']" [routerLinkActive]="'active'">
Product Attributes
</a>
</li>
Step 4 : Run the application
After you have integrated the ProductAttribute 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.
Angular
Flutter
React
These are the steps that need to be followed to do the front end store setup.
  • Installing an extension
  • Update the configuration
  • Component 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 "productattribute.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 Component Config
Import below line into the add-ons/add-ons.shared.component
import { SpecificationControlsComponent } from
'./ProductAttributes/template/specification-controls/specification-controls.component';
Add the following components into the below object
SpecificationControlsComponent
After adding its looks like below
export const ADD_ON_COMPONENTS = [ SpecificationControlsComponent
]
Step 3 : Component Detail
The modules pertaining to productsAttributes are listed below. You may use these modules, in any page of Spurtcommerce.
In the ProductAttributes addon having one components.
SpecificationControlsComponent
SpecificationControlsComponent
Directive
<app-spurt-specification-controls [productId]="(productDetail.productDetails$ | async)?.productId">
In the above directive have one input field
ProductId:number;
Step 4 : Run the application
After you have integrated the Product Attributes module into Spurtcommerce, you can use the following command to run the application.
ng serve
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.
Extract the store-flutter folder inside the folder go to (store-fluter → add-ons → Attributes folder) and copy the Attribute folder and place the copied folder inside the add-ons folder inside the project folder
Add on location:
projectFolder->lib->add-ons
After placing it it will look like this
projectFolder->lib->add-ons->Attributes
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
projectFolder->lib->add-ons->addonsshared.dart
Then inside addonsShared array paste the following content
{"Attribute": SpurtAttribute(), "data":""},
After placing the above files it will look like this
List addonsShared = [ {"Attribute": SpurtAttribute(), "data":""}, ]; Then give the following imports import 'package:spurtcommerce/add-ons/Attributes/attributes.dart';
Or
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 rating and review to the user.
Attributes
Once you finished updating the configuration then in the projectFolder->lib->core->modules->detail->details.dart file update this line where you seem comfortable with
findMyClass("Attribute", {“ProductId”:details[“productId”]}),
Add this line to your side menu to get blogs section
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
In Run menu select run without debugging In case if throws any exception
$ 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 integrated
Step 5 : Make the build
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
These are the steps that need to be followed to do the front end store setup.
  • Installing an extension
  • Update the configuration
  • 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 "productattribute.addOns.zip". Extract the zip file and copy the content of store-react/addOns folder into the specified path as given below
Path - addOns/Attributes
Add on location:
projectFolder->addOns
After placing it it will look like this
projectFolder->addOns->Attributes
Step 2 : Update the configuration
After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce addonsconfig.js 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 addonconfig.js
import SpurtPartialSpecification from './Attributes/PartialSpecification'
Add the PartialSpecification into the below object
export const AddonsComponent={
SpurtPartialSpecification
}
Step 3 : Module Detail
The modules pertaining to Attributes are listed below. You may use these modules, in any page of Spurtcommerce.
SpurtAttributes Component:
{ConnectPlugin.SpurtPartialSpecification && <ConnectPlugin.SpurtPartialSpecification productId={product.productId} />}
Step 4 : Run the application
After you have integrated the Attributes 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.
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 "vendorproductattribute-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 executed for installation of the extension.
  • 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, spurtcommerce comes packed in a zip, whose name ends in "productattribute.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 fromProductAttribute from
'./ProductAttribute/core/reducer/ProductAttribute.reducer';
  • Add the reducer into the below object
productAttribute: fromProductAttribute.reducer,
  • After adding its looks like below
export const AddOnReducers: ActionReducerMap = { productAttribute: fromProductAttribute.reducer, };
Update State Config
  • Import below line into the add-ons/add-ons-state.ts
import { ProductAttributeState } from
"./ProductAttribute/core/reducer/ProductAttribute.state";
  • Add the state into the below object
productAttribute: ProductAttributeState;
  • After adding its looks like below
export interface AddOnAppState {
productAttribute: ProductAttributeState;
}
Import below line into the add-ons/add-ons-effect.ts
import { ProductAttributeEffect } from './ProductAttribute/core/effects/ProductAttribute.effect';
Add the effect into the below object
ProductAttributeEffect
After adding its looks like below
export const ADD_ON_EFFECT = [
ProductAttributeEffect,
];
Update Component Config
  1. 1.
    Import below line into the add-ons/add-ons.shared.ts
import { ProductAttributeListComponent } from "./ProductAttribute/template/product-attribute-list/product-attribute-list.component";
import { ProductAttributeUpdateComponent } from "./ProductAttribute/template/product-attribute-update/product-attribute-update.component";
Add the following components into the below object
ProductAttributeListComponent,
ProductAttributeUpdateComponent
After adding its looks like below
export const ADD_ON_COMPONENTS = [
ProductAttributeListComponent,
ProductAttributeUpdateComponent
]
Step 3 : Module Detail
The modules pertaining toProductAttributeListComponent,
and ProductAttributeUpdateComponent
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 ProductAttribute addon having two component.
  1. 1.
    ProductAttributeListComponent,
  2. 2.
    ProductAttributeUpdateComponent
Add the below steps to configure routing
In src/app/default/pages/component/calalog/manage-product/manage-product.module.ts
  1. 1.
    Import below line
import { ProductAttributeListComponent } from '../../../../../../../add-ons/ProductAttribute/template/product-attribute-list/product-attribute-list.component';
import { ProductAttributeUpdateComponent } from '../../../../../../../add-ons/ProductAttribute/template/product-attribute-update/product-attribute-update.component';
Add these routes below the Routes array
{
path: 'product-attribute-list',
component: ProductAttributeListComponent,
data: {
title: 'Product Attributes',
urls: [{ title: 'Home', url: '/dashboard' }, { title: 'Products', url: '/products/attribute' }, { title: 'Product Attributes' }]
}
},
{
path: 'product-attribut-update/:id',
component: ProductAttributeUpdateComponent,
data: {
title: 'Add Attribute Product',
urls: [{ title: 'Home', url: '/dashboard' }, { title: 'Products', url: '/products/add' }, { title: 'Add Attribute Products' }]
}
},
For setting up the tab add this line in
src/app/default/pages/catalog/layout/products.component.html
Below line = 20
<a href="#" [routerLink]="['/catalog/manage-products/product-attribute-list']" class="">Product Attributes</a>
Step 4 : Run the application
After you have integrated the ProductAttribute 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.
Angular
Flutter
React
These are the steps that need to be followed to do the front end store setup.
  • Installing an extension
  • Update the configuration
  • Component 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 "productattribute.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 Component Config
Import below line into the add-ons/add-ons.shared.component
import { SpecificationControlsComponent } from
'./ProductAttributes/template/specification-controls/specification-controls.component';
Add the following components into the below object
SpecificationControlsComponent
After adding its looks like below
export const ADD_ON_COMPONENTS = [ SpecificationControlsComponent
]
Step 3 : Component Detail
The modules pertaining to productsAttributes are listed below. You may use these modules, in any page of Spurtcommerce.
In the ProductAttributes addon having one components. SpecificationControlsComponent
SpecificationControlsComponent
Directive
<app-spurt-specification-controls [productId]="(productDetail.productDetails$ | async)?.productId">
In the above directive have one input field
ProductId:number;
Step 4 : Run the application
After you have integrated the Product Attributes module into Spurtcommerce, you can use the following command to run the application.
ng serve
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.
Extract the productattribute.zip file and place the extracted files inside the add-ons folder inside the project folder
Add on location:
projectFolder->lib->add-ons
After placing it it will look like this
projectFolder->lib->add-ons->Attributes
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
projectFolder->lib->add-ons->addonsshared.dart
Then inside addonsShared array paste the following content
{"Attribute": SpurtAttribute(), "data":""},
After placing the above files it will look like this
List addonsShared = [ {"Attribute": SpurtAttribute(), "data":""}, ];
Then give the following imports
import 'package:spurtcommerce/add-ons/Attributes/attributes.dart';
Or
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 rating and review to the user.
Attributes
Once you finished updating the configuration then in the projectFolder->lib->core->modules->detail->details.dart file update this line where you seem comfortable with
findMyClass("Attribute", {“ProductId”:details[“productId”]}),
Add this line to your side menu to get blogs section
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
In Run menu select run without debugging In case if throws any exception $ 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 integrated
Step 5 : Make the build
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
These are the steps that need to be followed to do the front end store setup.
  • Installing an extension
  • Update the configuration
  • 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 "productattribute.addOns.zip". Extract the zip file and copy the content of store folder into the specified path as given below.
Move Attributes folder from addOns/Attributes to
Path - <PROJECT_ROOT>/addOns
Add on location:
projectFolder->addOns
After placing it it will look like this
projectFolder->addOns->Attributes
Step 2 : Update the configuration
After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce addonsconfig.js 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 addonconfig.js
import SpurtPartialSpecification from './Attributes/PartialSpecification'
  • Add the PartialSpecification into the below object
export const AddonsComponent={
SpurtPartialSpecification
}
Step 3 : Module Detail
The modules pertaining to Attributes are listed below. You may use these modules, in any page of Spurtcommerce.
SpurtAttributes Component:
{ConnectPlugin.SpurtPartialSpecification && <ConnectPlugin.SpurtPartialSpecification productId={product.productId} />}
Step 4 : Run the application
After you have integrated the Attributes 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.