This is WooCommerce to Vue Storefront data bridge. Harness the power of Progressive Web Apps for Your Woo Commerce shop!
woocommerce2vuestorefront indexer is standalone application designed to feed VSF's catalog models with data right from WooCommerce.
Sign up for a demo at https://vuestorefront.io/ (Vue Storefront integrated with Pimcore, Magento2, WooCommerce ...).
You should install Vue Storefront prior to use this indexer (which is feeding the Vue Storefront datbase). Read the installation guide.
This project provides an indexer for WooCommerce data structures
The module is a standalone application that:
nodejs scripts/db.js new
In config.js
there is a woo section when you should adjust some data, i.e. keys for REST requests:
woo: {
api: {
host: 'localhost',
protocol: 'http',
auth: {
consumer_key: "",
consumer_secret: "",
version: "v3"
}
}
},
notice that version should stay the same.
In db
section contained in config.js
file you should adjust some info about ES:
db: {
host: 'localhost',
port: 9200,
driver: 'elasticsearch',
url: 'http://localhost:9200',
indexName: 'vue_storefront_catalog'
},
notice that indexName can be changed but it should stay consistent with VSF configuration.
Please execute indexers one by one with:
nodejs cli.js attributes
nodejs cli.js categories
nodejs cli.js products
and that's it.
To simplify the development process You may want to use one of existing tools, for instance: ready-to-use docker images and wp-cli
:
docker-compose.dev.yml
located in dev/docker/
subdirectory: docker-compose -f docker-compose.dev.yml up
it's recommended to run this command being inside
docker
dir, because of docker's networking naming conventions which will be used in further steps
docker run -it --rm --volumes-from vsf_woo --network docker_default wordpress:cli wp core install --url="localhost" --title="VSFvsWoo" --admin_user="admin" --admin_email="[email protected]" --admin_password=admin
notice what parameters should be passed with command above: network and volumes-from should cover names set in docker-compose.dev.yml it creates a new wordpress's instance available on
localhost
and with credentialsadmin
/admin
install woocommerce plugin via wp-cli: docker run -it --rm --volumes-from vsf_woo --network docker_default wordpress:cli wp plugin install woocommerce --activate
add some attributes and options, running:
docker run -it --rm --volumes-from vsf_woo --network docker_default wordpress:cli wp wc product_attribute create --name=Size --type=options --user=admin
docker run -it --rm --volumes-from vsf_woo --network docker_default wordpress:cli wp wc product_attribute_term create 1 --name=XS --user=admin
docker run -it --rm --volumes-from vsf_woo --network docker_default wordpress:cli wp wc product_attribute_term create 1 --name=L --user=admin
wp-cli command
wc product_attribute_term create
requires as a first input an ID of attribute created at first step (in this case1
)
docker run -it --rm --volumes-from vsf_woo --network docker_default wordpress:cli wp wc product create --name="Vue T-Shirt L" --type=simple --sku=VUE/T-shirt/L --regular_price=200 --user=admin --sale_price=150 --stock_quantity=94 --in_stock=true
always pay attention to the arguments provided in commands above which can vary depending on WP/WooCommerce current state.
This module has been initially created by Divante's team:
If You have any questions regarding this project feel free to contact us:
woocommerce2vuestorefront source code is completely free and released under the MIT License.