• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

If You like to integrate Vue Storefront - PWA for eCommerce with 3rd party platform, use this SDK

Vue Storefront Custom Integration Tutorial

Vue Storefront is platform agnostic which means it can be connected to virtually any eCommerce backend and CMS. This repository is created to make the integration with any 3rd party backend platform as easy as possible.

Note: This tutorial shows how to build a Generic integration for any custom backend API. This is the recommended approach giving you most of the Vue Storefront features of the box. Check the other options...

Three steps for the integration

  • Step One Vue Storefront uses Elastic Search as backend for all catalog operations. We do have three default types of entities that must be supported: product, category, attribute and three optional entities taxrule, cms_block and cms_page in the ES. You may find some sample-data json files in sample-data subdirectory.

  • Step Two The second step is to support the dynamic calls that are used to synchronize shopping carts, promotion rules, user accounts, and so on. To have this step accomplished you'll need to implement the actuall endpoints business logic. Check the boilerplate API implementation in Express.js

  • Step Three Is to configure vue-storefront to use the right set of endpoints from Step Two.

Tutorial

Now, we're to go through all three steps to integrate Vue Storefront with custom or 3rd party eCommerce platform.

First, make sure you've got the vue-storefront and vue-storefront-api installed on your local machine, up and running. Opening the http://localhost:3000 should display default Vue Storefront theme with demo products.

Note: As we'll be using extensively Elastic Search for the next steps in this tutorial, make sure you've got the right tooling to browse the ES indexes. I'm using es-head. Pretty easy to use and simple tool, provided as a Google Chrome plugin.

Empty the vue_storefront_catalog index.

This is the default Vue Storefront index which is configured in both vue-storefront and vue-storefront-api projects - in the config/local.json, elasticsearch.indices section. We'll be using "default".

First, please go to vue-storefront-api directory with the following command:

$ cd ./vue-storefront-api

Then you can empty the default index:

$ yarn db new
yarn run v1.17.3
$ node scripts/db.js new
Elasticsearch INFO: 2019-09-06T19:32:23Z
  Adding iconnection to http://localhost:9200/

** Hello! I am going to create s cNEW ES index
Elasticsearch DEBUG: 2019-09-06T19:32:23Z
  starting request {
    "method": "DELETE",
    "path": "/*/_alias/vue_storefront_catalog",
    "query": {}
  }
  
...

Note: Please make sure your local Elastic instance is up and running. After you've got the vue-storefront plus vue-storefront-api installed, you can ensure it by just running docker-compose up -d in the vue-storefront-api directory.

Import data.

In your custom integration, you'll probably be pumping the data directly to ElasticSearch as it changed in the platform admin panel.

This is exactly how other Vue Storefront integrations work. You might want to get inspired by:

In our example, we'll push the static JSON files from sample-data directly to the ElasticSearch index. Then I'll explain these data formats in details to let you prepare such an automatic exporter on your own.

To push the data into ElasticSearch we'll be using a simple NodeJS tool located in the sample-data folder.

Now we can import the data:

$ cd ./vue-storefront-integration-boilerplate/sample-data/
$ yarn install Or npm install
$ node import.js products.json product vue_storefront_catalog
Importing product { id: 1769,
  name: 'Chloe Compete Tank',
  image: '/w/t/wt06-blue_main.jpg',
  sku: 'WT06',
  url_key: 'chloe-compete-tank',
  url_path:
   'women/tops-women/tanks-women/bras-and-tanks-26/chloe-compete-tank-1769.html',
  type_id: 'configurable',
  price: 39,
  special_price: 0,
  price_incl_tax: null,
  special_price_incl_tax: null,
  special_to_date: null,
  special_from_date: null,
  status: 1,
  size: null,
  color: null,
  size_options: [ 167, 168, 169, 170, 171 ],
  color_options: [ 50, 58, 60 ],
  category_ids: [ '26' ],
  media_gallery:
  ...
{ _index: 'vue_storefront_catalog',
  _type: 'product',
  _id: '1433',
  _version: 2,
  result: 'updated',
  _shards: { total: 2, successful: 1, failed: 0 },
  created: false }
{ _index: 'vue_storefront_catalog',
  _type: 'product',
  _id: '1529',
  _version: 2,
  result: 'updated',
  _shards: { total: 2, successful: 1, failed: 0 },
  created: false }

Then please do execute the same import scripts for atttribute and category entities:

$ node import.js attributes.json attribute vue_storefront_catalog
$ node import.js categories.json category vue_storefront_catalog

After importing the data, we need to make sure the Vue Storefront Elastic index schema has been properly applied. To ensure this, we'll use the Database tool used previously to clear out the index - once again:

$ yarn db rebuild
yarn run v1.17.3
$ node scripts/db.js rebuild
Elasticsearch INFO: 2019-09-06T20:13:28Z
  Adding connection to http://localhost:9200/

** Hello! I am going to rebuild EXISTING ES index to fix the schema
** Creating temporary index vue_storefront_catalog_1567800809
Elasticsearch DEBUG: 2019-09-06T20:13:28Z
  starting request {
    "method": "DELETE",
    "path": "/*/_alias/vue_storefront_catalog_1567800809",
    "query": {}
  }

After data has been imported you can check if it works by opening http://localhost:3000 and using the Search feature:

Search Feature

Congratulations! Now it's a good moment to take a deep breath and study the data formats we'd just imported to create your own mapper from the custom platform of your choice to Vue Storefront format.

Note: please make sure that you use non-zero IDs in the following entities to avoid unexpected behavior.

Product entity

You might have seen that our data formats are pretty much similar to Magento formats. We've simplified them and aggregated. Some parts are denormalized on purpose. We're trying to avoid the relations known from the standard databases and rather use the DTO concept. For example, Product is a DTO containing all information necessary to display the PDP (Product Details Page): including media_gallery, configurable_children and other features. It's then fairly easy to cache the data for the Offline mode and performance.

Read the full Product entity specification

Attribute entity

Vue Storefront uses the attributes meta data dictionaries saved in the attribute entities. They're related to the product. The attribute.attribute_code represents the product[attribute_code] proeprty - when defined. When not, the product[attribute_code] is being used as a plain tetxt.

Read more on why Attributes are important

Category entity

Categories are being used mostly for building tree navigation. Vue Storefront uses the dynamic-catetgories-prefetching. Please make sure that all the categories are indexed on the main level - even if they exist as a category.children_data assigned to any other category.

Read the Category format specification

TaxRate entity

Note: TaxRates are skipped from sample-data as they're not crucial to display the products and categories in Vue Storefront (as long as the taxes are calculated before product pricing is imported to Elastic)

Here is the data format:

{
  "id": 2,
  "code": "Poland",
  "priority": 0,
  "position": 0,
  "customer_tax_class_ids": [3],
  "product_tax_class_ids": [2],
  "tax_rate_ids": [4],
  "calculate_subtotal": false,
  "rates": [
    {
      "id": 4,
      "tax_country_id": "PL",
      "tax_region_id": 0,
      "tax_postcode": "*",
      "rate": 23,
      "code": "VAT23%",
      "titles": []
    }
  ]
}

To read more on how tax rates are processed when config.tax.calculateServerSide=false, please read the Prices how to and then study the taxCalc.ts.

Write your API adapter for dynamic requests

Vue Storefront doesn't store any user data, order or payment information. Even shopping carts are only stored locally in the browser and then synced with the server (cart/merge Vuex action).

Whenever a product is added to the cart, or user authorization is performed, there is an API request executed.

Read more on the required API endpoints you must provide to have Vue Storefront synchronized

Note: If you're to use Vue Storefront just for catalog browsing purposes you can probably skip this step. In that case please make sure your vue-storefront instance is properly configured with the config.cart.synchronize=false and config.cart.synchronize_totals=false.

Configure vue-storefront

All You need to do is to set the proper dynamic API endpoints in the config/local.json. Here you have the details.

Support

This is a project under MIT license so it's just AS IS :) However, if you're planning to add the new platform to the Vue Storefront ecosystem and publish it freely as an open-source - we'll do our best to support you!

Please feel free to contact the core team at Vue Storefront Forum, on Slack channel or via [email protected]

More Repositories

1

microservices-book

"Microservices Architecture for eCommerce" is an Open Source Book on Microservices and Headless eCommerce. Feel invited to contribute! Read online or download a PDF
JavaScript
379
star
2

anonymizer

Universal tool to anonymize database. GDPR (General Data Protection Regulation) data protection act supporting tool.
Ruby
351
star
3

woocommerce2vuestorefront

This is WooCommerce to Vue Storefront data bridge. Harness the power of Progressive Web Apps for Your Woo Commerce shop!
JavaScript
134
star
4

coreshop-vsbridge

CoreShop Vue Storefront integration - first Progressive Web App (PWA) framework for Pimcore
PHP
74
star
5

magento2-rapid-theme

Divante Rapid Theme for Magento 2. More information http://go.divante.co/divante-for-fashion/
CSS
66
star
6

shopware2vuestorefront

First Progressive Web App for Shopware 6. Made with ❀️ by Vue Storefront
JavaScript
59
star
7

magento1-vsbridge

Run the Progressive Web App (PWA) on top of Magento 1.9. This is a Vue Storefront bridge for Magento 1.x. MIT License
PHP
57
star
8

spartacus-capybara

SAP Spartacus Theme based on https://storefrontui.io look and feel and design system. Headless storefront solution for Hybris. Always Open Source, MIT license. Made with πŸ’™ by Divante
TypeScript
46
star
9

pimcore2vuestorefront

Project has been moved ->
JavaScript
40
star
10

next

Vue Storefront Next is R&D branch of Vue Storefront.
TypeScript
39
star
11

pimcore-magento2-bridge

Pimcore module for Magento 2 integration
PHP
35
star
12

magento2-review-api

Long awaited Magento2 API for reviews!
PHP
32
star
13

magento2-pimcore-bridge

Magento 2 module for Pimcore integration.
PHP
32
star
14

pimcore-graphql

Create Your own GraphQL API with admin panel based on Pimcore
PHP
31
star
15

bigcommerce2vuestorefront

This is a Big Commerce 2 Vue Storefront bridge based on https://github.com/DivanteLtd/vue-storefront-integration-boilerplate
JavaScript
24
star
16

magento1-vsbridge-indexer

This is an official, native Vue Storefront data indexer for Magento 1.9
PHP
18
star
17

magento2-module-groupped-products-manager

Magento 2 Module "Grouped Products Manager" adds new features for grouped products
PHP
16
star
18

pimcore5-notifications

Notifications bundle for pimcore 5
PHP
16
star
19

magento2-rapid-uikit

Magento 2 Divante Uikit Module. More information http://go.divante.co/divante-for-fashion/
HTML
13
star
20

pimcore4-magento2-connector

This is a deprecated repository. Please visit https://go.divante.co/pimcore-magento/ for newest information.
PHP
12
star
21

magento2-vsbridge-pagebuilder

PHP
12
star
22

orocommerce-elasticsearch-bundle

PHP
11
star
23

magento2-external-checkout

The project is now maintained by VENDIC: https://github.com/Vendic/magento2-external-checkout
PHP
11
star
24

salesforce-cc-graphql-bridge

Salesforce Commerce Cloud GraphQL bridge (based on sfcc-sample-apps)
TypeScript
11
star
25

pimcore5-clipboard

Pimcore 5 Clipboard Bundle gives you the possibility to shelve your objects into a separated area and perform chosen actions only on these separated objects - without changing anything in your project structure!
PHP
11
star
26

pimcore-translation-bundle

PHP
10
star
27

pimcore-devkit

Set of tools that helps developing Pimcore applications
PHP
9
star
28

pimcore-elasticsearch-plugin

Flexible ElasticSearch Plugin for Pimcore - now with DSL!
PHP
9
star
29

vsf-mobile-wrapper-ios

iOS wrapper for the Vue Storefront to provide the PWA with all the iOS missing features like push notifications capabilities
Swift
8
star
30

vue-storefront-simple-api

Minimalistic API implementation for Vue Storefront.
Shell
8
star
31

jquery-validation-polish

Polish methods for jQuery validation
JavaScript
8
star
32

headless-security.org

This is an Open Source repository of the Best Practices for Headless app development brought to you by the Vue Storefront Community and the partners
CSS
8
star
33

magento2-vsbridge

Vue Storefront tools for Magento2 - optional package improving data sync
PHP
8
star
34

pimcore5-user-tracking

GDPR plugin for Pimcore 5
PHP
7
star
35

pimcore-helm-chart

Helm chart example for pimcore
PHP
6
star
36

magento-open-loyalty

Integration between OpenLoyalty system and Magento
PHP
6
star
37

pimcore-notifications

Notifications plugin for Pimcore
PHP
6
star
38

orocommerce-ga

OroCommerce - Google Analytics and Google Tag Manager
PHP
6
star
39

Elastics

Magento 2.x catalog search with Elasticsearch
PHP
5
star
40

pimcore-scheduled-export

Scheduled Export lets you run ordinary grid exports in background.
PHP
5
star
41

vue-storefront-starter

This is a WIP boilerplate to be used for new Vue Storefront websites. Please don't use it until it will be ready ;)
5
star
42

MultiWishlist

Magento 1.x module that allows you to add multiple wishlists. Now you can marge, copy and move products between wishlists.
PHP
5
star
43

pwa-book

4
star
44

magento2-module-topbar

Module destiny is to write tests in MTF (Magento Testing Framework).
PHP
4
star
45

pimcore-workflow-dashboard

Dashboard for Pimcore 5 Workflow
PHP
4
star
46

pimcore-document-copier

PHP
4
star
47

pimcore-google-login

Allows using google credentials for logging into Pimcore's admin panel
PHP
4
star
48

apparently

TypeScript
4
star
49

backend-user-wrapper

Wrapper for Pimcore's User Model
PHP
3
star
50

magento1-vsbridge-client

JavaScript
3
star
51

pimcore-contact-form

PHP
3
star
52

pimcore-class-locker

PHP
3
star
53

Validation-plugin

Forms validation for Magento & jQuery - with customizable settings on data-* attributes based on jQuery Validation Plugin.
JavaScript
3
star
54

pimcore-classification-tree

Classification Tree for Pimcore 5
PHP
3
star
55

LiveEditor

Magento 2 module which allows user do some dynamic editings of Magento pages (category, product, cms blocks) in live ajax editor.
PHP
3
star
56

php-magento2-swagger

PHP
3
star
57

pimcore5-docker

3
star
58

orocommerce-cookie-consent-bundle

PHP
2
star
59

magento1-external-checkout

PHP
2
star
60

spartacus-localized-routing

Example implementation of localized routing
TypeScript
2
star
61

pimcore-enrichment-progress

Pimcore Enrichment Progress Bundle
PHP
2
star
62

pimcore-docker-php-fpm

2
star
63

Manufacturer

This Magento 1.x module allows to add additional options to product attribute 'manufacturer'.
PHP
2
star
64

varnish-docker

Docker with Varnish Cache
VCL
2
star
65

magento2-gtm

PHP
2
star
66

CustomerLog

This Magento 1.x module raports all changes made by customer. Could be used for example for GIODO compilance
PHP
2
star
67

capistrano-pimcore

Pimcore plugin for capistrano
Ruby
2
star
68

AdSection

Magento 1.x module that allows you to add custom banner sections in any XML-layout block
PHP
2
star
69

vue-storefront-community

The driving force behind the various VueStorefront and Storefront UI projects is without a doubt its community. This repository contains information on everything that has to do with you, the community.
2
star
70

pimcore-coding-standards

Coding standards rulesets for Pimcore 4 and Pimcore 5
2
star
71

pimcore-mysql-object-search

Similar to Pimcore's Advanced Object Search, but does not need Elasticsearch
PHP
1
star
72

woocommerce2vuestorefront-api

1
star
73

pimcore-auto-import

Auto Import runs Import Definitions automatically on created assets
PHP
1
star
74

vsf-pagebuilder

1
star
75

DivanteAdventure

PHP
1
star
76

pimcore-asset-unicode-name

PHP
1
star
77

connector-magento-module-rest-api-client

Connector Client Magento 1 Module REST-API
PHP
1
star
78

woohoolabs-yin-bundle

PHP
1
star
79

pimcore-workflow-validation

Additional validation for Pimcore workflows
PHP
1
star
80

svelte-graphcms

POC based on SvelteKit and GraphCMS
Svelte
1
star
81

PersonalReceipt

This Magento 1.x module allows to add new shipping method - personal receipt. In this method, you can add several pickup locations, by seperate them with "|" sign.
PHP
1
star
82

CodFee

This Magento 1.x module extends "Cash on delivery" payment method, to manage rates per delivery type.
PHP
1
star
83

capistrano-pimcore5

Capistrano plugin for Pimcore 5
Ruby
1
star
84

pimcore-object-fields-permissions

JavaScript
1
star