Skip to content

Conversation

ukilla
Copy link
Collaborator

@ukilla ukilla commented Oct 6, 2025

Description

This change makes the /fb-checkout iframe optional and defaults to using a top-level redirect to the standard WooCommerce checkout page.
Previously, the plugin always rendered the checkout inside a full-screen iframe, causing UX, session, payment gateway, and analytics issues. With this update:

  • Classic redirect is now the default behavior for /fb-checkout.
  • The iframe remains available as a legacy option via the facebook_commerce_checkout_use_iframe filter.
  • Cart rebuilding and coupon application via query parameters remain unchanged.
  • A JavaScript fallback ensures proper navigation if headers are already sent.
    No additional dependencies are required. This update improves browser history handling, UX consistency, payment gateway compatibility, and analytics tracking.
    Fixes/addresses Issue #3653

Type of change

  • Add (non-breaking change which adds functionality)

Checklist

  • I have commented my code, particularly in hard-to-understand areas, if any.
  • I have confirmed that my changes do not introduce any new PHPCS warnings or errors.
  • I have checked plugin debug logs that my changes do not introduce any new PHP warnings or FATAL errors.
  • I followed general Pull Request best practices. Meta employees to follow this wiki.
  • I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes.
  • I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality.
  • [] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this wiki.

Changelog entry

/fb-checkout now defaults to a classic redirect; iframe support is optional via filter.

Test Plan

Tested the changes using the setup checkout URL provided by Facebook Commerce Manager. Verified that the cart rebuilds correctly, coupons are applied, and users are redirected to the standard WooCommerce checkout page.

Screenshots

Before

After

@meta-cla meta-cla bot added the CLA Signed label Oct 6, 2025
@ukilla ukilla added the changelog: add A new feature, function, or functionality was added. label Oct 6, 2025
Copy link
Contributor

github-actions bot commented Oct 6, 2025

📦 Latest Plugin Build

Built at: 2025-10-07T09:04:57.686Z
Commit: 613df32
Size: 1.1M

Download: Click here to download the plugin

To download: Click the link above → Scroll to bottom → Download "facebook-for-woocommerce" artifact

@ukilla ukilla force-pushed the feature/fb-checkout-iframe-optional branch from a2dda7a to 95ba22c Compare October 7, 2025 09:04
@ajello-meta
Copy link
Contributor

ajello-meta commented Oct 8, 2025

The reason /fb-checkout was implemented as an iframe and not a standard redirect to the checkout page was to ensure that the URL and it's parameters persist and load an identical cart when being opened in another window. When buyers open the seller's checkout in Meta's in-app browser, many of them choose to "open in external browser", if the URL does not persist, then the cart is emptied (as with the standard redirect).

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

Labels

changelog: add A new feature, function, or functionality was added. CLA Signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants