Abandoned Cart Addon

Installation of Spurtcommerce Abandoned Cart Addon

This document will help you to install Abandoned Cart add-on to your spurtcommerce server for single vendor as well as multi vendor

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 "abandonedcart-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 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 "abandonedcart.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 sales folder exists.

Inside sales/manage-orders folder paste abandoned folder.

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

export const abandonedRoutes=[

{

path:'abandoned_module', loadChildren:()=>import('./manage-orders/abandoned/abandonedcart.module').then(m=>

m.AbandonedCartModule),

canActivate: [AuthGuard]

}

]

2) Inside the addon if the sales 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

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

import * as fromAbandonedCart from '../add-ons/sales/manage-orders/abandoned/core/reducer/abandonedcart.reducer';
  1. Add the reducer into the below object

  abondonedCart: fromAbandonedCart.reducer,
  1. After adding its looks like below

export const AddOnReducers: ActionReducerMap<State> = {

abondonedCart: fromAbandonedCart.reducer,

};

Update State Config

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

abondonedCart: fromAbandonedCart.reducer,import { AbandonedCartStates } from '../add-ons/sales/manage-orders/abandoned/core/reducer/abandonedcart.state';
  1. Add the state into the below object

abondonedCart: AbandonedCartStates,
  1. After adding its looks like below

export interface AddOnAppState {

abondonedCart: AbandonedCartStates,

}

Step 3 : Change the routing file(manage-orders.routing.ts)

Inside the

/src/theme/default/admin/sales/components/manage-orders/manage-orders.routing.ts

If the point one already exists in your file, skip point one

  1. Import below line

import * as SalesInventoryRoutes  from 'add-ons/sales/sales.routing';
  1. Add these routes below the manageOrderRoutes array

manageOrderRoutes.forEach(data =>

{ if (data) { manageOrderRoutes.push(SalesInventoryRoutes.

abandonedRoutes[0]); }

});

For setting up the tab add this line in

/src/theme/default/admin/sales/components/header/header.component.html

Below line no=39

<li [appHideIfUnauthorized]="''" >

<a href="javascript:void(0)" [routerLink]="['/sales/manage-orders/abandoned_module']"

[routerLinkActive]="'active'">

{{'Sales.nav.Abandoned'|translate}}

</a>

</li>

Step 4 : Run the application

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

Last updated