Repository navigation
Conversation
A website can print the prices, options and addons the order form charges by reading /feed/products.json, instead of copying them by hand. Only what the store already shows goes in: products neither hidden nor retired, their visible option values and addons, in the default currency. Settings: the groups to publish, the websites that may read it from a browser (CORS) and the cache minutes.
2 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A bundled addon, Product Feed (
modules/Addons/ProductFeed, inactive by default, its own service provider like BankPayments), that serves the store catalogue as public JSON atGET /feed/products.json. A marketing website can read the prices, options and addons the order form charges instead of copying them by hand.Built to the shape agreed in #525:
api/, so it never goes throughApiKeyAuth. No login, throttled to 60 requests a minute, cached for a configurable number of minutes (10 by default).Product::active()(neither hidden nor retired), with their visible configurable options and the product addons offered with them.descriptionHtml(),taxed,order_url, prices). Nothing is passed through from the model.-1) has no entry for that cycle, never a-1.*).group=<slug>,product=<slug>,lang=<code>(localised description,langon the order link).Translations in en/tr/de/pl/zh/it and a guide in
docs/guides/product-feed.md(added tomkdocs.yml).Linked issue
Closes #525
Type of change
Checklist
main(rebased on 3703966)./vendor/bin/pint --testpasses on the new files./vendor/bin/phpstan analysepasses: 7 findings inServices/ProductFeed.php, all from existing model relations that have no return type (Product::pricing/terms/translations,ConfigOptionGroup::$options,ConfigOption::$subs), which Larastan cannot see. None points at a defect; I left the models alone to keep this PR to one subject.php artisan testpasses: not the full suite.tests/Feature/ProductFeedTest.phpplus the Addon*, Translation*, ModuleDiscovery* and ApiAuditFixes tests: 226 passed.-1prices, admin page)docs/,README.md,.env.example) where relevantlang/en/(in the addon's ownlang/en/addon.php)Additional context
Out of scope for this first version, as discussed in #525: currencies other than the default, product bundles, promotions, domain pricing (
client/domain-pricingalready exists) and limits only a server module knows.🤖 Generated with Claude Code