Enhance the sylius API with new endpoints etc


A plugin that extends the Sylius new API: find products by slug, search for products, add stripe gateway...

This plugin is mandatory if you use the sylius next.js boilerplate (https://github.com/davidroberto/sylius-next-boilerplate-theme) This is the first version so there is a lot of room for improvements, bugfixes etc!

composer require davidroberto/sylius-extra-api-plugin

Install and configure the Sylius API

    - { resource: "@DavidRobertoSyliusExtraApiPlugin/Resources/app/config.yml" }
# your stripe secret key
# your stripe payment_intent.succeeded webhook secret key
# the Next.js front end URL
# the front end url for the stripe payment success (by default "https://yourNextBoilerPlateThemeDomainName/cart/confirmation")
# the front end url for the stripe payment failure (by default "https://yourNextBoilerPlateThemeDomainName/cart/failed")
  • Configure the nelmio cors bundle to match your next js frontend url.

  • In your admin, in the "channel" section, set this values: -- "Ignore shipping selection step where only one shipping method exists": TRUE -- "Ignore payment selection step where only one payment method exists": TRUE -- "The account verification is mandatory": FALSE

  • In your admin, foreach product, set the "variant selection method" to "Variant choice"

  • The plugin has a dependency on the Nelmio Cors Bundle. So you need to it to match your next js frontend url (https://github.com/nelmio/NelmioCorsBundle)


  • The theme don't work well yet with taxons slug containing slashes, so remove them if you want to test the theme.
  • Depending on yout nelmio cors configuration, the theme might not be able to perform the fetch request if you use https for your local sylius api url. You can fix it using http (only for localhost).
  • This theme was created with only one payment method and shipping method. So if you want to test theme theme, keep only one payment method and one shipping method. You you have multiple ones, you have to implement the select logic by your own.

Install and configure the next.js boilerplate theme

  • Clone this repo
  • Fill the .env variables into a .env.local file
# Your Sylius API URL. Exemple: "https://yourSyliusAPIDomainName/api/v2/"
# Your Sylius API base URL (without the /api/v2). Exemple: "https://yourSyliusAPIDomainName")
# Your Sylius API Hostname (without the protocol). Exemple: "yourSyliusAPIDomainName"
# your stripe public key
# Your Mailchimp Newsletter Form Action URL
  • Tnstall the dependencies:
yarn install
  • Change the default locale (if needed) in lib/config/locales.ts
  • Launch the local dev server:
yarn dev
  • it's done ! You can browse you shop!