ys-tools/orocommerce-elfsight-bundle
An OroCommerce bundle for embedding Elfsight widgets in your storefront. Add Elfsight reviews, social feeds, and other embeddable widgets to pages through configurable content blocks, with widget settings managed from the OroCommerce admin.
Treat this like pulling in a Laravel package where the README is the only docs and the vendor tree is your real documentation source. It's a Symfony bundle on OroPlatform, so the mental map is: composer require ≈ composer require, bundle class ≈ service provider, Resources/config ≈ config/, Twig ≈ Blade, Doctrine entities ≈ Eloquent models, layout YAML ≈ your view composers.
Minimal path:
composer require ys-tools/orocommerce-elfsight-bundle — pin the version in composer.json. With 1 star and 0 dependents there is no compatibility matrix to lean on, so pin a tested version and commit the lock file.config/bundles.php (or Resources/config/oro/bundles.yml if your Oro version still uses that flow), matching the bundle's DependencyInjection namespace exactly as shipped.composer install:
php bin/console cache:clearphp bin/console oro:platform:update --force (migrations/fixtures if the bundle ships any)php bin/console oro:assets:build if the bundle adds frontend assetsREADME.md, then Resources/config/ (DI parameters, oro/app.yml, layout YAML under Resources/views/layouts/) and Resources/views/ for the Twig entry point. The DI parameters are where the Elfsight app IDs / widget placement config will be defined.platform.js script loads and the <div class="elfsight-app-<APP_ID>"> mount point renders, then expand to other placements.Verify against the repo before assuming any specific config key — this is a low-traffic bundle and the README may lag the code.
Placement through Oro layouts, not hardcoded Twig. OroCommerce storefront composition runs through layout YAML. Add the Elfsight block to the correct layout update — header, footer, product_view, shopping_list, checkout — rather than pasting <script> tags into theme templates. That keeps the placement theme-agnostic and upgrade-safe.
Config-driven widget identity. Each Elfsight widget has its own app ID. Keep IDs in system configuration or bundle parameters keyed per placement, so marketing can swap a widget without a code deploy. If the bundle exposes multiple block types, register them as Oro CMS content widgets so editors drag them into pages instead of developers editing YAML.
Typical embed shape (what the bundle will ultimately render, or what you write yourself if the block isn't covered):
<div class="elfsight-app-{{ elfsightAppId }}"></div>
<script src="https://static.elfsight.com/platform/platform.js" async defer></script>
Load the platform script once per page. If you're placing multiple widgets, hoist the <script> to a single layout position (e.g. before_content or head) and let only the <div class="elfsight-app-..."> mount points scatter across placements. Duplicate script tags will double-init and can blank out widgets.
Per-channel / per-storefront scoping. OroCommerce is multi-channel and multi-website by design. Gate rendering on the current website/channel (layout conditions or a Twig check against the current website) so you don't bleed a B2C popup into a B2B portal.
Consent and async. Wrap the embed in your cookie/consent gate when required in the target market. Elfsight loads client-side and injects an iframe, so it does not interfere with Oro's full-page cache — good, but it also means the widget cannot read server-side context. If the widget needs order/customer data, pass it via data- attributes or Elfsight's documented prefill mechanism, not through Twig-injected globals buried in the widget itself.
Theme inheritance. If you're overriding the bundle's Twig, do it from your own theme bundle under Resources/<ThemeName>/views/... so future bundle updates don't clobber customizations.
src/ before relying on documented behavior; budget time to fork if you need fixes.static.elfsight.com and its widgets pull further assets. If the storefront sends a Content-Security-Policy, whitelist the Elfsight domains or widgets will render empty with only console violations.oro:platform:update then cache:clear is the reliable reset.oro:assets:build — otherwise you'll debug a change that was never compiled.div and a script. If the widget is blank, check the Elfsight API calls and the CSP console errors before touching Oro logs.services.yaml, override Twig in your theme bundle, and add layout updates in your own bundle rather than editing vendor. If the package lacks a needed hook, a small decorator around the block-rendering service is usually cheaper than a fork.How can I help you explore Laravel packages today?