vendure-salestracker-plugin

A Vendure Ecommerce plugin for tracking sales

Usage no npm install needed!

<script type="module">
  import vendureSalestrackerPlugin from 'https://cdn.skypack.dev/vendure-salestracker-plugin';
</script>

README

Vendure SalesTracker Plugin

This is a plugin for the Vendure e-commerce framework designed for Sales tracking of any product variant sold.

It also contains the feature where you can setup a custom unit type for you goods unit tracking like Piece, Kg, Dozen, Liter and so.

After setting of your vendure project, you can just use this plugin via npm install:

npm install vendure-salestracker-plugin

and then include it to vendure-config file as below:


import { SalesTrackerPlugin } from "vendure-salestracker-plugin";
...
export const config: VendureConfig = {
  ...
  plugins: [
    ...,
    SalesTrackerPlugin
  ]
}

After the recompiltation, you get your Admin UI customized where you may update the sales and unit of measurement manualy as below:

And the mutations are exposed to Shop API to update entire product variant sales or just increase product variant sales.

Update Sales Value

    input SalesTrackerInput{
      productVariantId: ID!
      sales: Int
    }
    
    extend type Mutation{
       updateTotalSales(input:[SalesTrackerInput!]!):Boolean!
    }

Increase Sales Value

   input SalesTrackerInput{
      productVariantId: ID!
      sales: Int
    }
    
    extend type Mutation{
       increaseTotalSales(input:[SalesTrackerInput!]!):Boolean!
    }

Note: The UnitType field is just a feature added to make your storefront or unit tracking easier. It has nothing to do with the sales tracking algorithm.