Download the PHP package bitbag/vuestorefront-plugin without Composer

On this page you can find all versions of the php package bitbag/vuestorefront-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vuestorefront-plugin

:warning: BEWARE! The current solution is deprecated as it was created for Vue Storefront v1. For Vue Storefront 2 integration check out our GraphQL-based integration, which could be found here:

https://github.com/BitBagCommerce/SyliusGraphQLPlugin

https://github.com/vuestorefront-community/sylius

If you want to know more about the new integration, read our blog -> https://bitbag.io/blog/introduction-to-vue-storefront-2sylius-integration-technical-aspects

BitBag SyliusVueStorefrontPlugin

Slack [Support](https://bitbag.io/contact-us/?utm_source=github&utm_medium=referral&utm_campaign=plugins_vsf)

At BitBag we do believe in open source. However, we are able to do it just because of our awesome clients, who are kind enough to share some parts of our work with the community. Therefore, if you feel like there is a possibility for us working together, feel free to reach us out. You will find out more about our professional services, technologies and contact details at https://bitbag.io/.

Table of Content

Overview

This document assumes that you are already familiar with Vue Storefront and its technology stack.
If that's not the case please check VSF Documentation and GitHub repository.

Please also check Sylius Documentation and Sylius-Standard if you are new to Sylius.

Depending on your preferences, the plugin can also fully replace VSF API - you will only need VSF front app if you choose so.
Sylius ShopBundle is also no longer needed as Vue Storefront will be your new ... Storefront. :)

We are here to help

This open-source plugin was developed to help the Sylius community. If you have any additional questions, would like help with installing or configuring the plugin or need any assistance with your Sylius project - let us know!

Installation

Supported versions

Plugin version Sylius version Supported VSF version
v2.1.1 1.8 1.12.2
v1.0.0-beta.1 1.6 1.11.4

Requirements

We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.
Please also check Vue Storefront requirements.

Package Version
PHP 7.4 (>= 7.3)
MySQL 8.0.x (>= 5.7)
Elasticsearch 6.8.x
Vue Storefront 1.12

Important note
Please inspect files stored in tests/Application directory (especially config subdirectory)
to make sure that you fully understand installation steps written below.

We recommend you to disable Sylius ShopBundle as you will no longer need it.
Please refer to Sylius Documentation - How to disable Sylius shop? for details.


First, add this plugin as dependency to your Sylius project.

Add the plugin to config/bundles.php (if it's not there already):


Add few variables to your .env file:

To generate JWT public and secret keys please run commands below in Sylius' project directory:

Then set value of JWT_PASSPHRASE environment variable with passphrase that you've entered during running commands above.


Next step is to add a following line to the end of the imports section in your config/packages/_sylius.yaml:

It's needed to load some plugin configuration.


Now it is needed to edit config/packages/security.yaml file.

Add a line below to parameters key at the top of the file:

Add a code below to the top of security -> firewalls key (an order is really important there):

So it should look like this:

Afterwards add a line below to security -> access_control part:


Now go to config/routes.yaml file in your Sylius app and paste there:

to load configuration of all routes for API endpoints.


Create new file gesdinet_jwt_refresh_token.yaml (or name it however you like) inside config/packages directory and paste inside it:


Replace content of your config/packages/lexik_jwt_authentication.yaml file with the following configuration:


Afterwards add:

under your framework key in config/packages/framework.yaml so it should look like this afterwards:


Set content of your config/fos_elastica.yaml to the following:


Add a following rule to fos_rest.format_listener.rules in your config/packages/fos_rest.yaml

For example the file should look like this afterwards:


Go to your src/Entity/Order/OrderItem.php file and make it to extend the OrderItem entity from our plugin.

Change:

to:


Copy etc/vsf-config/local.json file from this repository to config/local.json of Vue Storefront project directory.
In that file you only need to replace every occurence of <insert-your-hostname> with URL of your store.
You don't have to change anything else as sensible defaults are provided by us, that are proven to work in Vue Storefront v1.12.
If your configuration settings differ from defaults provided with the plugin and you run into problems don't hesitate to create issue on GitHub or contact us directly at [email protected].

Architecture

VueStorefront fetches data in two ways - statically and dynamically.
Less frequently updated data is stored in Elasticsearch:

  1. Products
  2. Categories (Sylius taxons)
  3. Attributes (Sylius product options)

Everything else is fetched dynamically using provided API, including:

Elasticsearch

Everything related to Elasticsearch is contained within Elastisearch with the exception of FOS Elastica Bundle configuration which can be found in src/Resources/config/indexes directory.
To have the data from Sylius mapped in ES, we have created Transformers providing object translations to ES indexes.
Schema of indexes is described in files stored in Document directory.

It's important to note once again that only Elasticsearch 6 is fully supported currently.
Support for ES 7 is on the way - once ruflin/elastica and FOSElasticaBundle start supporting it, we will as well.

Using the plugin within Sylius Standard app, with VSF

It is no surprise that you must have products, taxons etc. within your Sylius instance to benefit from VSF.
Therefore we assume that you have a shop already running.
If it's not the case you might want to run commands below on freshly cloned Sylius Standard repository:

.. to add all needed entities from fixtures to database.

Only then you can run

to populate Elasticsearch indexes and let refresher contained within the plugin to automatically update the data in ES in real time.

Known issues

Translatable trait error during loading fixtures

In case of this error - to be able to load the fixtures, go to the vendor/bitbag/vuestorefront-plugin/src/Resources/config/indexes/product.yaml file and comment last line in there (the defer:true one).

Then clear the cache, load fixtures and uncomment this line afterwards.

Getting 500 error related to taxa (taxons)

If you see something like this for example in your admin panel:

it means you are using invalid version of doctrine/inflector package.

To fix it add a following block into your composer.json file:

Make sure that

is present in require section in your composer.json file and then run:

Extending the plugin

Extending requests, commands/queries

The easiest way to extend the existing request classes and add new properties is to inherit from them.
Because of the way we denormalize incoming requests, you don't need constructor in that class. You must only:

Optionally you may want to add constraint to your properties that would validate incoming data.
We use separate .xml files for that as you can see in src/Resources/config/validation directory.

For example let's add locale to the coupon:

In the same manner the command would need to be created extending the ApplyCoupon class.
Then you only need to change one parameter in the configuration file:

Extending handlers

The main way to extend a handler is to decorate it. This makes adding functionality before and after the handler easy.
Please check example of extending view below and/or follow Symfony Documentation - How to Decorate Services guide.

However, if you want to change the logic in the handler, you need to overwrite it.
This can be done by registering the new handler with the same service id.
Do not just add it with a new service id otherwise, it will execute both handlers.

Extending views

When extending the views, two places need to be modified - view class and view factory.

ViewFactories should be decorated just like Handlers mentioned above. You can also completely override them if you prefer to do so.

You need to define this service in xml (or yaml) file:

and change the view class in configuration file:

About us

BitBag is an agency that provides high-quality eCommerce and Digital Experience software. Our main area of expertise includes eCommerce consulting and development for B2C, B2B, and Multi-vendor Marketplaces. The scope of our services related to Sylius includes:

Some numbers regarding Sylius:


If you need some help with Sylius development, don't be hesitate to contact us directly. You can fill the form on this site or send us an e-mail to [email protected]!


Community

For online communication, we invite you to chat with us & other users on Sylius Slack.

Vue Storefront + Sylius Demo

We've created a demo app that showcases usage of this plugin. Visit vsf.bitbag.shop to check it out!
The Sylius admin panel is accessible at syliusvsf.bitbag.shop/admin. Admin credentials: sylius : sylius. If you need an overview of this plugin, schedule a consultation with our expert.

Additional resources for developers

To be able to contribute to the plugin make sure that you familiarize yourself with:

Additionally you might want to get to know VSF better:

License

This plugin's source code is completely free and released under the terms of the MIT license.

Contact

If you want to contact us, the best way is to fill the form on our website or send us an e-mail to [email protected] with your question(s). We guarantee that we answer as soon as we can!


All versions of vuestorefront-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
ext-json Version *
friendsofsymfony/elastica-bundle Version ^5.1
ruflin/elastica Version ^6.1
sylius/sylius Version ^1.8
nelmio/cors-bundle Version ^1.5
symfony/messenger Version ^4.4
lexik/jwt-authentication-bundle Version ^2.6
gesdinet/jwt-refresh-token-bundle Version ^0.8
imagine/imagine Version ^1.2
symfony/serializer Version ^4.4 || ^5.0
symfony/property-info Version ^4.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bitbag/vuestorefront-plugin contains the following files

Loading the files please wait ....