Common Product Add-on
About Addon :
The installation of Common Product addon will allow the Admin to convert a particular product, either their own or any vendor's as a common product, which means any vendor on the portal can sell the same product, by just updating the price at which they want to sell the product and the quantity they have of that product.
Features
Make any product from your entire product list, a common product, by just enabing the toggle.
You can make admin products as well as Vendor products, the common product that will be available for all the vendors to sell on the online portal.
The vendor can sell any product that is available on the list of common products, by simply updating the price and the quantity that they have.
The Product detail page of a common product, will display the common products, along with the vendor's name and their price.
The product detail page will show the list of all the vendors that are selling the same product.
Frontend Setup - Seller Panel:
Follow these steps to set up the front end for the Common Product addon in Spurtcommerce Seller Panel.
Step 1: Install the Addon:
Locate the Spurtcommerce addon package, typically named Seller.addOns.zip.
Extract the zip file and copy the CommonProduct folder into the addOns folder in your project.
projectFolder -> addOns
After this step, the structure should look like:
projectFolder -> addOns ->CommonProduct
Once completed, proceed to update the configuration.
Step 2: Update the Configuration
After installing the addon, update the add-ons.constant.ts file to include the necessary plugins:
// ------------------common product ------------
import * as commonProductComponent from './CommonProduct/template/common-productData.constant'
// components paths
export const commonProductComponents = commonProductComponent.componentLists;
// route paths
export const commonProductComponentRoutes = commonProductComponent.routePath;
If you wish to uninstall or remove the Common Product addon, replace the component paths and route paths with an empty array.
// ------------------common product ------------
import * as commonProductComponent from './CommonProduct/template/common-productData.constant'
// components paths
export const commonProductComponents = [];
// route paths
export const commonProductComponentRoutes = [];
export const ProductSeoServices = [];
Step 3: Run the Application:
To run the application with the integrated Common Product addon, use the following command:
$ npm run large-serveAfter executing this command, the addon will be available on Spurtcommerce on the designated page.
Step 4: Build the Application
Finally, to prepare the application for deployment, run the build command:
$ npm run large-buildThe latest build files will then be ready to deploy to the server.
Frontend Setup – Admin Panel:
Follow these steps to set up the front end for the Common Product addon in Spurtcommerce Admin Panel.
Step 1: Install the Addon:
Locate the Spurtcommerce addon package, typically named Admin.addOns.zip.
Extract the zip file and copy the Common Product folder into the addOns folder in your project.
projectFolder -> addOns
After this step, the structure should look like:
projectFolder -> addOns ->Marketplace->Manage Product->Vendor Product
Once completed, proceed to update the configuration.
Step 2: Update the Configuration
After installing the addon, update the add-ons.constant.ts file to include the necessary plugins:
// ---------------------common vendor products---------------------
import * as commonVendorProducts from './Marketplace/Manage Product/vendor-product/vendor-product.constant';
// components paths
export const commonVendorProductsComponents = commonVendorProducts.vendorProductComponents;
// route paths
export const commonVendorProductsRoutes = commonVendorProducts.routePath;
If you wish to uninstall or remove the Common Product addon, replace the component paths and route paths with an empty array.
// ---------------------common vendor products---------------------
import * as commonVendorProducts from './Marketplace/Manage Product/vendor-product/vendor-product.constant';
// components paths
export const commonVendorProductsComponents = [];
// route paths
export const commonVendorProductsRoutes = [];
Step 3: Run the Application:
To run the application with the integrated Common Product addon, use the following command:
$ npm run large-serveAfter executing this command, the addon will be available on Spurtcommerce on the designated page.
Step 4: Build the Application
Finally, to prepare the application for deployment, run the build command:
$ npm run large-buildThe latest build files will then be ready to deploy to the server.
Store Setup
Follow these steps to set up the Common Product module on the front-end Next.js web store.
Setup Overview:
Install the extension
Update configuration
Integrate the module
Run the application
Build the application
Step 1: Install the Extension
Locate the Spurtcommerce addon package, typically named addOns.zip.
Extract the zip file and copy the CommonProduct folder into the addOns folder in your project.
projectFolder -> addOns
After this step, the structure should look like:
projectFolder -> addOns -> CommonProduct
Once completed, proceed to update the configuration.
Step 2: Update the Configuration
After installing the extension, update the configuration in Spurtcommerce’s addonsconfig.js as follows:
Import the required line into addonsconfig.js.
Import CommonProductVendorCount from './CommonProduct/CommonProductVendorCount'Add the CommonProductVendorCount plugin to the specified object.
export const AddonsComponent = { CommonProductVendorCount, } Step 3: Module Details
The Common Product module includes the following components that you can utilize in any page within Spurtcommerce by sending the required product data as props:
CommonProductVendorCount Component
{ConnectPlugin.CommonProductVendorCount && <ConnectPlugin.CommonProductVendorCount productId={productDetail?.productId} />}Note: Use the CommonProductVendorCount component by passing the product data as a prop:
<ConnectPlugin.CommonProductVendorCount productId={productDetail?.productId} />Step 4: Run the Application
Once you have integrated the CommonProductVendorCount module, run the application using:
$ npm run devThis command will launch Spurtcommerce with the integrated Common Product module visible on the specified page.
Step 5: Build the Application
To prepare the application for deployment, execute the following command:
$ npm run buildor
$ yarn run build The latest build files will then be ready for server deployment.
Common Product Add-On
Follow these below steps are installing commonproduct addon
App setup
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.
Locate the Spurtcommerce addon package, typically named addons.zip.
Extract the zip file and copy the Common Product folder into the addons folder in your project.
projectFolder->lib->module->add-ons
After this step, the structure should look like:
projectFolder->lib->module->add-ons->CommonProducts
Once completed, proceed to update the configuration.
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->module->add-ons->addonsshared.dart
Then inside addonsShared array paste the following content
{"CommonProduct": SpurtCommonProduct(), "data": ""},
After placing the above files it will look like this,
List addonsShared = [
{"CommonProduct": SpurtCommonProduct(), "data": ""},
];
Then give the following imports
import 'package:spurtcommerce/module/add-ons/CommonProducts/page/commonproduct.dart';Or
There will be a popup for quick fix
Step 3 : Module details
After executing the above mentioned steps, we have to place these below lines in the module folder to show the commonproduct to the user.
Common Products
Once you finished updating the configuration then in the projectFolder->lib->module->Tab->Home->Product-detailpage->presentation->details.dart
Use this line for view the commonproduct
findMyClass('CommonProduct', {
"productId":
detail.details["productId"],
"details": detail.details
}),
After insert the line restart your application
Step 4 : Run the application
After integrating the commonproducts Module into Spurt Commerce, you can use the following commands to run the application in terminal.
$ flutter runOr
In Run menu select run without debugging
In case if throws any exception
$ flutter run –no-sound-null-safetyOnce you execute the above command you can view the installed module in Spurt Commerce, within the page in which you have integrated
Last updated