Download the PHP package fluffydiscord/sylius-honkers-plugin without Composer

On this page you can find all versions of the php package fluffydiscord/sylius-honkers-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 sylius-honkers-plugin

Sylius honkers.dev Plugin

Renamed from fluffydiscord/sylius-honkers-bundle → see UPGRADE-2.0.md.

Sylius plugin for the honkers.dev chatbot: shop tools, catalog sources and the shop widget. Sylius 1.14 and 2.x.

Tool-server mechanics (endpoints, error format, locales, your own tools and sources) live in the Symfony bundle README — this page covers the Sylius pieces.

Features

Requirements

Package Constraint
php ^8.1
ext-intl *
sylius/sylius ^1.14 \|\| ^2.2 \|\| ^2.3@alpha
doctrine/orm ^2.20 \|\| ^3.6 \|\| ^4.0
symfony/* ^6.4 \|\| ^7.0 \|\| ^8.0

On Sylius 1.14 the widget uses a deprecated hook. 1.14 has no Twig Hooks, so the widget is a sylius_ui template block on sylius.shop.layout.javascripts. The container build reports sylius/ui-bundle deprecations for it: expected. Everything else works the same on both lines.

Install

Usage

  1. config/bundles.php — register the Symfony bundle and this plugin (Symfony Flex already did this if it's on):

  2. config/routes/fluffy_discord_honkers.yaml — the routes live in the Symfony bundle, /chatbot/pair included:

    Keep them off the shop's _locale prefix. The backend calls /chatbot/v1/* on the shop host; the dashboard's Connect button opens /chatbot/pair.

  3. config/packages/security.yaml — guard /chatbot/v1, before the Sylius shop firewall (firewalls match in order and shop matches ^/):

    /chatbot/pair stays outside this firewall — it's a browser redirect, not a backend call.

  4. config/packages/fluffy_discord_honkers.yaml — where the backend is:

  5. .env.local — the backend URL, plus the credentials unless you connect from the dashboard:

Configuration

The connection and the widget belong to the Symfony bundle. Defaults:

Option Default Meaning
backend_url '' honkers.dev origin; the widget, notifications, reports and pairing talk to it. Empty → nothing is sent
widget.enabled true false → no widget. Literal boolean, no %env()%
widget.cdn_url '' where chat.js loads from. Empty → https://honkers.b-cdn.net/widget/v1/chat.js
widget.defer true false → plain <script src>, no defer. Literal boolean, no %env()%

Outside dev, a non-https backend_url is refused and nothing is sent.

Credentials

The widget needs only a site key. Notifications and order reports also need an ingest secret (outbound: Authorization: Bearer <site key>.<ingest secret>); the backend calls /chatbot/v1 with the API secret. Per channel, the first match wins:

Channel Site key Ingest secret
paired stored on the channel stored on the channel
in channel_site_keys the entry CHATBOT_INGEST_SECRET
in channel_site_keys with '' none → no widget, no notifications —
any other CHATBOT_SITE_KEY CHATBOT_INGEST_SECRET

Site key without an ingest secret → the widget renders; notifications and order reports are skipped.

The backend's API secret is accepted when it matches CHATBOT_API_SECRET or any paired channel's secret.

A paired API secret works on every channel, not only on the channels it was paired with.

One site per channel

Map channel codes to site keys when each channel is its own site on the backend. config/packages/fluffy_discord_sylius_honkers_plugin.yaml:

Option Default Meaning
channel_site_keys {} { <channel code>: <site key> }; codes verbatim (cz-web stays cz-web), values literal or %env()%

Your own store

Alias ChannelCredentialsProviderInterface to your service in config/services.yaml:

The Symfony bundle's CredentialsProviderInterface points at the same service. To make Connect store into it too, also implement FluffyDiscord\HonkersBundle\Contract\CredentialsWriterInterface and alias it the same way.

Alias the Sylius interface, not only the Symfony one. Aliasing just CredentialsProviderInterface fails the container build: Sylius resolves credentials per channel.

Connect from the dashboard

Click Connect on the tool-server connection in the chatbot dashboard — the shop generates its secrets, sends them to backend_url and stores them on the connection's channels (none listed → the channel of the shop host). Nothing to copy. A new key works at once, no cache clear.

  1. src/Entity/Channel/Channel.php — let the channel store credentials:

    Use HonkersChannelInterface only together with HonkersChannelTrait. The lookup relies on the trait's fields.

  2. Add the honkers_site_key, honkers_api_secret_hash and honkers_ingest_secret columns:

  3. Admin → Channels → set Hostname to the host of the connection's base URL (shop.cz for https://shop.cz). Case doesn't matter; www.shop.cz ≠ shop.cz.

    Pairing several channels on different hosts? Every channel's hostname must be on a verified domain of the website (shop.sk or eshop.shop.sk for shop.sk), else nothing is saved.

  4. Click Connect in the dashboard. You land back there when it's done.

Adding the trait changes nothing until a channel is paired: unpaired channels keep their configured credentials.

Unset CHATBOT_API_SECRET once every channel is paired. It stays valid otherwise.

The API secret is stored only as a SHA-256 hash; the ingest secret is stored as-is (it has to be sent). The trait maps the columns with Doctrine attributes and annotations. Channel mapped in XML → map honkersSiteKey (string, 64), honkersApiSecretHash (string, 64, fixed) and honkersIngestSecret (string, 128), all nullable, yourself.

What can go wrong:

Situation Result
Channel entity without the trait 409 page: paste the credentials into the shop's configuration
backend_url empty, or not https outside dev 400 backend_url_refused, nothing sent
Shop host's channel has no hostname 400 pairing_hostname_missing, nothing sent
A paired channel has no hostname 400 pairing_hostname_missing, nothing saved
Connection's base URL on another host 400 pairing_wrong_shop, nothing saved
A paired channel's hostname not on a verified domain 400 pairing_wrong_shop, nothing saved
Connection names a channel code the shop doesn't have 400 pairing_unsupported, nothing saved
Link older than 10 minutes, or used 400 pairing_not_found

A failed Connect is retried by clicking Connect again.

Shipped tools

The backend calls these mid-conversation for live data:

Add your own tool → Symfony bundle README.

Shipped sources

The backend pulls these in bulk and ingests them into its retrieval index:

Every absolute URL a source or tool emits is built on the resolved channel's hostname, not the request host. A read for channel=X returns links on X's domain; only the host is swapped.

imageUrl: a liip_imagine cache resolver in front of web_path memoises the finished absolute URL under a host-less key — the first channel read then feeds its host to every other channel. Keep the chatbot's image filter on a host-agnostic resolver.

Extension points

Both govern the products source; redefine the container alias in services.yaml to replace them:

Interface Default Purpose
ProductViewFactoryInterface ProductViewFactory price, stock, image and URL of an indexed product
ProductIndexabilityInterface ProductIndexability which products the source serves (enabled, in the channel, at least one priced enabled variant)

Add your own source → Symfony bundle README.

Catalog change notifications

These keep the backend's ingested sources fresh. Saving a Product, ProductTranslation, Taxon or TaxonTranslation collects the changed ids; one POST {backend_url}/api/v1/catalog/changes per (source, locale, site) is sent after the response (kernel.terminate, ConsoleEvents::TERMINATE), one at a time, max 500 ids per request.

The backend accepts notifications only from an active site. A draft site answers 401 — activate it in the dashboard first. The same goes for order reports and the widget.

Saved entity Announces
ProductTranslation its own locale
TaxonTranslation categories for its own locale
Product every locale of sylius_locale
Taxon categories for every locale, no product fan-out

Recipients: every enabled channel serving the locale. Channels with the same site key share one request.

Re-announce everything

Re-announces the whole catalog of one channel to its site in 500-id batches, pausing 2 s between batches. A 429 or 503 → waits Retry-After and sends the same batch again, up to 5 times.

Widget

When widget.enabled is true the plugin injects, via the sylius_shop.base#javascripts twig hook on Sylius 2 and the sylius.shop.layout.javascripts template block on Sylius 1.14:

Include the template yourself with a plain context:

The widget talks only to backend_url; it never calls /chatbot/v1 itself.

Chat click tracking

Visits and orders from chat links are reported for you. No setup beyond backend_url and credentials.

Only shop checkout is covered (sylius.order.post_complete). Orders completed through the API or your own code aren't reported.

Backend unreachable → logged warning; checkout is never affected. Non-https backend_url → skipped outside the dev env.

Orders from chat

Open the chat conversation behind an order from its admin page. Add the interface and trait to your Order entity:

Then add the chat_click_ids column:

The order keeps the click id (gooseclid) of every chat link that led to one of its products, oldest click first. The order detail shows a From chatbot box, last in the right column:

The trait maps the column with Doctrine attributes and annotations. Order mapped in XML → map chatClickIds (json, nullable) yourself.

Overriding @SyliusAdmin/Order/show.html.twig on Sylius 1 drops the sidebar blocks. Include the field yourself: {% include '@FluffyDiscordSyliusHonkersPlugin/admin/order/from_chat.html.twig' %}.

License

MIT


All versions of sylius-honkers-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-intl Version *
doctrine/collections Version ^1.8 || ^2.1
doctrine/doctrine-bundle Version ^2.13 || ^3.2 || ^4.0
doctrine/orm Version ^2.20 || ^3.6 || ^4.0
fluffydiscord/honkers-sdk Version ^2.0
fluffydiscord/symfony-honkers-bundle Version ^2.0
liip/imagine-bundle Version ^2.13
sylius/sylius Version ^1.14 || ^2.2 || ^2.3@alpha
symfony/config Version ^6.4 || ^7.0 || ^8.0
symfony/console Version ^6.4 || ^7.0 || ^8.0
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/event-dispatcher Version ^6.4 || ^7.0 || ^8.0
symfony/http-client Version ^6.4 || ^7.0 || ^8.0
symfony/http-foundation Version ^6.4 || ^7.0 || ^8.0
symfony/http-kernel Version ^6.4 || ^7.0 || ^8.0
symfony/intl Version ^6.4 || ^7.0 || ^8.0
symfony/translation Version ^6.4 || ^7.0 || ^8.0
twig/twig Version ^2.12 || ^3.3
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 fluffydiscord/sylius-honkers-plugin contains the following files

Loading the files please wait ...