# Product Variant Add-on old

**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: [<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>](#store-setup)<mark style="color:blue;">**.**</mark> 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)</mark>](#setup-an-api-step-by-step-to-add-extension-for-multivendor) to 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,</mark>](#store-setup-1) [<mark style="color:blue;">Flutter</mark> ](#store-setup-1)and [<mark style="color:blue;">React.</mark>  ](#store-setup-1)

**About Addon:**

The Installation of Spurtcommerce Product Variant add-on will enable the feature of adding variant master When the plugin is installed, the multi-Vendor eCommerce site becomes ready for the admin and vendors to add variants under products and get them displayed for the visitors to view different variants in the same product.&#x20;

**Features:**&#x20;

* The admin can create a master of variants. E.g., Colour or Size.
* The admin can then add different variant values under the variant name. E.g., Under colour, they can add different values like red, green, blue, etc.
* When the admin is listing a main product, they can choose different variants available in the masters to list different variants available for the same product.
* While listing variants, they can specify different pricing for different variants and also specify the inventory (quantity stock available) for each variant separately.
* For each variant under the same product, the SKU prefix followed by a unique number gets allocated. So, each variant under a product will have a unique SKU.
* When the Vendor is listing a main product, they can choose different variants available in the variants master list created by the admin, in order to list different variants available for the same product.&#x20;
* While listing variants, they can specify different pricing for different variants and also specify the inventory (quantity stock available) for each variant separately.

#### [<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**&#x20;

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;">**"productvariant-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>/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.

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

These are the steps that need to be followed to do the front end admin 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 "productvariant.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 catalog folder exists.

Inside cms folder paste productVarient folder.

<br>

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

<br>
{% endhint %}

```
export const productVariantRoutes = [
  {
    path: 'product_variant',
    loadChildren: () => import('./ProductVariant/template/product_variant.module').then(m => m.ProductVariantModule),
    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 <mark style="color:green;">**add-ons/add-ons-reducer.ts**</mark>

```
import * as fromProductVariant from
 './catalog/ProductVariant/core/reducer/productVariant.reducer';      
```

* Add the reducer into the below object

```
  variantList: fromProductVariant.reducer, 
```

* After adding its looks like below

```
export const AddOnReducers: ActionReducerMap<State> = {
    variantList: fromProductVariant.reducer, 
};
```

**Update State Config**

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

```
 import { ProductVariantState } from                 
  './catalog/ProductVariant/core/reducer/productVariant.state';
```

* Add the state into the below object

```
variantList: ProductVariantState
```

* After adding its looks like below

```

export interface AddOnAppState {
    variantList: ProductVariantState;
}


```

**Step 3 : Change the routing file(**<mark style="color:green;">**manageproduct.routing.ts**</mark>**) Inside the&#x20;**<mark style="color:green;">**src/theme/default/admin/catalog/components/manage-products/manage-products.routing.ts**</mark>

Import below line

```
   import * as catalogRouting from'../../../../../../../add-ons/catalog/catalog.routing';


```

Add these routes below the *manageProductsRoute* array

<pre><code><strong> manageProductsRoute.forEach(data => {
</strong> if (data) {
           manageProductsRoute.
           push(catalogRouting.productVariantRoutes[0]);
            }
                                                             });

                                                          




</code></pre>

For setting up the tab add this line in

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

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

```
<li [appHideIfUnauthorized]="'product-variant'">
                       <a href="#" [routerLink]="['/catalog/manage-products/product_variant/product-list']" [routerLinkActive]="'active'">
                           Product Variants
                       </a>
                   </li>
```

**Step 4 :** Filters configurations

&#x20;Change the routing file (<mark style="color:green;">**variant-routing.module.ts**</mark>)

Inside the <mark style="color:green;">**/add-ons/catalog/ProductVariant/template/variant/variant-routing.module.ts**</mark>

1\) Import below line

```
import { VariantLayoutComponent } from './variant-layout/variant-layout.component';

```

&#x20;Add these routes below the variants array

&#x20;                               {

&#x20;                                   path: 'filters', loadChildren: () =>

&#x20;                                   import('./filters/filters.module').then(m =>&#x20;

&#x20;                                    m.FiltersModule), canActivate: \[AuthGuard],&#x20;

&#x20;                                 data: { permissionForHeader: 'settings-site-filters', root: 'settingsSite' }&#x20;

&#x20;                        }

For variants up the tab add this line in

**/add-ons/catalog/ProductVariant/template/variant/variant-layout/variant-layout.component.html**

**Below line =13**

\<button \[appHideIfUnauthorized]="'filters'"&#x20;

\[routerLinkActive]="'active'"\[routerLink]="\[

'/catalog/manage-products/product\_variant/variant-settings/filters/list']" routerLinkActive="active" class="tablinks">

Filters

\</button>

**Step 5 : Run the application**

After you have integrated the product attribute 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 6 : 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;Component Detail
* 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 "productvariant.addOn.zip".

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

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

&#x20;        &#x20;

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

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

```
  import { ControlsVariantComponent } from 
  './ProductVariant/template/controls-variant/controls-variant.component';
```

* Add the following components into the below object

&#x20;                              ControlsVariantComponent

* After adding its looks like below

```
export const ADD_ON_COMPONENTS = [ ControlsVariantComponent 
                     ]

```

**Step 3 : Component Detail**&#x20;

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

In the ProductVariants addon having one components. <mark style="color:blue;">ControlsVariantComponent</mark>

**ControlsVariantComponent**

&#x20;                                       Directive

```
 <app-spurt-controls-variant  [productId]="(productDetail.productDetails$ | async)?.productId" (varPrice)="VarPrice($event)"></app-spurt-controls-variant>
     
```

In the above directive have one input field

&#x20;                                     **ProductId:number;**

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

After you have integrated the ControlsVariantComponent 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-flutter → add-ons → ProductVariant folder) and copy the ProductVariant folder  and place the copied folder into the addon folder

<br>

Add on location:&#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->ProductVariant**</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

```
  {"Variant": SpurtProductVariant(), "data":""},
```

After placing the above files it will look like this

```
List addonsShared = [

   {"Variant": SpurtProductVariant(), "data":""},
];

```

Then give the following imports

*import 'package:spurtcommerce/addons/ProductVariant/productvariant.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 rating and review to the user.

**ProductVariant**&#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("Variant", {“Id”: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 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.&#x20;

* Installing an extension&#x20;
* Update the configuration
* &#x20;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 "productvariant-addOns.zip". Extract the zip file and copy the content of  store-react/addOns folder into the specified path as given below

\
**Path -addOns/Varient**

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

*projectFolder->addOns*&#x20;

**After placing it it will look like this**&#x20;

*projectFolder->addOns->Varient*

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

intoImport below line the addonconfig.js

```
import SpurtVarientComponent from './Varient/VarientComponent'

```

Add the VarientComponent into the below object    &#x20;

```
export const AddonsComponent={
SpurtVarientComponent
}

```

**Step 3 : Module Detail**

The modules pertaining to Varient are listed below. You may use these modules, in any page of Spurtcommerce.&#x20;

SpurtVarientComponent Component:     &#x20;

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

<br>

**Step 4 : Run the application**

After you have integrated the *Varient* 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;">**Setup an API (Step By Step) to add  extension for multi vendor**</mark>](#setup-an-api-step-by-step-to-add-extension-for-multivendor)

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**&#x20;

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;">**"vendorproductvariant-addOn.zip".**</mark> Extract the zip file and copy the content of api folder into the specified path

&#x20;                                      **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.

### [<mark style="color:blue;">Multi vendor frontend  Setup</mark> ](#vendor-setup)

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

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

**Step 1 : Installing an extension**

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

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

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

&#x20;    &#x20;

**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.&#x20;

Update Reducer Config

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

```
 import * as fromProductVariant from './ProductVariant/core/reducer/productVariant.reducer';

```

2\. Add the reducer into the below object

&#x20;    variantList: fromProductVariant.reducer

3.After adding its looks like below

&#x20;**export const AddOnReducers: ActionReducerMap\<State> = {**

&#x20;                                                   **variantList: fromProductVariant.reducer**

&#x20;                                           **};**

Update State Config

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

```
   import { ProductVariantState } from "./ProductVariant/core/reducer/productVariant.state";

```

2\. Add the state into the below object

&#x20;        variantList:ProductVariantState;

3\. After adding its looks like below

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

&#x20;                                    **variantList:ProductVariantState;**

&#x20;                                **}**

**Update Effect Config**

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

```
 import { ProductVariantEffect } from "./ProductVariant/core/effect/productVariant.effect";
```

2\. Add the effect into the below object

&#x20;                                   ProductVariantEffect

After adding its looks like below

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

&#x20;                                    **ProductVariantEffect**

**];**

**Update Component Config**

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

```
   import { VariantProductListComponent } from "./ProductVariant/template/product-list/list.component";

```

```
import { VariantProductAddComponent } from "./ProductVariant/template/product-update/add.component";
```

1. Add the following components into the below object

&#x20; VariantProductListComponent,

&#x20; VariantProductAddComponent

After adding its looks like below

**export const ADD\_ON\_COMPONENTS = \[**

&#x20;                       **VariantProductListComponent,**

&#x20;                       **VariantProductAddComponent**

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

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

In the *ProductVariant* addon having two component.&#x20;

&#x20;                                   *VariantProductListComponent,*&#x20;

&#x20;                                   *VariantProductAddComponent*

Routing&#x20;

In <mark style="color:green;">**src/app/default/pages/component/calalog/manage-product/manage-product.module.ts**</mark>

Import below line

```

      import { VariantProductListComponent } from ../'../../../../../../add-ons/ProductVariant/template/product-list/list.component';

import { VariantProductAddComponent } from '../../../../../../../add-ons/ProductVariant/template/product-update/add.component';

```

Add these routes below the Routes array

<pre><code>      
             {
                path: 'product-variant-list',
                component: VariantProductListComponent,
                data: {
                    title: 'Variant Products',
                    urls: [{ title: 'Home', url: '/dashboard' }, { title: 'Products', url: '/products/list' }, { title: 'Variant Products' }]
                }
              },
              {
                path: 'product-variant-update/:id',
                component: VariantProductAddComponent,
                data: {
                    title: 'Add Variant Product',
                    urls: [{ title: 'Home', url: '/dashboard' }, { title: 'Products', url: '/products/add' }, { title: 'Add Variant Products' }]
                }
              },




<strong>
</strong>


</code></pre>

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

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

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

```
  <a href="#" [routerLink]="['/catalog/manage-products/product-variant-list']" class="">Product Variants</a>

```

**Step 4 : Run the application**

After you have integrated the ProductVariant 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;Component Detail
* 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 "productvariant.addOn.zip".

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

&#x20;           &#x20;

**Path - \<PROJECT\_ROOT>/add-ons**

&#x20;     &#x20;

&#x20;        &#x20;

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

&#x20;**Update Component Config**

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

```
   import { ControlsVariantComponent } from './ProductVariant/template/controls-variant/controls-variant.component';

```

2\. Add the following components into the below object&#x20;

&#x20;     ControlsVariantComponent&#x20;

After adding its looks like below

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

&#x20;                    **]**

**Step 3 : Component Detail**&#x20;

The modules pertaining to productsVariants are listed below. You may use these modules, in any page of Spurtcommerce.&#x20;

In the ProductVariants addon having one components.

1. ControlsVariantComponent

ControlsVariantComponent\
Directive

```
 <app-spurt-controls-variant  [productId]="(productDetail.productDetails$ | async)?.productId" (varPrice)="VarPrice($event)"></app-spurt-controls-variant> 
```

&#x20; In the above directive have one input field

\
&#x20; ProductId:number;

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

After you have integrated the ControlsVariantComponent 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 vendorproductvariant.zip file and place the extracted files inside the add-ons folder inside the project folder

**Add on location:**&#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->ProductVariant**</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

```
  {"Variant": SpurtProductVariant(), "data":""},
```

After placing the above files it will look like this

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

Then give the following imports

```
import 'package:spurtcommerce/add-ons/ProductVariant/productvariant.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.

ProductVariant

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("Variant", {“Id”: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
```

$ flutter run –no-sound-null-safety

&#x20;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
```

{% endtab %}

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

* &#x20;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 "vendorproductvariant.addOns.zip". Extract the zip file and copy the content of store folder into the specified path as given below

Move Variant folder from addOns/Variant to&#x20;

&#x20;                             Path - \<PROJECT\_ROOT>/addOns

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

*projectFolder->addOns*&#x20;

**After placing it it will look like this**&#x20;

*projectFolder->addOns->Variant*

**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 <mark style="color:green;">**addonconfig.js**</mark>

```
import SpurtVarientComponent from 
'./Variant/VariantComponent'
```

* **Add the VarientComponent into the below object**   &#x20;

```
export const AddonsComponent={
SpurtVariantComponent
}
```

&#x20;**Step 3 : Module Detail**

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

**SpurtVariantComponent Component:**    &#x20;

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

**Step 4 : Run the application**

After you have integrated the Variant 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 %}
{% 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/product-variant-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.
