Skip to content

Add WooCommerce product source for Shopstr plugin - #19

Open
RenAndKiwi wants to merge 2 commits into
Nisaba:masterfrom
RenAndKiwi:bb-feature
Open

Add WooCommerce product source for Shopstr plugin#19
RenAndKiwi wants to merge 2 commits into
Nisaba:masterfrom
RenAndKiwi:bb-feature

Conversation

@RenAndKiwi

@RenAndKiwi RenAndKiwi commented Jun 6, 2026

Copy link
Copy Markdown

Summary

  • Adds WooCommerce as an alternative product source alongside the existing BTCPay POS integration
  • Merchants can connect their WooCommerce store via REST API (consumer key/secret) and publish products to the Shopstr/Nostr marketplace as kind:30402 events
  • Includes full UI for WooCommerce settings (URL, API credentials, location, condition, restrictions, flash sales)
  • Products fetched via WC REST API v3 with pagination support, mapped to the same AppItem format used by POS publishing

Key implementation details

  • Uses query param auth for HTTP URLs (WooCommerce requires HTTPS for Basic auth headers)
  • Uses stock_status field from WC API v3 (not the deprecated boolean in_stock) to correctly mark products as active/sold
  • WC_URL must match the WordPress siteurl option, not the server IP — WooCommerce rejects API requests that don't match

Changes

  • WooCommerceSettings model + DB migration for storing WC connection config per store
  • WooCommerceService for fetching and mapping WC products (handles both HTTP and HTTPS auth)
  • Controller endpoints: SaveWooCommerceSettings, PublishWooCommerce, UnPublishWooCommerce
  • Updated plugin view with WooCommerce configuration section and publish/unpublish controls
  • Registered WooCommerceService in plugin DI

Test plan

  • Configure WooCommerce API credentials in the Shopstr plugin settings
  • Verify products are fetched from WooCommerce store
  • Publish WooCommerce products to Shopstr and verify kind:30402 events on configured relays
  • Verify products show correct stock status (active vs sold)
  • Unpublish and verify products are removed from marketplace
  • Confirm existing POS product publishing still works unchanged
  • Test with both HTTP and HTTPS WooCommerce URLs

🤖 Generated with Claude Code

benjamin-jarvie and others added 2 commits June 6, 2026 17:51
Enables merchants using WooCommerce to publish their product catalog
to the Shopstr/Nostr marketplace (kind:30402 events), alongside the
existing BTCPay POS product source. Adds WooCommerce API settings UI,
product fetching via WC REST API v3, and publish/unpublish controls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use query param auth for HTTP URLs (WC requires HTTPS for Basic auth)
- Use stock_status field from WC API v3 instead of boolean in_stock
- Products were incorrectly showing as sold/disabled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Nisaba

Nisaba commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Hello,

The sponsor of the Shopstr plugin will provide his feedback about this PR during the upcoming week.

Thank you.

@Nisaba

Nisaba commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Hello,

Your idea has been approved by the plugin's sponsor.

Now, the question arises about maintaining the WooCommerce part of the plugin...
How can we ensure smooth WooCommerce integration maintenance for th e future ?

And also, I need to test this integration but don’t have a WooCommerce site at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants